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 .globl fp_fscc, fp_fbccw, fp_fbccl
45 printf PDECODE,"fnop\n"
48 #define fp_fnop fp_end
54 printf PDECODE,"fbccw "
56 lea (-2,%a0,%d2.w),%a0
60 printf PDECODE,"fbccl "
64 fp_get_instr_word %d0,fp_err_ua1
65 lea (-2,%a0,%d0.l),%a0
66 1: printf PDECODE,"%x",1,%a0
73 1: printf PDECODE,"\n"
77 printf PDECODE,"fdbcc "
78 fp_get_pc %a1 | calculate new pc
79 fp_get_instr_word %d0,fp_err_ua1
82 printf PDECODE,"d%d,%x\n",2,%d0,%a1
83 swap %d1 | test condition in %d1
91 1: jsr fp_put_data_reg
94 | set flags for decode macros for fs<cc>
99 printf PDECODE,"fscc "
105 | decode addressing mode
108 .long fp_data, fp_fdbcc
109 .long fp_indirect, fp_postinc
110 .long fp_predecr, fp_disp16
111 .long fp_extmode0, fp_extmode1
113 | addressing mode: data register direct
116 move.w %d0,%d1 | save register nr
126 fp_mode_addr_indirect
130 fp_mode_addr_indirect_postinc
134 fp_mode_addr_indirect_predec
138 fp_mode_addr_indirect_disp16
142 fp_mode_addr_indirect_extmode0
146 bfextu %d2{#13,#3},%d0
147 jmp ([0f:w,%pc,%d0*4])
151 .long fp_absolute_short, fp_absolute_long
152 .long fp_ill, fp_ill | NOTE: jump here to ftrap.x
166 putuser.b %d1,(%a0),fp_err_ua1,%a0
171 #define tst_NAN btst #24,%d1
172 #define tst_Z btst #26,%d1
173 #define tst_N btst #27,%d1
176 move.l (FPD_FPSR,FPDATA),%d1
183 move.l %d1,(FPD_FPSR,FPDATA)
185 jmp ([0f:w,%pc,%d0.w*4])
189 .long fp_f , fp_eq , fp_ogt, fp_oge
190 .long fp_olt, fp_ole, fp_ogl, fp_or
191 .long fp_un , fp_ueq, fp_ugt, fp_uge
192 .long fp_ult, fp_ule, fp_ne , fp_t