[LLVMdev] llvm.powi intrinsic

Chris Lattner sabre at nondot.org
Mon Nov 26 20:06:08 PST 2007


On Mon, 26 Nov 2007, Chris Lattner wrote:
>> Do any architectures have an integer power instruction of some sort?
>
> The purpose of this is to capture this information at a higher level,
> allowing the code generator top (eventually) lower it into an optimal

"allowing the code generator to (eventually) lower it into an optimal"

-Chris

> sequence of multiplies.  for example, powi(x, 9) can be lowered to:
>
> t = x*x;
> t2 = t*t
> result = t2*t2*x
>
> The code generator doesn't currently do any smart lowering, if you're
> interested in this, it would be a great place to dive in
>
> -Chris
>
>

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list