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
183 | set flags for decode macros for fmovem control register
188 printf PDECODE,"fmovem.cr "
189 | get register list and count them
190 bfextu %d2{#19,#3},%d0
198 printf PDECODE,"#%08x",1,%d1
202 printf PDECODE,"->" | fpu -> cpu
204 1: printf PDECODE,"<-" | fpu <- cpu
208 | decode address mode
211 .long fpc_data, fpc_addr
212 .long fpc_indirect, fpc_postinc
213 .long fpc_predecr, fpc_disp16
214 .long fpc_extmode0, fpc_extmode1
219 bfffo %d2{#19,#3},%d0
221 lea (FPD_FPCR,FPDATA,%d0.w*4),%a1
234 printf PDECODE,"a%d",1,%d0
238 move.l %a0,(FPD_FPIAR,FPDATA)
240 1: move.l (FPD_FPIAR,FPDATA),%a0
245 fp_mode_addr_indirect
249 fp_mode_addr_indirect_postinc
253 fp_mode_addr_indirect_predec
257 fp_mode_addr_indirect_disp16
261 fp_mode_addr_indirect_extmode0
266 jmp ([0f:w,%pc,%d0*4])
270 .long fpc_absolute_short, fpc_absolute_long
271 .long fpc_disp16, fpc_extmode0
272 .long fpc_immediate, fp_ill
285 lea (%a0,%d1.w*4),%a1
287 printf PDECODE,"#imm"
291 swap %d1 | get fpu register list
293 lea (FPD_FPCR,FPDATA),%a1
297 | move register from memory into fpu
299 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1
300 getuser.l (%a0)+,%d0,fp_err_ua1,%a0
308 | move register from fpu into memory
309 1: printf PMOVEM,"(%p>%p)",2,%a1,%a0
311 putuser.l %d0,(%a0)+,fp_err_ua1,%a0
318 and.l #0x0000fff0,(FPD_FPCR,FPDATA)
319 and.l #0x0ffffff8,(FPD_FPSR,FPDATA)
320 move.l (FPD_FPCR,FPDATA),%d0
324 move.w %d1,(FPD_RND,FPDATA)
328 move.w %d1,(FPD_PREC,FPDATA)