blob: cb2ed0beef184bdc0c01724f47445bdb15cc24e1 [file] [log] [blame]
Alex Bradbury89718422017-10-19 21:37:38 +00001//===-- RISCVInstrInfo.h - RISCV Instruction Information --------*- 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 RISCV implementation of the TargetInstrInfo class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_RISCV_RISCVINSTRINFO_H
15#define LLVM_LIB_TARGET_RISCV_RISCVINSTRINFO_H
16
17#include "RISCVRegisterInfo.h"
David Blaikie3f833ed2017-11-08 01:01:31 +000018#include "llvm/CodeGen/TargetInstrInfo.h"
Alex Bradbury89718422017-10-19 21:37:38 +000019
20#define GET_INSTRINFO_HEADER
21#include "RISCVGenInstrInfo.inc"
22
23namespace llvm {
24
25class RISCVInstrInfo : public RISCVGenInstrInfo {
26
27public:
28 RISCVInstrInfo();
Alex Bradburycfa62912017-11-08 12:20:01 +000029
30 void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
31 const DebugLoc &DL, unsigned DstReg, unsigned SrcReg,
32 bool KillSrc) const override;
Alex Bradbury74913e12017-11-08 13:31:40 +000033
34 void storeRegToStackSlot(MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator MBBI, unsigned SrcReg,
36 bool IsKill, int FrameIndex,
37 const TargetRegisterClass *RC,
38 const TargetRegisterInfo *TRI) const override;
39
40 void loadRegFromStackSlot(MachineBasicBlock &MBB,
41 MachineBasicBlock::iterator MBBI, unsigned DstReg,
42 int FrameIndex, const TargetRegisterClass *RC,
43 const TargetRegisterInfo *TRI) const override;
Alex Bradbury9fea4882018-01-10 19:53:46 +000044
45 // Materializes the given int32 Val into DstReg.
46 void movImm32(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
47 const DebugLoc &DL, unsigned DstReg, uint64_t Val,
48 MachineInstr::MIFlag Flag = MachineInstr::NoFlags) const;
Alex Bradbury89718422017-10-19 21:37:38 +000049};
50}
Alex Bradbury89718422017-10-19 21:37:38 +000051#endif