LLVM  15.0.0git
X86InstrRelaxTables.h
Go to the documentation of this file.
1 //===-- X86InstrRelaxTables.h - X86 Instruction Relaxation Tables -*- C++ -*-=//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the interface to query the X86 instruction relaxation
10 // tables.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_X86_X86INSTRRELAXTABLES_H
15 #define LLVM_LIB_TARGET_X86_X86INSTRRELAXTABLES_H
16 
17 #include <cstdint>
18 
19 namespace llvm {
20 
21 // This struct is used for both the relaxed and short tables. The KeyOp is used
22 // to determine the sorting order.
26 
27  bool operator<(const X86InstrRelaxTableEntry &RHS) const {
28  return KeyOp < RHS.KeyOp;
29  }
30  bool operator==(const X86InstrRelaxTableEntry &RHS) const {
31  return KeyOp == RHS.KeyOp;
32  }
33  friend bool operator<(const X86InstrRelaxTableEntry &TE, unsigned Opcode) {
34  return TE.KeyOp < Opcode;
35  }
36 };
37 
38 /// Look up the relaxed form table entry for a given \p ShortOp.
39 const X86InstrRelaxTableEntry *lookupRelaxTable(unsigned ShortOp);
40 
41 /// Look up the short form table entry for a given \p RelaxOp.
42 const X86InstrRelaxTableEntry *lookupShortTable(unsigned RelaxOp);
43 
44 namespace X86 {
45 
46 /// Get the short instruction opcode for a given relaxed opcode.
47 unsigned getShortOpcodeArith(unsigned RelaxOp);
48 
49 /// Get the relaxed instruction opcode for a given short opcode.
50 unsigned getRelaxedOpcodeArith(unsigned ShortOp);
51 } // namespace X86
52 } // namespace llvm
53 
54 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::X86::getRelaxedOpcodeArith
unsigned getRelaxedOpcodeArith(unsigned ShortOp)
Get the relaxed instruction opcode for a given short opcode.
Definition: X86InstrRelaxTables.cpp:160
llvm::X86::getShortOpcodeArith
unsigned getShortOpcodeArith(unsigned RelaxOp)
Get the short instruction opcode for a given relaxed opcode.
Definition: X86InstrRelaxTables.cpp:153
llvm::lookupShortTable
const X86InstrRelaxTableEntry * lookupShortTable(unsigned RelaxOp)
Look up the short form table entry for a given RelaxOp.
Definition: X86InstrRelaxTables.cpp:142
llvm::X86InstrRelaxTableEntry::DstOp
uint16_t DstOp
Definition: X86InstrRelaxTables.h:25
RHS
Value * RHS
Definition: X86PartialReduction.cpp:76
llvm::lookupRelaxTable
const X86InstrRelaxTableEntry * lookupRelaxTable(unsigned ShortOp)
Look up the relaxed form table entry for a given ShortOp.
Definition: X86InstrRelaxTables.cpp:115
llvm::X86InstrRelaxTableEntry::operator<
friend bool operator<(const X86InstrRelaxTableEntry &TE, unsigned Opcode)
Definition: X86InstrRelaxTables.h:33
llvm::X86InstrRelaxTableEntry::KeyOp
uint16_t KeyOp
Definition: X86InstrRelaxTables.h:24
llvm::X86InstrRelaxTableEntry::operator==
bool operator==(const X86InstrRelaxTableEntry &RHS) const
Definition: X86InstrRelaxTables.h:30
llvm::X86InstrRelaxTableEntry
Definition: X86InstrRelaxTables.h:23
llvm::X86InstrRelaxTableEntry::operator<
bool operator<(const X86InstrRelaxTableEntry &RHS) const
Definition: X86InstrRelaxTables.h:27
uint16_t
X86
Unrolling by would eliminate the &in both leading to a net reduction in code size The resultant code would then also be suitable for exit value computation We miss a bunch of rotate opportunities on various including etc On X86
Definition: README.txt:568