Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/extq_1.c

raw
1 /* { dg-do compile } */
2
3 #include <arm_sve.h>
4
5 #pragma GCC target "+sve2p1"
6
7 void
8 f1 (svbool_t pg, svint8_t s8, svuint8_t u8, svint16_t s16, svuint16_t u16,
9 svfloat16_t f16, svint32_t s32, svuint32_t u32, svfloat32_t f32,
10 svint64_t s64, svuint64_t u64, svfloat64_t f64, int i)
11 {
12 svextq (pg, pg, 0); /* { dg-error {'svextq' has no form that takes 'svbool_t' arguments} } */
13 svextq (s8, s8, i); /* { dg-error {argument 3 of 'svextq' must be an integer constant expression} } */
14
15 svextq (s8, s8, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 15\]} } */
16 svextq (s8, s8, 0);
17 svextq (s8, s8, 15);
18 svextq (s8, s8, 16); /* { dg-error {passing 16 to argument 3 of 'svextq', which expects a value in the range \[0, 15\]} } */
19
20 svextq (u8, u8, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 15\]} } */
21 svextq (u8, u8, 0);
22 svextq (u8, u8, 15);
23 svextq (u8, u8, 16); /* { dg-error {passing 16 to argument 3 of 'svextq', which expects a value in the range \[0, 15\]} } */
24
25 svextq (s16, s16, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 7\]} } */
26 svextq (s16, s16, 0);
27 svextq (s16, s16, 7);
28 svextq (s16, s16, 8); /* { dg-error {passing 8 to argument 3 of 'svextq', which expects a value in the range \[0, 7\]} } */
29
30 svextq (u16, u16, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 7\]} } */
31 svextq (u16, u16, 0);
32 svextq (u16, u16, 7);
33 svextq (u16, u16, 8); /* { dg-error {passing 8 to argument 3 of 'svextq', which expects a value in the range \[0, 7\]} } */
34
35 svextq (f16, f16, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 7\]} } */
36 svextq (f16, f16, 0);
37 svextq (f16, f16, 7);
38 svextq (f16, f16, 8); /* { dg-error {passing 8 to argument 3 of 'svextq', which expects a value in the range \[0, 7\]} } */
39
40 svextq (s32, s32, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 3\]} } */
41 svextq (s32, s32, 0);
42 svextq (s32, s32, 3);
43 svextq (s32, s32, 4); /* { dg-error {passing 4 to argument 3 of 'svextq', which expects a value in the range \[0, 3\]} } */
44
45 svextq (u32, u32, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 3\]} } */
46 svextq (u32, u32, 0);
47 svextq (u32, u32, 3);
48 svextq (u32, u32, 4); /* { dg-error {passing 4 to argument 3 of 'svextq', which expects a value in the range \[0, 3\]} } */
49
50 svextq (f32, f32, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 3\]} } */
51 svextq (f32, f32, 0);
52 svextq (f32, f32, 3);
53 svextq (f32, f32, 4); /* { dg-error {passing 4 to argument 3 of 'svextq', which expects a value in the range \[0, 3\]} } */
54
55 svextq (s64, s64, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 1\]} } */
56 svextq (s64, s64, 0);
57 svextq (s64, s64, 1);
58 svextq (s64, s64, 2); /* { dg-error {passing 2 to argument 3 of 'svextq', which expects a value in the range \[0, 1\]} } */
59
60 svextq (u64, u64, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 1\]} } */
61 svextq (u64, u64, 0);
62 svextq (u64, u64, 1);
63 svextq (u64, u64, 2); /* { dg-error {passing 2 to argument 3 of 'svextq', which expects a value in the range \[0, 1\]} } */
64
65 svextq (f64, f64, -1); /* { dg-error {passing -1 to argument 3 of 'svextq', which expects a value in the range \[0, 1\]} } */
66 svextq (f64, f64, 0);
67 svextq (f64, f64, 1);
68 svextq (f64, f64, 2); /* { dg-error {passing 2 to argument 3 of 'svextq', which expects a value in the range \[0, 1\]} } */
69 }
70
71 #pragma GCC target "+nosve2p1"
72
73 void
74 f2 (svint8_t s8)
75 {
76 svextq (s8, s8, 0); /* { dg-error {ACLE function 'svextq_s8' requires ISA extension 'sve2p1'} } */
77 }