]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/shift_right_imm_narrowt_to_uint_1.c
[AArch64] Add support for the SVE2 ACLE
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / acle / general-c / shift_right_imm_narrowt_to_uint_1.c
1 /* { dg-do compile } */
2
3 #include <arm_sve.h>
4
5 #pragma GCC target ("arch=armv8.2-a+sve2")
6
7 void
8 f1 (svbool_t pg, svint8_t s8, svuint8_t u8,
9 svint16_t s16, svuint16_t u16,
10 svint32_t s32, svuint32_t u32,
11 svint64_t s64, svuint64_t u64,
12 svfloat32_t f32, int x)
13 {
14 const int one = 1;
15 svqshrunt (u8, s16); /* { dg-error {too few arguments to function 'svqshrunt'} } */
16 svqshrunt (u8, s16, s16, 1); /* { dg-error {too many arguments to function 'svqshrunt'} } */
17
18 svqshrunt (u16, s16, 1); /* { dg-error {passing 'svuint16_t' instead of the expected 'svuint8_t' to argument 1 of 'svqshrunt', after passing 'svint16_t' to argument 2} } */
19 svqshrunt (s16, s16, 1); /* { dg-error {passing 'svint16_t' to argument 1 of 'svqshrunt', which expects a vector of unsigned integers} } */
20 svqshrunt (s8, s16, 1); /* { dg-error {passing 'svint8_t' to argument 1 of 'svqshrunt', which expects a vector of unsigned integers} } */
21 svqshrunt (pg, s16, 1); /* { dg-error {passing 'svbool_t' to argument 1 of 'svqshrunt', which expects a vector of unsigned integers} } */
22
23 svqshrunt (u8, s16, x); /* { dg-error {argument 3 of 'svqshrunt' must be an integer constant expression} } */
24 svqshrunt (u8, s16, one); /* { dg-error {argument 3 of 'svqshrunt' must be an integer constant expression} } */
25 svqshrunt (u8, s16, 0.4); /* { dg-error {passing 0 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 8\]} } */
26 svqshrunt (u8, s16, 1.0);
27
28 svqshrunt (u8, pg, 1); /* { dg-error {'svqshrunt' has no form that takes 'svbool_t' arguments} } */
29
30 svqshrunt (u8, u8, -1); /* { dg-error {'svqshrunt' has no form that takes 'svuint8_t' arguments} } */
31 svqshrunt (u8, u8, 1); /* { dg-error {'svqshrunt' has no form that takes 'svuint8_t' arguments} } */
32 svqshrunt (u8, u8, 100); /* { dg-error {'svqshrunt' has no form that takes 'svuint8_t' arguments} } */
33
34 svqshrunt (u8, s8, 1); /* { dg-error {'svqshrunt' has no form that takes 'svint8_t' arguments} } */
35
36 svqshrunt (u8, u16, 1); /* { dg-error {'svqshrunt' has no form that takes 'svuint16_t' arguments} } */
37
38 svqshrunt (u8, s16, -1); /* { dg-error {passing -1 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 8\]} } */
39 svqshrunt (u8, s16, 0); /* { dg-error {passing 0 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 8\]} } */
40 svqshrunt (u8, s16, 1);
41 svqshrunt (u8, s16, 8);
42 svqshrunt (u8, s16, 9); /* { dg-error {passing 9 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 8\]} } */
43
44 svqshrunt (u16, u32, 1); /* { dg-error {'svqshrunt' has no form that takes 'svuint32_t' arguments} } */
45
46 svqshrunt (u16, s32, -1); /* { dg-error {passing -1 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 16\]} } */
47 svqshrunt (u16, s32, 0); /* { dg-error {passing 0 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 16\]} } */
48 svqshrunt (u16, s32, 1);
49 svqshrunt (u16, s32, 16);
50 svqshrunt (u16, s32, 17); /* { dg-error {passing 17 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 16\]} } */
51
52 svqshrunt (u32, u64, 1); /* { dg-error {'svqshrunt' has no form that takes 'svuint64_t' arguments} } */
53
54 svqshrunt (u32, s64, -1); /* { dg-error {passing -1 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 32\]} } */
55 svqshrunt (u32, s64, 0); /* { dg-error {passing 0 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 32\]} } */
56 svqshrunt (u32, s64, 1);
57 svqshrunt (u32, s64, 32);
58 svqshrunt (u32, s64, 33); /* { dg-error {passing 33 to argument 3 of 'svqshrunt', which expects a value in the range \[1, 32\]} } */
59
60 svqshrunt (u16, f32, 1); /* { dg-error {'svqshrunt' has no form that takes 'svfloat32_t' arguments} } */
61
62 svqshrunt (1, u32, 1); /* { dg-error {passing 'int' to argument 1 of 'svqshrunt', which expects an SVE vector type} } */
63 svqshrunt (u32, 1, 1); /* { dg-error {passing 'int' to argument 2 of 'svqshrunt', which expects an SVE vector type} } */
64 }