|
|
@ -15,12 +15,12 @@ int test() |
|
|
|
#include "arm_neon.h" |
|
|
|
#include "arm_neon.h" |
|
|
|
int test() |
|
|
|
int test() |
|
|
|
{ |
|
|
|
{ |
|
|
|
const float src[] = { 0.0f, 1.0f, 2.0f, 3.0f }; |
|
|
|
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; |
|
|
|
short dst[4]; |
|
|
|
short dst[8]; |
|
|
|
float32x4_t v_src = vld1q_f32(src); |
|
|
|
float32x4_t v_src = *(float32x4_t*)src; |
|
|
|
float16x4_t v_dst = vcvt_f16_f32(v_src); |
|
|
|
float16x4_t v_dst = vcvt_f16_f32(v_src); |
|
|
|
vst1_f16((__fp16*)dst, v_dst); |
|
|
|
*(float16x4_t*)dst = v_dst; |
|
|
|
return dst[0] + dst[1] + dst[2] + dst[3]; |
|
|
|
return (int)dst[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
#error "FP16 is not supported" |
|
|
|
#error "FP16 is not supported" |
|
|
|