This is the mail archive of the
mailing list for the GCC project.
Re: MIPS patch for nmadd/nmsub w/wo fast-math
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: James E Wilson <wilson at specifixinc dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 14 Aug 2004 08:23:56 +0100
- Subject: Re: MIPS patch for nmadd/nmsub w/wo fast-math
- References: <email@example.com>
James E Wilson <firstname.lastname@example.org> writes:
> While working on the vector float stuff, I noticed that we didn't
> generate nmadd instructions when -ffast-math was used. Then I noticed
> that we didn't generate nmsub instructions unless -ffast-math was used.
> This is an unfortunate side-effect of a change from Geoff Keating in Dec
> 2002. Because some FP optimizations can only be performed when
> -ffast-math is used, we end up with different canonical representations
> for nmadd/nmsub depending on whether -ffast-math was used. Thus we need
> two patterns for them in the md file, one for the normal case and one
> for the fast math case. This is a bit annoying,
Indeed. My attempts to reduce the cut-&-paste patterns in mips.md
are obviously doomed to fail ;)
> but I don't see any way
> around it. We will lose some optimizations if we don't canonicalize
> this way.
Indeed. Patch looks OK to me, except for the very minor nit below.
Please do add a scan-assembler testcase to dejagnu though. Preferrably
one for -ffast-math and one for -fno-fast-math.
! "ISA_HAS_NMADD_NMSUB && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FUSED_MADD && ! HONOR_SIGNED_ZEROS (DFmode)"
Please write as:
"ISA_HAS_NMADD_NMSUB && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT
&& TARGET_FUSED_MADD && !HONOR_SIGNED_ZEROS (DFmode)"
and similarly elsewhere.
I know the overlong line is a pre-existing problem, but it's nice
to clean these things up. Also, the coding conventions say there
should be no space after "!". (The code's hardly consistent on that
front, but I've been trying to follow it when making changes.)
Sorry for such anal comments!