1 //===- ZPURegisterInfo.td - ZPU Register defs ------------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
11 // Declarations that describe the ZPU register file
12 //===----------------------------------------------------------------------===//
14 // We have the program counter and stack pointer.
15 class ZPUReg<string n> : Register<n> {
17 let Namespace = "ZPU";
20 //===----------------------------------------------------------------------===//
22 //===----------------------------------------------------------------------===//
24 let Namespace = "ZPU" in {
26 // General Purpose Registers
27 def PC : ZPUReg<"pc">, DwarfRegNum<[0]>;
28 def SP : ZPUReg<"sp">, DwarfRegNum<[1]>;
29 def FP : ZPUReg<"fp">, DwarfRegNum<[2]>; // Frame pointer
30 def RETVAL : ZPUReg<"retval">, DwarfRegNum<[3]>; // return value
31 // These are just a few registers to satisfy the register allocator.
32 // We'll convert them to stack slots immediately after register allocation
33 def R0 : ZPUReg<"r0">, DwarfRegNum<[4]>;
34 def R1 : ZPUReg<"r1">, DwarfRegNum<[5]>;
35 def R2 : ZPUReg<"r2">, DwarfRegNum<[6]>;
36 def R3 : ZPUReg<"r3">, DwarfRegNum<[7]>;
37 def R4 : ZPUReg<"r4">, DwarfRegNum<[8]>;
38 def R5 : ZPUReg<"r5">, DwarfRegNum<[9]>;
39 def R6 : ZPUReg<"r6">, DwarfRegNum<[10]>;
43 //===----------------------------------------------------------------------===//
45 //===----------------------------------------------------------------------===//
47 def CPURegs : RegisterClass<"ZPU", [i32], 32,
48 // Program counter and stack pointer is all there is
50 R0, R1, R2, R3,R4,R5,R6,