This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC does not support *mmintrin.h with function specific opts
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Fri, 12 Apr 2013 10:58:50 +0200
- Subject: Re: GCC does not support *mmintrin.h with function specific opts
- References: <CAAs8HmwMYGGB80J1-YxSK4tY_hn7i65Tw4DGbaq9RpA9M4vPRQ at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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
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")
#endif
...
#ifndef __FMA4__
#pragma GCC pop options
#endif
so that everything that is in the headers is compiled with the ISA
in question
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
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?
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
then
For all this you certainly need testcases.
Jakub