return Binary;
}
+/// convertNEONDataProcToThumb - Convert the ARM mode encoding for a NEON
+/// data-processing instruction to the corresponding Thumb encoding.
+static unsigned convertNEONDataProcToThumb(unsigned Binary) {
+ assert((Binary & 0xfe000000) == 0xf2000000 &&
+ "not an ARM NEON data-processing instruction");
+ unsigned UBit = (Binary >> 24) & 1;
+ return 0xef000000 | (UBit << 28) | (Binary & 0xffffff);
+}
+
void ARMCodeEmitter::emitNEONGetLaneInstruction(const MachineInstr &MI) {
unsigned Binary = getBinaryCodeForInstr(MI);
Binary |= (Imm3 << 16);
unsigned Imm4 = Imm & 0xf;
Binary |= Imm4;
+ if (Subtarget->isThumb())
+ Binary = convertNEONDataProcToThumb(Binary);
emitWordLE(Binary);
}
if (TID.getOperandConstraint(OpIdx, TOI::TIED_TO) != -1)
++OpIdx;
Binary |= encodeNEONRm(MI, OpIdx);
+ if (Subtarget->isThumb())
+ Binary = convertNEONDataProcToThumb(Binary);
// FIXME: This does not handle VDUPfdf or VDUPfqf.
emitWordLE(Binary);
}
if (TID.getOperandConstraint(OpIdx, TOI::TIED_TO) != -1)
++OpIdx;
Binary |= encodeNEONRm(MI, OpIdx);
+ if (Subtarget->isThumb())
+ Binary = convertNEONDataProcToThumb(Binary);
// FIXME: This does not handle VMOVDneon or VMOVQ.
emitWordLE(Binary);
}