Move the subtarget dependent features from the target machine to
[oota-llvm.git] / lib / Target / ARM / ARMISelLowering.cpp
index cf849951088adb901296c676e453d322bba01ae2..9905526bf160bef79ffe5f704e01135010107de9 100644 (file)
@@ -4504,6 +4504,11 @@ static SDValue isNEONModifiedImm(uint64_t SplatBits, uint64_t SplatUndef,
       BitMask <<= 8;
       ImmMask <<= 1;
     }
+
+    if (DAG.getTargetLoweringInfo().isBigEndian())
+      // swap higher and lower 32 bit word
+      Imm = ((Imm & 0xf) << 4) | ((Imm & 0xf0) >> 4);
+
     // Op=1, Cmode=1110.
     OpCmode = 0x1e;
     VT = is128Bits ? MVT::v2i64 : MVT::v1i64;