Skip to content

Commit bf8f684

Browse files
committed
Revert "[RFC][X86][MemFold] Upgrade the mechanism of auto-generated Memory Folding Table"
X86FoldTablesEmitter.cpp:386:26: runtime error: shift exponent -1 is negative This reverts commit ca4c533.
1 parent 0818433 commit bf8f684

File tree

5 files changed

+134
-234
lines changed

5 files changed

+134
-234
lines changed

llvm/include/llvm/Support/X86FoldTablesUtils.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

llvm/lib/Target/X86/X86InstrFoldTables.h

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,55 @@
1414
#define LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
1515

1616
#include <cstdint>
17-
#include "llvm/Support/X86FoldTablesUtils.h"
1817

1918
namespace llvm {
2019

20+
enum {
21+
// Select which memory operand is being unfolded.
22+
// (stored in bits 0 - 2)
23+
TB_INDEX_0 = 0,
24+
TB_INDEX_1 = 1,
25+
TB_INDEX_2 = 2,
26+
TB_INDEX_3 = 3,
27+
TB_INDEX_4 = 4,
28+
TB_INDEX_MASK = 0x7,
29+
30+
// Do not insert the reverse map (MemOp -> RegOp) into the table.
31+
// This may be needed because there is a many -> one mapping.
32+
TB_NO_REVERSE = 1 << 3,
33+
34+
// Do not insert the forward map (RegOp -> MemOp) into the table.
35+
// This is needed for Native Client, which prohibits branch
36+
// instructions from using a memory operand.
37+
TB_NO_FORWARD = 1 << 4,
38+
39+
TB_FOLDED_LOAD = 1 << 5,
40+
TB_FOLDED_STORE = 1 << 6,
41+
TB_FOLDED_BCAST = 1 << 7,
42+
43+
// Minimum alignment required for load/store.
44+
// Used for RegOp->MemOp conversion. Encoded as Log2(Align) + 1 to allow 0
45+
// to mean align of 0.
46+
// (stored in bits 8 - 11)
47+
TB_ALIGN_SHIFT = 8,
48+
TB_ALIGN_NONE = 0 << TB_ALIGN_SHIFT,
49+
TB_ALIGN_16 = 5 << TB_ALIGN_SHIFT,
50+
TB_ALIGN_32 = 6 << TB_ALIGN_SHIFT,
51+
TB_ALIGN_64 = 7 << TB_ALIGN_SHIFT,
52+
TB_ALIGN_MASK = 0xf << TB_ALIGN_SHIFT,
53+
54+
// Broadcast type.
55+
// (stored in bits 12 - 13)
56+
TB_BCAST_TYPE_SHIFT = 12,
57+
TB_BCAST_D = 0 << TB_BCAST_TYPE_SHIFT,
58+
TB_BCAST_Q = 1 << TB_BCAST_TYPE_SHIFT,
59+
TB_BCAST_SS = 2 << TB_BCAST_TYPE_SHIFT,
60+
TB_BCAST_SD = 3 << TB_BCAST_TYPE_SHIFT,
61+
TB_BCAST_MASK = 0x3 << TB_BCAST_TYPE_SHIFT,
62+
63+
// Unused bits 14-15
64+
};
65+
2166
// This struct is used for both the folding and unfold tables. They KeyOp
2267
// is used to determine the sorting order.
2368
struct X86MemoryFoldTableEntry {

llvm/test/TableGen/x86-auto-memfold.td

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)