@@ -219,42 +219,24 @@ namespace xsimd
219219 type get () const { return value; }
220220 void set (type v) { value = v; }
221221 };
222- //
223- // But sometimes we want our storage type to be less than a whole
224- // register, while presenting as a whole register to the outside
225- // world. This is because some partial-register types are not
226- // defined, but they can (mostly) be emulated using shorter vl on a
227- // full-width register for arithmetic, and cast back to a partial
228- // byte register for storage.
229- //
230- template <class T , size_t divisor>
231- struct rvv_semiblob : public rvv_type_info <T, rvv_width_m1>
232- {
233- using super = rvv_type_info<T, rvv_width_m1>;
234- static constexpr size_t width = rvv_width_m1 / divisor;
235- using typename super::type;
236- template <size_t div>
237- struct semitype ;
238- template <>
239- struct semitype <2 >
240- {
241- using type = vuint8mf2_t __attribute__ ((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF2)));
242- };
243- template <>
244- struct semitype <4 >
245- {
246- using type = vuint8mf4_t __attribute__ ((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF4)));
247- };
248- template <>
249- struct semitype <8 >
250- {
251- using type = vuint8mf8_t __attribute__ ((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF8)));
252- };
253- using fixed_type = typename semitype<divisor>::type;
254- using super::as_bytes;
255- using super::bitcast;
256222
257- fixed_type value;
223+ template <size_t div>
224+ struct semitype ;
225+ template <>
226+ struct semitype <2 >
227+ {
228+ using type = vuint8mf2_t __attribute__ ((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF2)));
229+ };
230+ template <>
231+ struct semitype <4 >
232+ {
233+ using type = vuint8mf4_t __attribute__ ((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF4)));
234+ };
235+ template <>
236+ struct semitype <8 >
237+ {
238+ using type = vuint8mf8_t __attribute__ ((riscv_rvv_vector_bits(XSIMD_RVV_WIDTH_MF8)));
239+ };
258240 template <size_t div>
259241 vuint8m1_t get_bytes () const ;
260242 template <>
@@ -281,7 +263,27 @@ namespace xsimd
281263 vuint8m1_t bytes = as_bytes (v);
282264 set_bytes<divisor>(bytes);
283265 }
284- };
266+
267+ //
268+ // But sometimes we want our storage type to be less than a whole
269+ // register, while presenting as a whole register to the outside
270+ // world. This is because some partial-register types are not
271+ // defined, but they can (mostly) be emulated using shorter vl on a
272+ // full-width register for arithmetic, and cast back to a partial
273+ // byte register for storage.
274+ //
275+ template <class T , size_t divisor>
276+ struct rvv_semiblob : public rvv_type_info <T, rvv_width_m1>
277+ {
278+ using super = rvv_type_info<T, rvv_width_m1>;
279+ static constexpr size_t width = rvv_width_m1 / divisor;
280+ using typename super::type;
281+ using fixed_type = typename semitype<divisor>::type;
282+ using super::as_bytes;
283+ using super::bitcast;
284+
285+ fixed_type value;
286+ };
285287 template <class T >
286288 struct rvv_blob <T, rvv_width_mf2> : rvv_semiblob<T, 2 >
287289 {
0 commit comments