summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools/llvm-exegesis
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/unittests/tools/llvm-exegesis
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/unittests/tools/llvm-exegesis')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
index 0f8dc1f39c6..8b110f8c8a5 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
@@ -227,19 +227,20 @@ TEST_F(UopsSnippetGeneratorTest, SerialInstruction) {
}
TEST_F(UopsSnippetGeneratorTest, StaticRenaming) {
- // CMOVA32rr has tied variables, we enumerate the possible values to execute
+ // CMOV32rr has tied variables, we enumerate the possible values to execute
// as many in parallel as possible.
- // - CMOVA32rr
+ // - CMOV32rr
// - Op0 Explicit Def RegClass(GR32)
// - Op1 Explicit Use RegClass(GR32) TiedToOp0
// - Op2 Explicit Use RegClass(GR32)
+ // - Op3 Explicit Use Immediate
// - Op3 Implicit Use Reg(EFLAGS)
// - Var0 [Op0,Op1]
// - Var1 [Op2]
// - hasTiedRegisters (execution is always serial)
// - hasAliasingRegisters
- const unsigned Opcode = llvm::X86::CMOVA32rr;
+ const unsigned Opcode = llvm::X86::CMOV32rr;
const auto CodeTemplates = checkAndGetCodeTemplates(Opcode);
ASSERT_THAT(CodeTemplates, SizeIs(1));
const auto &CT = CodeTemplates[0];
@@ -249,7 +250,7 @@ TEST_F(UopsSnippetGeneratorTest, StaticRenaming) {
ASSERT_THAT(CT.Instructions, SizeIs(kInstructionCount));
std::unordered_set<unsigned> AllDefRegisters;
for (const auto &IT : CT.Instructions) {
- ASSERT_THAT(IT.VariableValues, SizeIs(2));
+ ASSERT_THAT(IT.VariableValues, SizeIs(3));
AllDefRegisters.insert(IT.VariableValues[0].getReg());
}
EXPECT_THAT(AllDefRegisters, SizeIs(kInstructionCount))
OpenPOWER on IntegriCloud