1 //===-- BPFRegisterInfo.td - BPF 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 BPF register file
11 //===----------------------------------------------------------------------===//
13 let Namespace = "BPF" in {
14 def sub_32 : SubRegIndex<32>;
17 class Wi<bits<16> Enc, string n> : Register<n> {
19 let Namespace = "BPF";
22 // Registers are identified with 4-bit ID numbers.
23 // Ri - 64-bit integer registers
24 class Ri<bits<16> Enc, string n, list<Register> subregs>
25 : RegisterWithSubRegs<n, subregs> {
27 let Namespace = "BPF";
28 let SubRegIndices = [sub_32];
32 // 32-bit Integer (alias to low part of 64-bit register).
33 def W#I : Wi<I, "w"#I>, DwarfRegNum<[I]>;
34 // 64-bit Integer registers
35 def R#I : Ri<I, "r"#I, [!cast<Wi>("W"#I)]>, DwarfRegNum<[I]>;
39 def GPR32 : RegisterClass<"BPF", [i32], 32, (add
40 (sequence "W%u", 1, 9),
46 def GPR : RegisterClass<"BPF", [i64], 64, (add
47 (sequence "R%u", 1, 9),