diff options
author | Kevin Enderby <enderby@apple.com> | 2010-10-19 00:01:44 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2010-10-19 00:01:44 +0000 |
commit | 49843c016253e2af19633b8ea87f6b30d5c2e497 (patch) | |
tree | d5469cea04b221de5fd1cdd339550e540cc4f547 /llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | |
parent | 9987c0ea425c3740d33d787ed627346cd93eac32 (diff) | |
download | bcm5719-llvm-49843c016253e2af19633b8ea87f6b30d5c2e497.tar.gz bcm5719-llvm-49843c016253e2af19633b8ea87f6b30d5c2e497.zip |
Added a few tweaks to the Intel Descriptor-table support instructions to allow
word forms and suffixed versions to match the darwin assembler in 32-bit and
64-bit modes. This is again for use just with assembly source for llvm-mc .
llvm-svn: 116773
Diffstat (limited to 'llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp')
-rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index c9e210795dd..4aad817f13d 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -1089,6 +1089,46 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, Operands.push_back(X86Operand::CreateImm(A, NameLoc, NameLoc)); } + // "lgdtl" is not ambiguous 32-bit mode and is the same as "lgdt". + // "lgdtq" is not ambiguous 64-bit mode and is the same as "lgdt". + if ((Name == "lgdtl" && Is64Bit == false) || + (Name == "lgdtq" && Is64Bit == true)) { + const char *NewName = "lgdt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + + // "lidtl" is not ambiguous 32-bit mode and is the same as "lidt". + // "lidtq" is not ambiguous 64-bit mode and is the same as "lidt". + if ((Name == "lidtl" && Is64Bit == false) || + (Name == "lidtq" && Is64Bit == true)) { + const char *NewName = "lidt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + + // "sgdtl" is not ambiguous 32-bit mode and is the same as "sgdt". + // "sgdtq" is not ambiguous 64-bit mode and is the same as "sgdt". + if ((Name == "sgdtl" && Is64Bit == false) || + (Name == "sgdtq" && Is64Bit == true)) { + const char *NewName = "sgdt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + + // "sidtl" is not ambiguous 32-bit mode and is the same as "sidt". + // "sidtq" is not ambiguous 64-bit mode and is the same as "sidt". + if ((Name == "sidtl" && Is64Bit == false) || + (Name == "sidtq" && Is64Bit == true)) { + const char *NewName = "sidt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + return false; } |