mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
AsmParser/X86: Add temporary hack to allow parsing "sal". Eventually we need
some mechanism for specifying alternative syntaxes, but I'm not sure what form that should take yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e1f6de3fbd
commit
e7070e9006
@ -456,8 +456,14 @@ X86Operand *X86ATTAsmParser::ParseMemOperand() {
|
|||||||
bool X86ATTAsmParser::
|
bool X86ATTAsmParser::
|
||||||
ParseInstruction(const StringRef &Name, SMLoc NameLoc,
|
ParseInstruction(const StringRef &Name, SMLoc NameLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||||
|
// FIXME: Hack to recognize "sal..." for now. We need a way to represent
|
||||||
Operands.push_back(X86Operand::CreateToken(Name, NameLoc));
|
// alternative syntaxes in the .td file, without requiring instruction
|
||||||
|
// duplication.
|
||||||
|
if (Name.startswith("sal")) {
|
||||||
|
std::string Tmp = "shl" + Name.substr(3).str();
|
||||||
|
Operands.push_back(X86Operand::CreateToken(Tmp, NameLoc));
|
||||||
|
} else
|
||||||
|
Operands.push_back(X86Operand::CreateToken(Name, NameLoc));
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||||
|
|
||||||
|
@ -64,3 +64,9 @@
|
|||||||
// FIXME: Check that this matches the correct instruction.
|
// FIXME: Check that this matches the correct instruction.
|
||||||
// CHECK: shldl %cl, %eax, %ebx
|
// CHECK: shldl %cl, %eax, %ebx
|
||||||
shldl %cl, %eax, %ebx
|
shldl %cl, %eax, %ebx
|
||||||
|
|
||||||
|
// CHECK: shll $2, %eax
|
||||||
|
shll $2, %eax
|
||||||
|
|
||||||
|
// CHECK: shll $2, %eax
|
||||||
|
sall $2, %eax
|
||||||
|
Loading…
x
Reference in New Issue
Block a user