24 #ifndef ARM_COMPUTE_WRAPPER_CVT_H
25 #define ARM_COMPUTE_WRAPPER_CVT_H
33 #define VCVT_TO_F32_IMPL(ptype, vtype, prefix, postfix1, postfix2) \
34 template <typename T> \
35 inline typename std::enable_if<std::is_same<T, float>::value, float32x4_t>::type vcvt(const vtype &a) \
37 return prefix##_##postfix1##_##postfix2(a); \
42 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
44 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
45 #undef VCVT_TO_F32_IMPL
47 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
48 #define VCVT_TO_F16_IMPL(ptype, vtype, prefix, postfix1, postfix2) \
49 template <typename T> \
50 inline typename std::enable_if<std::is_same<T, float16_t>::value, float16x4_t>::type vcvt(const vtype &a) \
52 return prefix##_##postfix1##_##postfix2(a); \
55 VCVT_TO_F16_IMPL(float16x4_t, float32x4_t,
vcvt, f16, f32)
56 #undef VCVT_TO_F16_IMPL
57 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
60 inline typename std::enable_if<std::is_same<T, uint8_t>::value || std::is_same<T, uint32_t>::value, uint32x4_t>
::type
63 return vcvtq_u32_f32(a);
67 inline typename std::enable_if<std::is_same<T, int8_t>::value || std::is_same<T, int32_t>::value, int32x4_t>
::type
70 return vcvtq_s32_f32(a);
75 inline typename std::enable_if<std::is_same<T, uint32_t>::value, uint32x4_t>
::type vcvta(
const float32x4_t &a)
77 return vcvtaq_u32_f32(a);
81 inline typename std::enable_if<std::is_same<T, int32_t>::value, int32x4_t>
::type vcvta(
const float32x4_t &a)
83 return vcvtaq_s32_f32(a);
87 #if defined(ARM_COMPUTE_ENABLE_BF16)
93 inline void vcvt_bf16_f32(
const float *inptr, uint16_t *outptr)
95 __asm __volatile(
"ldp q0, q1, [%[inptr]]\n"
98 "str q0, [%[outptr]]\n"
100 : [outptr]
"r"(outptr)
101 :
"v0",
"v1",
"memory");