Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr106708.c

raw
1 /* PR target/106708 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -mno-prefixed -save-temps" } */
4 /* { dg-require-effective-target has_arch_ppc64 } */
5
6 long long arr[]
7 = {0xffffffff7cdeab55LL, 0x98765432LL, 0xabcd0000LL, 0xffffffff65430000LL};
8
9 void __attribute__ ((__noipa__)) test_li_xoris (long long *arg)
10 {
11 *arg = 0xffffffff7cdeab55LL;
12 }
13 /* { dg-final { scan-assembler-times {\mli .*,-21675\M} 1 } } */
14 /* { dg-final { scan-assembler-times {\mxoris .*0x8321\M} 1 } } */
15
16 void __attribute__ ((__noipa__)) test_li_oris (long long *arg)
17 {
18 *arg = 0x98765432LL;
19 }
20 /* { dg-final { scan-assembler-times {\mli .*,21554\M} 1 } } */
21 /* { dg-final { scan-assembler-times {\moris .*0x9876\M} 1 } } */
22
23 void __attribute__ ((__noipa__)) test_lis_rldicl (long long *arg)
24 {
25 *arg = 0xabcd0000LL;
26 }
27 /* { dg-final { scan-assembler-times {\mlis .*,0xabcd\M} 1 } } */
28 /* { dg-final { scan-assembler-times {\mrldicl .*,0,32\M} 1 } } */
29
30 void __attribute__ ((__noipa__)) test_lis_xoris (long long *arg)
31 {
32 *arg = 0xffffffff65430000LL;
33 }
34 /* { dg-final { scan-assembler-times {\mlis .*,0xe543\M} 1 } } */
35 /* { dg-final { scan-assembler-times {\mxoris .*0x8000\M} 1 } } */
36
37 int
38 main ()
39 {
40 long long a[sizeof (arr) / sizeof (arr[0])];
41
42 test_li_xoris (a);
43 test_li_oris (a + 1);
44 test_lis_rldicl (a + 2);
45 test_lis_xoris (a + 3);
46 if (__builtin_memcmp (a, arr, sizeof (arr)) != 0)
47 __builtin_abort ();
48 return 0;
49 }