1//===-- BPFRegisterInfo.td - BPF Register defs -------------*- 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//===----------------------------------------------------------------------===// 11// Declarations that describe the BPF register file 12//===----------------------------------------------------------------------===// 13 14// Registers are identified with 4-bit ID numbers. 15// Ri - 64-bit integer registers 16class Ri<bits<16> Enc, string n> : Register<n> { 17 let Namespace = "BPF"; 18 let HWEncoding = Enc; 19} 20 21// Integer registers 22def R0 : Ri< 0, "r0">, DwarfRegNum<[0]>; 23def R1 : Ri< 1, "r1">, DwarfRegNum<[1]>; 24def R2 : Ri< 2, "r2">, DwarfRegNum<[2]>; 25def R3 : Ri< 3, "r3">, DwarfRegNum<[3]>; 26def R4 : Ri< 4, "r4">, DwarfRegNum<[4]>; 27def R5 : Ri< 5, "r5">, DwarfRegNum<[5]>; 28def R6 : Ri< 6, "r6">, DwarfRegNum<[6]>; 29def R7 : Ri< 7, "r7">, DwarfRegNum<[7]>; 30def R8 : Ri< 8, "r8">, DwarfRegNum<[8]>; 31def R9 : Ri< 9, "r9">, DwarfRegNum<[9]>; 32def R10 : Ri<10, "r10">, DwarfRegNum<[10]>; 33def R11 : Ri<11, "r11">, DwarfRegNum<[11]>; 34 35// Register classes. 36def GPR : RegisterClass<"BPF", [i64], 64, (add R1, R2, R3, R4, R5, 37 R6, R7, R8, R9, // callee saved 38 R0, // return value 39 R11, // stack ptr 40 R10 // frame ptr 41 )>; 42