"sldt <mem>" is ambiguous in 64-bit mode, but should

always be disambiguated as sldtw.  sldtw and sldtq with
a mem operands have the same effect, but sldtw is more
compact.  Force it to sldtw, resolving rdar://8017530


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-09-06 23:51:44 +00:00
parent d68c474ec5
commit c5cebeb3cb
2 changed files with 10 additions and 0 deletions

View File

@ -820,6 +820,13 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
Op->getEndLoc()));
}
// 'sldt <mem>' can be encoded with either sldtw or sldtq with the same
// effect (both store to a 16-bit mem). Force to sldtw to avoid ambiguity
// errors, since its encoding is the most compact.
if (Name == "sldt" && Operands.size() == 2 &&
static_cast<X86Operand*>(Operands[1])->isMem())
Operands[0] = X86Operand::CreateToken("sldtw", NameLoc);
return false;
}

View File

@ -178,3 +178,6 @@ inb $161, %al
// CHECK: pushq $1
push $1
// rdar://8017530
// CHECK: sldtw 4
sldt 4