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: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Carl Love <cel at us dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Fri, 16 Mar 2018 17:51:14 -0500
- Subject: Re: [PATCH ] PR 844422 Fix FCTID, FCTIW with -mcpu=power7
- References: <1521041228.7699.7.camel@us.ibm.com>
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.
Segher