LLVM 17.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
19namespace 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
28 return KeyOp < RHS.KeyOp;
29 }
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.
39const X86InstrRelaxTableEntry *lookupRelaxTable(unsigned ShortOp);
40
41/// Look up the short form table entry for a given \p RelaxOp.
42const X86InstrRelaxTableEntry *lookupShortTable(unsigned RelaxOp);
43
44namespace X86 {
45
46/// Get the short instruction opcode for a given relaxed opcode.
47unsigned getShortOpcodeArith(unsigned RelaxOp);
48
49/// Get the relaxed instruction opcode for a given short opcode.
50unsigned getRelaxedOpcodeArith(unsigned ShortOp);
51} // namespace X86
52} // namespace llvm
53
54#endif
Value * RHS
unsigned getShortOpcodeArith(unsigned RelaxOp)
Get the short instruction opcode for a given relaxed opcode.
unsigned getRelaxedOpcodeArith(unsigned ShortOp)
Get the relaxed instruction opcode for a given short opcode.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
const X86InstrRelaxTableEntry * lookupRelaxTable(unsigned ShortOp)
Look up the relaxed form table entry for a given ShortOp.
const X86InstrRelaxTableEntry * lookupShortTable(unsigned RelaxOp)
Look up the short form table entry for a given RelaxOp.
friend bool operator<(const X86InstrRelaxTableEntry &TE, unsigned Opcode)
bool operator==(const X86InstrRelaxTableEntry &RHS) const
bool operator<(const X86InstrRelaxTableEntry &RHS) const