MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
x86.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
7#include <mim/plug/mem/mem.h>
8
10
11namespace mim::plug::x86 {
12
13using mach::encoding;
14
15constexpr size_t Num_Regs = Annex::num<reg>();
16constexpr size_t Num_Xmm = Annex::num<xmm>();
17
18/// System V AMD64 ABI.
19// clang-format off
20constexpr std::array<size_t, 6> Arg_Regs = {
23};
24// clang-format on
25constexpr std::array<bool, Num_Regs> Caller_Saved = {1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0};
26constexpr bool reserved(size_t r) { return r == encoding(reg::rsp) || r == encoding(reg::rbp); }
27
28} // namespace mim::plug::x86
constexpr size_t encoding(Reg r)
The hardware encoding of the register r of a backend's module reg, whose subtags are in encoding orde...
Definition mach.h:15
The x86 Plugin
Definition emit.h:9
constexpr std::array< bool, Num_Regs > Caller_Saved
Definition x86.h:25
constexpr size_t encoding(Reg r)
The hardware encoding of the register r of a backend's module reg, whose subtags are in encoding orde...
Definition mach.h:15
constexpr bool reserved(size_t r)
Definition x86.h:26
constexpr std::array< size_t, 6 > Arg_Regs
System V AMD64 ABI.
Definition x86.h:20
constexpr size_t Num_Regs
Definition x86.h:15
constexpr size_t Num_Xmm
Definition x86.h:16
static consteval size_t num()
Definition plugin.h:277