From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Math/Simd/bool1.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Runtime/Math/Simd/bool1.h (limited to 'Runtime/Math/Simd/bool1.h') 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 -- cgit v1.1-26-g67d0