This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, i386] Support AES, F16C, BMI and BMI2 targets in multiversioning
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Allan Sandfeld Jensen <linux at carewolf dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 2 Jan 2015 19:40:06 +0100
- Subject: Re: [Patch, i386] Support AES, F16C, BMI and BMI2 targets in multiversioning
- Authentication-results: sourceware.org; auth=none
- References: <201412311328 dot 48412 dot linux at carewolf dot com> <20141231131542 dot GV1667 at tucnak dot redhat dot com> <201412311438 dot 09295 dot linux at carewolf dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 31, 2014 at 02:38:09PM +0100, Allan Sandfeld Jensen wrote:
> On Wednesday 31 December 2014, Jakub Jelinek wrote:
> > On Wed, Dec 31, 2014 at 01:28:47PM +0100, Allan Sandfeld Jensen wrote:
> > > I recently wanted to use multiversioning for BMI2 specific extensions
> > > PDEP/PEXT, and noticed it wasn't there. So I wrote this patch to add it,
> > > and also added AES, F16C and BMI1 for completeness.
> >
> > AES nor F16C doesn't make any sense IMHO for multiversioning, you need
> > special intrinsics for that anyway and when you use them, the function will
> > fail to compile without those features.
> > Multiversioning only makes sense for ISA features the compiler uses for
> > normal C/C++ code without any intrinsics.
> >
> I disagree. You just include the intrinsics and use them. Inside a function
> with the right target rule they will work even if they don't outside. This
> works even without multiversioning, e.g. just specific functions with specific
> targets.
I don't understand. Target attribute for aes or f16c of course makes sense,
but that is already supported. But for multiversioning, you can't have
intrinsics vs. other code depending on what the function is multiversioned
for. So, you either don't use them at all, then multiversioning on it
doesn't make sense, or you include them, and get errors because intrinsics
are used in a function that doesn't support aes or f16c.
Jakub