1 /* Test SIMD shift works correctly. */
3 /* { dg-options "-O3 --save-temps" } */
7 extern void abort (void);
9 int __attribute__ ((noinline
))
16 arg
= vcreate_s64 (0x0000000080000000);
17 result
= vshr_n_s64 (arg
, 64);
18 got
= vget_lane_s64 (result
, 0);
20 /* Expect: "result" = 0000000000000000. */
26 int __attribute__ ((noinline
))
33 arg
= vcreate_s64 (0xffffffff80000000);
34 result
= vshr_n_s64 (arg
, 64);
35 got
= vget_lane_s64 (result
, 0);
36 exp
= 0xffffffffffffffff;
37 /* Expect: "result" = -1. */
44 __attribute__ ((noinline
))
51 arg
= vcreate_s64 (0x0000000080000000);
52 result
= vshr_n_s64 (arg
, 4);
53 got
= vget_lane_s64 (result
, 0);
54 exp
= 0x0000000008000000;
55 /* Expect: "result" = 0x0000000008000000. */
61 int __attribute__ ((noinline
))
68 arg
= vcreate_s64 (0xffffffff80000000);
69 result
= vshr_n_s64 (arg
, 4);
70 got
= vget_lane_s64 (result
, 0);
71 exp
= 0xfffffffff8000000;
72 /* Expect: "result" = 0xfffffffff8000000. */
78 int __attribute__ ((noinline
))
85 arg
= vcreate_s64 (0x0000000080000000);
86 result
= vshr_n_s64 (arg
, 0);
87 got
= vget_lane_s64 (result
, 0);
88 exp
= 0x0000000080000000;
89 /* Expect: "result" = 0x0000000080000000. */
95 /* { dg-final { scan-assembler-not "sshr\\td\[0-9\]+, d\[0-9\]+, 0" } } */
104 if (test_sshr64_neg ())
106 if (test_other_neg ())
109 if (test_no_sshr0 ())