ranjith kumar <ranjit_kumar_b4u@xxxxxxxxxxx> writes: > Gcc manuals says all builtin functions are folded in > tree optimization passe(given below) that are run > after gimplification > http://gcc.gnu.org/onlinedocs/gccint/Tree_002dSSA-passes.html#Tree_002dSSA-passes > > >Folding built-in functions > > >This pass simplifies built-in functions, as > applicable, >with constant arguments or with > inferrable string >lengths. It is located in > tree-ssa-ccp.c and is >described by > pass_fold_builtins. > > 1)I find _builtin* functions in mmintrin.h, > xmmintrin.h and emmintrin.h........ > I think 'Folding built-in functions' is the pass that > replaces _builtin functions when a program is > compiled. Am I right? Sort of but not really. The __builtin* functions used by mmintrin.h and friends are not generally folded. They may be folded in some cases if they are called with constant arguments, as in the description of the pass. Those functions are usually expanded when translating GIMPLE into RTL. The code to do the expansion of these particular functions is ix86_expand_builtin. That function looks at the __builtin function code and generates the appropriate RTL. Ian