This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 10/10] Port testsuite to GCN
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Andrew Stubbs <ams at codesourcery dot com>
- Cc: Jeff Law <law at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 08 Dec 2018 12:05:06 +0000
- Subject: Re: [PATCH 10/10] Port testsuite to GCN
- References: <cover.1542381960.git.ams@codesourcery.com> <2d4f15916d3fd76c3c125eca60a86f5be5b807c0.1542381960.git.ams@codesourcery.com> <bdc97e35-5152-778c-a192-42dbd92305a1@redhat.com> <e209773e-cfb2-399f-c72d-c4f1944810f7@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com> writes:
> I finally got back to investigating this ....
>
> On 21/11/2018 01:00, Jeff Law wrote:
>>> --- a/gcc/testsuite/gcc.dg/gimplefe-28.c
>>> +++ b/gcc/testsuite/gcc.dg/gimplefe-28.c
>>> @@ -1,5 +1,5 @@
>>> /* { dg-do compile { target sqrt_insn } } */
>>> -/* { dg-options "-fgimple -O2" } */
>>> +/* { dg-options "-fgimple -O2 -ffast-math" } */
>> So why does the GCN need fast-math here? I'm not aware of any other
>> target that needs that kind of handling to make this test work.
>
> It needs it because the sqrt instruction is only enabled when
> flag_unsafe_math_optimizations is set. This seems appropriate given the
> approximate nature of the machine instruction.
>
> This test uses gimple directly and so bypasses the usual optab checks
> that would normally select a library function instead, which results in
> an ICE.
>
> It seems like a safe change to make, since most targets will have more
> patterns enabled, not fewer, in this mode.
>
> The test will continue to fail on any target that does not have a sqrt
> instruction at all.
But then I think we'll end up doing this for other (future) tests gated
on sqrt_insn, which would reduce the sqrt coverage for targets that don't
need -ffast-math.
I think it'd be better to define add_options_for_sqrt_insn, returning
"-ffast-math" for GCN and "" for everything else. Then the test can use:
/* { dg-add-options sqrt_insn } */
after the dg-options line.
Thanks,
Richard