summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-04-05 19:27:41 +0000
committerCraig Topper <craig.topper@intel.com>2019-04-05 19:27:41 +0000
commite0bfeb5f24979416144c16e8b99204f5f163b889 (patch)
tree9fe1fba081f0d71c0f0f5c823e9a4115ef1eeb93 /llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
parent4af5d748ce34c3ef78b8b34c419508a58baafc60 (diff)
downloadbcm5719-llvm-e0bfeb5f24979416144c16e8b99204f5f163b889.tar.gz
bcm5719-llvm-e0bfeb5f24979416144c16e8b99204f5f163b889.zip
[X86] Merge the different CMOV instructions for each condition code into single instructions that store the condition code as an immediate.
Summary: Reorder the condition code enum to match their encodings. Move it to MC layer so it can be used by the scheduler models. This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between CMOV instructions and condition codes. Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser. This does complicate the scheduler models a little since we can't assign the A and BE instructions to a separate class now. I plan to make similar changes for SETcc and Jcc. Reviewers: RKSimon, spatel, lebedev.ri, andreadb, courbet Reviewed By: RKSimon Subscribers: gchatelet, hiraditya, kristina, lebedev.ri, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60041 llvm-svn: 357800
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp')
-rw-r--r--llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
index 9a7bcc8bd5d..97341a0d027 100644
--- a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
+++ b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp
@@ -1846,6 +1846,9 @@ static int readOperands(struct InternalInstruction* insn) {
if (readOpcodeRegister(insn, 0))
return -1;
break;
+ case ENCODING_CC:
+ insn->immediates[0] = insn->opcode & 0xf;
+ break;
case ENCODING_FP:
break;
case ENCODING_VVVV:
OpenPOWER on IntegriCloud