This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: rs6000 fused multiply-add patch
- From: Segher Boessenkool <segher at koffie dot nl>
- To: Geoffrey Keating <gkeating at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org, dje at watson dot ibm dot com,pinskia at physics dot uc dot edu, dalej at apple dot com
- Date: Wed, 04 Dec 2002 00:34:59 +0100
- Subject: Re: rs6000 fused multiply-add patch
- References: <200212030300.gB330LRm001329@keatge.apple.com>
Geoffrey Keating wrote:
>
> I looked at Segher's patch, and while I thought it was the right
> direction, I kept finding more missing pieces the more I looked at
> it. So, I wrote my own. This one has test cases, documentation, and
> works in nearly every case.
Mine works in _every_ case -- I _did_ test it, after all :)
I didn't test your patch yet, but...
> --- config/rs6000/rs6000.md 16 Nov 2002 18:01:51 -0000 1.222
> +++ config/rs6000/rs6000.md 3 Dec 2002 02:32:41 -0000
> @@ -5280,7 +5280,18 @@
> (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
> (match_operand:SF 2 "gpc_reg_operand" "f"))
> (match_operand:SF 3 "gpc_reg_operand" "f"))))]
> - "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
> + "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
> + && HONOR_SIGNED_ZEROS (SFmode)"
> + "fnmadds %0,%1,%2,%3"
> + [(set_attr "type" "fp")])
> +
> +(define_insn ""
> + [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
> + (minus:SF (mult:SF (neg:SF (match_operand:SF 1 "gpc_reg_operand" "f"))
> + (match_operand:SF 2 "gpc_reg_operand" "f"))
> + (match_operand:SF 3 "gpc_reg_operand" "f")))]
> + "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
> + && ! HONOR_SIGNED_ZEROS (SFmode)"
> "fnmadds %0,%1,%2,%3"
> [(set_attr "type" "fp")])
We're not supposed to add duplicate patterns to the .md -- that's what started
all of this, after all?
Segher