mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 08:26:29 +00:00
implement support for 'clr' alias. This is part of rdar://8416805,
but balrog was wanting it on irc. llvm-svn: 114809
This commit is contained in:
parent
d342ada445
commit
75edc6b6e0
@ -1052,6 +1052,17 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
Operands[0] = X86Operand::CreateToken("fstps", NameLoc);
|
||||
}
|
||||
|
||||
|
||||
// "clr <reg>" -> "xor <reg>, <reg>".
|
||||
if ((Name == "clrb" || Name == "clrw" || Name == "clrl" || Name == "clrq" ||
|
||||
Name == "clr") && Operands.size() == 2 &&
|
||||
static_cast<X86Operand*>(Operands[1])->isReg()) {
|
||||
unsigned RegNo = static_cast<X86Operand*>(Operands[1])->getReg();
|
||||
Operands.push_back(X86Operand::CreateReg(RegNo, NameLoc, NameLoc));
|
||||
delete Operands[0];
|
||||
Operands[0] = X86Operand::CreateToken("xor", NameLoc);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -360,4 +360,18 @@ mov %rdx, %cr15
|
||||
faddp %st, %st(1)
|
||||
fmulp %st, %st(2)
|
||||
|
||||
// rdar://8416805
|
||||
// CHECK: xorb %al, %al
|
||||
// CHECK: encoding: [0x30,0xc0]
|
||||
// CHECK: xorw %di, %di
|
||||
// CHECK: encoding: [0x66,0x31,0xff]
|
||||
// CHECK: xorl %esi, %esi
|
||||
// CHECK: encoding: [0x31,0xf6]
|
||||
// CHECK: xorq %rsi, %rsi
|
||||
// CHECK: encoding: [0x48,0x31,0xf6]
|
||||
clrb %al
|
||||
clr %di
|
||||
clr %esi
|
||||
clr %rsi
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user