1#![cfg_attr(rustfmt, rustfmt_skip)]
3#![allow(
4 clippy::too_many_lines,
5 clippy::missing_errors_doc,
6 clippy::must_use_candidate,
7 clippy::derivable_impls,
8 clippy::inline_always,
9 clippy::cast_lossless,
10 clippy::cast_possible_truncation,
11 clippy::cast_possible_wrap,
12 clippy::cast_sign_loss,
13 clippy::identity_op,
14 clippy::match_same_arms,
15 clippy::uninlined_format_args,
16 clippy::doc_markdown,
17 clippy::collapsible_match,
18)]
19
20use crate::{BranchTarget, Ins, Options};
21#[cfg(feature = "sh4")]
22use crate::{DReg, FReg, VecReg};
23use crate::Reg;
24pub trait FormatIns: core::fmt::Write {
25 fn options(&self) -> &Options;
26 fn write_space(&mut self) -> core::fmt::Result {
27 self.write_str(" ")
28 }
29 fn write_separator(&mut self) -> core::fmt::Result {
30 self.write_str(", ")
31 }
32 fn write_reg(&mut self, reg: Reg) -> core::fmt::Result {
33 self.write_str(reg.name())
34 }
35 #[cfg(feature = "sh4")]
36 fn write_freg(&mut self, reg: FReg) -> core::fmt::Result {
37 self.write_str(reg.name())
38 }
39 #[cfg(feature = "sh4")]
40 fn write_dreg(&mut self, reg: DReg) -> core::fmt::Result {
41 self.write_str(reg.name())
42 }
43 #[cfg(feature = "sh4")]
44 fn write_vecreg(&mut self, reg: VecReg) -> core::fmt::Result {
45 self.write_str(reg.name())
46 }
47 fn write_uimm(&mut self, v: u32) -> core::fmt::Result {
48 if self.options().imm_decimal {
49 write!(self, "{v}")
50 } else {
51 write!(self, "0x{v:x}")
52 }
53 }
54 fn write_simm(&mut self, v: i32) -> core::fmt::Result {
55 if self.options().imm_decimal {
56 write!(self, "{v}")
57 } else if v < 0 {
58 write!(self, "-0x{:x}", - v)
59 } else {
60 write!(self, "0x{v:x}")
61 }
62 }
63 fn write_branch(&mut self, target: BranchTarget) -> core::fmt::Result {
64 write!(self, "0x{:x}", target.addr)
65 }
66 fn write_ins(&mut self, ins: &Ins) -> core::fmt::Result {
67 ins.write_opcode(self)?;
68 ins.write_params(self)?;
69 Ok(())
70 }
71}
72impl Ins {
73 pub fn write_opcode<W: FormatIns + ?Sized>(&self, out: &mut W) -> core::fmt::Result {
74 match self {
75 Ins::MovRmRn { .. } => out.write_str("mov"),
76 Ins::MovImmRn { .. } => out.write_str("mov"),
77 Ins::MovwAtDispPcRn { .. } => out.write_str("mov.w"),
78 Ins::MovlAtDispPcRn { .. } => out.write_str("mov.l"),
79 Ins::MovbRmAtRn { .. } => out.write_str("mov.b"),
80 Ins::MovwRmAtRn { .. } => out.write_str("mov.w"),
81 Ins::MovlRmAtRn { .. } => out.write_str("mov.l"),
82 Ins::MovbAtRmRn { .. } => out.write_str("mov.b"),
83 Ins::MovwAtRmRn { .. } => out.write_str("mov.w"),
84 Ins::MovlAtRmRn { .. } => out.write_str("mov.l"),
85 Ins::MovbRmAtDecRn { .. } => out.write_str("mov.b"),
86 Ins::MovwRmAtDecRn { .. } => out.write_str("mov.w"),
87 Ins::MovlRmAtDecRn { .. } => out.write_str("mov.l"),
88 Ins::MovbAtRmIncRn { .. } => out.write_str("mov.b"),
89 Ins::MovwAtRmIncRn { .. } => out.write_str("mov.w"),
90 Ins::MovlAtRmIncRn { .. } => out.write_str("mov.l"),
91 Ins::MovbR0AtDispRn { .. } => out.write_str("mov.b"),
92 Ins::MovwR0AtDispRn { .. } => out.write_str("mov.w"),
93 Ins::MovlRmAtDispRn { .. } => out.write_str("mov.l"),
94 Ins::MovbAtDispRmR0 { .. } => out.write_str("mov.b"),
95 Ins::MovwAtDispRmR0 { .. } => out.write_str("mov.w"),
96 Ins::MovlAtDispRmRn { .. } => out.write_str("mov.l"),
97 Ins::MovbRmAtR0Rn { .. } => out.write_str("mov.b"),
98 Ins::MovwRmAtR0Rn { .. } => out.write_str("mov.w"),
99 Ins::MovlRmAtR0Rn { .. } => out.write_str("mov.l"),
100 Ins::MovbAtR0RmRn { .. } => out.write_str("mov.b"),
101 Ins::MovwAtR0RmRn { .. } => out.write_str("mov.w"),
102 Ins::MovlAtR0RmRn { .. } => out.write_str("mov.l"),
103 Ins::MovbR0AtDispGbr { .. } => out.write_str("mov.b"),
104 Ins::MovwR0AtDispGbr { .. } => out.write_str("mov.w"),
105 Ins::MovlR0AtDispGbr { .. } => out.write_str("mov.l"),
106 Ins::MovbAtDispGbrR0 { .. } => out.write_str("mov.b"),
107 Ins::MovwAtDispGbrR0 { .. } => out.write_str("mov.w"),
108 Ins::MovlAtDispGbrR0 { .. } => out.write_str("mov.l"),
109 Ins::Mova { .. } => out.write_str("mova"),
110 Ins::Movt { .. } => out.write_str("movt"),
111 #[cfg(feature = "sh4")]
112 Ins::MovcalR0AtRn { .. } => out.write_str("movca.l"),
113 Ins::SwapbRmRn { .. } => out.write_str("swap.b"),
114 Ins::SwapwRmRn { .. } => out.write_str("swap.w"),
115 Ins::XtrctRmRn { .. } => out.write_str("xtrct"),
116 Ins::AddRmRn { .. } => out.write_str("add"),
117 Ins::AddImmRn { .. } => out.write_str("add"),
118 Ins::AddcRmRn { .. } => out.write_str("addc"),
119 Ins::AddvRmRn { .. } => out.write_str("addv"),
120 Ins::CmpeqImmR0 { .. } => out.write_str("cmp/eq"),
121 Ins::CmpeqRmRn { .. } => out.write_str("cmp/eq"),
122 Ins::CmpgeRmRn { .. } => out.write_str("cmp/ge"),
123 Ins::CmpgtRmRn { .. } => out.write_str("cmp/gt"),
124 Ins::CmphiRmRn { .. } => out.write_str("cmp/hi"),
125 Ins::CmphsRmRn { .. } => out.write_str("cmp/hs"),
126 Ins::CmpplRn { .. } => out.write_str("cmp/pl"),
127 Ins::CmppzRn { .. } => out.write_str("cmp/pz"),
128 Ins::CmpstrRmRn { .. } => out.write_str("cmp/str"),
129 Ins::Div0sRmRn { .. } => out.write_str("div0s"),
130 Ins::Div0u => out.write_str("div0u"),
131 Ins::Div1RmRn { .. } => out.write_str("div1"),
132 #[cfg(feature = "sh2")]
133 Ins::DmulslRmRn { .. } => out.write_str("dmuls.l"),
134 #[cfg(feature = "sh2")]
135 Ins::DmuluRmRn { .. } => out.write_str("dmulu.l"),
136 #[cfg(feature = "sh2")]
137 Ins::DtRn { .. } => out.write_str("dt"),
138 Ins::ExtsbRmRn { .. } => out.write_str("exts.b"),
139 Ins::ExtswRmRn { .. } => out.write_str("exts.w"),
140 Ins::ExtubRmRn { .. } => out.write_str("extu.b"),
141 Ins::ExtuwRmRn { .. } => out.write_str("extu.w"),
142 #[cfg(feature = "sh2")]
143 Ins::MaclAtRmIncAtRnInc { .. } => out.write_str("mac.l"),
144 Ins::MacwAtRmIncAtRnInc { .. } => out.write_str("mac.w"),
145 #[cfg(feature = "sh2")]
146 Ins::MullRmRn { .. } => out.write_str("mul.l"),
147 Ins::MulswRmRn { .. } => out.write_str("muls.w"),
148 Ins::MuluwRmRn { .. } => out.write_str("mulu.w"),
149 Ins::NegRmRn { .. } => out.write_str("neg"),
150 Ins::NegcRmRn { .. } => out.write_str("negc"),
151 Ins::SubRmRn { .. } => out.write_str("sub"),
152 Ins::SubcRmRn { .. } => out.write_str("subc"),
153 Ins::SubvRmRn { .. } => out.write_str("subv"),
154 Ins::AndRmRn { .. } => out.write_str("and"),
155 Ins::AndImmR0 { .. } => out.write_str("and"),
156 Ins::AndbImmAtR0Gbr { .. } => out.write_str("and.b"),
157 Ins::NotRmRn { .. } => out.write_str("not"),
158 Ins::OrRmRn { .. } => out.write_str("or"),
159 Ins::OrImmR0 { .. } => out.write_str("or"),
160 Ins::OrbImmAtR0Gbr { .. } => out.write_str("or.b"),
161 Ins::TasbAtRn { .. } => out.write_str("tas.b"),
162 Ins::TstRmRn { .. } => out.write_str("tst"),
163 Ins::TstImmR0 { .. } => out.write_str("tst"),
164 Ins::TstbImmAtR0Gbr { .. } => out.write_str("tst.b"),
165 Ins::XorRmRn { .. } => out.write_str("xor"),
166 Ins::XorImmR0 { .. } => out.write_str("xor"),
167 Ins::XorbImmAtR0Gbr { .. } => out.write_str("xor.b"),
168 Ins::RotlRn { .. } => out.write_str("rotl"),
169 Ins::RotrRn { .. } => out.write_str("rotr"),
170 Ins::RotclRn { .. } => out.write_str("rotcl"),
171 Ins::RotcrRn { .. } => out.write_str("rotcr"),
172 #[cfg(feature = "sh3")]
173 Ins::ShadRmRn { .. } => out.write_str("shad"),
174 Ins::ShalRn { .. } => out.write_str("shal"),
175 Ins::SharRn { .. } => out.write_str("shar"),
176 #[cfg(feature = "sh3")]
177 Ins::ShldRmRn { .. } => out.write_str("shld"),
178 Ins::ShllRn { .. } => out.write_str("shll"),
179 Ins::Shll2Rn { .. } => out.write_str("shll2"),
180 Ins::Shll8Rn { .. } => out.write_str("shll8"),
181 Ins::Shll16Rn { .. } => out.write_str("shll16"),
182 Ins::ShlrRn { .. } => out.write_str("shlr"),
183 Ins::Shlr2Rn { .. } => out.write_str("shlr2"),
184 Ins::Shlr8Rn { .. } => out.write_str("shlr8"),
185 Ins::Shlr16Rn { .. } => out.write_str("shlr16"),
186 Ins::Bt { .. } => out.write_str("bt"),
187 #[cfg(feature = "sh2")]
188 Ins::Bts { .. } => out.write_str("bt.s"),
189 Ins::Bf { .. } => out.write_str("bf"),
190 #[cfg(feature = "sh2")]
191 Ins::Bfs { .. } => out.write_str("bf.s"),
192 Ins::Bra { .. } => out.write_str("bra"),
193 Ins::Bsr { .. } => out.write_str("bsr"),
194 #[cfg(feature = "sh2")]
195 Ins::BrafRn { .. } => out.write_str("braf"),
196 #[cfg(feature = "sh2")]
197 Ins::BsrfRn { .. } => out.write_str("bsrf"),
198 Ins::JmpAtRn { .. } => out.write_str("jmp"),
199 Ins::JsrAtRn { .. } => out.write_str("jsr"),
200 Ins::Rts => out.write_str("rts"),
201 Ins::Rte => out.write_str("rte"),
202 Ins::Clrmac => out.write_str("clrmac"),
203 #[cfg(feature = "sh3")]
204 Ins::Clrs => out.write_str("clrs"),
205 Ins::Clrt => out.write_str("clrt"),
206 #[cfg(feature = "sh3")]
207 Ins::Sets => out.write_str("sets"),
208 Ins::Sett => out.write_str("sett"),
209 Ins::Nop => out.write_str("nop"),
210 Ins::Sleep => out.write_str("sleep"),
211 #[cfg(feature = "sh3")]
212 Ins::Ldtlb => out.write_str("ldtlb"),
213 Ins::Trapa { .. } => out.write_str("trapa"),
214 Ins::StcSrRn { .. } => out.write_str("stc"),
215 Ins::StcGbrRn { .. } => out.write_str("stc"),
216 Ins::StcVbrRn { .. } => out.write_str("stc"),
217 #[cfg(feature = "sh3")]
218 Ins::StcSsrRn { .. } => out.write_str("stc"),
219 #[cfg(feature = "sh3")]
220 Ins::StcSpcRn { .. } => out.write_str("stc"),
221 #[cfg(feature = "sh4")]
222 Ins::StcDbrRn { .. } => out.write_str("stc"),
223 #[cfg(feature = "sh4")]
224 Ins::StcSgrRn { .. } => out.write_str("stc"),
225 #[cfg(feature = "sh3")]
226 Ins::StcBankRn { .. } => out.write_str("stc"),
227 #[cfg(feature = "sh3")]
228 Ins::StcLoBank5Rn { .. } => out.write_str("stc"),
229 #[cfg(feature = "sh3")]
230 Ins::StcLoBank6Rn { .. } => out.write_str("stc"),
231 #[cfg(feature = "sh3")]
232 Ins::StcLoBank7Rn { .. } => out.write_str("stc"),
233 Ins::StclSrAtDecRn { .. } => out.write_str("stc.l"),
234 Ins::StclGbrAtDecRn { .. } => out.write_str("stc.l"),
235 Ins::StclVbrAtDecRn { .. } => out.write_str("stc.l"),
236 #[cfg(feature = "sh3")]
237 Ins::StclSsrAtDecRn { .. } => out.write_str("stc.l"),
238 #[cfg(feature = "sh3")]
239 Ins::StclSpcAtDecRn { .. } => out.write_str("stc.l"),
240 #[cfg(feature = "sh4")]
241 Ins::StclDbrAtDecRn { .. } => out.write_str("stc.l"),
242 #[cfg(feature = "sh4")]
243 Ins::StclSgrAtDecRn { .. } => out.write_str("stc.l"),
244 #[cfg(feature = "sh3")]
245 Ins::StclBankAtDecRn { .. } => out.write_str("stc.l"),
246 #[cfg(feature = "sh3")]
247 Ins::StclLoBank5AtDecRn { .. } => out.write_str("stc.l"),
248 #[cfg(feature = "sh3")]
249 Ins::StclLoBank6AtDecRn { .. } => out.write_str("stc.l"),
250 #[cfg(feature = "sh3")]
251 Ins::StclLoBank7AtDecRn { .. } => out.write_str("stc.l"),
252 Ins::LdcRmSr { .. } => out.write_str("ldc"),
253 Ins::LdcRmGbr { .. } => out.write_str("ldc"),
254 Ins::LdcRmVbr { .. } => out.write_str("ldc"),
255 #[cfg(feature = "sh3")]
256 Ins::LdcRmSsr { .. } => out.write_str("ldc"),
257 #[cfg(feature = "sh3")]
258 Ins::LdcRmSpc { .. } => out.write_str("ldc"),
259 #[cfg(feature = "sh4")]
260 Ins::LdcRmDbr { .. } => out.write_str("ldc"),
261 #[cfg(feature = "sh4")]
262 Ins::LdcRmSgr { .. } => out.write_str("ldc"),
263 #[cfg(feature = "sh3")]
264 Ins::LdcRmBank { .. } => out.write_str("ldc"),
265 #[cfg(feature = "sh3")]
266 Ins::LdcRmLoBank5 { .. } => out.write_str("ldc"),
267 #[cfg(feature = "sh3")]
268 Ins::LdcRmLoBank6 { .. } => out.write_str("ldc"),
269 #[cfg(feature = "sh3")]
270 Ins::LdcRmLoBank7 { .. } => out.write_str("ldc"),
271 Ins::LdclAtRmIncSr { .. } => out.write_str("ldc.l"),
272 Ins::LdclAtRmIncGbr { .. } => out.write_str("ldc.l"),
273 Ins::LdclAtRmIncVbr { .. } => out.write_str("ldc.l"),
274 #[cfg(feature = "sh3")]
275 Ins::LdclAtRmIncSsr { .. } => out.write_str("ldc.l"),
276 #[cfg(feature = "sh3")]
277 Ins::LdclAtRmIncSpc { .. } => out.write_str("ldc.l"),
278 #[cfg(feature = "sh4")]
279 Ins::LdclAtRmIncDbr { .. } => out.write_str("ldc.l"),
280 #[cfg(feature = "sh4")]
281 Ins::LdclAtRmIncSgr { .. } => out.write_str("ldc.l"),
282 #[cfg(feature = "sh3")]
283 Ins::LdclAtRmIncBank { .. } => out.write_str("ldc.l"),
284 #[cfg(feature = "sh3")]
285 Ins::LdclAtRmIncLoBank5 { .. } => out.write_str("ldc.l"),
286 #[cfg(feature = "sh3")]
287 Ins::LdclAtRmIncLoBank6 { .. } => out.write_str("ldc.l"),
288 #[cfg(feature = "sh3")]
289 Ins::LdclAtRmIncLoBank7 { .. } => out.write_str("ldc.l"),
290 Ins::StsMachRn { .. } => out.write_str("sts"),
291 Ins::StsMaclRn { .. } => out.write_str("sts"),
292 Ins::StsPrRn { .. } => out.write_str("sts"),
293 #[cfg(feature = "sh4")]
294 Ins::StsFpscrRn { .. } => out.write_str("sts"),
295 #[cfg(feature = "sh4")]
296 Ins::StsFpulRn { .. } => out.write_str("sts"),
297 Ins::StslMachAtDecRn { .. } => out.write_str("sts.l"),
298 Ins::StslMaclAtDecRn { .. } => out.write_str("sts.l"),
299 Ins::StslPrAtDecRn { .. } => out.write_str("sts.l"),
300 #[cfg(feature = "sh4")]
301 Ins::StslFpscrAtDecRn { .. } => out.write_str("sts.l"),
302 #[cfg(feature = "sh4")]
303 Ins::StslFpulAtDecRn { .. } => out.write_str("sts.l"),
304 Ins::LdsRmMach { .. } => out.write_str("lds"),
305 Ins::LdsRmMacl { .. } => out.write_str("lds"),
306 Ins::LdsRmPr { .. } => out.write_str("lds"),
307 #[cfg(feature = "sh4")]
308 Ins::LdsRmFpscr { .. } => out.write_str("lds"),
309 #[cfg(feature = "sh4")]
310 Ins::LdsRmFpul { .. } => out.write_str("lds"),
311 Ins::LdslAtRmIncMach { .. } => out.write_str("lds.l"),
312 Ins::LdslAtRmIncMacl { .. } => out.write_str("lds.l"),
313 Ins::LdslAtRmIncPr { .. } => out.write_str("lds.l"),
314 #[cfg(feature = "sh4")]
315 Ins::LdslAtRmIncFpscr { .. } => out.write_str("lds.l"),
316 #[cfg(feature = "sh4")]
317 Ins::LdslAtRmIncFpul { .. } => out.write_str("lds.l"),
318 #[cfg(feature = "sh3")]
319 Ins::PrefAtRn { .. } => out.write_str("pref"),
320 #[cfg(feature = "sh4")]
321 Ins::OcbiAtRn { .. } => out.write_str("ocbi"),
322 #[cfg(feature = "sh4")]
323 Ins::OcbpAtRn { .. } => out.write_str("ocbp"),
324 #[cfg(feature = "sh4")]
325 Ins::OcbwbAtRn { .. } => out.write_str("ocbwb"),
326 #[cfg(feature = "sh4")]
327 Ins::FaddFrmFrn { .. } => out.write_str("fadd"),
328 #[cfg(feature = "sh4")]
329 Ins::FsubFrmFrn { .. } => out.write_str("fsub"),
330 #[cfg(feature = "sh4")]
331 Ins::FmulFrmFrn { .. } => out.write_str("fmul"),
332 #[cfg(feature = "sh4")]
333 Ins::FdivFrmFrn { .. } => out.write_str("fdiv"),
334 #[cfg(feature = "sh4")]
335 Ins::FcmpeqFrmFrn { .. } => out.write_str("fcmp/eq"),
336 #[cfg(feature = "sh4")]
337 Ins::FcmpgtFrmFrn { .. } => out.write_str("fcmp/gt"),
338 #[cfg(feature = "sh4")]
339 Ins::FmovAtR0RmFrn { .. } => out.write_str("fmov"),
340 #[cfg(feature = "sh4")]
341 Ins::FmovFrmAtR0Rn { .. } => out.write_str("fmov"),
342 #[cfg(feature = "sh4")]
343 Ins::FmovAtRmFrn { .. } => out.write_str("fmov"),
344 #[cfg(feature = "sh4")]
345 Ins::FmovAtRmIncFrn { .. } => out.write_str("fmov"),
346 #[cfg(feature = "sh4")]
347 Ins::FmovFrmAtRn { .. } => out.write_str("fmov"),
348 #[cfg(feature = "sh4")]
349 Ins::FmovFrmAtDecRn { .. } => out.write_str("fmov"),
350 #[cfg(feature = "sh4")]
351 Ins::FmovFrmFrn { .. } => out.write_str("fmov"),
352 #[cfg(feature = "sh4")]
353 Ins::FstsFpulFrn { .. } => out.write_str("fsts"),
354 #[cfg(feature = "sh4")]
355 Ins::FldsFrnFpul { .. } => out.write_str("flds"),
356 #[cfg(feature = "sh4")]
357 Ins::FloatFpulFrn { .. } => out.write_str("float"),
358 #[cfg(feature = "sh4")]
359 Ins::FtrcFrnFpul { .. } => out.write_str("ftrc"),
360 #[cfg(feature = "sh4")]
361 Ins::FnegFrn { .. } => out.write_str("fneg"),
362 #[cfg(feature = "sh4")]
363 Ins::FabsFrn { .. } => out.write_str("fabs"),
364 #[cfg(feature = "sh4")]
365 Ins::FsqrtFrn { .. } => out.write_str("fsqrt"),
366 #[cfg(feature = "sh4")]
367 Ins::Fldi0Frn { .. } => out.write_str("fldi0"),
368 #[cfg(feature = "sh4")]
369 Ins::Fldi1Frn { .. } => out.write_str("fldi1"),
370 #[cfg(feature = "sh4")]
371 Ins::FmacFr0FrmFrn { .. } => out.write_str("fmac"),
372 #[cfg(feature = "sh4")]
373 Ins::FcnvsdFpulDrn { .. } => out.write_str("fcnvsd"),
374 #[cfg(feature = "sh4")]
375 Ins::FcnvdsDrnFpul { .. } => out.write_str("fcnvds"),
376 #[cfg(feature = "sh4")]
377 Ins::FiprFvmFvn { .. } => out.write_str("fipr"),
378 #[cfg(feature = "sh4")]
379 Ins::FtrvXmtrxFvn { .. } => out.write_str("ftrv"),
380 #[cfg(feature = "sh4")]
381 Ins::FsrraFrn { .. } => out.write_str("fsrra"),
382 #[cfg(feature = "sh4")]
383 Ins::FscaFpulDrn { .. } => out.write_str("fsca"),
384 #[cfg(feature = "sh4")]
385 Ins::Fschg => out.write_str("fschg"),
386 #[cfg(feature = "sh4")]
387 Ins::Frchg => out.write_str("frchg"),
388 Ins::Word(_) => out.write_str(".word"),
389 Ins::Byte(_) => out.write_str(".byte"),
390 Ins::Long(_) => out.write_str(".long"),
391 }
392 }
393 pub fn write_params<W: FormatIns + ?Sized>(&self, out: &mut W) -> core::fmt::Result {
394 match self {
395 Ins::MovRmRn { rn, rm } => {
396 out.write_space()?;
397 out.write_reg(*rm)?;
398 out.write_separator()?;
399 out.write_reg(*rn)?;
400 Ok(())
401 }
402 Ins::MovImmRn { rn, imm } => {
403 out.write_space()?;
404 out.write_str("#")?;
405 out.write_simm(*imm as i32)?;
406 out.write_separator()?;
407 out.write_reg(*rn)?;
408 Ok(())
409 }
410 Ins::MovwAtDispPcRn { rn, disp } => {
411 out.write_space()?;
412 out.write_str("@(")?;
413 out.write_uimm(*disp as u32 * 2u32 + 4u32)?;
414 out.write_str(", pc), ")?;
415 out.write_reg(*rn)?;
416 Ok(())
417 }
418 Ins::MovlAtDispPcRn { rn, disp } => {
419 out.write_space()?;
420 out.write_str("@(")?;
421 out.write_uimm(*disp)?;
422 out.write_str(", pc), ")?;
423 out.write_reg(*rn)?;
424 Ok(())
425 }
426 Ins::MovbRmAtRn { rn, rm } => {
427 out.write_space()?;
428 out.write_reg(*rm)?;
429 out.write_str(", @")?;
430 out.write_reg(*rn)?;
431 Ok(())
432 }
433 Ins::MovwRmAtRn { rn, rm } => {
434 out.write_space()?;
435 out.write_reg(*rm)?;
436 out.write_str(", @")?;
437 out.write_reg(*rn)?;
438 Ok(())
439 }
440 Ins::MovlRmAtRn { rn, rm } => {
441 out.write_space()?;
442 out.write_reg(*rm)?;
443 out.write_str(", @")?;
444 out.write_reg(*rn)?;
445 Ok(())
446 }
447 Ins::MovbAtRmRn { rn, rm } => {
448 out.write_space()?;
449 out.write_str("@")?;
450 out.write_reg(*rm)?;
451 out.write_separator()?;
452 out.write_reg(*rn)?;
453 Ok(())
454 }
455 Ins::MovwAtRmRn { rn, rm } => {
456 out.write_space()?;
457 out.write_str("@")?;
458 out.write_reg(*rm)?;
459 out.write_separator()?;
460 out.write_reg(*rn)?;
461 Ok(())
462 }
463 Ins::MovlAtRmRn { rn, rm } => {
464 out.write_space()?;
465 out.write_str("@")?;
466 out.write_reg(*rm)?;
467 out.write_separator()?;
468 out.write_reg(*rn)?;
469 Ok(())
470 }
471 Ins::MovbRmAtDecRn { rn, rm } => {
472 out.write_space()?;
473 out.write_reg(*rm)?;
474 out.write_str(", @-")?;
475 out.write_reg(*rn)?;
476 Ok(())
477 }
478 Ins::MovwRmAtDecRn { rn, rm } => {
479 out.write_space()?;
480 out.write_reg(*rm)?;
481 out.write_str(", @-")?;
482 out.write_reg(*rn)?;
483 Ok(())
484 }
485 Ins::MovlRmAtDecRn { rn, rm } => {
486 out.write_space()?;
487 out.write_reg(*rm)?;
488 out.write_str(", @-")?;
489 out.write_reg(*rn)?;
490 Ok(())
491 }
492 Ins::MovbAtRmIncRn { rn, rm } => {
493 out.write_space()?;
494 out.write_str("@")?;
495 out.write_reg(*rm)?;
496 out.write_str("+, ")?;
497 out.write_reg(*rn)?;
498 Ok(())
499 }
500 Ins::MovwAtRmIncRn { rn, rm } => {
501 out.write_space()?;
502 out.write_str("@")?;
503 out.write_reg(*rm)?;
504 out.write_str("+, ")?;
505 out.write_reg(*rn)?;
506 Ok(())
507 }
508 Ins::MovlAtRmIncRn { rn, rm } => {
509 out.write_space()?;
510 out.write_str("@")?;
511 out.write_reg(*rm)?;
512 out.write_str("+, ")?;
513 out.write_reg(*rn)?;
514 Ok(())
515 }
516 Ins::MovbR0AtDispRn { rn, disp } => {
517 out.write_space()?;
518 out.write_str("r0, @(")?;
519 out.write_uimm(*disp as u32)?;
520 out.write_separator()?;
521 out.write_reg(*rn)?;
522 out.write_str(")")?;
523 Ok(())
524 }
525 Ins::MovwR0AtDispRn { rn, disp } => {
526 out.write_space()?;
527 out.write_str("r0, @(")?;
528 out.write_uimm(*disp as u32 * 2u32)?;
529 out.write_separator()?;
530 out.write_reg(*rn)?;
531 out.write_str(")")?;
532 Ok(())
533 }
534 Ins::MovlRmAtDispRn { rn, rm, disp } => {
535 out.write_space()?;
536 out.write_reg(*rm)?;
537 out.write_str(", @(")?;
538 out.write_uimm(*disp as u32 * 4u32)?;
539 out.write_separator()?;
540 out.write_reg(*rn)?;
541 out.write_str(")")?;
542 Ok(())
543 }
544 Ins::MovbAtDispRmR0 { rm, disp } => {
545 out.write_space()?;
546 out.write_str("@(")?;
547 out.write_uimm(*disp as u32)?;
548 out.write_separator()?;
549 out.write_reg(*rm)?;
550 out.write_str("), r0")?;
551 Ok(())
552 }
553 Ins::MovwAtDispRmR0 { rm, disp } => {
554 out.write_space()?;
555 out.write_str("@(")?;
556 out.write_uimm(*disp as u32 * 2u32)?;
557 out.write_separator()?;
558 out.write_reg(*rm)?;
559 out.write_str("), r0")?;
560 Ok(())
561 }
562 Ins::MovlAtDispRmRn { rn, rm, disp } => {
563 out.write_space()?;
564 out.write_str("@(")?;
565 out.write_uimm(*disp as u32 * 4u32)?;
566 out.write_separator()?;
567 out.write_reg(*rm)?;
568 out.write_str("), ")?;
569 out.write_reg(*rn)?;
570 Ok(())
571 }
572 Ins::MovbRmAtR0Rn { rn, rm } => {
573 out.write_space()?;
574 out.write_reg(*rm)?;
575 out.write_str(", @(r0, ")?;
576 out.write_reg(*rn)?;
577 out.write_str(")")?;
578 Ok(())
579 }
580 Ins::MovwRmAtR0Rn { rn, rm } => {
581 out.write_space()?;
582 out.write_reg(*rm)?;
583 out.write_str(", @(r0, ")?;
584 out.write_reg(*rn)?;
585 out.write_str(")")?;
586 Ok(())
587 }
588 Ins::MovlRmAtR0Rn { rn, rm } => {
589 out.write_space()?;
590 out.write_reg(*rm)?;
591 out.write_str(", @(r0, ")?;
592 out.write_reg(*rn)?;
593 out.write_str(")")?;
594 Ok(())
595 }
596 Ins::MovbAtR0RmRn { rn, rm } => {
597 out.write_space()?;
598 out.write_str("@(r0, ")?;
599 out.write_reg(*rm)?;
600 out.write_str("), ")?;
601 out.write_reg(*rn)?;
602 Ok(())
603 }
604 Ins::MovwAtR0RmRn { rn, rm } => {
605 out.write_space()?;
606 out.write_str("@(r0, ")?;
607 out.write_reg(*rm)?;
608 out.write_str("), ")?;
609 out.write_reg(*rn)?;
610 Ok(())
611 }
612 Ins::MovlAtR0RmRn { rn, rm } => {
613 out.write_space()?;
614 out.write_str("@(r0, ")?;
615 out.write_reg(*rm)?;
616 out.write_str("), ")?;
617 out.write_reg(*rn)?;
618 Ok(())
619 }
620 Ins::MovbR0AtDispGbr { disp } => {
621 out.write_space()?;
622 out.write_str("r0, @(")?;
623 out.write_uimm(*disp as u32)?;
624 out.write_str(", gbr)")?;
625 Ok(())
626 }
627 Ins::MovwR0AtDispGbr { disp } => {
628 out.write_space()?;
629 out.write_str("r0, @(")?;
630 out.write_uimm(*disp as u32 * 2u32)?;
631 out.write_str(", gbr)")?;
632 Ok(())
633 }
634 Ins::MovlR0AtDispGbr { disp } => {
635 out.write_space()?;
636 out.write_str("r0, @(")?;
637 out.write_uimm(*disp as u32 * 4u32)?;
638 out.write_str(", gbr)")?;
639 Ok(())
640 }
641 Ins::MovbAtDispGbrR0 { disp } => {
642 out.write_space()?;
643 out.write_str("@(")?;
644 out.write_uimm(*disp as u32)?;
645 out.write_str(", gbr), r0")?;
646 Ok(())
647 }
648 Ins::MovwAtDispGbrR0 { disp } => {
649 out.write_space()?;
650 out.write_str("@(")?;
651 out.write_uimm(*disp as u32 * 2u32)?;
652 out.write_str(", gbr), r0")?;
653 Ok(())
654 }
655 Ins::MovlAtDispGbrR0 { disp } => {
656 out.write_space()?;
657 out.write_str("@(")?;
658 out.write_uimm(*disp as u32 * 4u32)?;
659 out.write_str(", gbr), r0")?;
660 Ok(())
661 }
662 Ins::Mova { disp } => {
663 out.write_space()?;
664 out.write_str("@(")?;
665 out.write_uimm(*disp)?;
666 out.write_str(", pc), r0")?;
667 Ok(())
668 }
669 Ins::Movt { rn } => {
670 out.write_space()?;
671 out.write_reg(*rn)?;
672 Ok(())
673 }
674 #[cfg(feature = "sh4")]
675 Ins::MovcalR0AtRn { rn } => {
676 out.write_space()?;
677 out.write_str("r0, @")?;
678 out.write_reg(*rn)?;
679 Ok(())
680 }
681 Ins::SwapbRmRn { rn, rm } => {
682 out.write_space()?;
683 out.write_reg(*rm)?;
684 out.write_separator()?;
685 out.write_reg(*rn)?;
686 Ok(())
687 }
688 Ins::SwapwRmRn { rn, rm } => {
689 out.write_space()?;
690 out.write_reg(*rm)?;
691 out.write_separator()?;
692 out.write_reg(*rn)?;
693 Ok(())
694 }
695 Ins::XtrctRmRn { rn, rm } => {
696 out.write_space()?;
697 out.write_reg(*rm)?;
698 out.write_separator()?;
699 out.write_reg(*rn)?;
700 Ok(())
701 }
702 Ins::AddRmRn { rn, rm } => {
703 out.write_space()?;
704 out.write_reg(*rm)?;
705 out.write_separator()?;
706 out.write_reg(*rn)?;
707 Ok(())
708 }
709 Ins::AddImmRn { rn, imm } => {
710 out.write_space()?;
711 out.write_str("#")?;
712 out.write_simm(*imm as i32)?;
713 out.write_separator()?;
714 out.write_reg(*rn)?;
715 Ok(())
716 }
717 Ins::AddcRmRn { rn, rm } => {
718 out.write_space()?;
719 out.write_reg(*rm)?;
720 out.write_separator()?;
721 out.write_reg(*rn)?;
722 Ok(())
723 }
724 Ins::AddvRmRn { rn, rm } => {
725 out.write_space()?;
726 out.write_reg(*rm)?;
727 out.write_separator()?;
728 out.write_reg(*rn)?;
729 Ok(())
730 }
731 Ins::CmpeqImmR0 { imm } => {
732 out.write_space()?;
733 out.write_str("#")?;
734 out.write_simm(*imm as i32)?;
735 out.write_str(", r0")?;
736 Ok(())
737 }
738 Ins::CmpeqRmRn { rn, rm } => {
739 out.write_space()?;
740 out.write_reg(*rm)?;
741 out.write_separator()?;
742 out.write_reg(*rn)?;
743 Ok(())
744 }
745 Ins::CmpgeRmRn { rn, rm } => {
746 out.write_space()?;
747 out.write_reg(*rm)?;
748 out.write_separator()?;
749 out.write_reg(*rn)?;
750 Ok(())
751 }
752 Ins::CmpgtRmRn { rn, rm } => {
753 out.write_space()?;
754 out.write_reg(*rm)?;
755 out.write_separator()?;
756 out.write_reg(*rn)?;
757 Ok(())
758 }
759 Ins::CmphiRmRn { rn, rm } => {
760 out.write_space()?;
761 out.write_reg(*rm)?;
762 out.write_separator()?;
763 out.write_reg(*rn)?;
764 Ok(())
765 }
766 Ins::CmphsRmRn { rn, rm } => {
767 out.write_space()?;
768 out.write_reg(*rm)?;
769 out.write_separator()?;
770 out.write_reg(*rn)?;
771 Ok(())
772 }
773 Ins::CmpplRn { rn } => {
774 out.write_space()?;
775 out.write_reg(*rn)?;
776 Ok(())
777 }
778 Ins::CmppzRn { rn } => {
779 out.write_space()?;
780 out.write_reg(*rn)?;
781 Ok(())
782 }
783 Ins::CmpstrRmRn { rn, rm } => {
784 out.write_space()?;
785 out.write_reg(*rm)?;
786 out.write_separator()?;
787 out.write_reg(*rn)?;
788 Ok(())
789 }
790 Ins::Div0sRmRn { rn, rm } => {
791 out.write_space()?;
792 out.write_reg(*rm)?;
793 out.write_separator()?;
794 out.write_reg(*rn)?;
795 Ok(())
796 }
797 Ins::Div0u => Ok(()),
798 Ins::Div1RmRn { rn, rm } => {
799 out.write_space()?;
800 out.write_reg(*rm)?;
801 out.write_separator()?;
802 out.write_reg(*rn)?;
803 Ok(())
804 }
805 #[cfg(feature = "sh2")]
806 Ins::DmulslRmRn { rn, rm } => {
807 out.write_space()?;
808 out.write_reg(*rm)?;
809 out.write_separator()?;
810 out.write_reg(*rn)?;
811 Ok(())
812 }
813 #[cfg(feature = "sh2")]
814 Ins::DmuluRmRn { rn, rm } => {
815 out.write_space()?;
816 out.write_reg(*rm)?;
817 out.write_separator()?;
818 out.write_reg(*rn)?;
819 Ok(())
820 }
821 #[cfg(feature = "sh2")]
822 Ins::DtRn { rn } => {
823 out.write_space()?;
824 out.write_reg(*rn)?;
825 Ok(())
826 }
827 Ins::ExtsbRmRn { rn, rm } => {
828 out.write_space()?;
829 out.write_reg(*rm)?;
830 out.write_separator()?;
831 out.write_reg(*rn)?;
832 Ok(())
833 }
834 Ins::ExtswRmRn { rn, rm } => {
835 out.write_space()?;
836 out.write_reg(*rm)?;
837 out.write_separator()?;
838 out.write_reg(*rn)?;
839 Ok(())
840 }
841 Ins::ExtubRmRn { rn, rm } => {
842 out.write_space()?;
843 out.write_reg(*rm)?;
844 out.write_separator()?;
845 out.write_reg(*rn)?;
846 Ok(())
847 }
848 Ins::ExtuwRmRn { rn, rm } => {
849 out.write_space()?;
850 out.write_reg(*rm)?;
851 out.write_separator()?;
852 out.write_reg(*rn)?;
853 Ok(())
854 }
855 #[cfg(feature = "sh2")]
856 Ins::MaclAtRmIncAtRnInc { rn, rm } => {
857 out.write_space()?;
858 out.write_str("@")?;
859 out.write_reg(*rm)?;
860 out.write_str("+, @")?;
861 out.write_reg(*rn)?;
862 out.write_str("+")?;
863 Ok(())
864 }
865 Ins::MacwAtRmIncAtRnInc { rn, rm } => {
866 out.write_space()?;
867 out.write_str("@")?;
868 out.write_reg(*rm)?;
869 out.write_str("+, @")?;
870 out.write_reg(*rn)?;
871 out.write_str("+")?;
872 Ok(())
873 }
874 #[cfg(feature = "sh2")]
875 Ins::MullRmRn { rn, rm } => {
876 out.write_space()?;
877 out.write_reg(*rm)?;
878 out.write_separator()?;
879 out.write_reg(*rn)?;
880 Ok(())
881 }
882 Ins::MulswRmRn { rn, rm } => {
883 out.write_space()?;
884 out.write_reg(*rm)?;
885 out.write_separator()?;
886 out.write_reg(*rn)?;
887 Ok(())
888 }
889 Ins::MuluwRmRn { rn, rm } => {
890 out.write_space()?;
891 out.write_reg(*rm)?;
892 out.write_separator()?;
893 out.write_reg(*rn)?;
894 Ok(())
895 }
896 Ins::NegRmRn { rn, rm } => {
897 out.write_space()?;
898 out.write_reg(*rm)?;
899 out.write_separator()?;
900 out.write_reg(*rn)?;
901 Ok(())
902 }
903 Ins::NegcRmRn { rn, rm } => {
904 out.write_space()?;
905 out.write_reg(*rm)?;
906 out.write_separator()?;
907 out.write_reg(*rn)?;
908 Ok(())
909 }
910 Ins::SubRmRn { rn, rm } => {
911 out.write_space()?;
912 out.write_reg(*rm)?;
913 out.write_separator()?;
914 out.write_reg(*rn)?;
915 Ok(())
916 }
917 Ins::SubcRmRn { rn, rm } => {
918 out.write_space()?;
919 out.write_reg(*rm)?;
920 out.write_separator()?;
921 out.write_reg(*rn)?;
922 Ok(())
923 }
924 Ins::SubvRmRn { rn, rm } => {
925 out.write_space()?;
926 out.write_reg(*rm)?;
927 out.write_separator()?;
928 out.write_reg(*rn)?;
929 Ok(())
930 }
931 Ins::AndRmRn { rn, rm } => {
932 out.write_space()?;
933 out.write_reg(*rm)?;
934 out.write_separator()?;
935 out.write_reg(*rn)?;
936 Ok(())
937 }
938 Ins::AndImmR0 { imm } => {
939 out.write_space()?;
940 out.write_str("#")?;
941 out.write_uimm(*imm as u32)?;
942 out.write_str(", r0")?;
943 Ok(())
944 }
945 Ins::AndbImmAtR0Gbr { imm } => {
946 out.write_space()?;
947 out.write_str("#")?;
948 out.write_uimm(*imm as u32)?;
949 out.write_str(", @(r0, gbr)")?;
950 Ok(())
951 }
952 Ins::NotRmRn { rn, rm } => {
953 out.write_space()?;
954 out.write_reg(*rm)?;
955 out.write_separator()?;
956 out.write_reg(*rn)?;
957 Ok(())
958 }
959 Ins::OrRmRn { rn, rm } => {
960 out.write_space()?;
961 out.write_reg(*rm)?;
962 out.write_separator()?;
963 out.write_reg(*rn)?;
964 Ok(())
965 }
966 Ins::OrImmR0 { imm } => {
967 out.write_space()?;
968 out.write_str("#")?;
969 out.write_uimm(*imm as u32)?;
970 out.write_str(", r0")?;
971 Ok(())
972 }
973 Ins::OrbImmAtR0Gbr { imm } => {
974 out.write_space()?;
975 out.write_str("#")?;
976 out.write_uimm(*imm as u32)?;
977 out.write_str(", @(r0, gbr)")?;
978 Ok(())
979 }
980 Ins::TasbAtRn { rn } => {
981 out.write_space()?;
982 out.write_str("@")?;
983 out.write_reg(*rn)?;
984 Ok(())
985 }
986 Ins::TstRmRn { rn, rm } => {
987 out.write_space()?;
988 out.write_reg(*rm)?;
989 out.write_separator()?;
990 out.write_reg(*rn)?;
991 Ok(())
992 }
993 Ins::TstImmR0 { imm } => {
994 out.write_space()?;
995 out.write_str("#")?;
996 out.write_uimm(*imm as u32)?;
997 out.write_str(", r0")?;
998 Ok(())
999 }
1000 Ins::TstbImmAtR0Gbr { imm } => {
1001 out.write_space()?;
1002 out.write_str("#")?;
1003 out.write_uimm(*imm as u32)?;
1004 out.write_str(", @(r0, gbr)")?;
1005 Ok(())
1006 }
1007 Ins::XorRmRn { rn, rm } => {
1008 out.write_space()?;
1009 out.write_reg(*rm)?;
1010 out.write_separator()?;
1011 out.write_reg(*rn)?;
1012 Ok(())
1013 }
1014 Ins::XorImmR0 { imm } => {
1015 out.write_space()?;
1016 out.write_str("#")?;
1017 out.write_uimm(*imm as u32)?;
1018 out.write_str(", r0")?;
1019 Ok(())
1020 }
1021 Ins::XorbImmAtR0Gbr { imm } => {
1022 out.write_space()?;
1023 out.write_str("#")?;
1024 out.write_uimm(*imm as u32)?;
1025 out.write_str(", @(r0, gbr)")?;
1026 Ok(())
1027 }
1028 Ins::RotlRn { rn } => {
1029 out.write_space()?;
1030 out.write_reg(*rn)?;
1031 Ok(())
1032 }
1033 Ins::RotrRn { rn } => {
1034 out.write_space()?;
1035 out.write_reg(*rn)?;
1036 Ok(())
1037 }
1038 Ins::RotclRn { rn } => {
1039 out.write_space()?;
1040 out.write_reg(*rn)?;
1041 Ok(())
1042 }
1043 Ins::RotcrRn { rn } => {
1044 out.write_space()?;
1045 out.write_reg(*rn)?;
1046 Ok(())
1047 }
1048 #[cfg(feature = "sh3")]
1049 Ins::ShadRmRn { rn, rm } => {
1050 out.write_space()?;
1051 out.write_reg(*rm)?;
1052 out.write_separator()?;
1053 out.write_reg(*rn)?;
1054 Ok(())
1055 }
1056 Ins::ShalRn { rn } => {
1057 out.write_space()?;
1058 out.write_reg(*rn)?;
1059 Ok(())
1060 }
1061 Ins::SharRn { rn } => {
1062 out.write_space()?;
1063 out.write_reg(*rn)?;
1064 Ok(())
1065 }
1066 #[cfg(feature = "sh3")]
1067 Ins::ShldRmRn { rn, rm } => {
1068 out.write_space()?;
1069 out.write_reg(*rm)?;
1070 out.write_separator()?;
1071 out.write_reg(*rn)?;
1072 Ok(())
1073 }
1074 Ins::ShllRn { rn } => {
1075 out.write_space()?;
1076 out.write_reg(*rn)?;
1077 Ok(())
1078 }
1079 Ins::Shll2Rn { rn } => {
1080 out.write_space()?;
1081 out.write_reg(*rn)?;
1082 Ok(())
1083 }
1084 Ins::Shll8Rn { rn } => {
1085 out.write_space()?;
1086 out.write_reg(*rn)?;
1087 Ok(())
1088 }
1089 Ins::Shll16Rn { rn } => {
1090 out.write_space()?;
1091 out.write_reg(*rn)?;
1092 Ok(())
1093 }
1094 Ins::ShlrRn { rn } => {
1095 out.write_space()?;
1096 out.write_reg(*rn)?;
1097 Ok(())
1098 }
1099 Ins::Shlr2Rn { rn } => {
1100 out.write_space()?;
1101 out.write_reg(*rn)?;
1102 Ok(())
1103 }
1104 Ins::Shlr8Rn { rn } => {
1105 out.write_space()?;
1106 out.write_reg(*rn)?;
1107 Ok(())
1108 }
1109 Ins::Shlr16Rn { rn } => {
1110 out.write_space()?;
1111 out.write_reg(*rn)?;
1112 Ok(())
1113 }
1114 Ins::Bt { disp } => {
1115 out.write_space()?;
1116 out.write_branch(*disp)?;
1117 Ok(())
1118 }
1119 #[cfg(feature = "sh2")]
1120 Ins::Bts { disp } => {
1121 out.write_space()?;
1122 out.write_branch(*disp)?;
1123 Ok(())
1124 }
1125 Ins::Bf { disp } => {
1126 out.write_space()?;
1127 out.write_branch(*disp)?;
1128 Ok(())
1129 }
1130 #[cfg(feature = "sh2")]
1131 Ins::Bfs { disp } => {
1132 out.write_space()?;
1133 out.write_branch(*disp)?;
1134 Ok(())
1135 }
1136 Ins::Bra { disp } => {
1137 out.write_space()?;
1138 out.write_branch(*disp)?;
1139 Ok(())
1140 }
1141 Ins::Bsr { disp } => {
1142 out.write_space()?;
1143 out.write_branch(*disp)?;
1144 Ok(())
1145 }
1146 #[cfg(feature = "sh2")]
1147 Ins::BrafRn { rn } => {
1148 out.write_space()?;
1149 out.write_reg(*rn)?;
1150 Ok(())
1151 }
1152 #[cfg(feature = "sh2")]
1153 Ins::BsrfRn { rn } => {
1154 out.write_space()?;
1155 out.write_reg(*rn)?;
1156 Ok(())
1157 }
1158 Ins::JmpAtRn { rn } => {
1159 out.write_space()?;
1160 out.write_str("@")?;
1161 out.write_reg(*rn)?;
1162 Ok(())
1163 }
1164 Ins::JsrAtRn { rn } => {
1165 out.write_space()?;
1166 out.write_str("@")?;
1167 out.write_reg(*rn)?;
1168 Ok(())
1169 }
1170 Ins::Rts => Ok(()),
1171 Ins::Rte => Ok(()),
1172 Ins::Clrmac => Ok(()),
1173 #[cfg(feature = "sh3")]
1174 Ins::Clrs => Ok(()),
1175 Ins::Clrt => Ok(()),
1176 #[cfg(feature = "sh3")]
1177 Ins::Sets => Ok(()),
1178 Ins::Sett => Ok(()),
1179 Ins::Nop => Ok(()),
1180 Ins::Sleep => Ok(()),
1181 #[cfg(feature = "sh3")]
1182 Ins::Ldtlb => Ok(()),
1183 Ins::Trapa { imm } => {
1184 out.write_space()?;
1185 out.write_str("#")?;
1186 out.write_uimm(*imm as u32)?;
1187 Ok(())
1188 }
1189 Ins::StcSrRn { rn } => {
1190 out.write_space()?;
1191 out.write_str("sr, ")?;
1192 out.write_reg(*rn)?;
1193 Ok(())
1194 }
1195 Ins::StcGbrRn { rn } => {
1196 out.write_space()?;
1197 out.write_str("gbr, ")?;
1198 out.write_reg(*rn)?;
1199 Ok(())
1200 }
1201 Ins::StcVbrRn { rn } => {
1202 out.write_space()?;
1203 out.write_str("vbr, ")?;
1204 out.write_reg(*rn)?;
1205 Ok(())
1206 }
1207 #[cfg(feature = "sh3")]
1208 Ins::StcSsrRn { rn } => {
1209 out.write_space()?;
1210 out.write_str("ssr, ")?;
1211 out.write_reg(*rn)?;
1212 Ok(())
1213 }
1214 #[cfg(feature = "sh3")]
1215 Ins::StcSpcRn { rn } => {
1216 out.write_space()?;
1217 out.write_str("spc, ")?;
1218 out.write_reg(*rn)?;
1219 Ok(())
1220 }
1221 #[cfg(feature = "sh4")]
1222 Ins::StcDbrRn { rn } => {
1223 out.write_space()?;
1224 out.write_str("dbr, ")?;
1225 out.write_reg(*rn)?;
1226 Ok(())
1227 }
1228 #[cfg(feature = "sh4")]
1229 Ins::StcSgrRn { rn } => {
1230 out.write_space()?;
1231 out.write_str("sgr, ")?;
1232 out.write_reg(*rn)?;
1233 Ok(())
1234 }
1235 #[cfg(feature = "sh3")]
1236 Ins::StcBankRn { rn, bank } => {
1237 out.write_space()?;
1238 out.write_str("r")?;
1239 write!(out, "{}", bank)?;
1240 out.write_str("_bank, ")?;
1241 out.write_reg(*rn)?;
1242 Ok(())
1243 }
1244 #[cfg(feature = "sh3")]
1245 Ins::StcLoBank5Rn { rn } => {
1246 out.write_space()?;
1247 out.write_str("r5_bank, ")?;
1248 out.write_reg(*rn)?;
1249 Ok(())
1250 }
1251 #[cfg(feature = "sh3")]
1252 Ins::StcLoBank6Rn { rn } => {
1253 out.write_space()?;
1254 out.write_str("r6_bank, ")?;
1255 out.write_reg(*rn)?;
1256 Ok(())
1257 }
1258 #[cfg(feature = "sh3")]
1259 Ins::StcLoBank7Rn { rn } => {
1260 out.write_space()?;
1261 out.write_str("r7_bank, ")?;
1262 out.write_reg(*rn)?;
1263 Ok(())
1264 }
1265 Ins::StclSrAtDecRn { rn } => {
1266 out.write_space()?;
1267 out.write_str("sr, @-")?;
1268 out.write_reg(*rn)?;
1269 Ok(())
1270 }
1271 Ins::StclGbrAtDecRn { rn } => {
1272 out.write_space()?;
1273 out.write_str("gbr, @-")?;
1274 out.write_reg(*rn)?;
1275 Ok(())
1276 }
1277 Ins::StclVbrAtDecRn { rn } => {
1278 out.write_space()?;
1279 out.write_str("vbr, @-")?;
1280 out.write_reg(*rn)?;
1281 Ok(())
1282 }
1283 #[cfg(feature = "sh3")]
1284 Ins::StclSsrAtDecRn { rn } => {
1285 out.write_space()?;
1286 out.write_str("ssr, @-")?;
1287 out.write_reg(*rn)?;
1288 Ok(())
1289 }
1290 #[cfg(feature = "sh3")]
1291 Ins::StclSpcAtDecRn { rn } => {
1292 out.write_space()?;
1293 out.write_str("spc, @-")?;
1294 out.write_reg(*rn)?;
1295 Ok(())
1296 }
1297 #[cfg(feature = "sh4")]
1298 Ins::StclDbrAtDecRn { rn } => {
1299 out.write_space()?;
1300 out.write_str("dbr, @-")?;
1301 out.write_reg(*rn)?;
1302 Ok(())
1303 }
1304 #[cfg(feature = "sh4")]
1305 Ins::StclSgrAtDecRn { rn } => {
1306 out.write_space()?;
1307 out.write_str("sgr, @-")?;
1308 out.write_reg(*rn)?;
1309 Ok(())
1310 }
1311 #[cfg(feature = "sh3")]
1312 Ins::StclBankAtDecRn { rn, bank } => {
1313 out.write_space()?;
1314 out.write_str("r")?;
1315 write!(out, "{}", bank)?;
1316 out.write_str("_bank, @-")?;
1317 out.write_reg(*rn)?;
1318 Ok(())
1319 }
1320 #[cfg(feature = "sh3")]
1321 Ins::StclLoBank5AtDecRn { rn } => {
1322 out.write_space()?;
1323 out.write_str("r5_bank, @-")?;
1324 out.write_reg(*rn)?;
1325 Ok(())
1326 }
1327 #[cfg(feature = "sh3")]
1328 Ins::StclLoBank6AtDecRn { rn } => {
1329 out.write_space()?;
1330 out.write_str("r6_bank, @-")?;
1331 out.write_reg(*rn)?;
1332 Ok(())
1333 }
1334 #[cfg(feature = "sh3")]
1335 Ins::StclLoBank7AtDecRn { rn } => {
1336 out.write_space()?;
1337 out.write_str("r7_bank, @-")?;
1338 out.write_reg(*rn)?;
1339 Ok(())
1340 }
1341 Ins::LdcRmSr { rm } => {
1342 out.write_space()?;
1343 out.write_reg(*rm)?;
1344 out.write_str(", sr")?;
1345 Ok(())
1346 }
1347 Ins::LdcRmGbr { rm } => {
1348 out.write_space()?;
1349 out.write_reg(*rm)?;
1350 out.write_str(", gbr")?;
1351 Ok(())
1352 }
1353 Ins::LdcRmVbr { rm } => {
1354 out.write_space()?;
1355 out.write_reg(*rm)?;
1356 out.write_str(", vbr")?;
1357 Ok(())
1358 }
1359 #[cfg(feature = "sh3")]
1360 Ins::LdcRmSsr { rm } => {
1361 out.write_space()?;
1362 out.write_reg(*rm)?;
1363 out.write_str(", ssr")?;
1364 Ok(())
1365 }
1366 #[cfg(feature = "sh3")]
1367 Ins::LdcRmSpc { rm } => {
1368 out.write_space()?;
1369 out.write_reg(*rm)?;
1370 out.write_str(", spc")?;
1371 Ok(())
1372 }
1373 #[cfg(feature = "sh4")]
1374 Ins::LdcRmDbr { rm } => {
1375 out.write_space()?;
1376 out.write_reg(*rm)?;
1377 out.write_str(", dbr")?;
1378 Ok(())
1379 }
1380 #[cfg(feature = "sh4")]
1381 Ins::LdcRmSgr { rm } => {
1382 out.write_space()?;
1383 out.write_reg(*rm)?;
1384 out.write_str(", sgr")?;
1385 Ok(())
1386 }
1387 #[cfg(feature = "sh3")]
1388 Ins::LdcRmBank { rm, bank } => {
1389 out.write_space()?;
1390 out.write_reg(*rm)?;
1391 out.write_str(", r")?;
1392 write!(out, "{}", bank)?;
1393 out.write_str("_bank")?;
1394 Ok(())
1395 }
1396 #[cfg(feature = "sh3")]
1397 Ins::LdcRmLoBank5 { rm } => {
1398 out.write_space()?;
1399 out.write_reg(*rm)?;
1400 out.write_str(", r5_bank")?;
1401 Ok(())
1402 }
1403 #[cfg(feature = "sh3")]
1404 Ins::LdcRmLoBank6 { rm } => {
1405 out.write_space()?;
1406 out.write_reg(*rm)?;
1407 out.write_str(", r6_bank")?;
1408 Ok(())
1409 }
1410 #[cfg(feature = "sh3")]
1411 Ins::LdcRmLoBank7 { rm } => {
1412 out.write_space()?;
1413 out.write_reg(*rm)?;
1414 out.write_str(", r7_bank")?;
1415 Ok(())
1416 }
1417 Ins::LdclAtRmIncSr { rm } => {
1418 out.write_space()?;
1419 out.write_str("@")?;
1420 out.write_reg(*rm)?;
1421 out.write_str("+, sr")?;
1422 Ok(())
1423 }
1424 Ins::LdclAtRmIncGbr { rm } => {
1425 out.write_space()?;
1426 out.write_str("@")?;
1427 out.write_reg(*rm)?;
1428 out.write_str("+, gbr")?;
1429 Ok(())
1430 }
1431 Ins::LdclAtRmIncVbr { rm } => {
1432 out.write_space()?;
1433 out.write_str("@")?;
1434 out.write_reg(*rm)?;
1435 out.write_str("+, vbr")?;
1436 Ok(())
1437 }
1438 #[cfg(feature = "sh3")]
1439 Ins::LdclAtRmIncSsr { rm } => {
1440 out.write_space()?;
1441 out.write_str("@")?;
1442 out.write_reg(*rm)?;
1443 out.write_str("+, ssr")?;
1444 Ok(())
1445 }
1446 #[cfg(feature = "sh3")]
1447 Ins::LdclAtRmIncSpc { rm } => {
1448 out.write_space()?;
1449 out.write_str("@")?;
1450 out.write_reg(*rm)?;
1451 out.write_str("+, spc")?;
1452 Ok(())
1453 }
1454 #[cfg(feature = "sh4")]
1455 Ins::LdclAtRmIncDbr { rm } => {
1456 out.write_space()?;
1457 out.write_str("@")?;
1458 out.write_reg(*rm)?;
1459 out.write_str("+, dbr")?;
1460 Ok(())
1461 }
1462 #[cfg(feature = "sh4")]
1463 Ins::LdclAtRmIncSgr { rm } => {
1464 out.write_space()?;
1465 out.write_str("@")?;
1466 out.write_reg(*rm)?;
1467 out.write_str("+, sgr")?;
1468 Ok(())
1469 }
1470 #[cfg(feature = "sh3")]
1471 Ins::LdclAtRmIncBank { rm, bank } => {
1472 out.write_space()?;
1473 out.write_str("@")?;
1474 out.write_reg(*rm)?;
1475 out.write_str("+, r")?;
1476 write!(out, "{}", bank)?;
1477 out.write_str("_bank")?;
1478 Ok(())
1479 }
1480 #[cfg(feature = "sh3")]
1481 Ins::LdclAtRmIncLoBank5 { rm } => {
1482 out.write_space()?;
1483 out.write_str("@")?;
1484 out.write_reg(*rm)?;
1485 out.write_str("+, r5_bank")?;
1486 Ok(())
1487 }
1488 #[cfg(feature = "sh3")]
1489 Ins::LdclAtRmIncLoBank6 { rm } => {
1490 out.write_space()?;
1491 out.write_str("@")?;
1492 out.write_reg(*rm)?;
1493 out.write_str("+, r6_bank")?;
1494 Ok(())
1495 }
1496 #[cfg(feature = "sh3")]
1497 Ins::LdclAtRmIncLoBank7 { rm } => {
1498 out.write_space()?;
1499 out.write_str("@")?;
1500 out.write_reg(*rm)?;
1501 out.write_str("+, r7_bank")?;
1502 Ok(())
1503 }
1504 Ins::StsMachRn { rn } => {
1505 out.write_space()?;
1506 out.write_str("mach, ")?;
1507 out.write_reg(*rn)?;
1508 Ok(())
1509 }
1510 Ins::StsMaclRn { rn } => {
1511 out.write_space()?;
1512 out.write_str("macl, ")?;
1513 out.write_reg(*rn)?;
1514 Ok(())
1515 }
1516 Ins::StsPrRn { rn } => {
1517 out.write_space()?;
1518 out.write_str("pr, ")?;
1519 out.write_reg(*rn)?;
1520 Ok(())
1521 }
1522 #[cfg(feature = "sh4")]
1523 Ins::StsFpscrRn { rn } => {
1524 out.write_space()?;
1525 out.write_str("fpscr, ")?;
1526 out.write_reg(*rn)?;
1527 Ok(())
1528 }
1529 #[cfg(feature = "sh4")]
1530 Ins::StsFpulRn { rn } => {
1531 out.write_space()?;
1532 out.write_str("fpul, ")?;
1533 out.write_reg(*rn)?;
1534 Ok(())
1535 }
1536 Ins::StslMachAtDecRn { rn } => {
1537 out.write_space()?;
1538 out.write_str("mach, @-")?;
1539 out.write_reg(*rn)?;
1540 Ok(())
1541 }
1542 Ins::StslMaclAtDecRn { rn } => {
1543 out.write_space()?;
1544 out.write_str("macl, @-")?;
1545 out.write_reg(*rn)?;
1546 Ok(())
1547 }
1548 Ins::StslPrAtDecRn { rn } => {
1549 out.write_space()?;
1550 out.write_str("pr, @-")?;
1551 out.write_reg(*rn)?;
1552 Ok(())
1553 }
1554 #[cfg(feature = "sh4")]
1555 Ins::StslFpscrAtDecRn { rn } => {
1556 out.write_space()?;
1557 out.write_str("fpscr, @-")?;
1558 out.write_reg(*rn)?;
1559 Ok(())
1560 }
1561 #[cfg(feature = "sh4")]
1562 Ins::StslFpulAtDecRn { rn } => {
1563 out.write_space()?;
1564 out.write_str("fpul, @-")?;
1565 out.write_reg(*rn)?;
1566 Ok(())
1567 }
1568 Ins::LdsRmMach { rm } => {
1569 out.write_space()?;
1570 out.write_reg(*rm)?;
1571 out.write_str(", mach")?;
1572 Ok(())
1573 }
1574 Ins::LdsRmMacl { rm } => {
1575 out.write_space()?;
1576 out.write_reg(*rm)?;
1577 out.write_str(", macl")?;
1578 Ok(())
1579 }
1580 Ins::LdsRmPr { rm } => {
1581 out.write_space()?;
1582 out.write_reg(*rm)?;
1583 out.write_str(", pr")?;
1584 Ok(())
1585 }
1586 #[cfg(feature = "sh4")]
1587 Ins::LdsRmFpscr { rm } => {
1588 out.write_space()?;
1589 out.write_reg(*rm)?;
1590 out.write_str(", fpscr")?;
1591 Ok(())
1592 }
1593 #[cfg(feature = "sh4")]
1594 Ins::LdsRmFpul { rm } => {
1595 out.write_space()?;
1596 out.write_reg(*rm)?;
1597 out.write_str(", fpul")?;
1598 Ok(())
1599 }
1600 Ins::LdslAtRmIncMach { rm } => {
1601 out.write_space()?;
1602 out.write_str("@")?;
1603 out.write_reg(*rm)?;
1604 out.write_str("+, mach")?;
1605 Ok(())
1606 }
1607 Ins::LdslAtRmIncMacl { rm } => {
1608 out.write_space()?;
1609 out.write_str("@")?;
1610 out.write_reg(*rm)?;
1611 out.write_str("+, macl")?;
1612 Ok(())
1613 }
1614 Ins::LdslAtRmIncPr { rm } => {
1615 out.write_space()?;
1616 out.write_str("@")?;
1617 out.write_reg(*rm)?;
1618 out.write_str("+, pr")?;
1619 Ok(())
1620 }
1621 #[cfg(feature = "sh4")]
1622 Ins::LdslAtRmIncFpscr { rm } => {
1623 out.write_space()?;
1624 out.write_str("@")?;
1625 out.write_reg(*rm)?;
1626 out.write_str("+, fpscr")?;
1627 Ok(())
1628 }
1629 #[cfg(feature = "sh4")]
1630 Ins::LdslAtRmIncFpul { rm } => {
1631 out.write_space()?;
1632 out.write_str("@")?;
1633 out.write_reg(*rm)?;
1634 out.write_str("+, fpul")?;
1635 Ok(())
1636 }
1637 #[cfg(feature = "sh3")]
1638 Ins::PrefAtRn { rn } => {
1639 out.write_space()?;
1640 out.write_str("@")?;
1641 out.write_reg(*rn)?;
1642 Ok(())
1643 }
1644 #[cfg(feature = "sh4")]
1645 Ins::OcbiAtRn { rn } => {
1646 out.write_space()?;
1647 out.write_str("@")?;
1648 out.write_reg(*rn)?;
1649 Ok(())
1650 }
1651 #[cfg(feature = "sh4")]
1652 Ins::OcbpAtRn { rn } => {
1653 out.write_space()?;
1654 out.write_str("@")?;
1655 out.write_reg(*rn)?;
1656 Ok(())
1657 }
1658 #[cfg(feature = "sh4")]
1659 Ins::OcbwbAtRn { rn } => {
1660 out.write_space()?;
1661 out.write_str("@")?;
1662 out.write_reg(*rn)?;
1663 Ok(())
1664 }
1665 #[cfg(feature = "sh4")]
1666 Ins::FaddFrmFrn { frn, frm } => {
1667 out.write_space()?;
1668 out.write_freg(*frm)?;
1669 out.write_separator()?;
1670 out.write_freg(*frn)?;
1671 Ok(())
1672 }
1673 #[cfg(feature = "sh4")]
1674 Ins::FsubFrmFrn { frn, frm } => {
1675 out.write_space()?;
1676 out.write_freg(*frm)?;
1677 out.write_separator()?;
1678 out.write_freg(*frn)?;
1679 Ok(())
1680 }
1681 #[cfg(feature = "sh4")]
1682 Ins::FmulFrmFrn { frn, frm } => {
1683 out.write_space()?;
1684 out.write_freg(*frm)?;
1685 out.write_separator()?;
1686 out.write_freg(*frn)?;
1687 Ok(())
1688 }
1689 #[cfg(feature = "sh4")]
1690 Ins::FdivFrmFrn { frn, frm } => {
1691 out.write_space()?;
1692 out.write_freg(*frm)?;
1693 out.write_separator()?;
1694 out.write_freg(*frn)?;
1695 Ok(())
1696 }
1697 #[cfg(feature = "sh4")]
1698 Ins::FcmpeqFrmFrn { frn, frm } => {
1699 out.write_space()?;
1700 out.write_freg(*frm)?;
1701 out.write_separator()?;
1702 out.write_freg(*frn)?;
1703 Ok(())
1704 }
1705 #[cfg(feature = "sh4")]
1706 Ins::FcmpgtFrmFrn { frn, frm } => {
1707 out.write_space()?;
1708 out.write_freg(*frm)?;
1709 out.write_separator()?;
1710 out.write_freg(*frn)?;
1711 Ok(())
1712 }
1713 #[cfg(feature = "sh4")]
1714 Ins::FmovAtR0RmFrn { frn, rm } => {
1715 out.write_space()?;
1716 out.write_str("@(r0, ")?;
1717 out.write_reg(*rm)?;
1718 out.write_str("), ")?;
1719 out.write_freg(*frn)?;
1720 Ok(())
1721 }
1722 #[cfg(feature = "sh4")]
1723 Ins::FmovFrmAtR0Rn { rn, frm } => {
1724 out.write_space()?;
1725 out.write_freg(*frm)?;
1726 out.write_str(", @(r0, ")?;
1727 out.write_reg(*rn)?;
1728 out.write_str(")")?;
1729 Ok(())
1730 }
1731 #[cfg(feature = "sh4")]
1732 Ins::FmovAtRmFrn { frn, rm } => {
1733 out.write_space()?;
1734 out.write_str("@")?;
1735 out.write_reg(*rm)?;
1736 out.write_separator()?;
1737 out.write_freg(*frn)?;
1738 Ok(())
1739 }
1740 #[cfg(feature = "sh4")]
1741 Ins::FmovAtRmIncFrn { frn, rm } => {
1742 out.write_space()?;
1743 out.write_str("@")?;
1744 out.write_reg(*rm)?;
1745 out.write_str("+, ")?;
1746 out.write_freg(*frn)?;
1747 Ok(())
1748 }
1749 #[cfg(feature = "sh4")]
1750 Ins::FmovFrmAtRn { rn, frm } => {
1751 out.write_space()?;
1752 out.write_freg(*frm)?;
1753 out.write_str(", @")?;
1754 out.write_reg(*rn)?;
1755 Ok(())
1756 }
1757 #[cfg(feature = "sh4")]
1758 Ins::FmovFrmAtDecRn { rn, frm } => {
1759 out.write_space()?;
1760 out.write_freg(*frm)?;
1761 out.write_str(", @-")?;
1762 out.write_reg(*rn)?;
1763 Ok(())
1764 }
1765 #[cfg(feature = "sh4")]
1766 Ins::FmovFrmFrn { frn, frm } => {
1767 out.write_space()?;
1768 out.write_freg(*frm)?;
1769 out.write_separator()?;
1770 out.write_freg(*frn)?;
1771 Ok(())
1772 }
1773 #[cfg(feature = "sh4")]
1774 Ins::FstsFpulFrn { frn } => {
1775 out.write_space()?;
1776 out.write_str("fpul, ")?;
1777 out.write_freg(*frn)?;
1778 Ok(())
1779 }
1780 #[cfg(feature = "sh4")]
1781 Ins::FldsFrnFpul { frn } => {
1782 out.write_space()?;
1783 out.write_freg(*frn)?;
1784 out.write_str(", fpul")?;
1785 Ok(())
1786 }
1787 #[cfg(feature = "sh4")]
1788 Ins::FloatFpulFrn { frn } => {
1789 out.write_space()?;
1790 out.write_str("fpul, ")?;
1791 out.write_freg(*frn)?;
1792 Ok(())
1793 }
1794 #[cfg(feature = "sh4")]
1795 Ins::FtrcFrnFpul { frn } => {
1796 out.write_space()?;
1797 out.write_freg(*frn)?;
1798 out.write_str(", fpul")?;
1799 Ok(())
1800 }
1801 #[cfg(feature = "sh4")]
1802 Ins::FnegFrn { frn } => {
1803 out.write_space()?;
1804 out.write_freg(*frn)?;
1805 Ok(())
1806 }
1807 #[cfg(feature = "sh4")]
1808 Ins::FabsFrn { frn } => {
1809 out.write_space()?;
1810 out.write_freg(*frn)?;
1811 Ok(())
1812 }
1813 #[cfg(feature = "sh4")]
1814 Ins::FsqrtFrn { frn } => {
1815 out.write_space()?;
1816 out.write_freg(*frn)?;
1817 Ok(())
1818 }
1819 #[cfg(feature = "sh4")]
1820 Ins::Fldi0Frn { frn } => {
1821 out.write_space()?;
1822 out.write_freg(*frn)?;
1823 Ok(())
1824 }
1825 #[cfg(feature = "sh4")]
1826 Ins::Fldi1Frn { frn } => {
1827 out.write_space()?;
1828 out.write_freg(*frn)?;
1829 Ok(())
1830 }
1831 #[cfg(feature = "sh4")]
1832 Ins::FmacFr0FrmFrn { frn, frm } => {
1833 out.write_space()?;
1834 out.write_str("fr0, ")?;
1835 out.write_freg(*frm)?;
1836 out.write_separator()?;
1837 out.write_freg(*frn)?;
1838 Ok(())
1839 }
1840 #[cfg(feature = "sh4")]
1841 Ins::FcnvsdFpulDrn { drn } => {
1842 out.write_space()?;
1843 out.write_str("fpul, ")?;
1844 out.write_dreg(*drn)?;
1845 Ok(())
1846 }
1847 #[cfg(feature = "sh4")]
1848 Ins::FcnvdsDrnFpul { drn } => {
1849 out.write_space()?;
1850 out.write_dreg(*drn)?;
1851 out.write_str(", fpul")?;
1852 Ok(())
1853 }
1854 #[cfg(feature = "sh4")]
1855 Ins::FiprFvmFvn { fvn, fvm } => {
1856 out.write_space()?;
1857 out.write_vecreg(*fvm)?;
1858 out.write_separator()?;
1859 out.write_vecreg(*fvn)?;
1860 Ok(())
1861 }
1862 #[cfg(feature = "sh4")]
1863 Ins::FtrvXmtrxFvn { fvn } => {
1864 out.write_space()?;
1865 out.write_str("xmtrx, ")?;
1866 out.write_vecreg(*fvn)?;
1867 Ok(())
1868 }
1869 #[cfg(feature = "sh4")]
1870 Ins::FsrraFrn { frn } => {
1871 out.write_space()?;
1872 out.write_freg(*frn)?;
1873 Ok(())
1874 }
1875 #[cfg(feature = "sh4")]
1876 Ins::FscaFpulDrn { drn } => {
1877 out.write_space()?;
1878 out.write_str("fpul, ")?;
1879 out.write_dreg(*drn)?;
1880 Ok(())
1881 }
1882 #[cfg(feature = "sh4")]
1883 Ins::Fschg => Ok(()),
1884 #[cfg(feature = "sh4")]
1885 Ins::Frchg => Ok(()),
1886 Ins::Word(w) => {
1887 out.write_space()?;
1888 write!(out, "0x{:04x}", w)
1889 }
1890 Ins::Byte(b) => {
1891 out.write_space()?;
1892 write!(out, "0x{:02x}", b)
1893 }
1894 Ins::Long(l) => {
1895 out.write_space()?;
1896 write!(out, "0x{:08x}", l)
1897 }
1898 }
1899 }
1900}