MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / vfloat8

Class vfloat8

Source/astcenc_vecmathlib_avx2_8.h:49–113  ·  view source on GitHub ↗

* @brief Data type for 8-wide floats. */

Source from the content-addressed store, hash-verified

47 * @brief Data type for 8-wide floats.
48 */
49struct vfloat8
50{
51 /**
52 * @brief Construct from zero-initialized value.
53 */
54 ASTCENC_SIMD_INLINE vfloat8() = default;
55
56 /**
57 * @brief Construct from 8 values loaded from an unaligned address.
58 *
59 * Consider using loada() which is better with vectors if data is aligned
60 * to vector length.
61 */
62 ASTCENC_SIMD_INLINE explicit vfloat8(const float *p)
63 {
64 m = _mm256_loadu_ps(p);
65 }
66
67 /**
68 * @brief Construct from 1 scalar value replicated across all lanes.
69 *
70 * Consider using zero() for constexpr zeros.
71 */
72 ASTCENC_SIMD_INLINE explicit vfloat8(float a)
73 {
74 m = _mm256_set1_ps(a);
75 }
76
77 /**
78 * @brief Construct from an existing SIMD register.
79 */
80 ASTCENC_SIMD_INLINE explicit vfloat8(__m256 a)
81 {
82 m = a;
83 }
84
85 /**
86 * @brief Factory that returns a vector of zeros.
87 */
88 static ASTCENC_SIMD_INLINE vfloat8 zero()
89 {
90 return vfloat8(_mm256_setzero_ps());
91 }
92
93 /**
94 * @brief Factory that returns a replicated scalar loaded from memory.
95 */
96 static ASTCENC_SIMD_INLINE vfloat8 load1(const float* p)
97 {
98 return vfloat8(_mm256_broadcast_ss(p));
99 }
100
101 /**
102 * @brief Factory that returns a vector loaded from 32B aligned memory.
103 */
104 static ASTCENC_SIMD_INLINE vfloat8 loada(const float* p)
105 {
106 return vfloat8(_mm256_load_ps(p));

Callers 15

zeroMethod · 0.70
load1Method · 0.70
loadaMethod · 0.70
operator+Function · 0.70
operator-Function · 0.70
operator*Function · 0.70
operator/Function · 0.70
minFunction · 0.70
maxFunction · 0.70
absFunction · 0.70
roundFunction · 0.70
hminFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected