LLVM 24.0.0git
PISARegEncoder.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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/// \file
10/// This file declares encoding of PISA virtual registers.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISAREGENCODER_H
15#define LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISAREGENCODER_H
16
17#include "llvm/MC/MCRegister.h"
18
19namespace llvm {
20
21class MCRegisterClass;
22
23namespace PISA {
24
26public:
27 enum RegType {
29 // Keep in sync with TSFlags in PISARegisterInfo.td
33 };
34
63
64 static RegBank getRegBank(unsigned NumElts, unsigned EltSize);
65 static const char *getPrefixFromBank(RegBank Bank);
66 static bool isVirtualRegNo(unsigned RegNo);
67 static unsigned encodeVirtualRegisterIndex(unsigned Idx, RegBank Bank,
68 RegType Type);
69 static std::pair<const char *, unsigned>
71
72protected:
73 static RegEncoder::RegBank getRegBank(uint8_t EncodedBits);
74 static RegEncoder::RegType getRegType(uint8_t EncodedBits);
76};
77
78} // namespace PISA
79} // namespace llvm
80
81#endif // LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISAREGENCODER_H
Register Reg
MCRegisterClass - Base class of TargetRegisterClass.
Wrapper class representing physical registers and target specific virtual registers.
Definition MCRegister.h:42
static bool isVirtualRegNo(unsigned RegNo)
static RegBank getRegBank(unsigned NumElts, unsigned EltSize)
static unsigned encodeVirtualRegisterIndex(unsigned Idx, RegBank Bank, RegType Type)
static const char * getPrefixFromBank(RegBank Bank)
static RegEncoder::RegType getRegType(uint8_t EncodedBits)
static std::pair< const char *, unsigned > decodeVirtualRegister(MCRegister Reg)
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
This is an optimization pass for GlobalISel generic memory operations.