test cases/common/147 simd/simd_neon.c
raw| 1 | #include<simdconfig.h> |
| 2 | #include<simdfuncs.h> |
| 3 | |
| 4 | #include<arm_neon.h> |
| 5 | #include<stdint.h> |
| 6 | |
| 7 | int neon_available(void) { |
| 8 | return 1; /* Incorrect, but I don't know how to check this properly. */ |
| 9 | } |
| 10 | |
| 11 | void increment_neon(float arr[4]) { |
| 12 | float32x2_t a1, a2, one; |
| 13 | a1 = vld1_f32(arr); |
| 14 | a2 = vld1_f32(&arr[2]); |
| 15 | one = vdup_n_f32(1.0); |
| 16 | a1 = vadd_f32(a1, one); |
| 17 | a2 = vadd_f32(a2, one); |
| 18 | vst1_f32(arr, a1); |
| 19 | vst1_f32(&arr[2], a2); |
| 20 | } |