PR c++/67273
[official-gcc.git] / gcc / testsuite / gcc.target / arm / neon-combine-sub-abs-into-vabd.c
blobfe3d78b308cde0338300785cf7cb6ca77a831e3d
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_neon_ok } */
3 /* { dg-options "-O2 -funsafe-math-optimizations" } */
4 /* { dg-add-options arm_neon } */
6 #include <arm_neon.h>
7 float32x2_t f_sub_abs_to_vabd_32(float32x2_t val1, float32x2_t val2)
9 float32x2_t sres = vsub_f32(val1, val2);
10 float32x2_t res = vabs_f32 (sres);
12 return res;
14 /* { dg-final { scan-assembler "vabd\.f32" } }*/
16 #include <arm_neon.h>
17 int8x8_t sub_abs_to_vabd_8(int8x8_t val1, int8x8_t val2)
19 int8x8_t sres = vsub_s8(val1, val2);
20 int8x8_t res = vabs_s8 (sres);
22 return res;
24 /* { dg-final { scan-assembler "vabd\.s8" } }*/
26 int16x4_t sub_abs_to_vabd_16(int16x4_t val1, int16x4_t val2)
28 int16x4_t sres = vsub_s16(val1, val2);
29 int16x4_t res = vabs_s16 (sres);
31 return res;
33 /* { dg-final { scan-assembler "vabd\.s16" } }*/
35 int32x2_t sub_abs_to_vabd_32(int32x2_t val1, int32x2_t val2)
37 int32x2_t sres = vsub_s32(val1, val2);
38 int32x2_t res = vabs_s32 (sres);
40 return res;
42 /* { dg-final { scan-assembler "vabd\.s32" } }*/