[AArch64] PR target/66731 Fix fnmul insn with -frounding-math
gcc/Changelog: 2015-07-03 Szabolcs Nagy <szabolcs.nagy@arm.com> PR target/66731 * config/aarch64/aarch64.md (fnmul<mode>3): Handle -frounding-math. gcc/testsuite/Changelog: 2015-07-03 Szabolcs Nagy <szabolcs.nagy@arm.com> * gcc.target/aarch64/fnmul-1.c: New. * gcc.target/aarch64/fnmul-2.c: New. * gcc.target/aarch64/fnmul-3.c: New. * gcc.target/aarch64/fnmul-4.c: New. From-SVN: r225450
This commit is contained in:
parent
0409237b68
commit
2b3fe2e950
@ -1,3 +1,8 @@
|
||||
2015-07-06 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||
|
||||
PR target/66731
|
||||
* config/aarch64/aarch64.md (fnmul<mode>3): Handle -frounding-math.
|
||||
|
||||
2015-07-06 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/66759
|
||||
|
@ -4175,6 +4175,16 @@
|
||||
(mult:GPF
|
||||
(neg:GPF (match_operand:GPF 1 "register_operand" "w"))
|
||||
(match_operand:GPF 2 "register_operand" "w")))]
|
||||
"TARGET_FLOAT && !flag_rounding_math"
|
||||
"fnmul\\t%<s>0, %<s>1, %<s>2"
|
||||
[(set_attr "type" "fmul<s>")]
|
||||
)
|
||||
|
||||
(define_insn "*fnmul<mode>3"
|
||||
[(set (match_operand:GPF 0 "register_operand" "=w")
|
||||
(neg:GPF (mult:GPF
|
||||
(match_operand:GPF 1 "register_operand" "w")
|
||||
(match_operand:GPF 2 "register_operand" "w"))))]
|
||||
"TARGET_FLOAT"
|
||||
"fnmul\\t%<s>0, %<s>1, %<s>2"
|
||||
[(set_attr "type" "fmul<s>")]
|
||||
|
@ -1,3 +1,10 @@
|
||||
2015-07-06 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||
|
||||
* gcc.target/aarch64/fnmul-1.c: New.
|
||||
* gcc.target/aarch64/fnmul-2.c: New.
|
||||
* gcc.target/aarch64/fnmul-3.c: New.
|
||||
* gcc.target/aarch64/fnmul-4.c: New.
|
||||
|
||||
2015-07-06 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/66759
|
||||
|
16
gcc/testsuite/gcc.target/aarch64/fnmul-1.c
Normal file
16
gcc/testsuite/gcc.target/aarch64/fnmul-1.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
|
||||
double
|
||||
foo_d (double a, double b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fnmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
|
||||
return -a * b;
|
||||
}
|
||||
|
||||
float
|
||||
foo_s (float a, float b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fnmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
|
||||
return -a * b;
|
||||
}
|
18
gcc/testsuite/gcc.target/aarch64/fnmul-2.c
Normal file
18
gcc/testsuite/gcc.target/aarch64/fnmul-2.c
Normal file
@ -0,0 +1,18 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -frounding-math" } */
|
||||
|
||||
double
|
||||
foo_d (double a, double b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fneg\\td\[0-9\]+, d\[0-9\]+" } } */
|
||||
/* { dg-final { scan-assembler "fmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
|
||||
return -a * b;
|
||||
}
|
||||
|
||||
float
|
||||
foo_s (float a, float b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fneg\\ts\[0-9\]+, s\[0-9\]+" } } */
|
||||
/* { dg-final { scan-assembler "fmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
|
||||
return -a * b;
|
||||
}
|
16
gcc/testsuite/gcc.target/aarch64/fnmul-3.c
Normal file
16
gcc/testsuite/gcc.target/aarch64/fnmul-3.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
|
||||
double
|
||||
foo_d (double a, double b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fnmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
|
||||
return -(a * b);
|
||||
}
|
||||
|
||||
float
|
||||
foo_s (float a, float b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fnmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
|
||||
return -(a * b);
|
||||
}
|
16
gcc/testsuite/gcc.target/aarch64/fnmul-4.c
Normal file
16
gcc/testsuite/gcc.target/aarch64/fnmul-4.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -frounding-math" } */
|
||||
|
||||
double
|
||||
foo_d (double a, double b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fnmul\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" } } */
|
||||
return -(a * b);
|
||||
}
|
||||
|
||||
float
|
||||
foo_s (float a, float b)
|
||||
{
|
||||
/* { dg-final { scan-assembler "fnmul\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" } } */
|
||||
return -(a * b);
|
||||
}
|
Loading…
Reference in New Issue
Block a user