[LLVMdev] A partial reply to the previous question and another one

Gil Dogon gil.dogon at mobileye.com
Thu Feb 26 06:07:29 PST 2009


OK ,  grepping the whole source tree for 'ctlz' I found the answer to my 
question in:

 test/FrontendC/2006-01-16-BitCountIntrinsicsUnsigned.c

and that is to use gnu  frontend style __builtin_clz()   for this one.

This test/FrontendC directory has a plethora of other usefull examples 
so I guess It will be sufficient for me.
However I still think that some documentation of the frontend interface 
for the intrinsics is sorely missing.
Or is it that LLVM is supposed to support ALL of gnu's intrinsic 
extensions , and in that case just refer to
the gnu documentation of intrinsics ?

Also I will need to introduce new intrinsics specific to our processor, 
as an example to get me started I would
like to ask the forum (as recommended in the 'extending llvm' document) 
how to extend it to support the following:
(or maybe there is already some support ...)

double load (load Ri, Ri+1 from an immediate address).
double store  (store Ri,Ri+1 to an immediate address).

actually double load is specially challenging as an intrinsic syntax you 
would have to return two values ....



More information about the llvm-dev mailing list