From c85624d79ed25d737ecf11ab3f64d4d5b7ace8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 5 Sep 2017 20:06:17 -0700 Subject: [PATCH] Cleanup. --- include/bx/inline/pixelformat.inl | 2 +- include/bx/inline/simd128_langext.inl | 52 ++++++++++++------------ include/bx/inline/simd128_neon.inl | 32 +++++++-------- include/bx/inline/simd128_ref.inl | 58 +++++++++++++-------------- include/bx/inline/simd128_sse.inl | 28 ++++++------- include/bx/inline/simd128_swizzle.inl | 2 +- include/bx/inline/simd256_avx.inl | 2 +- include/bx/inline/simd256_ref.inl | 2 +- include/bx/inline/simd_ni.inl | 2 +- 9 files changed, 90 insertions(+), 90 deletions(-) diff --git a/include/bx/inline/pixelformat.inl b/include/bx/inline/pixelformat.inl index 9c0abcd..682417d 100644 --- a/include/bx/inline/pixelformat.inl +++ b/include/bx/inline/pixelformat.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ diff --git a/include/bx/inline/simd128_langext.inl b/include/bx/inline/simd128_langext.inl index 6795503..72e4c56 100644 --- a/include/bx/inline/simd128_langext.inl +++ b/include/bx/inline/simd128_langext.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ @@ -13,13 +13,13 @@ namespace bx #define ELEMy 1 #define ELEMz 2 #define ELEMw 3 -#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ - template<> \ - BX_SIMD_FORCE_INLINE simd128_langext_t simd_swiz_##_x##_y##_z##_w(simd128_langext_t _a) \ - { \ - simd128_langext_t result; \ +#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ + template<> \ + BX_SIMD_FORCE_INLINE simd128_langext_t simd_swiz_##_x##_y##_z##_w(simd128_langext_t _a) \ + { \ + simd128_langext_t result; \ result.vf = __builtin_shufflevector(_a.vf, _a.vf, ELEM##_x, ELEM##_y, ELEM##_z, ELEM##_w); \ - return result; \ + return result; \ } #include "simd128_swizzle.inl" @@ -30,27 +30,27 @@ namespace bx #undef ELEMy #undef ELEMx -#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _mask) \ - template<> \ +#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _mask) \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_any_##_xyzw(simd128_langext_t _test) \ - { \ - uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ - | ( (_test.uxyzw[2]>>31)<<2) \ - | ( (_test.uxyzw[1]>>31)<<1) \ - | ( _test.uxyzw[0]>>31) \ - ; \ - return 0 != (tmp&(_mask) ); \ - } \ - \ - template<> \ + { \ + uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ + | ( (_test.uxyzw[2]>>31)<<2) \ + | ( (_test.uxyzw[1]>>31)<<1) \ + | ( _test.uxyzw[0]>>31) \ + ; \ + return 0 != (tmp&(_mask) ); \ + } \ + \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_all_##_xyzw(simd128_langext_t _test) \ - { \ - uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ - | ( (_test.uxyzw[2]>>31)<<2) \ - | ( (_test.uxyzw[1]>>31)<<1) \ - | ( _test.uxyzw[0]>>31) \ - ; \ - return (_mask) == (tmp&(_mask) ); \ + { \ + uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ + | ( (_test.uxyzw[2]>>31)<<2) \ + | ( (_test.uxyzw[1]>>31)<<1) \ + | ( _test.uxyzw[0]>>31) \ + ; \ + return (_mask) == (tmp&(_mask) ); \ } BX_SIMD128_IMPLEMENT_TEST(x , 0x1); diff --git a/include/bx/inline/simd128_neon.inl b/include/bx/inline/simd128_neon.inl index bf16196..ccce9db 100644 --- a/include/bx/inline/simd128_neon.inl +++ b/include/bx/inline/simd128_neon.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ @@ -13,10 +13,10 @@ namespace bx #define ELEMy 1 #define ELEMz 2 #define ELEMw 3 -#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ - template<> \ - BX_SIMD_FORCE_INLINE simd128_neon_t simd_swiz_##_x##_y##_z##_w(simd128_neon_t _a) \ - { \ +#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ + template<> \ + BX_SIMD_FORCE_INLINE simd128_neon_t simd_swiz_##_x##_y##_z##_w(simd128_neon_t _a) \ + { \ return __builtin_shuffle(_a, (uint32x4_t){ ELEM##_x, ELEM##_y, ELEM##_z, ELEM##_w }); \ } @@ -28,19 +28,19 @@ namespace bx #undef ELEMy #undef ELEMx -#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _swizzle) \ - template<> \ +#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _swizzle) \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_any_##_xyzw(simd128_neon_t _test) \ - { \ - const simd128_neon_t tmp0 = simd_swiz_##_swizzle(_test); \ - return simd_test_any_ni(tmp0); \ - } \ - \ - template<> \ + { \ + const simd128_neon_t tmp0 = simd_swiz_##_swizzle(_test); \ + return simd_test_any_ni(tmp0); \ + } \ + \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_all_##_xyzw(simd128_neon_t _test) \ - { \ - const simd128_neon_t tmp0 = simd_swiz_##_swizzle(_test); \ - return simd_test_all_ni(tmp0); \ + { \ + const simd128_neon_t tmp0 = simd_swiz_##_swizzle(_test); \ + return simd_test_all_ni(tmp0); \ } BX_SIMD128_IMPLEMENT_TEST(x, xxxx); diff --git a/include/bx/inline/simd128_ref.inl b/include/bx/inline/simd128_ref.inl index f7cabf3..85d82cf 100644 --- a/include/bx/inline/simd128_ref.inl +++ b/include/bx/inline/simd128_ref.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ @@ -13,16 +13,16 @@ namespace bx #define ELEMy 1 #define ELEMz 2 #define ELEMw 3 -#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ - template<> \ +#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ + template<> \ BX_SIMD_FORCE_INLINE simd128_ref_t simd_swiz_##_x##_y##_z##_w(simd128_ref_t _a) \ - { \ - simd128_ref_t result; \ - result.ixyzw[0] = _a.ixyzw[ELEM##_x]; \ - result.ixyzw[1] = _a.ixyzw[ELEM##_y]; \ - result.ixyzw[2] = _a.ixyzw[ELEM##_z]; \ - result.ixyzw[3] = _a.ixyzw[ELEM##_w]; \ - return result; \ + { \ + simd128_ref_t result; \ + result.ixyzw[0] = _a.ixyzw[ELEM##_x]; \ + result.ixyzw[1] = _a.ixyzw[ELEM##_y]; \ + result.ixyzw[2] = _a.ixyzw[ELEM##_z]; \ + result.ixyzw[3] = _a.ixyzw[ELEM##_w]; \ + return result; \ } #include "simd128_swizzle.inl" @@ -33,27 +33,27 @@ namespace bx #undef ELEMy #undef ELEMx -#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _mask) \ - template<> \ +#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _mask) \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_any_##_xyzw(simd128_ref_t _test) \ - { \ - uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ - | ( (_test.uxyzw[2]>>31)<<2) \ - | ( (_test.uxyzw[1]>>31)<<1) \ - | ( _test.uxyzw[0]>>31) \ - ; \ - return 0 != (tmp&(_mask) ); \ - } \ - \ - template<> \ + { \ + uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ + | ( (_test.uxyzw[2]>>31)<<2) \ + | ( (_test.uxyzw[1]>>31)<<1) \ + | ( _test.uxyzw[0]>>31) \ + ; \ + return 0 != (tmp&(_mask) ); \ + } \ + \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_all_##_xyzw(simd128_ref_t _test) \ - { \ - uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ - | ( (_test.uxyzw[2]>>31)<<2) \ - | ( (_test.uxyzw[1]>>31)<<1) \ - | ( _test.uxyzw[0]>>31) \ - ; \ - return (_mask) == (tmp&(_mask) ); \ + { \ + uint32_t tmp = ( (_test.uxyzw[3]>>31)<<3) \ + | ( (_test.uxyzw[2]>>31)<<2) \ + | ( (_test.uxyzw[1]>>31)<<1) \ + | ( _test.uxyzw[0]>>31) \ + ; \ + return (_mask) == (tmp&(_mask) ); \ } BX_SIMD128_IMPLEMENT_TEST(x , 0x1); diff --git a/include/bx/inline/simd128_sse.inl b/include/bx/inline/simd128_sse.inl index d30ff21..29d74b1 100644 --- a/include/bx/inline/simd128_sse.inl +++ b/include/bx/inline/simd128_sse.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ @@ -13,10 +13,10 @@ namespace bx #define ELEMy 1 #define ELEMz 2 #define ELEMw 3 -#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ - template<> \ - BX_SIMD_FORCE_INLINE simd128_sse_t simd_swiz_##_x##_y##_z##_w(simd128_sse_t _a) \ - { \ +#define BX_SIMD128_IMPLEMENT_SWIZZLE(_x, _y, _z, _w) \ + template<> \ + BX_SIMD_FORCE_INLINE simd128_sse_t simd_swiz_##_x##_y##_z##_w(simd128_sse_t _a) \ + { \ return _mm_shuffle_ps( _a, _a, _MM_SHUFFLE(ELEM##_w, ELEM##_z, ELEM##_y, ELEM##_x ) ); \ } @@ -28,17 +28,17 @@ namespace bx #undef ELEMy #undef ELEMx -#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _mask) \ - template<> \ +#define BX_SIMD128_IMPLEMENT_TEST(_xyzw, _mask) \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_any_##_xyzw(simd128_sse_t _test) \ - { \ - return 0x0 != (_mm_movemask_ps(_test)&(_mask) ); \ - } \ - \ - template<> \ + { \ + return 0x0 != (_mm_movemask_ps(_test)&(_mask) ); \ + } \ + \ + template<> \ BX_SIMD_FORCE_INLINE bool simd_test_all_##_xyzw(simd128_sse_t _test) \ - { \ - return (_mask) == (_mm_movemask_ps(_test)&(_mask) ); \ + { \ + return (_mask) == (_mm_movemask_ps(_test)&(_mask) ); \ } BX_SIMD128_IMPLEMENT_TEST(x , 0x1); diff --git a/include/bx/inline/simd128_swizzle.inl b/include/bx/inline/simd128_swizzle.inl index 4185be8..e734ce9 100644 --- a/include/bx/inline/simd128_swizzle.inl +++ b/include/bx/inline/simd128_swizzle.inl @@ -1,6 +1,6 @@ /* * Copyright 2010-2015 Branimir Karadzic. All rights reserved. - * License: http://www.opensource.org/licenses/BSD-2-Clause + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ #ifndef BX_SIMD_T_H_HEADER_GUARD diff --git a/include/bx/inline/simd256_avx.inl b/include/bx/inline/simd256_avx.inl index f81a9b4..c59cc80 100644 --- a/include/bx/inline/simd256_avx.inl +++ b/include/bx/inline/simd256_avx.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ diff --git a/include/bx/inline/simd256_ref.inl b/include/bx/inline/simd256_ref.inl index 04a5777..fd8d889 100644 --- a/include/bx/inline/simd256_ref.inl +++ b/include/bx/inline/simd256_ref.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */ diff --git a/include/bx/inline/simd_ni.inl b/include/bx/inline/simd_ni.inl index fb77f44..6a0be79 100644 --- a/include/bx/inline/simd_ni.inl +++ b/include/bx/inline/simd_ni.inl @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx#license-bsd-2-clause */