diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-01-06 13:06:17 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-01-07 03:52:26 -0800 |
commit | e96905d3d17588cd6236f24af45665bed1d0fdcc (patch) | |
tree | ad69d05873f7e1db97ecdb724b832de095e9f7c9 /gcc/testsuite | |
parent | 1d1e4d6b346e1cddc3c249993d8391a971e608cc (diff) | |
download | gcc-hjl/pr69171/master.tar.gz |
Add round_nimm_scalar_predicate and use xBmhjl/pr69171/master
Add round_nimm_scalar_predicate for scalar SSE integer to floating point
conversions since round_nimm_predicate is for vector operand.
round_constraint can't be used on vector SSE patterns since it is mapped
to "vm". The "xBm" constraint must be used in this case.
gcc/
PR target/69171
* config/i386/sse.md (<sse>_sqrt<mode>2<mask_name><round_name>):
Use the "xBm" constraint.
(float<sseintvecmodelower><mode>2<mask_name><round_name):
Likewise.
(sse_cvtsi2ss<round_name>): Use round_nimm_scalar_predicate.
(sse_cvtsi2ssq<round_name>): Likewise.
(sse_cvtss2si<round_name>): Likewise.
(sse_cvtss2siq<round_name>): Likewise.
(sse2_cvtsi2sdq<round_name>): Likewise.
(sse2_cvtsd2si<round_name>): Likewise.
(sse2_cvtsd2siq<round_name>): Likewise.
* config/i386/subst.md (round_nimm_scalar_predicate): New
predicate.
gcc/testsuite/
PR target/69171
* gcc.target/i386/pr69171-1.c: New test.
* gcc.target/i386/pr69171-2.c: Likewise.
* gcc.target/i386/pr69171-3.c: Likewise.
* gcc.target/i386/pr69171-4.c: Likewise.
* gcc.target/i386/pr69171-5.c: Likewise.
* gcc.target/i386/pr69171-6.c: Likewise.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69171-1.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69171-2.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69171-3.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69171-4.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69171-5.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr69171-6.c | 12 |
6 files changed, 74 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr69171-1.c b/gcc/testsuite/gcc.target/i386/pr69171-1.c new file mode 100644 index 00000000000..0b92c22b61f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69171-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2 -mno-avx -mfpmath=sse" } */ + +#pragma pack(2) +struct { + int n; +} a; +extern void fn2 (float); +void +fn1 () +{ + fn2 (a.n); +} diff --git a/gcc/testsuite/gcc.target/i386/pr69171-2.c b/gcc/testsuite/gcc.target/i386/pr69171-2.c new file mode 100644 index 00000000000..80e1a097f20 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69171-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2 -mno-avx -mfpmath=sse" } */ + +#pragma pack(2) +struct { + long long int n; +} a; +extern void fn2 (float); +void +fn1 () +{ + fn2 (a.n); +} diff --git a/gcc/testsuite/gcc.target/i386/pr69171-3.c b/gcc/testsuite/gcc.target/i386/pr69171-3.c new file mode 100644 index 00000000000..73717bef6ba --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69171-3.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-fpic -O2 -msse2 -mno-avx -mfpmath=sse" } */ + +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; + +extern int glob1; + +double +foo (void) +{ + return (double) (int) (uintptr_t) &glob1; +} diff --git a/gcc/testsuite/gcc.target/i386/pr69171-4.c b/gcc/testsuite/gcc.target/i386/pr69171-4.c new file mode 100644 index 00000000000..e4acf3fd5f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69171-4.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-fpic -O2 -msse2 -mno-avx -mfpmath=sse" } */ + +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; + +extern int glob1; + +float +foo (void) +{ + return (float) (int) (uintptr_t) &glob1; +} diff --git a/gcc/testsuite/gcc.target/i386/pr69171-5.c b/gcc/testsuite/gcc.target/i386/pr69171-5.c new file mode 100644 index 00000000000..230af3ec3d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69171-5.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-fpic -O2 -msse2 -mno-avx -mfpmath=sse" } */ + +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; + +extern int glob1; + +float +foo (void) +{ + return (float) (long long) (uintptr_t) &glob1; +} diff --git a/gcc/testsuite/gcc.target/i386/pr69171-6.c b/gcc/testsuite/gcc.target/i386/pr69171-6.c new file mode 100644 index 00000000000..b82627a4419 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr69171-6.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-fpic -O2 -msse2 -mno-avx -mfpmath=sse" } */ + +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; + +extern int glob1; + +double +foo (void) +{ + return (double) (long long) (uintptr_t) &glob1; +} |