summaryrefslogtreecommitdiff
path: root/Runtime/Math/Simd/bool1.h
blob: d195a4c33fb6a38051d7022be5b3df43a8c05d8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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