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