|
@@ -7,7 +7,6 @@
|
|
|
#define BX_SIMD_T_H_HEADER_GUARD
|
|
#define BX_SIMD_T_H_HEADER_GUARD
|
|
|
|
|
|
|
|
#include "bx.h"
|
|
#include "bx.h"
|
|
|
-#include "math.h"
|
|
|
|
|
|
|
|
|
|
#define BX_SIMD_FORCE_INLINE BX_FORCE_INLINE
|
|
#define BX_SIMD_FORCE_INLINE BX_FORCE_INLINE
|
|
|
#define BX_SIMD_INLINE inline
|
|
#define BX_SIMD_INLINE inline
|
|
@@ -17,6 +16,8 @@
|
|
|
#define BX_SIMD_NEON 0
|
|
#define BX_SIMD_NEON 0
|
|
|
#define BX_SIMD_SSE 0
|
|
#define BX_SIMD_SSE 0
|
|
|
|
|
|
|
|
|
|
+#define BX_CONFIG_SUPPORTS_SIMD 0
|
|
|
|
|
+
|
|
|
#if defined(__AVX__) || defined(__AVX2__)
|
|
#if defined(__AVX__) || defined(__AVX2__)
|
|
|
# include <immintrin.h>
|
|
# include <immintrin.h>
|
|
|
# undef BX_SIMD_AVX
|
|
# undef BX_SIMD_AVX
|
|
@@ -484,6 +485,15 @@ BX_SIMD128_IMPLEMENT_TEST(xyzw);
|
|
|
# include "inline/simd128_sse.inl"
|
|
# include "inline/simd128_sse.inl"
|
|
|
#endif // BX_SIMD_SSE
|
|
#endif // BX_SIMD_SSE
|
|
|
|
|
|
|
|
|
|
+#if ( BX_SIMD_LANGEXT \
|
|
|
|
|
+ || BX_SIMD_NEON \
|
|
|
|
|
+ || BX_SIMD_SSE \
|
|
|
|
|
+ || BX_SIMD_AVX \
|
|
|
|
|
+ )
|
|
|
|
|
+# undef BX_CONFIG_SUPPORTS_SIMD
|
|
|
|
|
+# define BX_CONFIG_SUPPORTS_SIMD 1
|
|
|
|
|
+#endif // BX_SIMD_*
|
|
|
|
|
+
|
|
|
namespace bx
|
|
namespace bx
|
|
|
{
|
|
{
|
|
|
union simd128_ref_t
|
|
union simd128_ref_t
|
|
@@ -497,16 +507,13 @@ namespace bx
|
|
|
# define BX_SIMD_WARN_REFERENCE_IMPL 0
|
|
# define BX_SIMD_WARN_REFERENCE_IMPL 0
|
|
|
#endif // BX_SIMD_WARN_REFERENCE_IMPL
|
|
#endif // BX_SIMD_WARN_REFERENCE_IMPL
|
|
|
|
|
|
|
|
-#if !( BX_SIMD_LANGEXT \
|
|
|
|
|
- || BX_SIMD_NEON \
|
|
|
|
|
- || BX_SIMD_SSE \
|
|
|
|
|
- )
|
|
|
|
|
|
|
+#if !BX_CONFIG_SUPPORTS_SIMD
|
|
|
# if BX_SIMD_WARN_REFERENCE_IMPL
|
|
# if BX_SIMD_WARN_REFERENCE_IMPL
|
|
|
# pragma message("*** Using SIMD128 reference implementation! ***")
|
|
# pragma message("*** Using SIMD128 reference implementation! ***")
|
|
|
# endif // BX_SIMD_WARN_REFERENCE_IMPL
|
|
# endif // BX_SIMD_WARN_REFERENCE_IMPL
|
|
|
|
|
|
|
|
typedef simd128_ref_t simd128_t;
|
|
typedef simd128_ref_t simd128_t;
|
|
|
-#endif //
|
|
|
|
|
|
|
+#endif // BX_SIMD_REFERENCE
|
|
|
|
|
|
|
|
struct simd256_ref_t
|
|
struct simd256_ref_t
|
|
|
{
|
|
{
|