This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, Jan Hubicka <hubicka at ucw dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 16 Aug 2017 12:43:37 +0200
- Subject: Re: Add option for whether ceil etc. can raise "inexact", adjust x86 conditions
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1605252344370.15050@digraph.polyomino.org.uk> <CAFULd4Y_p4S-2ZYxhndF9UbJgO2dH2r1w2Z3Ae4dLZpZ80YMLA@mail.gmail.com> <20160526175950.GA60285@kam.mff.cuni.cz> <alpine.DEB.2.20.1605262100470.6600@digraph.polyomino.org.uk> <20170815135244.4jsd4jyeg6q2lyjc@virgil.suse.cz> <CAFiYyc2ZOOZz_q5gBMVZF1=1QQMFkQa0r+F8xGhbp=pKr8qBYQ@mail.gmail.com> <CAFiYyc2u20NtEpifhvrD9JkrhHQzuF4hyJDud4H49BRdUUxXzw@mail.gmail.com> <CAFiYyc27tQ4ph-zpLf1a1FcGS66SegbzaH38AqTeGSMH691y-A@mail.gmail.com> <CAFULd4YxVbct+OggCWOpNSOE7+oEoMcCOXm4T+DRZy=LUxcESA@mail.gmail.com>
On Tue, Aug 15, 2017 at 9:21 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Aug 15, 2017 at 4:59 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>
>> So I'd try the "easy" way of expanding if (__builtin_cpu_supports ("sse4.1"))
>> as the sse4.1 sequence is just a single instruction. The interesting part
>> of the story will be to make sure we can emit that even if ! TARGET_ROUND ...
>>
>> Uros, any idea how to accomplish this? Or is the idea of a "local" ifunc
>> better? Note the ABI boundary will be expensive but I guess the conditional
>> sequence as well (and it will disturb RA even if predicted to have SSE 4.1).
>
> TARGET_ROUND is just:
>
> /* SSE4.1 defines round instructions */
> #define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1
> #define TARGET_ISA_ROUND ((ix86_isa_flags & OPTION_MASK_ISA_ROUND) != 0)
>
> I don't remember the history around the #define, once upon a time
> probably made sense, but nowadays it looks that it can be simply
> substituted with TARGET_SSE4_1.
Sure but we want the backend to use a TARGET_ROUND guarded define_insn
when TARGET_ROUND is false but inside a runtime conditional ensuring that
TARGET_ROUND is satisfied. With doing this with ifuncs we'd mark the function
with a proper target attribute but within a function?
Richard.
> Uros.