Commit 8c191c89 by Claudiu Zissulescu Committed by Claudiu Zissulescu

[ARC] Update fma expansions.

Accept at most a single constant for fma patterns.

gcc/
2018-03-21  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/fpu.md (fmasf4): Force operand to register.
	(fnmasf4): Likewise.

gcc/testsuite
2018-03-21  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/fma-1.c: New test.

From-SVN: r261543
parent 16493b57
2018-06-12 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/fpu.md (fmasf4): Force operand to register.
(fnmasf4): Likewise.
2018-06-12 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-protos.h (arc_pad_return): Remove.
* config/arc/arc.c (machine_function): Remove force_short_suffix
and size_reason.
......
......@@ -64,6 +64,9 @@
tmp = gen_rtx_REG (SFmode, ACCL_REGNO);
emit_move_insn (tmp, operands[3]);
operands[3] = tmp;
if (!register_operand (operands[1], SFmode)
&& !register_operand (operands[2], SFmode))
operands[2] = force_reg (SFmode, operands[2]);
}")
(define_expand "fnmasf4"
......@@ -77,6 +80,9 @@
tmp = gen_rtx_REG (SFmode, ACCL_REGNO);
emit_move_insn (tmp, operands[3]);
operands[3] = tmp;
if (!register_operand (operands[1], SFmode)
&& !register_operand (operands[2], SFmode))
operands[2] = force_reg (SFmode, operands[2]);
}")
(define_insn "fmasf4_fpu"
......
2018-06-12 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/fma-1.c: New test.
2018-06-12 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/pr9001107555.c: New file.
2018-06-12 Richard Sandiford <richard.sandiford@linaro.org>
......
/* { dg-do compile } */
/* { dg-skip-if "FPU not available" { arc700 || arc6xx } } */
/* { dg-options "-s -std=gnu11 -O2 -frounding-math -mfpu=fpus_all" } */
const float a, b = 7.8539818525e01;
/* Check if the fma operation is generated correctly. */
int foo (void)
{
return (float)3.0 * b + a;
}
/* { dg-final { scan-assembler "fsmadd" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment