if (getLexer().is(AsmToken::EndOfStatement))
Parser.Lex(); // Consume the EndOfStatement
+ // Hack to allow 'movq <largeimm>, <reg>' as an alias for movabsq.
+ if ((Name == "movq" || Name == "mov") && Operands.size() == 3 &&
+ static_cast<X86Operand*>(Operands[2])->isReg() &&
+ static_cast<X86Operand*>(Operands[1])->isImm() &&
+ !static_cast<X86Operand*>(Operands[1])->isImmSExti64i32()) {
+ delete Operands[0];
+ Operands[0] = X86Operand::CreateToken("movabsq", NameLoc);
+ }
+
// FIXME: Hack to handle recognize s{hr,ar,hl} $1, <op>. Canonicalize to
// "shift <op>".
if ((Name.startswith("shr") || Name.startswith("sar") ||
Operands[0] = X86Operand::CreateToken(Repl, IDLoc);
}
-
bool WasOriginallyInvalidOperand = false;
unsigned OrigErrorInfo;
MCInst Inst;
} // Defs = [EFLAGS]
-// FIXME: NOT sets EFLAGS!
+// Note: NOT does not set EFLAGS!
let Constraints = "$src1 = $dst" in {
// Match xor -1 to not. Favors these over a move imm + xor to save code size.
// Move Instructions.
//
-// The assembler accepts movq of a 64-bit immediate as an alternate spelling of
-// movabsq.
-let isAsmParserOnly = 1 in {
-// FIXME: Alias??
-def MOV64ri_alt : RIi64<0xB8, AddRegFrm, (outs GR64:$dst), (ins i64imm:$src),
- "mov{q}\t{$src, $dst|$dst, $src}", []>;
-}
-
-
let neverHasSideEffects = 1 in {
def MOV8rr : I<0x88, MRMDestReg, (outs GR8 :$dst), (ins GR8 :$src),
"mov{b}\t{$src, $dst|$dst, $src}", []>;
// CHECK: encoding: [0x48,0xb8,0x02,0x00,0x00,0x00,0x00,0x00,0xff,0xff]
movabsq $0xFFFF000000000002, %rax
-// CHECK: movq $-281474976710654, %rax
+// CHECK: movabsq $-281474976710654, %rax
// CHECK: encoding: [0x48,0xb8,0x02,0x00,0x00,0x00,0x00,0x00,0xff,0xff]
movq $0xFFFF000000000002, %rax
// CHECK: encoding: [0x48,0x05,0xff,0xff,0x00,0x00]
addq $0xFFFF, %rax
-// CHECK: movq $4294967168, %rax
+// CHECK: movabsq $4294967168, %rax
// CHECK: encoding: [0x48,0xb8,0x80,0xff,0xff,0xff,0x00,0x00,0x00,0x00]
movq $0xFFFFFF80, %rax
-// CHECK: movq $4294967295, %rax
+// CHECK: movabsq $4294967295, %rax
// CHECK: encoding: [0x48,0xb8,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00]
movq $0xFFFFFFFF, %rax