]>
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 | 98 | .macro morello_cspcspi6 cdsp, cnsp |
0bd71233 | 99 | .irp op, alignd, alignu, scbnds |
1ef7b7e1 SP |
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 | ||
0bd71233 SP |
118 | .macro morello_scbnds cdsp, cnsp |
119 | scbnds \cdsp, \cnsp, #0x3f, lsl #4 | |
120 | scbnds \cdsp, \cnsp, #0x1e, lsl #4 | |
121 | scbnds \cdsp, \cnsp, #0, lsl #4 | |
122 | scbnds \cdsp, \cnsp, #0x20, lsl #4 | |
123 | scbnds \cdsp, \cnsp, #0x3f0 | |
124 | scbnds \cdsp, \cnsp, #0x40 | |
125 | .endm | |
126 | morello_scbnds c17, c16 | |
127 | morello_scbnds csp, c16 | |
128 | morello_scbnds c18, csp | |
129 | morello_scbnds csp, csp | |
130 | ||
9e5e0b29 SP |
131 | // Three operands (dnm) |
132 | ||
133 | .macro morello_cspcspx cdsp, cnsp, xm | |
0bd71233 | 134 | .irp op, bicflgs, eorflgs, orrflgs, clrperm, scbnds, scbndse, scoff, scflgs, sctag, scvalue |
9e5e0b29 SP |
135 | \op \cdsp, \cnsp, \xm |
136 | .endr | |
137 | .endm | |
138 | morello_cspcspx c7, c6, x25 | |
139 | morello_cspcspx c7, csp, x25 | |
140 | morello_cspcspx csp, c6, x25 | |
141 | morello_cspcspx csp, csp, x25 | |
142 | ||
1ef7b7e1 SP |
143 | subs x4, c13, c14 |
144 | ||
adffaa8e SP |
145 | .macro morello_jump_sealed cn, cm |
146 | .irp op, blrs, brs, rets | |
147 | \op c29, \cn, \cm | |
148 | .endr | |
149 | .endm | |
150 | morello_jump_sealed c2, c4 | |
151 | ||
1ef7b7e1 SP |
152 | .macro morello_ccc cd, cn, cm |
153 | .irp op, cpytype, cpyvalue | |
154 | \op \cd, \cn, \cm | |
155 | .endr | |
156 | .endm | |
157 | morello_ccc c2, c4, c13 | |
158 | ||
159 | .macro morello_cspcx cdsp, cn, xm | |
160 | .irp op, cthi | |
161 | \op \cdsp, \cn, \xm | |
162 | .endr | |
163 | .endm | |
164 | morello_cspcx c0, c22, x25 | |
165 | morello_cspcx csp, c4, x25 | |
166 | ||
167 | .macro morello_ccspx cd, cnsp, xm | |
168 | .irp op, cvt, cvtz | |
169 | \op \cd, \cnsp, \xm | |
170 | .endr | |
171 | .endm | |
172 | morello_ccspx c22, c0, x25 | |
173 | morello_ccspx c4, csp, x25 | |
174 | ||
175 | .macro morello_xcspc xd, cnsp, cm | |
176 | .irp op, cvt | |
177 | \op \xd, \cnsp, \cm | |
178 | .endr | |
179 | .endm | |
180 | morello_xcspc x22, c0, c25 | |
181 | morello_xcspc x4, csp, c25 | |
182 | ||
183 | .macro morello_ccspcsp cd, cnsp, cmsp | |
184 | .irp op, chkssu | |
185 | \op \cd, \cnsp, \cmsp | |
186 | .endr | |
187 | .endm | |
188 | morello_ccspcsp c13, c7, c22 | |
189 | morello_ccspcsp c13, csp, c22 | |
190 | morello_ccspcsp c13, c7, csp | |
191 | morello_ccspcsp c13, csp, csp | |
192 | ||
193 | .macro morello_cspcspcsp cdsp, cnsp, cmsp | |
194 | .irp op, build, cseal | |
195 | \op \cdsp, \cnsp, \cmsp | |
196 | .endr | |
197 | .endm | |
198 | morello_cspcspcsp c2, c4, c13 | |
199 | morello_cspcspcsp csp, c4, c13 | |
200 | morello_cspcspcsp c2, csp, c13 | |
201 | morello_cspcspcsp csp, csp, c13 | |
202 | morello_cspcspcsp c2, c4, csp | |
203 | morello_cspcspcsp csp, c4, csp | |
204 | morello_cspcspcsp c2, csp, csp | |
205 | morello_cspcspcsp csp, csp, csp | |
206 | ||
dc64c2ba SP |
207 | // Four operands (dnmi) |
208 | ||
209 | .macro morello_add_scalar cspd, cspn, rm | |
210 | .irp op, add | |
211 | \op \cspd, \cspn, x\rm, sxtx #0 | |
212 | \op \cspd, \cspn, x\rm, sxtx #4 | |
213 | \op \cspd, \cspn, w\rm, sxtw #4 | |
214 | \op \cspd, \cspn, x\rm | |
215 | \op \cspd, \cspn, x\rm, lsl #4 | |
216 | .endr | |
217 | .endm | |
218 | morello_add_scalar c17, c9, 4 | |
219 | morello_add_scalar csp, c9, 4 | |
220 | morello_add_scalar c17, csp, 4 | |
221 | morello_add_scalar csp, csp, 4 | |
1ef7b7e1 SP |
222 | |
223 | .macro morello_csel cd, cn, cm | |
224 | .irp cond, EQ, NE, CS, HS, CC, LO, MI, PL, VS, VC, HI, LS, GE, LT, GT, LE, AL, NV | |
225 | csel \cd, \cn, \cm, \cond | |
226 | .endr | |
227 | .endm | |
228 | morello_csel c13, c7, c3 |