OSDN Git Service

Refactor encoding function for NEON 1-register with modified immediate format.
authorBob Wilson <bob.wilson@apple.com>
Mon, 28 Jun 2010 21:16:30 +0000 (21:16 +0000)
committerBob Wilson <bob.wilson@apple.com>
Mon, 28 Jun 2010 21:16:30 +0000 (21:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMCodeEmitter.cpp

index cf3ae98..00237a7 100644 (file)
@@ -1630,15 +1630,11 @@ void ARMCodeEmitter::emitNEON1RegModImmInstruction(const MachineInstr &MI) {
   // Immediate fields: Op, Cmode, I, Imm3, Imm4
   unsigned Imm = MI.getOperand(1).getImm();
   unsigned Op = (Imm >> 12) & 1;
-  Binary |= (Op << 5);
   unsigned Cmode = (Imm >> 8) & 0xf;
-  Binary |= (Cmode << 8);
   unsigned I = (Imm >> 7) & 1;
-  Binary |= (I << 24);
   unsigned Imm3 = (Imm >> 4) & 0x7;
-  Binary |= (Imm3 << 16);
   unsigned Imm4 = Imm & 0xf;
-  Binary |= Imm4;
+  Binary |= (I << 24) | (Imm3 << 16) | (Cmode << 8) | (Op << 5) | Imm4;
   if (Subtarget->isThumb())
     Binary = convertNEONDataProcToThumb(Binary);
   emitWordLE(Binary);