#ifndef LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
#define LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
#include <cstdint>
namespace llvm {
enum {
TB_INDEX_0 = 0,
TB_INDEX_1 = 1,
TB_INDEX_2 = 2,
TB_INDEX_3 = 3,
TB_INDEX_4 = 4,
TB_INDEX_MASK = 0x7,
TB_NO_REVERSE = 1 << 3,
TB_NO_FORWARD = 1 << 4,
TB_FOLDED_LOAD = 1 << 5,
TB_FOLDED_STORE = 1 << 6,
TB_FOLDED_BCAST = 1 << 7,
TB_ALIGN_SHIFT = 8,
TB_ALIGN_NONE = 0 << TB_ALIGN_SHIFT,
TB_ALIGN_16 = 5 << TB_ALIGN_SHIFT,
TB_ALIGN_32 = 6 << TB_ALIGN_SHIFT,
TB_ALIGN_64 = 7 << TB_ALIGN_SHIFT,
TB_ALIGN_MASK = 0xf << TB_ALIGN_SHIFT,
TB_BCAST_TYPE_SHIFT = 12,
TB_BCAST_D = 0 << TB_BCAST_TYPE_SHIFT,
TB_BCAST_Q = 1 << TB_BCAST_TYPE_SHIFT,
TB_BCAST_SS = 2 << TB_BCAST_TYPE_SHIFT,
TB_BCAST_SD = 3 << TB_BCAST_TYPE_SHIFT,
TB_BCAST_MASK = 0x3 << TB_BCAST_TYPE_SHIFT,
};
struct X86MemoryFoldTableEntry {
uint16_t KeyOp;
uint16_t DstOp;
uint16_t Flags;
bool operator<(const X86MemoryFoldTableEntry &RHS) const {
return KeyOp < RHS.KeyOp;
}
bool operator==(const X86MemoryFoldTableEntry &RHS) const {
return KeyOp == RHS.KeyOp;
}
friend bool operator<(const X86MemoryFoldTableEntry &TE, unsigned Opcode) {
return TE.KeyOp < Opcode;
}
};
const X86MemoryFoldTableEntry *lookupTwoAddrFoldTable(unsigned RegOp);
const X86MemoryFoldTableEntry *lookupFoldTable(unsigned RegOp, unsigned OpNum);
const X86MemoryFoldTableEntry *lookupUnfoldTable(unsigned MemOp);
}
#endif