Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/vect-nop-move.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-require-effective-target vect_float } */ | |
2 /* { dg-additional-options "-fdump-rtl-combine-details" } */ | |
3 | |
4 #include "tree-vect.h" | |
5 | |
6 extern void abort (void); | |
7 | |
8 #define NOINLINE __attribute__((noinline)) | |
9 | |
10 typedef float float32x4_t __attribute__ ((__vector_size__ (16))); | |
11 typedef float float32x2_t __attribute__ ((__vector_size__ (8))); | |
12 | |
13 NOINLINE float | |
14 foo32x4_be (float32x4_t x) | |
15 { | |
16 return x[3]; | |
17 } | |
18 | |
19 NOINLINE float | |
20 foo32x4_le (float32x4_t x) | |
21 { | |
22 return x[0]; | |
23 } | |
24 | |
25 NOINLINE float | |
26 bar (float a) | |
27 { | |
28 return a; | |
29 } | |
30 | |
31 NOINLINE float | |
32 foo32x2_be (float32x2_t x) | |
33 { | |
34 #ifdef __i386__ | |
35 /* ix86 passes float32x2 vector arguments in mmx registers. We need to | |
36 emit emms to empty MMS state and reenable x87 stack before float value | |
37 can be loaded to and passed in x87 floating-point return register. */ | |
38 __builtin_ia32_emms (); | |
39 #endif | |
40 return bar (x[1]); | |
41 } | |
42 | |
43 NOINLINE float | |
44 foo32x2_le (float32x2_t x) | |
45 { | |
46 #ifdef __i386__ | |
47 __builtin_ia32_emms (); | |
48 #endif | |
49 return bar (x[0]); | |
50 } | |
51 | |
52 NOINLINE int | |
53 test (void) | |
54 { | |
55 float32x4_t a = { 0.0f, 1.0f, 2.0f, 3.0f }; | |
56 float32x2_t b = { 0.0f, 1.0f }; | |
57 | |
58 if (foo32x2_be (b) != 1.0f) | |
59 abort (); | |
60 | |
61 if (foo32x2_le (b) != 0.0f) | |
62 abort (); | |
63 | |
64 if (foo32x4_be (a) != 3.0f) | |
65 abort (); | |
66 | |
67 if (foo32x4_le (a) != 0.0f) | |
68 abort (); | |
69 | |
70 return 0; | |
71 } | |
72 | |
73 int | |
74 main () | |
75 { | |
76 check_vect (); | |
77 return test (); | |
78 } | |
79 | |
80 /* { dg-final { scan-rtl-dump "deleting noop move" "combine" { target aarch64*-*-* } } } */ |