[LLVMdev] [PATCH] Emit rbit, clz on ARM for __builtin_ctz

Richard Osborne richard at xmos.com
Fri Jan 15 11:37:21 PST 2010


On 15 Jan 2010, at 18:03, Chris Lattner wrote:

> On Jan 14, 2010, at 10:13 PM, David Conrad wrote:
> 
>> Other targets that I know of that could potentially benefit from  
>> this optimization being global (that have a clz and bitreverse  
>> instruction but not ctz) are AVR32 and C64x, neither of which llvm  
>> has backends for yet.
> 
> When/if another target wants this, we could add a ISD::RBIT operation,  
> it doesn't need to be added at the llvm ir level,

The XCore also has ctlz and bitreverse instructions and not cttz. At the moment in the XCore backend cttz is marked as legal and expanded to this pair of instructions in a pattern in the InstrInfo.td.

-- 
Richard Osborne | XMOS
http://www.xmos.com





More information about the llvm-dev mailing list