This is the mail archive of the
mailing list for the GCC project.
Re: GCC does not support *mmintrin.h with function specific opts
- From: Xinliang David Li <davidxl at google dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Sriraman Tallam <tmsriram at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Apr 2013 11:11:50 -0700
- Subject: Re: GCC does not support *mmintrin.h with function specific opts
- References: <CAAs8HmwMYGGB80J1-YxSK4tY_hn7i65Tw4DGbaq9RpA9M4vPRQ at mail dot gmail dot com> <20130412085850 dot GZ16463 at tucnak dot redhat dot com>
On Fri, Apr 12, 2013 at 1:58 AM, Jakub Jelinek <email@example.com> wrote:
> On Thu, Apr 11, 2013 at 12:05:41PM -0700, Sriraman Tallam wrote:
>> I have attached a patch that fixes this. I have added an option
>> "-mgenerate-builtins" that will do two things. It will define a macro
>> "__ALL_ISA__" which will expose the *intrin.h functions. It will also
>> expose all the target specific builtins. -mgenerate-builtins will not
>> affect code generation.
> 1) this shouldn't be an option, either it can be made to work reliably,
> then it should be done always, or it can't, then it shouldn't be done
Except that if there is compile time/memory consumption concerns,
users can use the option to turn it off.
> 2) have you verified that if you always generate all builtins, that the
> builtins not supported by the ISA selected from the command line are
> created with the right vector modes?
> 3) the *intrin.h headers in the case where the guarding macro isn't defined
> should be surrounded by something like
> #ifndef __FMA4__
> #pragma GCC push options
> #pragma GCC target("fma4")
> #ifndef __FMA4__
> #pragma GCC pop options
> so that everything that is in the headers is compiled with the ISA
> in question
For the inline functions? (The caller functions should have the target
option), or FE needs the target option properly set?
> 4) what happens if you use the various vector types typedefed in the
> *intrin.h headers in code that doesn't support those ISAs? As TYPE_MODE
> for VECTOR_TYPE is a function call, perhaps it will just be handled as
> generic BLKmode vectors, which is desirable I think
Will the veclower pass deal with it (lowered into scalar operations)?
> 5) what happens if you use a target builtin in a function not supporting
> the corresponding ISA, do you get proper error explaining what you are
> doing wrong?
Yes, in ix86_expand_builtin there is a check -- that is what Sri
mentioned in a previous email.
> 6) what happens if you use some intrinsics in a function not supporting
> the corresponding ISA? Dunno if the inliner chooses not to inline it
> and error out because it is always_inline, or what exactly will happen
I think it may end up with errors about unsupported builtins as above
> For all this you certainly need testcases.