1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5// clang-format off
6
7/*****************************************************************************/
8/*****************************************************************************/
9#ifndef REGDEF
10#error Must define REGDEF macro before including this file
11#endif
12#ifndef REGALIAS
13#define REGALIAS(alias, realname)
14#endif
15
16#define RMASK(x) (1ULL << (x))
17
18/*
19REGDEF(name, rnum, mask, xname, wname) */
20REGDEF(R0, 0, 0x0001, "x0" , "w0" )
21REGDEF(R1, 1, 0x0002, "x1" , "w1" )
22REGDEF(R2, 2, 0x0004, "x2" , "w2" )
23REGDEF(R3, 3, 0x0008, "x3" , "w3" )
24REGDEF(R4, 4, 0x0010, "x4" , "w4" )
25REGDEF(R5, 5, 0x0020, "x5" , "w5" )
26REGDEF(R6, 6, 0x0040, "x6" , "w6" )
27REGDEF(R7, 7, 0x0080, "x7" , "w7" )
28REGDEF(R8, 8, 0x0100, "x8" , "w8" )
29REGDEF(R9, 9, 0x0200, "x9" , "w9" )
30REGDEF(R10, 10, 0x0400, "x10", "w10" )
31REGDEF(R11, 11, 0x0800, "x11", "w11" )
32REGDEF(R12, 12, 0x1000, "x12", "w12" )
33REGDEF(R13, 13, 0x2000, "x13", "w13" )
34REGDEF(R14, 14, 0x4000, "x14", "w14" )
35REGDEF(R15, 15, 0x8000, "x15", "w15" )
36REGDEF(IP0, 16, 0x10000, "xip0","wip0" )
37REGDEF(IP1, 17, 0x20000, "xip1","wip1" )
38REGDEF(PR, 18, 0x40000, "xpr", "wpr" )
39REGDEF(R19, 19, 0x80000, "x19", "w19" )
40REGDEF(R20, 20, 0x100000, "x20", "w20" )
41REGDEF(R21, 21, 0x200000, "x21", "w21" )
42REGDEF(R22, 22, 0x400000, "x22", "w22" )
43REGDEF(R23, 23, 0x800000, "x23", "w23" )
44REGDEF(R24, 24, 0x1000000, "x24", "w24" )
45REGDEF(R25, 25, 0x2000000, "x25", "w25" )
46REGDEF(R26, 26, 0x4000000, "x26", "w26" )
47REGDEF(R27, 27, 0x8000000, "x27", "w27" )
48REGDEF(R28, 28, 0x10000000, "x28", "w28" )
49REGDEF(FP, 29, 0x20000000, "fp" , "w29" )
50REGDEF(LR, 30, 0x40000000, "lr" , "w30" )
51REGDEF(ZR, 31, 0x80000000, "xzr", "wzr" )
52
53// Allow us to call IP0,IP1,PR,FP,LR by their register number names
54REGALIAS(R16, IP0)
55REGALIAS(R17, IP1)
56REGALIAS(R18, PR)
57REGALIAS(R29, FP)
58REGALIAS(R30, LR)
59
60#define VBASE 32
61#define VMASK(x) (1ULL << (VBASE+(x)))
62
63/*
64REGDEF(name, rnum, mask, xname, wname) */
65REGDEF(V0, 0+VBASE, VMASK(0), "d0", "s0")
66REGDEF(V1, 1+VBASE, VMASK(1), "d1", "s1")
67REGDEF(V2, 2+VBASE, VMASK(2), "d2", "s2")
68REGDEF(V3, 3+VBASE, VMASK(3), "d3", "s3")
69REGDEF(V4, 4+VBASE, VMASK(4), "d4", "s4")
70REGDEF(V5, 5+VBASE, VMASK(5), "d5", "s5")
71REGDEF(V6, 6+VBASE, VMASK(6), "d6", "s6")
72REGDEF(V7, 7+VBASE, VMASK(7), "d7", "s7")
73REGDEF(V8, 8+VBASE, VMASK(8), "d8", "s8")
74REGDEF(V9, 9+VBASE, VMASK(9), "d9", "s9")
75REGDEF(V10, 10+VBASE, VMASK(10), "d10", "s10")
76REGDEF(V11, 11+VBASE, VMASK(11), "d11", "s11")
77REGDEF(V12, 12+VBASE, VMASK(12), "d12", "s12")
78REGDEF(V13, 13+VBASE, VMASK(13), "d13", "s13")
79REGDEF(V14, 14+VBASE, VMASK(14), "d14", "s14")
80REGDEF(V15, 15+VBASE, VMASK(15), "d15", "s15")
81REGDEF(V16, 16+VBASE, VMASK(16), "d16", "s16")
82REGDEF(V17, 17+VBASE, VMASK(17), "d17", "s17")
83REGDEF(V18, 18+VBASE, VMASK(18), "d18", "s18")
84REGDEF(V19, 19+VBASE, VMASK(19), "d19", "s19")
85REGDEF(V20, 20+VBASE, VMASK(20), "d20", "s20")
86REGDEF(V21, 21+VBASE, VMASK(21), "d21", "s21")
87REGDEF(V22, 22+VBASE, VMASK(22), "d22", "s22")
88REGDEF(V23, 23+VBASE, VMASK(23), "d23", "s23")
89REGDEF(V24, 24+VBASE, VMASK(24), "d24", "s24")
90REGDEF(V25, 25+VBASE, VMASK(25), "d25", "s25")
91REGDEF(V26, 26+VBASE, VMASK(26), "d26", "s26")
92REGDEF(V27, 27+VBASE, VMASK(27), "d27", "s27")
93REGDEF(V28, 28+VBASE, VMASK(28), "d28", "s28")
94REGDEF(V29, 29+VBASE, VMASK(29), "d29", "s29")
95REGDEF(V30, 30+VBASE, VMASK(30), "d30", "s30")
96REGDEF(V31, 31+VBASE, VMASK(31), "d31", "s31")
97
98// The registers with values 64 (NBASE) and above are not real register numbers
99#define NBASE 64
100
101REGDEF(SP, 0+NBASE, 0x0000, "sp", "wsp?")
102// This must be last!
103REGDEF(STK, 1+NBASE, 0x0000, "STK", "STK")
104
105/*****************************************************************************/
106#undef RMASK
107#undef VMASK
108#undef VBASE
109#undef NBASE
110#undef REGDEF
111#undef REGALIAS
112/*****************************************************************************/
113
114// clang-format on
115