120
|
1 //===-- RISCV.td - Describe the RISCV Target Machine -------*- tablegen -*-===//
|
|
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 include "llvm/Target/Target.td"
|
|
11
|
121
|
12 //===----------------------------------------------------------------------===//
|
|
13 // RISC-V subtarget features and instruction predicates.
|
|
14 //===----------------------------------------------------------------------===//
|
|
15
|
|
16 def Feature64Bit : SubtargetFeature<"64bit", "HasRV64", "true",
|
|
17 "Implements RV64">;
|
|
18
|
|
19 def RV64 : HwMode<"+64bit">;
|
|
20 def RV32 : HwMode<"-64bit">;
|
|
21
|
|
22 //===----------------------------------------------------------------------===//
|
|
23 // Registers, calling conventions, instruction descriptions.
|
|
24 //===----------------------------------------------------------------------===//
|
|
25
|
120
|
26 include "RISCVRegisterInfo.td"
|
121
|
27 include "RISCVCallingConv.td"
|
120
|
28 include "RISCVInstrInfo.td"
|
|
29
|
121
|
30 //===----------------------------------------------------------------------===//
|
|
31 // RISC-V processors supported.
|
|
32 //===----------------------------------------------------------------------===//
|
120
|
33
|
|
34 def : ProcessorModel<"generic-rv32", NoSchedModel, []>;
|
|
35
|
|
36 def : ProcessorModel<"generic-rv64", NoSchedModel, [Feature64Bit]>;
|
|
37
|
121
|
38 //===----------------------------------------------------------------------===//
|
|
39 // Define the RISC-V target.
|
|
40 //===----------------------------------------------------------------------===//
|
|
41
|
|
42 def RISCVInstrInfo : InstrInfo {
|
|
43 // TODO: disable guessInstructionProperties when
|
|
44 // https://reviews.llvm.org/D37065 lands.
|
|
45 let guessInstructionProperties = 1;
|
|
46 }
|
|
47
|
|
48 def RISCVAsmParser : AsmParser {
|
|
49 let ShouldEmitMatchRegisterAltName = 1;
|
|
50 }
|
|
51
|
120
|
52 def RISCV : Target {
|
|
53 let InstructionSet = RISCVInstrInfo;
|
121
|
54 let AssemblyParsers = [RISCVAsmParser];
|
120
|
55 }
|