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

Eli Friedman eli.friedman at gmail.com
Sun Apr 4 19:05:02 PDT 2010


On Sun, Apr 4, 2010 at 6:59 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> 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)));

Umm, I think we already have such a utility function somewhere... I'm
sure someone can remember.

-Eli




More information about the llvm-commits mailing list