[llvm-commits] [llvm] r139969 - /llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
Owen Anderson
resistor at mac.com
Fri Sep 16 16:04:49 PDT 2011
Author: resistor
Date: Fri Sep 16 18:04:48 2011
New Revision: 139969
URL: http://llvm.org/viewvc/llvm-project?rev=139969&view=rev
Log:
Fix bitfield decoding based on Eli's feedback.
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=139969&r1=139968&r2=139969&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Fri Sep 16 18:04:48 2011
@@ -1004,10 +1004,9 @@
unsigned msb = fieldFromInstruction32(Val, 5, 5);
unsigned lsb = fieldFromInstruction32(Val, 0, 5);
- uint32_t msb_mask = (1 << (msb+1)) - 1;
- if (msb == 31) msb_mask = 0xFFFFFFFF;
- uint32_t lsb_mask = (1 << lsb) - 1;
- if (lsb == 31) lsb_mask = 0xFFFFFFFF;
+ uint32_t msb_mask = 0xFFFFFFFF;
+ if (msb != 31) msb_mask = (1U << (msb+1)) - 1;
+ uint32_t lsb_mask = (1U << lsb) - 1;
Inst.addOperand(MCOperand::CreateImm(~(msb_mask ^ lsb_mask)));
return MCDisassembler::Success;
More information about the llvm-commits
mailing list