This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH ] PR 844422 Fix FCTID, FCTIW with -mcpu=power7
- From: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Carl Love <cel at us dot ibm dot com>, gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Mon, 19 Mar 2018 08:19:18 -0500
- Subject: Re: [PATCH ] PR 844422 Fix FCTID, FCTIW with -mcpu=power7
- References: <1521041228.7699.7.camel@us.ibm.com> <20180316225114.GQ21977@gate.crashing.org>
On Mar 16, 2018, at 5:51 PM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
>
> Hi Carl,
>
> On Wed, Mar 14, 2018 at 08:27:08AM -0700, Carl Love wrote:
>> The following patch fixes an ICE when compiling the test case
>>
>> gcc -mcpu=power7 builtin-fctid-fctiw-runnable.c
>>
>> The GCC compiler now gives a message
>>
>> "error: builtin function ‘__builtin_fctiw’ requires the ‘-mpower8-vector’ option"
>>
>> and exits without generating an internal error.
>
> This is an improvement over the ICE, for sure.
>
> But fctiw is an ISA 1.xx instruction already (and fctid is as well,
> but explicitly undefined for 32-bit implementations until some 2.xx,
> I forgot which, 2.02 I think?)
>
> Requiring power8 for it is weird and surprising. power8-vector doubly so.
>
> It does not seem to be a good idea to only enable the builtin for cases
> where the current implementation is not broken.
>
> (The issue is that pre-power8 we do not allow SImode in FPR registers.
> Which makes the current fctiw implementation fail).
>
> I think we have two good options:
>
> 1) Remove these builtins;
> or
> 2) Make them work.
>
I don't think we can remove them, as for a while they were the only way to
access these instructions. We now have some vec_* intrinsics that are
the preferred interfaces, but for backward compatibility I think we have to
keep the old ones.
Thanks,
Bill
>
> Segher
>