On Fri, Apr 12, 2013 at 1:58 AM, Jakub Jelinek <ja...@redhat.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") > #endif > ... > #ifndef __FMA4__ > #pragma GCC pop options > #endif > 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 > then I think it may end up with errors about unsupported builtins as above thanks, David > > For all this you certainly need testcases. > > Jakub