Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr124710-2.c

raw
1 /* PR target/124710 */
2 /* { dg-do assemble } */
3 /* { dg-options "-O2 -masm=intel -mavx10.2" } */
4 /* { dg-require-effective-target masm_intel } */
5 /* { dg-require-effective-target avx10_2 } */
6
7 typedef float __v4sf __attribute__ ((__vector_size__ (16)));
8 typedef double __v2df __attribute__ ((__vector_size__ (16)));
9 typedef long long __v2di __attribute__ ((__vector_size__ (16)));
10
11 /* vcvttps2qqs 128-bit: source V4SF is half-width of dest V2DI,
12 Intel syntax needs "qword ptr" for memory operand.
13 At -O2 the compiler folds *p into the instruction. */
14
15 __v2di
16 test_vcvttps2qqs128 (__v4sf *p)
17 {
18 return (__v2di) __builtin_ia32_cvttps2qqs128_mask (*p, (__v2di) { 0, 0 },
19 (unsigned char) -1);
20 }
21
22 __v2di
23 test_vcvttps2uqqs128 (__v4sf *p)
24 {
25 return (__v2di) __builtin_ia32_cvttps2uqqs128_mask (*p, (__v2di) { 0, 0 },
26 (unsigned char) -1);
27 }
28
29 /* vcvttsd2sis: source V2DF extracts scalar double (64-bit),
30 Intel syntax needs "qword ptr" for memory operand. */
31
32 int
33 test_vcvttsd2sis32 (__v2df *p)
34 {
35 return (int) __builtin_ia32_cvttsd2sis32_round (*p, 4);
36 }
37
38 unsigned int
39 test_vcvttsd2usis32 (__v2df *p)
40 {
41 return (unsigned int) __builtin_ia32_cvttsd2usis32_round (*p, 4);
42 }
43
44 /* vcvttss2sis: source V4SF extracts scalar float (32-bit),
45 Intel syntax needs "dword ptr" for memory operand. */
46
47 int
48 test_vcvttss2sis32 (__v4sf *p)
49 {
50 return (int) __builtin_ia32_cvttss2sis32_round (*p, 4);
51 }
52
53 unsigned int
54 test_vcvttss2usis32 (__v4sf *p)
55 {
56 return (unsigned int) __builtin_ia32_cvttss2usis32_round (*p, 4);
57 }