aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/src/NvSimd
diff options
context:
space:
mode:
authorMarijn Tamis <[email protected]>2017-04-28 14:19:07 +0200
committerMarijn Tamis <[email protected]>2017-04-28 14:19:07 +0200
commitb350eb5f4d44e8448115796144375d79438d74ae (patch)
tree8e102e8c28f45a1b87bd335ceee4f33c3d4ee7c2 /NvCloth/src/NvSimd
parentAdd visual samples. (diff)
downloadnvcloth-b350eb5f4d44e8448115796144375d79438d74ae.tar.xz
nvcloth-b350eb5f4d44e8448115796144375d79438d74ae.zip
NvCloth 1.1.0 Release. (22041545)
Diffstat (limited to 'NvCloth/src/NvSimd')
-rw-r--r--NvCloth/src/NvSimd/NvSimd4f.h10
-rw-r--r--NvCloth/src/NvSimd/NvSimd4i.h5
-rw-r--r--NvCloth/src/NvSimd/NvSimdTypes.h18
3 files changed, 27 insertions, 6 deletions
diff --git a/NvCloth/src/NvSimd/NvSimd4f.h b/NvCloth/src/NvSimd/NvSimd4f.h
index cb863e7..7e2dde6 100644
--- a/NvCloth/src/NvSimd/NvSimd4f.h
+++ b/NvCloth/src/NvSimd/NvSimd4f.h
@@ -76,12 +76,18 @@ struct Simd4fTupleFactory
Simd4fTupleFactory(float x, float y, float z, float w)
// c++11: : tuple{ x, y, z, w }
{
- tuple[0] = x, tuple[1] = y, tuple[2] = z, tuple[3] = w;
+ tuple[0] = x;
+ tuple[1] = y;
+ tuple[2] = z;
+ tuple[3] = w;
}
Simd4fTupleFactory(unsigned x, unsigned y, unsigned z, unsigned w)
{
unsigned* ptr = reinterpret_cast<unsigned*>(tuple);
- ptr[0] = x, ptr[1] = y, ptr[2] = z, ptr[3] = w;
+ ptr[0] = x;
+ ptr[1] = y;
+ ptr[2] = z;
+ ptr[3] = w;
}
Simd4fTupleFactory& operator = (const Simd4fTupleFactory&); // not implemented
inline operator Simd4f() const;
diff --git a/NvCloth/src/NvSimd/NvSimd4i.h b/NvCloth/src/NvSimd/NvSimd4i.h
index 3da6169..7eda3f4 100644
--- a/NvCloth/src/NvSimd/NvSimd4i.h
+++ b/NvCloth/src/NvSimd/NvSimd4i.h
@@ -61,7 +61,10 @@ struct Simd4iTupleFactory
Simd4iTupleFactory(int x, int y, int z, int w)
// c++11: : tuple{ x, y, z, w }
{
- tuple[0] = x, tuple[1] = y, tuple[2] = z, tuple[3] = w;
+ tuple[0] = x;
+ tuple[1] = y;
+ tuple[2] = z;
+ tuple[3] = w;
}
Simd4iTupleFactory& operator = (const Simd4iTupleFactory&); // not implemented
inline operator Simd4i() const;
diff --git a/NvCloth/src/NvSimd/NvSimdTypes.h b/NvCloth/src/NvSimd/NvSimdTypes.h
index 57b4c36..0625332 100644
--- a/NvCloth/src/NvSimd/NvSimdTypes.h
+++ b/NvCloth/src/NvSimd/NvSimdTypes.h
@@ -72,8 +72,16 @@ void foo(const float* ptr)
* Define Simd4f and Simd4i, which map to four 32bit float or integer tuples.
* */
// note: ps4 compiler defines _M_X64 without value
-#define NV_SIMD_SSE2 (defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__)
-#define NV_SIMD_NEON (defined _M_ARM || defined __ARM_NEON__)
+#if defined (_M_IX86) || defined (_M_X64) || defined (__i386__) || defined (__x86_64__) || PX_EMSCRIPTEN
+#define NV_SIMD_SSE2 1
+#else
+#define NV_SIMD_SSE2 0
+#endif
+#if defined (_M_ARM) || defined (__ARM_NEON__) || defined (__ARM_NEON)
+#define NV_SIMD_NEON 1
+#else
+#define NV_SIMD_NEON 0
+#endif
#define NV_SIMD_SIMD (NV_SIMD_SSE2 || NV_SIMD_NEON)
/*! \def NV_SIMD_SCALAR
@@ -90,7 +98,11 @@ void foo(const float* ptr)
// support shift by vector operarations
#define NV_SIMD_SHIFT_BY_VECTOR (NV_SIMD_NEON)
// support inline assembler
-#define NV_SIMD_INLINE_ASSEMBLER !(defined _M_ARM || defined SN_TARGET_PSP2 || defined __arm64__)
+#if defined _M_ARM || defined SN_TARGET_PSP2 || defined __arm64__ || defined __aarch64__
+#define NV_SIMD_INLINE_ASSEMBLER 0
+#else
+#define NV_SIMD_INLINE_ASSEMBLER 1
+#endif
/*! \def NV_SIMD_USE_NAMESPACE
* \brief Set to 1 to define the SIMD library types and functions inside the nvidia::simd namespace.