|
1 | 1 | #ifdef _MSC_VER |
2 | 2 | #define _SIMD_INL_ __forceinline |
3 | | -#else |
4 | | -#define _SIMD_INL_ __attribute__((always_inline)) |
| 3 | +#elif defined(__GNUC__) || defined(__clang__) |
| 4 | +#define _SIMD_INL_ __attribute__((always_inline)) inline |
5 | 5 | #endif |
6 | 6 | #include <immintrin.h> |
7 | 7 | #include <type_traits> |
@@ -1384,31 +1384,31 @@ class Array |
1384 | 1384 | } |
1385 | 1385 |
|
1386 | 1386 | //Add + and - operators |
1387 | | - friend void operator+=(Array& lhs, const Array& rhs) |
| 1387 | + _SIMD_INL_ friend void operator+=(Array& lhs, const Array& rhs) |
1388 | 1388 | { |
1389 | 1389 | for (unsigned int i = 0; i < Length; i++) |
1390 | 1390 | { |
1391 | 1391 | T::AddInplaceRaw(lhs.Data + i*T::ElementCount, rhs.Data + i*T::ElementCount); |
1392 | 1392 | } |
1393 | 1393 | } |
1394 | 1394 |
|
1395 | | - friend void operator-=(Array& lhs, const Array& rhs) |
| 1395 | + _SIMD_INL_ friend void operator-=(Array& lhs, const Array& rhs) |
1396 | 1396 | { |
1397 | 1397 | for (unsigned int i = 0; i < Length; i++) |
1398 | 1398 | { |
1399 | 1399 | T::SubtractInplaceRaw(lhs.Data + i*T::ElementCount, rhs.Data + i*T::ElementCount); |
1400 | 1400 | } |
1401 | 1401 | } |
1402 | 1402 |
|
1403 | | - friend void operator*=(Array& lhs, const Array& rhs) |
| 1403 | + _SIMD_INL_ friend void operator*=(Array& lhs, const Array& rhs) |
1404 | 1404 | { |
1405 | 1405 | for (unsigned int i = 0; i < Length; i++) |
1406 | 1406 | { |
1407 | 1407 | T::MultiplyInplaceRaw(lhs.Data + i*T::ElementCount, rhs.Data + i*T::ElementCount); |
1408 | 1408 | } |
1409 | 1409 | } |
1410 | 1410 |
|
1411 | | - friend void operator/=(Array& lhs, const Array& rhs) |
| 1411 | + _SIMD_INL_ friend void operator/=(Array& lhs, const Array& rhs) |
1412 | 1412 | { |
1413 | 1413 | for (unsigned int i = 0; i < Length; i++) |
1414 | 1414 | { |
|
0 commit comments