summaryrefslogtreecommitdiff
path: root/Runtime/Math/Simd/bool1.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Math/Simd/bool1.h')
-rw-r--r--Runtime/Math/Simd/bool1.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/Runtime/Math/Simd/bool1.h b/Runtime/Math/Simd/bool1.h
new file mode 100644
index 0000000..d195a4c
--- /dev/null
+++ b/Runtime/Math/Simd/bool1.h
@@ -0,0 +1,42 @@
+#ifndef SIMD_BOOL1_H
+#define SIMD_BOOL1_H
+
+#include "Runtime/Math/Simd/intrinsic.h"
+
+namespace math
+{
+
+struct ATTRIBUTE_ALIGN(ALIGN4F) bool1
+{
+ enum {
+ RHS_SWZ = kXYZW
+ };
+
+ typedef bool scalar_type;
+ typedef vec4bs packed_type;
+
+ packed_type s;
+
+ MECANIM_FORCE_INLINE bool1()
+ {}
+
+ MECANIM_FORCE_INLINE explicit bool1(packed_type x) : s(x)
+ {}
+
+ MECANIM_FORCE_INLINE explicit bool1(scalar_type x) : s(Vloadsb(x))
+ {}
+
+ MECANIM_FORCE_INLINE operator scalar_type() const
+ { return Vstoresb(s); }
+
+ MECANIM_FORCE_INLINE bool1 &operator=(const bool1 &r)
+ { s = r.s; return *this; }
+
+ // unary operators
+ MECANIM_FORCE_INLINE bool1 operator!() const
+ { bool1 r = bool1(Vnot(s)); return r; }
+};
+
+}
+
+#endif