[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:
Szabolcs Nagy 2015-07-06 11:00:03 +00:00 committed by Szabolcs Nagy
parent 0409237b68
commit 2b3fe2e950
7 changed files with 88 additions and 0 deletions

View File

@ -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

View File

@ -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>")]

View File

@ -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

View 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;
}

View 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;
}

View 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);
}

View 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);
}