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

Class vfloat

Source/astcenc_vecmathlib_rvv_n.h:56–128  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

54 * @brief Data type for N-wide floats.
55 */
56struct vfloat
57{
58 /**
59 * @brief Construct from zero-initialized value.
60 */
61 ASTCENC_SIMD_INLINE vfloat() = default;
62
63 /**
64 * @brief Construct from N values loaded from an unaligned address.
65 *
66 * Consider using loada() which is better with vectors if data is aligned
67 * to vector length.
68 */
69 ASTCENC_SIMD_INLINE explicit vfloat(const float *p)
70 {
71 m = __riscv_vle32_v_f32m1(p, vl());
72 }
73
74 /**
75 * @brief Construct from 1 scalar value replicated across all lanes.
76 *
77 * Consider using zero() for constexpr zeros.
78 */
79 ASTCENC_SIMD_INLINE explicit vfloat(float a)
80 {
81 m = __riscv_vfmv_v_f_f32m1(a, vl());
82 }
83
84 /**
85 * @brief Construct from an existing SIMD register.
86 */
87 ASTCENC_SIMD_INLINE explicit vfloat(vfloat_t a)
88 {
89 m = a;
90 }
91
92 /**
93 * @brief Return vector length of type.
94 */
95 static ASTCENC_SIMD_INLINE size_t vl()
96 {
97 return __riscv_vsetvlmax_e32m1();
98 }
99
100 /**
101 * @brief Factory that returns a vector of zeros.
102 */
103 static ASTCENC_SIMD_INLINE vfloat zero()
104 {
105 return vfloat(0.0f);
106 }
107
108 /**
109 * @brief Factory that returns a replicated scalar loaded from memory.
110 */
111 static ASTCENC_SIMD_INLINE vfloat load1(const float* p)
112 {
113 return vfloat(*p);

Callers 15

atanFunction · 0.85
atan2Function · 0.85
store_image_blockFunction · 0.85
zeroMethod · 0.85
load1Method · 0.85
loadaMethod · 0.85
operator+Function · 0.85
operator-Function · 0.85
operator*Function · 0.85
operator/Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected