OSDN Git Service

Optimizing away Binary &= ~(0x80000000 >> 12) and Binary |= (Imm & 0x80000000) >> 12
authorShih-wei Liao <sliao@google.com>
Fri, 17 Jun 2011 20:09:03 +0000 (13:09 -0700)
committerShih-wei Liao <sliao@google.com>
Fri, 17 Jun 2011 20:09:03 +0000 (13:09 -0700)
The key is that the classical JIT does: unsigned Binary = getBinaryCodeForInstr(MI);
As a result, it will get information from ARMInstrVFP.td. Because regardless of my
previous CLs I20394c2c and I9a8e7177, the old td and the new td will result in
the same immed{31}.

See Line 1080 of ARMInstrVFP.td: let Inst{19} = imm{31};

In short, we only need to fix the difference between old td and the new td.

Change-Id: I02695ece0f15e77f7bd712961db1a24bd3c487d7

lib/Target/ARM/ARMCodeEmitter.cpp

index ddcf234..d010d1d 100644 (file)
@@ -1857,8 +1857,6 @@ void ARMCodeEmitter::emitMiscInstruction(const MachineInstr &MI) {
     Binary |= (Imm & 0x780000) >> 19;
     Binary &= ~(0x3800000 >> 7);
     Binary |= (Imm & 0x3800000) >> 7;
-    Binary &= ~(0x80000000 >> 12);
-    Binary |= (Imm & 0x80000000) >> 12;
     Binary = VFPThumb2PostEncoder(MI, Binary);
   }