diff --git a/include/bx/simd256_ref.inl b/include/bx/simd256_ref.inl index 15e2754..c781a30 100644 --- a/include/bx/simd256_ref.inl +++ b/include/bx/simd256_ref.inl @@ -15,25 +15,25 @@ namespace bx { const simd128_t* ptr = reinterpret_cast(_ptr); simd256_ref_t result; - result.simd128[0] = simd_ld(&ptr[0]); - result.simd128[1] = simd_ld(&ptr[1]); + result.simd128_0 = simd_ld(&ptr[0]); + result.simd128_1 = simd_ld(&ptr[1]); return result; } template<> - BX_SIMD_FORCE_INLINE void simd_st(void* _ptr, simd256_ref_t _a) + BX_SIMD_FORCE_INLINE void simd_st(void* _ptr, simd256_ref_t& _a) { simd128_t* result = reinterpret_cast(_ptr); - simd_st(&result[0], _a.simd128[0]); - simd_st(&result[1], _a.simd128[1]); + simd_st(&result[0], _a.simd128_0); + simd_st(&result[1], _a.simd128_1); } template<> BX_SIMD_FORCE_INLINE simd256_ref_t simd_ld(float _x, float _y, float _z, float _w, float _A, float _B, float _C, float _D) { simd256_ref_t result; - result.simd128[0] = simd_ld(_x, _y, _z, _w); - result.simd128[1] = simd_ld(_A, _B, _C, _D); + result.simd128_0 = simd_ld(_x, _y, _z, _w); + result.simd128_1 = simd_ld(_A, _B, _C, _D); return result; } @@ -41,8 +41,8 @@ namespace bx BX_SIMD_FORCE_INLINE simd256_ref_t simd_ild(uint32_t _x, uint32_t _y, uint32_t _z, uint32_t _w, uint32_t _A, uint32_t _B, uint32_t _C, uint32_t _D) { simd256_ref_t result; - result.simd128[0] = simd_ild(_x, _y, _z, _w); - result.simd128[1] = simd_ild(_A, _B, _C, _D); + result.simd128_0 = simd_ild(_x, _y, _z, _w); + result.simd128_1 = simd_ild(_A, _B, _C, _D); return result; } diff --git a/include/bx/simd_t.h b/include/bx/simd_t.h index c10a337..14e3789 100644 --- a/include/bx/simd_t.h +++ b/include/bx/simd_t.h @@ -400,9 +400,10 @@ namespace bx typedef simd128_ref_t simd128_t; #endif // - union simd256_ref_t + BX_ALIGN_DECL(32, struct) simd256_ref_t { - simd128_t simd128[2]; + simd128_t simd128_0; + simd128_t simd128_1; }; #if !BX_SIMD_AVX