4 * Copyright Roman Zippel, 1997. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, and the entire permission notice in its entirety,
11 * including the disclaimer of warranties.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote
16 * products derived from this software without specific prior
19 * ALTERNATIVELY, this product may be distributed under the terms of
20 * the GNU General Public License, in which case the provisions of the GPL are
21 * required INSTEAD OF the above restrictions. (This clause is
22 * necessary due to a potential bad interaction between the GPL and
23 * the restrictions contained in a BSD-style copyright.)
25 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35 * OF THE POSSIBILITY OF SUCH DAMAGE.
39 #include "fp_decode.h"
41 | set flags for decode macros for fmovem
44 .globl fp_fmovem_fp, fp_fmovem_cr
46 | %d1 contains the mask and count of the register list
47 | for other register usage see fp_decode.h
50 printf PDECODE,"fmovem.x "
51 | get register list and count them
54 bfextu %d2{#24,#8},%d0 | static register list
56 1: bfextu %d2{#25,#3},%d0 | dynamic register list
61 1: addq.w #1,%d1 | count the # of registers in
62 2: lsr.b #1,%d0 | register list and keep it in %d1
65 printf PDECODE,"#%08x",1,%d1
69 printf PDECODE,"-" | decremental move
71 1: printf PDECODE,"+" | incremental move
74 printf PDECODE,"->" | fpu -> cpu
76 1: printf PDECODE,"<-" | fpu <- cpu
84 .long fpr_indirect, fpr_postinc
85 .long fpr_predecr, fpr_disp16
86 .long fpr_extmode0, fpr_extmode1
88 | addressing mode: address register indirect
93 | addressing mode: address register indirect with postincrement
95 fp_mode_addr_indirect_postinc
99 fp_mode_addr_indirect_predec
102 | addressing mode: address register/programm counter indirect
103 | with 16bit displacement
105 fp_mode_addr_indirect_disp16
109 fp_mode_addr_indirect_extmode0
114 jmp ([0f:w,%pc,%d0*4])
118 .long fpr_absolute_short, fpr_absolute_long
119 .long fpr_disp16, fpr_extmode0
132 swap %d1 | get fpu register list
133 lea (FPD_FPREG,FPDATA),%a1
137 lea (-12,%a1,%d0*8),%a1
141 | move register from memory into fpu
143 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1
144 getuser.l (%a0)+,%d2,fp_err_ua1,%a0
149 getuser.l (%a0)+,%d2,fp_err_ua1,%a0
151 getuser.l (%a0),%d2,fp_err_ua1,%a0
161 | move register from fpu into memory
162 1: printf PMOVEM,"(%p>%p)",2,%a1,%a0
167 putuser.l %d2,(%a0)+,fp_err_ua1,%a0
169 putuser.l %d2,(%a0)+,fp_err_ua1,%a0
171 putuser.l %d2,(%a0),fp_err_ua1,%a0
182 lea (FPD_FPREG,FPDATA),%a0
184 printx PMOVEM,%a0@(0)
185 printx PMOVEM,%a0@(12)
187 printx PMOVEM,%a0@(24)
188 printx PMOVEM,%a0@(36)
190 printx PMOVEM,%a0@(48)
191 printx PMOVEM,%a0@(60)
193 printx PMOVEM,%a0@(72)
194 printx PMOVEM,%a0@(84)
199 | set flags for decode macros for fmovem control register
204 printf PDECODE,"fmovem.cr "
205 | get register list and count them
206 bfextu %d2{#19,#3},%d0
214 printf PDECODE,"#%08x",1,%d1
218 printf PDECODE,"->" | fpu -> cpu
220 1: printf PDECODE,"<-" | fpu <- cpu
224 | decode address mode
227 .long fpc_data, fpc_addr
228 .long fpc_indirect, fpc_postinc
229 .long fpc_predecr, fpc_disp16
230 .long fpc_extmode0, fpc_extmode1
235 bfffo %d2{#19,#3},%d0
237 lea (FPD_FPCR,FPDATA,%d0.w*4),%a1
250 printf PDECODE,"a%d",1,%d0
254 move.l %a0,(FPD_FPIAR,FPDATA)
256 1: move.l (FPD_FPIAR,FPDATA),%a0
261 fp_mode_addr_indirect
265 fp_mode_addr_indirect_postinc
269 fp_mode_addr_indirect_predec
273 fp_mode_addr_indirect_disp16
277 fp_mode_addr_indirect_extmode0
282 jmp ([0f:w,%pc,%d0*4])
286 .long fpc_absolute_short, fpc_absolute_long
287 .long fpc_disp16, fpc_extmode0
288 .long fpc_immediate, fp_ill
301 lea (%a0,%d1.w*4),%a1
303 printf PDECODE,"#imm"
308 lea (FPD_FPCR,FPDATA),%a0
319 swap %d1 | get fpu register list
321 lea (FPD_FPCR,FPDATA),%a1
325 | move register from memory into fpu
327 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1
328 getuser.l (%a0)+,%d0,fp_err_ua1,%a0
336 | move register from fpu into memory
337 1: printf PMOVEM,"(%p>%p)",2,%a1,%a0
339 putuser.l %d0,(%a0)+,fp_err_ua1,%a0
346 and.l #0x0000fff0,(FPD_FPCR,FPDATA)
347 and.l #0x0ffffff8,(FPD_FPSR,FPDATA)
348 move.l (FPD_FPCR,FPDATA),%d0
352 move.w %d1,(FPD_RND,FPDATA)
356 move.w %d1,(FPD_PREC,FPDATA)
359 printf PMOVEM,"fpcr : %08x\n",1,FPDATA@(FPD_FPCR)
360 printf PMOVEM,"fpsr : %08x\n",1,FPDATA@(FPD_FPSR)
361 printf PMOVEM,"fpiar: %08x\n",1,FPDATA@(FPD_FPIAR)
363 move.w (FPD_PREC,FPDATA),%d0
364 printf PMOVEM,"prec : %04x\n",1,%d0
365 move.w (FPD_RND,FPDATA),%d0
366 printf PMOVEM,"rnd : %04x\n",1,%d0