]>
Commit | Line | Data |
---|---|---|
adffaa8e SP |
1 | // Zero/one operands |
2 | ||
3 | bx #4 | |
4 | ret | |
5 | ||
6 | // Single operand (n) | |
7 | ||
8 | .macro morello_jump cn | |
9 | .irp op, blr, blrr, blrs, br, brr, brs, ret, retr, rets | |
10 | \op \cn | |
11 | .endr | |
12 | .endm | |
13 | morello_jump c20 | |
14 | ||
1ef7b7e1 SP |
15 | .macro morello_csp cnsp |
16 | .irp op, chksld, chktgd | |
17 | \op \cnsp | |
18 | .endr | |
19 | .endm | |
20 | morello_csp csp | |
21 | ||
ec145252 SP |
22 | // Two operands (dn). |
23 | ||
24 | .macro morello_cspcsp cdsp, cnsp | |
3e2ac3d2 | 25 | .irp op, cpy, mov, chkss, clrtag |
ec145252 SP |
26 | \op \cdsp, \cnsp |
27 | .endr | |
28 | .endm | |
29 | morello_cspcsp c11, c19 | |
30 | morello_cspcsp c11, csp | |
31 | morello_cspcsp csp, c11 | |
32 | morello_cspcsp csp, csp | |
33 | ||
34 | mov c0, czr | |
dc64c2ba | 35 | |
1ef7b7e1 SP |
36 | .macro morello_cx cd, xn |
37 | .irp op, cvtd, cvtdz, cvtp, cvtpz | |
38 | \op \cd, \xn | |
39 | .endr | |
40 | .endm | |
41 | morello_cx c0, x1 | |
42 | ||
43 | .macro morello_xx xd, xn | |
44 | .irp op, rrlen, rrmask | |
45 | \op \xd, \xn | |
46 | .endr | |
47 | .endm | |
48 | morello_xx x2, x1 | |
49 | ||
50 | .macro morello_xcsp xd, cnsp | |
51 | .irp op, cfhi, cvtd, cvtp | |
52 | \op \xd, \cnsp | |
53 | .endr | |
54 | .endm | |
55 | morello_xcsp x7, c15 | |
56 | morello_xcsp x6, csp | |
57 | ||
58 | .macro morello_gc_xc xd, cnsp | |
59 | .irp op, gcbase, gcflgs, gclen, gclim, gcoff, gcperm, gcseal, gctag, gctype, gcvalue | |
60 | \op \xd, \cnsp | |
61 | .endr | |
62 | .endm | |
63 | morello_gc_xc x7, c15 | |
64 | morello_gc_xc x6, csp | |
65 | ||
66 | chkeq csp, c20 | |
67 | chkeq c19, c20 | |
68 | ||
dc64c2ba SP |
69 | // Three operands (dni) |
70 | ||
71 | .macro morello_addsub_imm cdsp, cnsp | |
72 | .irp op, add, sub | |
73 | \op \cdsp, \cnsp, #0xff0 | |
74 | \op \cdsp, \cnsp, #0xfff, lsl #0 | |
75 | \op \cdsp, \cnsp, #0x1fe, lsl #12 | |
76 | \op \cdsp, \cnsp, #0x3, lsl #0 | |
77 | \op \cdsp, \cnsp, #0x0, lsl #12 | |
78 | .endr | |
79 | .endm | |
80 | morello_addsub_imm c21, c9 | |
81 | morello_addsub_imm csp, c9 | |
82 | morello_addsub_imm csp, csp | |
83 | morello_addsub_imm c21, csp | |
84 | ||
9e5e0b29 | 85 | .macro morello_cspcspi8 cdsp, cnsp |
1ef7b7e1 | 86 | .irp op, bicflgs, eorflgs, orrflgs |
9e5e0b29 SP |
87 | \op \cdsp, \cnsp, #0xff |
88 | \op \cdsp, \cnsp, #0 | |
89 | \op \cdsp, \cnsp, #0xff | |
90 | \op \cdsp, \cnsp, #0x10 | |
91 | .endr | |
92 | .endm | |
93 | morello_cspcspi8 c7, c6 | |
94 | morello_cspcspi8 csp, c6 | |
95 | morello_cspcspi8 c8, csp | |
96 | morello_cspcspi8 csp, csp | |
97 | ||
1ef7b7e1 SP |
98 | .macro morello_cspcspi6 cdsp, cnsp |
99 | .irp op, alignd, alignu | |
100 | \op \cdsp, \cnsp, #0x3f | |
101 | \op \cdsp, \cnsp, #0x1e | |
102 | \op \cdsp, \cnsp, #0 | |
103 | \op \cdsp, \cnsp, #0x20 | |
104 | .endr | |
105 | .endm | |
106 | morello_cspcspi6 c17, c16 | |
107 | morello_cspcspi6 csp, c16 | |
108 | morello_cspcspi6 c18, csp | |
109 | morello_cspcspi6 csp, csp | |
110 | ||
3e2ac3d2 SP |
111 | .macro morello_perm cd, cn |
112 | .irp perm, r, w, x, rx, wx, rw, rwx, #0, #1, #2, #3, #4, #5, #6, #7 | |
113 | clrperm \cd, \cn, \perm | |
114 | .endr | |
115 | .endm | |
116 | morello_perm c22, c23 | |
117 | ||
9e5e0b29 SP |
118 | // Three operands (dnm) |
119 | ||
120 | .macro morello_cspcspx cdsp, cnsp, xm | |
3e2ac3d2 | 121 | .irp op, bicflgs, eorflgs, orrflgs, clrperm |
9e5e0b29 SP |
122 | \op \cdsp, \cnsp, \xm |
123 | .endr | |
124 | .endm | |
125 | morello_cspcspx c7, c6, x25 | |
126 | morello_cspcspx c7, csp, x25 | |
127 | morello_cspcspx csp, c6, x25 | |
128 | morello_cspcspx csp, csp, x25 | |
129 | ||
1ef7b7e1 SP |
130 | subs x4, c13, c14 |
131 | ||
adffaa8e SP |
132 | .macro morello_jump_sealed cn, cm |
133 | .irp op, blrs, brs, rets | |
134 | \op c29, \cn, \cm | |
135 | .endr | |
136 | .endm | |
137 | morello_jump_sealed c2, c4 | |
138 | ||
1ef7b7e1 SP |
139 | .macro morello_ccc cd, cn, cm |
140 | .irp op, cpytype, cpyvalue | |
141 | \op \cd, \cn, \cm | |
142 | .endr | |
143 | .endm | |
144 | morello_ccc c2, c4, c13 | |
145 | ||
146 | .macro morello_cspcx cdsp, cn, xm | |
147 | .irp op, cthi | |
148 | \op \cdsp, \cn, \xm | |
149 | .endr | |
150 | .endm | |
151 | morello_cspcx c0, c22, x25 | |
152 | morello_cspcx csp, c4, x25 | |
153 | ||
154 | .macro morello_ccspx cd, cnsp, xm | |
155 | .irp op, cvt, cvtz | |
156 | \op \cd, \cnsp, \xm | |
157 | .endr | |
158 | .endm | |
159 | morello_ccspx c22, c0, x25 | |
160 | morello_ccspx c4, csp, x25 | |
161 | ||
162 | .macro morello_xcspc xd, cnsp, cm | |
163 | .irp op, cvt | |
164 | \op \xd, \cnsp, \cm | |
165 | .endr | |
166 | .endm | |
167 | morello_xcspc x22, c0, c25 | |
168 | morello_xcspc x4, csp, c25 | |
169 | ||
170 | .macro morello_ccspcsp cd, cnsp, cmsp | |
171 | .irp op, chkssu | |
172 | \op \cd, \cnsp, \cmsp | |
173 | .endr | |
174 | .endm | |
175 | morello_ccspcsp c13, c7, c22 | |
176 | morello_ccspcsp c13, csp, c22 | |
177 | morello_ccspcsp c13, c7, csp | |
178 | morello_ccspcsp c13, csp, csp | |
179 | ||
180 | .macro morello_cspcspcsp cdsp, cnsp, cmsp | |
181 | .irp op, build, cseal | |
182 | \op \cdsp, \cnsp, \cmsp | |
183 | .endr | |
184 | .endm | |
185 | morello_cspcspcsp c2, c4, c13 | |
186 | morello_cspcspcsp csp, c4, c13 | |
187 | morello_cspcspcsp c2, csp, c13 | |
188 | morello_cspcspcsp csp, csp, c13 | |
189 | morello_cspcspcsp c2, c4, csp | |
190 | morello_cspcspcsp csp, c4, csp | |
191 | morello_cspcspcsp c2, csp, csp | |
192 | morello_cspcspcsp csp, csp, csp | |
193 | ||
dc64c2ba SP |
194 | // Four operands (dnmi) |
195 | ||
196 | .macro morello_add_scalar cspd, cspn, rm | |
197 | .irp op, add | |
198 | \op \cspd, \cspn, x\rm, sxtx #0 | |
199 | \op \cspd, \cspn, x\rm, sxtx #4 | |
200 | \op \cspd, \cspn, w\rm, sxtw #4 | |
201 | \op \cspd, \cspn, x\rm | |
202 | \op \cspd, \cspn, x\rm, lsl #4 | |
203 | .endr | |
204 | .endm | |
205 | morello_add_scalar c17, c9, 4 | |
206 | morello_add_scalar csp, c9, 4 | |
207 | morello_add_scalar c17, csp, 4 | |
208 | morello_add_scalar csp, csp, 4 | |
1ef7b7e1 SP |
209 | |
210 | .macro morello_csel cd, cn, cm | |
211 | .irp cond, EQ, NE, CS, HS, CC, LO, MI, PL, VS, VC, HI, LS, GE, LT, GT, LE, AL, NV | |
212 | csel \cd, \cn, \cm, \cond | |
213 | .endr | |
214 | .endm | |
215 | morello_csel c13, c7, c3 |