[llvm-commits] [llvm] r100233 - in /llvm/trunk: ./ include/llvm/Support/ lib/Target/ARM/ lib/Target/ARM/Disassembler/ test/MC/Disassembler/ utils/TableGen/

Chris Lattner clattner at apple.com
Sun Apr 4 20:32:32 PDT 2010


On Apr 4, 2010, at 6:59 PM, Jakob Stoklund Olesen wrote:

> 
> On Apr 4, 2010, at 6:48 PM, Johnny Chen wrote:
> 
>> Hi Jakob,
>> 
>> Thanks.  You're welcome to modify the MathExtras.h stuff.
>> Right now, arm disassembler is the only client of SignExtend32<B>(int32_t x).
>> I originally use a bit-field hack but Chris thinks it is non-portable.
> 
> How about this?
> 
>  return x | -(x & (1 << (B - 1)));

Shift left + shift right is more easily recognized by the code generator as a sext.

-Chris



More information about the llvm-commits mailing list