LLVM
8.0.1
lib
Target
X86
X86InstrFoldTables.h
Go to the documentation of this file.
1
//===-- X86InstrFoldTables.h - X86 Instruction Folding Tables ---*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file contains the interface to query the X86 memory folding tables.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
15
#define LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
16
17
#include "
llvm/Support/DataTypes.h
"
18
19
namespace
llvm
{
20
21
enum
{
22
// Select which memory operand is being unfolded.
23
// (stored in bits 0 - 3)
24
TB_INDEX_0
= 0,
25
TB_INDEX_1
= 1,
26
TB_INDEX_2
= 2,
27
TB_INDEX_3
= 3,
28
TB_INDEX_4
= 4,
29
TB_INDEX_MASK
= 0xf,
30
31
// Do not insert the reverse map (MemOp -> RegOp) into the table.
32
// This may be needed because there is a many -> one mapping.
33
TB_NO_REVERSE
= 1 << 4,
34
35
// Do not insert the forward map (RegOp -> MemOp) into the table.
36
// This is needed for Native Client, which prohibits branch
37
// instructions from using a memory operand.
38
TB_NO_FORWARD
= 1 << 5,
39
40
TB_FOLDED_LOAD
= 1 << 6,
41
TB_FOLDED_STORE
= 1 << 7,
42
43
// Minimum alignment required for load/store.
44
// Used for RegOp->MemOp conversion.
45
// (stored in bits 8 - 15)
46
TB_ALIGN_SHIFT
= 8,
47
TB_ALIGN_NONE
= 0 <<
TB_ALIGN_SHIFT
,
48
TB_ALIGN_16
= 16 <<
TB_ALIGN_SHIFT
,
49
TB_ALIGN_32
= 32 <<
TB_ALIGN_SHIFT
,
50
TB_ALIGN_64
= 64 <<
TB_ALIGN_SHIFT
,
51
TB_ALIGN_MASK
= 0xff <<
TB_ALIGN_SHIFT
52
};
53
54
// This struct is used for both the folding and unfold tables. They KeyOp
55
// is used to determine the sorting order.
56
struct
X86MemoryFoldTableEntry
{
57
uint16_t
KeyOp
;
58
uint16_t
DstOp
;
59
uint16_t
Flags
;
60
61
bool
operator<
(
const
X86MemoryFoldTableEntry
&RHS)
const
{
62
return
KeyOp < RHS.
KeyOp
;
63
}
64
bool
operator==
(
const
X86MemoryFoldTableEntry
&RHS)
const
{
65
return
KeyOp == RHS.
KeyOp
;
66
}
67
friend
bool
operator<
(
const
X86MemoryFoldTableEntry
&TE,
unsigned
Opcode) {
68
return
TE.
KeyOp
< Opcode;
69
}
70
};
71
72
// Look up the memory folding table entry for folding a load and a store into
73
// operand 0.
74
const
X86MemoryFoldTableEntry
*
lookupTwoAddrFoldTable
(
unsigned
RegOp);
75
76
// Look up the memory folding table entry for folding a load or store with
77
// operand OpNum.
78
const
X86MemoryFoldTableEntry
*
lookupFoldTable
(
unsigned
RegOp,
unsigned
OpNum);
79
80
// Look up the memory unfolding table entry for this instruction.
81
const
X86MemoryFoldTableEntry
*
lookupUnfoldTable
(
unsigned
MemOp);
82
83
}
// namespace llvm
84
85
#endif
llvm::X86MemoryFoldTableEntry::DstOp
uint16_t DstOp
Definition:
X86InstrFoldTables.h:58
llvm::TB_NO_FORWARD
Definition:
X86InstrFoldTables.h:38
llvm::lookupUnfoldTable
const X86MemoryFoldTableEntry * lookupUnfoldTable(unsigned MemOp)
Definition:
X86InstrFoldTables.cpp:5405
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::lookupFoldTable
const X86MemoryFoldTableEntry * lookupFoldTable(unsigned RegOp, unsigned OpNum)
Definition:
X86InstrFoldTables.cpp:5333
llvm::X86MemoryFoldTableEntry
Definition:
X86InstrFoldTables.h:56
llvm::TB_ALIGN_SHIFT
Definition:
X86InstrFoldTables.h:46
llvm::TB_FOLDED_LOAD
Definition:
X86InstrFoldTables.h:40
llvm::X86MemoryFoldTableEntry::operator==
bool operator==(const X86MemoryFoldTableEntry &RHS) const
Definition:
X86InstrFoldTables.h:64
llvm::TB_NO_REVERSE
Definition:
X86InstrFoldTables.h:33
llvm::TB_ALIGN_64
Definition:
X86InstrFoldTables.h:50
llvm::TB_ALIGN_NONE
Definition:
X86InstrFoldTables.h:47
llvm::TB_ALIGN_16
Definition:
X86InstrFoldTables.h:48
llvm::TB_FOLDED_STORE
Definition:
X86InstrFoldTables.h:41
llvm::TB_INDEX_2
Definition:
X86InstrFoldTables.h:26
llvm::TB_ALIGN_MASK
Definition:
X86InstrFoldTables.h:51
llvm::TB_INDEX_1
Definition:
X86InstrFoldTables.h:25
llvm::X86MemoryFoldTableEntry::operator<
bool operator<(const X86MemoryFoldTableEntry &RHS) const
Definition:
X86InstrFoldTables.h:61
llvm::lookupTwoAddrFoldTable
const X86MemoryFoldTableEntry * lookupTwoAddrFoldTable(unsigned RegOp)
Definition:
X86InstrFoldTables.cpp:5328
llvm::TB_INDEX_3
Definition:
X86InstrFoldTables.h:27
llvm::TB_INDEX_MASK
Definition:
X86InstrFoldTables.h:29
llvm::TB_INDEX_4
Definition:
X86InstrFoldTables.h:28
DataTypes.h
llvm::X86MemoryFoldTableEntry::operator<
friend bool operator<(const X86MemoryFoldTableEntry &TE, unsigned Opcode)
Definition:
X86InstrFoldTables.h:67
llvm::TB_INDEX_0
Definition:
X86InstrFoldTables.h:24
llvm::X86MemoryFoldTableEntry::Flags
uint16_t Flags
Definition:
X86InstrFoldTables.h:59
llvm::X86MemoryFoldTableEntry::KeyOp
uint16_t KeyOp
Definition:
X86InstrFoldTables.h:57
llvm::TB_ALIGN_32
Definition:
X86InstrFoldTables.h:49
Generated on Sun Dec 20 2020 13:58:16 for LLVM by
1.8.13