Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
UVec8.inl
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
6
11
13{
14 return sEquals(*this, inV2).TestAllTrue();
15}
16
21
26
31
36
38{
39#ifdef JPH_USE_AVX2
40 return _mm256_cmpeq_epi32(inV1.mValue, inV2.mValue);
41#else
42 return UVec8(UVec4::sEquals(inV1.LowerVec4(), inV2.LowerVec4()), UVec4::sEquals(inV1.UpperVec4(), inV2.UpperVec4()));
43#endif
44}
45
50
55
60
65
66template<uint32 SwizzleX, uint32 SwizzleY, uint32 SwizzleZ, uint32 SwizzleW>
68{
69 static_assert(SwizzleX <= 3, "SwizzleX template parameter out of range");
70 static_assert(SwizzleY <= 3, "SwizzleY template parameter out of range");
71 static_assert(SwizzleZ <= 3, "SwizzleZ template parameter out of range");
72 static_assert(SwizzleW <= 3, "SwizzleW template parameter out of range");
73
75}
76
78{
80}
81
83{
85}
86
91
96
98{
100}
101
102template <const uint Count>
104{
105 static_assert(Count <= 31, "Invalid shift");
106
107#ifdef JPH_USE_AVX2
108 return _mm256_slli_epi32(mValue, Count);
109#else
111#endif
112}
113
114template <const uint Count>
116{
117 static_assert(Count <= 31, "Invalid shift");
118
119#ifdef JPH_USE_AVX2
120 return _mm256_srli_epi32(mValue, Count);
121#else
123#endif
124}
125
126template <const uint Count>
128{
129 static_assert(Count <= 31, "Invalid shift");
130
131#ifdef JPH_USE_AVX2
132 return _mm256_srai_epi32(mValue, Count);
133#else
135#endif
136}
137
#define JPH_NAMESPACE_END
Definition Core.h:367
std::uint32_t uint32
Definition Core.h:442
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
AllocateFunction Allocate
Definition Memory.cpp:59
Definition UVec4.h:12
static JPH_INLINE UVec4 sEquals(UVec4Arg inV1, UVec4Arg inV2)
Equals (component wise)
Definition UVec4.inl:138
Definition UVec8.h:12
JPH_OVERRIDE_NEW_DELETE UVec8()=default
Intentionally not initialized for performance reasons.
JPH_INLINE UVec4 UpperVec4() const
Fetch the higher 128 bit from a 256 bit variable.
Definition UVec8.inl:92
static JPH_INLINE UVec8 sEquals(UVec8Arg inV1, UVec8Arg inV2)
Equals (component wise)
Definition UVec8.inl:37
static JPH_INLINE UVec8 sSplatZ(UVec4Arg inV)
Replicate the Z component of inV to all components.
Definition UVec8.inl:32
JPH_INLINE UVec8 Swizzle() const
256 bit variant of Vec::Swizzle (no cross 128 bit lane swizzle)
JPH_INLINE bool TestAllTrue() const
Test if all components are true (true is when highest bit of component is set)
Definition UVec8.inl:82
JPH_INLINE bool operator==(UVec8Arg inV2) const
Comparison.
Definition UVec8.inl:12
JPH_INLINE UVec8 ArithmeticShiftRight() const
Shift all components by Count bits to the right (shifting in the value of the highest bit)
JPH_INLINE UVec8 LogicalShiftRight() const
Shift all components by Count bits to the right (filling with zeros from the right)
static JPH_INLINE UVec8 sAnd(UVec8Arg inV1, UVec8Arg inV2)
Logical and.
Definition UVec8.inl:61
JPH_INLINE bool TestAnyTrue() const
Test if any of the components are true (true is when highest bit of component is set)
Definition UVec8.inl:77
static JPH_INLINE UVec8 sSplatY(UVec4Arg inV)
Replicate the Y component of inV to all components.
Definition UVec8.inl:27
static JPH_INLINE UVec8 sSplatX(UVec4Arg inV)
Replicate the X component of inV to all components.
Definition UVec8.inl:22
static JPH_INLINE UVec8 sReplicate(uint32 inV)
Replicate int across all components.
Definition UVec8.inl:17
__m256i mValue
Definition UVec8.h:91
static JPH_INLINE UVec8 sOr(UVec8Arg inV1, UVec8Arg inV2)
Logical or.
Definition UVec8.inl:51
JPH_INLINE UVec4 LowerVec4() const
Fetch the lower 128 bit from a 256 bit variable.
Definition UVec8.inl:87
static JPH_INLINE UVec8 sXor(UVec8Arg inV1, UVec8Arg inV2)
Logical xor.
Definition UVec8.inl:56
JPH_INLINE Vec8 ToFloat() const
Converts int to float.
Definition UVec8.inl:97
JPH_INLINE UVec8 LogicalShiftLeft() const
Shift all components by Count bits to the left (filling with zeros from the left)
static JPH_INLINE UVec8 sSelect(UVec8Arg inV1, UVec8Arg inV2, UVec8Arg inControl)
Component wise select, returns inV1 when highest bit of inControl = 0 and inV2 when highest bit of in...
Definition UVec8.inl:46
Definition Vec8.h:12