1 //===-- XCoreRegisterInfo.td - XCore Register defs ---------*- tablegen -*-===//
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
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
10 // Declarations that describe the XCore register file
11 //===----------------------------------------------------------------------===//
13 class XCoreReg<string n> : Register<n> {
15 let Namespace = "XCore";
18 // Registers are identified with 4-bit ID numbers.
19 // Ri - 32-bit integer registers
20 class Ri<bits<4> num, string n> : XCoreReg<n> {
25 def R0 : Ri< 0, "r0">, DwarfRegNum<[0]>;
26 def R1 : Ri< 1, "r1">, DwarfRegNum<[1]>;
27 def R2 : Ri< 2, "r2">, DwarfRegNum<[2]>;
28 def R3 : Ri< 3, "r3">, DwarfRegNum<[3]>;
29 def R4 : Ri< 4, "r4">, DwarfRegNum<[4]>;
30 def R5 : Ri< 5, "r5">, DwarfRegNum<[5]>;
31 def R6 : Ri< 6, "r6">, DwarfRegNum<[6]>;
32 def R7 : Ri< 7, "r7">, DwarfRegNum<[7]>;
33 def R8 : Ri< 8, "r8">, DwarfRegNum<[8]>;
34 def R9 : Ri< 9, "r9">, DwarfRegNum<[9]>;
35 def R10 : Ri<10, "r10">, DwarfRegNum<[10]>;
36 def R11 : Ri<11, "r11">, DwarfRegNum<[11]>;
37 def CP : Ri<12, "cp">, DwarfRegNum<[12]>;
38 def DP : Ri<13, "dp">, DwarfRegNum<[13]>;
39 def SP : Ri<14, "sp">, DwarfRegNum<[14]>;
40 def LR : Ri<15, "lr">, DwarfRegNum<[15]>;
44 def GRRegs : RegisterClass<"XCore", [i32], 32,
45 // Return values and arguments
48 R4, R5, R6, R7, R8, R9, R10,
49 // Not preserved across procedure calls
53 def RRegs : RegisterClass<"XCore", [i32], 32,
55 R4, R5, R6, R7, R8, R9, R10,
56 R11, CP, DP, SP, LR)> {
57 let isAllocatable = 0;