This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Cc: Steve Ellcey <sellcey at imgtec dot com>, Richard Sandiford <richard dot sandiford at arm dot com>, Joseph Myers <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Catherine Moore <clm at codesourcery dot com>, Matthew Fortune <matthew dot fortune at imgtec dot com>
- Date: Wed, 17 Jun 2015 19:44:44 +0100
- Subject: Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Authentication-results: sourceware.org; auth=none
- References: <4c25620c-546c-40ae-b330-3652fe25f791 at BAMAIL02 dot ba dot imgtec dot org> <alpine dot DEB dot 2 dot 10 dot 1506112002380 dot 15628 at digraph dot polyomino dot org dot uk> <alpine dot LFD dot 2 dot 11 dot 1506152042580 dot 5418 at eddie dot linux-mips dot org> <alpine dot DEB dot 2 dot 10 dot 1506152047390 dot 9772 at digraph dot polyomino dot org dot uk> <alpine dot LFD dot 2 dot 11 dot 1506152215570 dot 5418 at eddie dot linux-mips dot org> <alpine dot DEB dot 2 dot 10 dot 1506152157470 dot 9772 at digraph dot polyomino dot org dot uk> <alpine dot LFD dot 2 dot 11 dot 1506161240330 dot 5418 at eddie dot linux-mips dot org> <alpine dot DEB dot 2 dot 10 dot 1506161215400 dot 4909 at digraph dot polyomino dot org dot uk> <alpine dot LFD dot 2 dot 11 dot 1506161421560 dot 5418 at eddie dot linux-mips dot org> <87mvzy4nwu dot fsf at e105548-lin dot cambridge dot arm dot com> <1434562571 dot 18552 dot 6 dot camel at ubuntu-sellcey> <alpine dot LFD dot 2 dot 11 dot 1506171910160 dot 16441 at eddie dot linux-mips dot org>
"Maciej W. Rozycki" <macro@linux-mips.org> writes:
> On Wed, 17 Jun 2015, Steve Ellcey wrote:
>> Well, I don't mind removing the HONOR_NAN checks from the MIPS code in
>> my patch but I am not sure I can do a patch to remove it from the shared
>> code. I see about 80 HONOR_NAN checks in the shared code and I am not
>> sure which ones can and cannot be removed.
>
> FAOD I meant to remove the checks globally throughout MIPS target code
> only.
FWIW, to be specific, I think we're talking about every check except
the last two in mips.md:
(define_insn "abs<mode>2"
[(set (match_operand:ANYF 0 "register_operand" "=f")
(abs:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
"mips_abs == MIPS_IEEE_754_2008 || !HONOR_NANS (<MODE>mode)"
"abs.<fmt>\t%0,%1"
[(set_attr "type" "fabs")
(set_attr "mode" "<UNITMODE>")])
(define_insn "neg<mode>2"
[(set (match_operand:ANYF 0 "register_operand" "=f")
(neg:ANYF (match_operand:ANYF 1 "register_operand" "f")))]
"mips_abs == MIPS_IEEE_754_2008 || !HONOR_NANS (<MODE>mode)"
"neg.<fmt>\t%0,%1"
[(set_attr "type" "fneg")
(set_attr "mode" "<UNITMODE>")])
and the one mips-ps-3d.md:
(define_expand "mips_abs_ps"
[(set (match_operand:V2SF 0 "register_operand")
(unspec:V2SF [(match_operand:V2SF 1 "register_operand")]
UNSPEC_ABS_PS))]
"TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
{
/* If we can ignore NaNs, this operation is equivalent to the
rtl ABS code. */
if (!HONOR_NANS (V2SFmode))
{
emit_insn (gen_absv2sf2 (operands[0], operands[1]));
DONE;
}
})
In particular, the two checks in mips.c should go.
But like I say, please do add a comment above the unfused patterns to say
why we can match NEG here without the HONOR_NANS test. It's going to be
far from obvious to anyone who hasn't read this thread.
It's also worth pointing out (although it's probably obvious) that this is
effectively going to be a no-op change. We'd never have a NEG to combine
if we were honouring NANs and using the legacy pre-2008 mode. We should
still be accurate though. Especially when it's also less code :-)
Thanks,
Richard
- References:
- [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
- Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd