mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
ae65e281f3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
52 lines
1.5 KiB
TableGen
52 lines
1.5 KiB
TableGen
//===-- BPFRegisterInfo.td - BPF Register defs -------------*- tablegen -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Declarations that describe the BPF register file
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
let Namespace = "BPF" in {
|
|
def sub_32 : SubRegIndex<32>;
|
|
}
|
|
|
|
class Wi<bits<16> Enc, string n> : Register<n> {
|
|
let HWEncoding = Enc;
|
|
let Namespace = "BPF";
|
|
}
|
|
|
|
// Registers are identified with 4-bit ID numbers.
|
|
// Ri - 64-bit integer registers
|
|
class Ri<bits<16> Enc, string n, list<Register> subregs>
|
|
: RegisterWithSubRegs<n, subregs> {
|
|
let HWEncoding = Enc;
|
|
let Namespace = "BPF";
|
|
let SubRegIndices = [sub_32];
|
|
}
|
|
|
|
foreach I = 0-11 in {
|
|
// 32-bit Integer (alias to low part of 64-bit register).
|
|
def W#I : Wi<I, "w"#I>, DwarfRegNum<[I]>;
|
|
// 64-bit Integer registers
|
|
def R#I : Ri<I, "r"#I, [!cast<Wi>("W"#I)]>, DwarfRegNum<[I]>;
|
|
}
|
|
|
|
// Register classes.
|
|
def GPR32 : RegisterClass<"BPF", [i32], 32, (add
|
|
(sequence "W%u", 1, 9),
|
|
W0, // Return value
|
|
W11, // Stack Ptr
|
|
W10 // Frame Ptr
|
|
)>;
|
|
|
|
def GPR : RegisterClass<"BPF", [i64], 64, (add
|
|
(sequence "R%u", 1, 9),
|
|
R0, // Return value
|
|
R11, // Stack Ptr
|
|
R10 // Frame Ptr
|
|
)>;
|