1 /* Simulator instruction semantics for sh64.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2005 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { SH64_COMPACT_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
36 { SH64_COMPACT_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
37 { SH64_COMPACT_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
38 { SH64_COMPACT_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
39 { SH64_COMPACT_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
40 { SH64_COMPACT_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
41 { SH64_COMPACT_INSN_ADD_COMPACT
, && case_sem_INSN_ADD_COMPACT
},
42 { SH64_COMPACT_INSN_ADDI_COMPACT
, && case_sem_INSN_ADDI_COMPACT
},
43 { SH64_COMPACT_INSN_ADDC_COMPACT
, && case_sem_INSN_ADDC_COMPACT
},
44 { SH64_COMPACT_INSN_ADDV_COMPACT
, && case_sem_INSN_ADDV_COMPACT
},
45 { SH64_COMPACT_INSN_AND_COMPACT
, && case_sem_INSN_AND_COMPACT
},
46 { SH64_COMPACT_INSN_ANDI_COMPACT
, && case_sem_INSN_ANDI_COMPACT
},
47 { SH64_COMPACT_INSN_ANDB_COMPACT
, && case_sem_INSN_ANDB_COMPACT
},
48 { SH64_COMPACT_INSN_BF_COMPACT
, && case_sem_INSN_BF_COMPACT
},
49 { SH64_COMPACT_INSN_BFS_COMPACT
, && case_sem_INSN_BFS_COMPACT
},
50 { SH64_COMPACT_INSN_BRA_COMPACT
, && case_sem_INSN_BRA_COMPACT
},
51 { SH64_COMPACT_INSN_BRAF_COMPACT
, && case_sem_INSN_BRAF_COMPACT
},
52 { SH64_COMPACT_INSN_BRK_COMPACT
, && case_sem_INSN_BRK_COMPACT
},
53 { SH64_COMPACT_INSN_BSR_COMPACT
, && case_sem_INSN_BSR_COMPACT
},
54 { SH64_COMPACT_INSN_BSRF_COMPACT
, && case_sem_INSN_BSRF_COMPACT
},
55 { SH64_COMPACT_INSN_BT_COMPACT
, && case_sem_INSN_BT_COMPACT
},
56 { SH64_COMPACT_INSN_BTS_COMPACT
, && case_sem_INSN_BTS_COMPACT
},
57 { SH64_COMPACT_INSN_CLRMAC_COMPACT
, && case_sem_INSN_CLRMAC_COMPACT
},
58 { SH64_COMPACT_INSN_CLRS_COMPACT
, && case_sem_INSN_CLRS_COMPACT
},
59 { SH64_COMPACT_INSN_CLRT_COMPACT
, && case_sem_INSN_CLRT_COMPACT
},
60 { SH64_COMPACT_INSN_CMPEQ_COMPACT
, && case_sem_INSN_CMPEQ_COMPACT
},
61 { SH64_COMPACT_INSN_CMPEQI_COMPACT
, && case_sem_INSN_CMPEQI_COMPACT
},
62 { SH64_COMPACT_INSN_CMPGE_COMPACT
, && case_sem_INSN_CMPGE_COMPACT
},
63 { SH64_COMPACT_INSN_CMPGT_COMPACT
, && case_sem_INSN_CMPGT_COMPACT
},
64 { SH64_COMPACT_INSN_CMPHI_COMPACT
, && case_sem_INSN_CMPHI_COMPACT
},
65 { SH64_COMPACT_INSN_CMPHS_COMPACT
, && case_sem_INSN_CMPHS_COMPACT
},
66 { SH64_COMPACT_INSN_CMPPL_COMPACT
, && case_sem_INSN_CMPPL_COMPACT
},
67 { SH64_COMPACT_INSN_CMPPZ_COMPACT
, && case_sem_INSN_CMPPZ_COMPACT
},
68 { SH64_COMPACT_INSN_CMPSTR_COMPACT
, && case_sem_INSN_CMPSTR_COMPACT
},
69 { SH64_COMPACT_INSN_DIV0S_COMPACT
, && case_sem_INSN_DIV0S_COMPACT
},
70 { SH64_COMPACT_INSN_DIV0U_COMPACT
, && case_sem_INSN_DIV0U_COMPACT
},
71 { SH64_COMPACT_INSN_DIV1_COMPACT
, && case_sem_INSN_DIV1_COMPACT
},
72 { SH64_COMPACT_INSN_DIVU_COMPACT
, && case_sem_INSN_DIVU_COMPACT
},
73 { SH64_COMPACT_INSN_MULR_COMPACT
, && case_sem_INSN_MULR_COMPACT
},
74 { SH64_COMPACT_INSN_DMULSL_COMPACT
, && case_sem_INSN_DMULSL_COMPACT
},
75 { SH64_COMPACT_INSN_DMULUL_COMPACT
, && case_sem_INSN_DMULUL_COMPACT
},
76 { SH64_COMPACT_INSN_DT_COMPACT
, && case_sem_INSN_DT_COMPACT
},
77 { SH64_COMPACT_INSN_EXTSB_COMPACT
, && case_sem_INSN_EXTSB_COMPACT
},
78 { SH64_COMPACT_INSN_EXTSW_COMPACT
, && case_sem_INSN_EXTSW_COMPACT
},
79 { SH64_COMPACT_INSN_EXTUB_COMPACT
, && case_sem_INSN_EXTUB_COMPACT
},
80 { SH64_COMPACT_INSN_EXTUW_COMPACT
, && case_sem_INSN_EXTUW_COMPACT
},
81 { SH64_COMPACT_INSN_FABS_COMPACT
, && case_sem_INSN_FABS_COMPACT
},
82 { SH64_COMPACT_INSN_FADD_COMPACT
, && case_sem_INSN_FADD_COMPACT
},
83 { SH64_COMPACT_INSN_FCMPEQ_COMPACT
, && case_sem_INSN_FCMPEQ_COMPACT
},
84 { SH64_COMPACT_INSN_FCMPGT_COMPACT
, && case_sem_INSN_FCMPGT_COMPACT
},
85 { SH64_COMPACT_INSN_FCNVDS_COMPACT
, && case_sem_INSN_FCNVDS_COMPACT
},
86 { SH64_COMPACT_INSN_FCNVSD_COMPACT
, && case_sem_INSN_FCNVSD_COMPACT
},
87 { SH64_COMPACT_INSN_FDIV_COMPACT
, && case_sem_INSN_FDIV_COMPACT
},
88 { SH64_COMPACT_INSN_FIPR_COMPACT
, && case_sem_INSN_FIPR_COMPACT
},
89 { SH64_COMPACT_INSN_FLDS_COMPACT
, && case_sem_INSN_FLDS_COMPACT
},
90 { SH64_COMPACT_INSN_FLDI0_COMPACT
, && case_sem_INSN_FLDI0_COMPACT
},
91 { SH64_COMPACT_INSN_FLDI1_COMPACT
, && case_sem_INSN_FLDI1_COMPACT
},
92 { SH64_COMPACT_INSN_FLOAT_COMPACT
, && case_sem_INSN_FLOAT_COMPACT
},
93 { SH64_COMPACT_INSN_FMAC_COMPACT
, && case_sem_INSN_FMAC_COMPACT
},
94 { SH64_COMPACT_INSN_FMOV1_COMPACT
, && case_sem_INSN_FMOV1_COMPACT
},
95 { SH64_COMPACT_INSN_FMOV2_COMPACT
, && case_sem_INSN_FMOV2_COMPACT
},
96 { SH64_COMPACT_INSN_FMOV3_COMPACT
, && case_sem_INSN_FMOV3_COMPACT
},
97 { SH64_COMPACT_INSN_FMOV4_COMPACT
, && case_sem_INSN_FMOV4_COMPACT
},
98 { SH64_COMPACT_INSN_FMOV5_COMPACT
, && case_sem_INSN_FMOV5_COMPACT
},
99 { SH64_COMPACT_INSN_FMOV6_COMPACT
, && case_sem_INSN_FMOV6_COMPACT
},
100 { SH64_COMPACT_INSN_FMOV7_COMPACT
, && case_sem_INSN_FMOV7_COMPACT
},
101 { SH64_COMPACT_INSN_FMOV8_COMPACT
, && case_sem_INSN_FMOV8_COMPACT
},
102 { SH64_COMPACT_INSN_FMOV9_COMPACT
, && case_sem_INSN_FMOV9_COMPACT
},
103 { SH64_COMPACT_INSN_FMUL_COMPACT
, && case_sem_INSN_FMUL_COMPACT
},
104 { SH64_COMPACT_INSN_FNEG_COMPACT
, && case_sem_INSN_FNEG_COMPACT
},
105 { SH64_COMPACT_INSN_FRCHG_COMPACT
, && case_sem_INSN_FRCHG_COMPACT
},
106 { SH64_COMPACT_INSN_FSCHG_COMPACT
, && case_sem_INSN_FSCHG_COMPACT
},
107 { SH64_COMPACT_INSN_FSQRT_COMPACT
, && case_sem_INSN_FSQRT_COMPACT
},
108 { SH64_COMPACT_INSN_FSTS_COMPACT
, && case_sem_INSN_FSTS_COMPACT
},
109 { SH64_COMPACT_INSN_FSUB_COMPACT
, && case_sem_INSN_FSUB_COMPACT
},
110 { SH64_COMPACT_INSN_FTRC_COMPACT
, && case_sem_INSN_FTRC_COMPACT
},
111 { SH64_COMPACT_INSN_FTRV_COMPACT
, && case_sem_INSN_FTRV_COMPACT
},
112 { SH64_COMPACT_INSN_JMP_COMPACT
, && case_sem_INSN_JMP_COMPACT
},
113 { SH64_COMPACT_INSN_JSR_COMPACT
, && case_sem_INSN_JSR_COMPACT
},
114 { SH64_COMPACT_INSN_LDC_GBR_COMPACT
, && case_sem_INSN_LDC_GBR_COMPACT
},
115 { SH64_COMPACT_INSN_LDC_VBR_COMPACT
, && case_sem_INSN_LDC_VBR_COMPACT
},
116 { SH64_COMPACT_INSN_LDC_SR_COMPACT
, && case_sem_INSN_LDC_SR_COMPACT
},
117 { SH64_COMPACT_INSN_LDCL_GBR_COMPACT
, && case_sem_INSN_LDCL_GBR_COMPACT
},
118 { SH64_COMPACT_INSN_LDCL_VBR_COMPACT
, && case_sem_INSN_LDCL_VBR_COMPACT
},
119 { SH64_COMPACT_INSN_LDS_FPSCR_COMPACT
, && case_sem_INSN_LDS_FPSCR_COMPACT
},
120 { SH64_COMPACT_INSN_LDSL_FPSCR_COMPACT
, && case_sem_INSN_LDSL_FPSCR_COMPACT
},
121 { SH64_COMPACT_INSN_LDS_FPUL_COMPACT
, && case_sem_INSN_LDS_FPUL_COMPACT
},
122 { SH64_COMPACT_INSN_LDSL_FPUL_COMPACT
, && case_sem_INSN_LDSL_FPUL_COMPACT
},
123 { SH64_COMPACT_INSN_LDS_MACH_COMPACT
, && case_sem_INSN_LDS_MACH_COMPACT
},
124 { SH64_COMPACT_INSN_LDSL_MACH_COMPACT
, && case_sem_INSN_LDSL_MACH_COMPACT
},
125 { SH64_COMPACT_INSN_LDS_MACL_COMPACT
, && case_sem_INSN_LDS_MACL_COMPACT
},
126 { SH64_COMPACT_INSN_LDSL_MACL_COMPACT
, && case_sem_INSN_LDSL_MACL_COMPACT
},
127 { SH64_COMPACT_INSN_LDS_PR_COMPACT
, && case_sem_INSN_LDS_PR_COMPACT
},
128 { SH64_COMPACT_INSN_LDSL_PR_COMPACT
, && case_sem_INSN_LDSL_PR_COMPACT
},
129 { SH64_COMPACT_INSN_MACL_COMPACT
, && case_sem_INSN_MACL_COMPACT
},
130 { SH64_COMPACT_INSN_MACW_COMPACT
, && case_sem_INSN_MACW_COMPACT
},
131 { SH64_COMPACT_INSN_MOV_COMPACT
, && case_sem_INSN_MOV_COMPACT
},
132 { SH64_COMPACT_INSN_MOVI_COMPACT
, && case_sem_INSN_MOVI_COMPACT
},
133 { SH64_COMPACT_INSN_MOVI20_COMPACT
, && case_sem_INSN_MOVI20_COMPACT
},
134 { SH64_COMPACT_INSN_MOVB1_COMPACT
, && case_sem_INSN_MOVB1_COMPACT
},
135 { SH64_COMPACT_INSN_MOVB2_COMPACT
, && case_sem_INSN_MOVB2_COMPACT
},
136 { SH64_COMPACT_INSN_MOVB3_COMPACT
, && case_sem_INSN_MOVB3_COMPACT
},
137 { SH64_COMPACT_INSN_MOVB4_COMPACT
, && case_sem_INSN_MOVB4_COMPACT
},
138 { SH64_COMPACT_INSN_MOVB5_COMPACT
, && case_sem_INSN_MOVB5_COMPACT
},
139 { SH64_COMPACT_INSN_MOVB6_COMPACT
, && case_sem_INSN_MOVB6_COMPACT
},
140 { SH64_COMPACT_INSN_MOVB7_COMPACT
, && case_sem_INSN_MOVB7_COMPACT
},
141 { SH64_COMPACT_INSN_MOVB8_COMPACT
, && case_sem_INSN_MOVB8_COMPACT
},
142 { SH64_COMPACT_INSN_MOVB9_COMPACT
, && case_sem_INSN_MOVB9_COMPACT
},
143 { SH64_COMPACT_INSN_MOVB10_COMPACT
, && case_sem_INSN_MOVB10_COMPACT
},
144 { SH64_COMPACT_INSN_MOVL1_COMPACT
, && case_sem_INSN_MOVL1_COMPACT
},
145 { SH64_COMPACT_INSN_MOVL2_COMPACT
, && case_sem_INSN_MOVL2_COMPACT
},
146 { SH64_COMPACT_INSN_MOVL3_COMPACT
, && case_sem_INSN_MOVL3_COMPACT
},
147 { SH64_COMPACT_INSN_MOVL4_COMPACT
, && case_sem_INSN_MOVL4_COMPACT
},
148 { SH64_COMPACT_INSN_MOVL5_COMPACT
, && case_sem_INSN_MOVL5_COMPACT
},
149 { SH64_COMPACT_INSN_MOVL6_COMPACT
, && case_sem_INSN_MOVL6_COMPACT
},
150 { SH64_COMPACT_INSN_MOVL7_COMPACT
, && case_sem_INSN_MOVL7_COMPACT
},
151 { SH64_COMPACT_INSN_MOVL8_COMPACT
, && case_sem_INSN_MOVL8_COMPACT
},
152 { SH64_COMPACT_INSN_MOVL9_COMPACT
, && case_sem_INSN_MOVL9_COMPACT
},
153 { SH64_COMPACT_INSN_MOVL10_COMPACT
, && case_sem_INSN_MOVL10_COMPACT
},
154 { SH64_COMPACT_INSN_MOVL11_COMPACT
, && case_sem_INSN_MOVL11_COMPACT
},
155 { SH64_COMPACT_INSN_MOVL12_COMPACT
, && case_sem_INSN_MOVL12_COMPACT
},
156 { SH64_COMPACT_INSN_MOVL13_COMPACT
, && case_sem_INSN_MOVL13_COMPACT
},
157 { SH64_COMPACT_INSN_MOVW1_COMPACT
, && case_sem_INSN_MOVW1_COMPACT
},
158 { SH64_COMPACT_INSN_MOVW2_COMPACT
, && case_sem_INSN_MOVW2_COMPACT
},
159 { SH64_COMPACT_INSN_MOVW3_COMPACT
, && case_sem_INSN_MOVW3_COMPACT
},
160 { SH64_COMPACT_INSN_MOVW4_COMPACT
, && case_sem_INSN_MOVW4_COMPACT
},
161 { SH64_COMPACT_INSN_MOVW5_COMPACT
, && case_sem_INSN_MOVW5_COMPACT
},
162 { SH64_COMPACT_INSN_MOVW6_COMPACT
, && case_sem_INSN_MOVW6_COMPACT
},
163 { SH64_COMPACT_INSN_MOVW7_COMPACT
, && case_sem_INSN_MOVW7_COMPACT
},
164 { SH64_COMPACT_INSN_MOVW8_COMPACT
, && case_sem_INSN_MOVW8_COMPACT
},
165 { SH64_COMPACT_INSN_MOVW9_COMPACT
, && case_sem_INSN_MOVW9_COMPACT
},
166 { SH64_COMPACT_INSN_MOVW10_COMPACT
, && case_sem_INSN_MOVW10_COMPACT
},
167 { SH64_COMPACT_INSN_MOVW11_COMPACT
, && case_sem_INSN_MOVW11_COMPACT
},
168 { SH64_COMPACT_INSN_MOVA_COMPACT
, && case_sem_INSN_MOVA_COMPACT
},
169 { SH64_COMPACT_INSN_MOVCAL_COMPACT
, && case_sem_INSN_MOVCAL_COMPACT
},
170 { SH64_COMPACT_INSN_MOVCOL_COMPACT
, && case_sem_INSN_MOVCOL_COMPACT
},
171 { SH64_COMPACT_INSN_MOVT_COMPACT
, && case_sem_INSN_MOVT_COMPACT
},
172 { SH64_COMPACT_INSN_MOVUAL_COMPACT
, && case_sem_INSN_MOVUAL_COMPACT
},
173 { SH64_COMPACT_INSN_MOVUAL2_COMPACT
, && case_sem_INSN_MOVUAL2_COMPACT
},
174 { SH64_COMPACT_INSN_MULL_COMPACT
, && case_sem_INSN_MULL_COMPACT
},
175 { SH64_COMPACT_INSN_MULSW_COMPACT
, && case_sem_INSN_MULSW_COMPACT
},
176 { SH64_COMPACT_INSN_MULUW_COMPACT
, && case_sem_INSN_MULUW_COMPACT
},
177 { SH64_COMPACT_INSN_NEG_COMPACT
, && case_sem_INSN_NEG_COMPACT
},
178 { SH64_COMPACT_INSN_NEGC_COMPACT
, && case_sem_INSN_NEGC_COMPACT
},
179 { SH64_COMPACT_INSN_NOP_COMPACT
, && case_sem_INSN_NOP_COMPACT
},
180 { SH64_COMPACT_INSN_NOT_COMPACT
, && case_sem_INSN_NOT_COMPACT
},
181 { SH64_COMPACT_INSN_OCBI_COMPACT
, && case_sem_INSN_OCBI_COMPACT
},
182 { SH64_COMPACT_INSN_OCBP_COMPACT
, && case_sem_INSN_OCBP_COMPACT
},
183 { SH64_COMPACT_INSN_OCBWB_COMPACT
, && case_sem_INSN_OCBWB_COMPACT
},
184 { SH64_COMPACT_INSN_OR_COMPACT
, && case_sem_INSN_OR_COMPACT
},
185 { SH64_COMPACT_INSN_ORI_COMPACT
, && case_sem_INSN_ORI_COMPACT
},
186 { SH64_COMPACT_INSN_ORB_COMPACT
, && case_sem_INSN_ORB_COMPACT
},
187 { SH64_COMPACT_INSN_PREF_COMPACT
, && case_sem_INSN_PREF_COMPACT
},
188 { SH64_COMPACT_INSN_ROTCL_COMPACT
, && case_sem_INSN_ROTCL_COMPACT
},
189 { SH64_COMPACT_INSN_ROTCR_COMPACT
, && case_sem_INSN_ROTCR_COMPACT
},
190 { SH64_COMPACT_INSN_ROTL_COMPACT
, && case_sem_INSN_ROTL_COMPACT
},
191 { SH64_COMPACT_INSN_ROTR_COMPACT
, && case_sem_INSN_ROTR_COMPACT
},
192 { SH64_COMPACT_INSN_RTS_COMPACT
, && case_sem_INSN_RTS_COMPACT
},
193 { SH64_COMPACT_INSN_SETS_COMPACT
, && case_sem_INSN_SETS_COMPACT
},
194 { SH64_COMPACT_INSN_SETT_COMPACT
, && case_sem_INSN_SETT_COMPACT
},
195 { SH64_COMPACT_INSN_SHAD_COMPACT
, && case_sem_INSN_SHAD_COMPACT
},
196 { SH64_COMPACT_INSN_SHAL_COMPACT
, && case_sem_INSN_SHAL_COMPACT
},
197 { SH64_COMPACT_INSN_SHAR_COMPACT
, && case_sem_INSN_SHAR_COMPACT
},
198 { SH64_COMPACT_INSN_SHLD_COMPACT
, && case_sem_INSN_SHLD_COMPACT
},
199 { SH64_COMPACT_INSN_SHLL_COMPACT
, && case_sem_INSN_SHLL_COMPACT
},
200 { SH64_COMPACT_INSN_SHLL2_COMPACT
, && case_sem_INSN_SHLL2_COMPACT
},
201 { SH64_COMPACT_INSN_SHLL8_COMPACT
, && case_sem_INSN_SHLL8_COMPACT
},
202 { SH64_COMPACT_INSN_SHLL16_COMPACT
, && case_sem_INSN_SHLL16_COMPACT
},
203 { SH64_COMPACT_INSN_SHLR_COMPACT
, && case_sem_INSN_SHLR_COMPACT
},
204 { SH64_COMPACT_INSN_SHLR2_COMPACT
, && case_sem_INSN_SHLR2_COMPACT
},
205 { SH64_COMPACT_INSN_SHLR8_COMPACT
, && case_sem_INSN_SHLR8_COMPACT
},
206 { SH64_COMPACT_INSN_SHLR16_COMPACT
, && case_sem_INSN_SHLR16_COMPACT
},
207 { SH64_COMPACT_INSN_STC_GBR_COMPACT
, && case_sem_INSN_STC_GBR_COMPACT
},
208 { SH64_COMPACT_INSN_STC_VBR_COMPACT
, && case_sem_INSN_STC_VBR_COMPACT
},
209 { SH64_COMPACT_INSN_STCL_GBR_COMPACT
, && case_sem_INSN_STCL_GBR_COMPACT
},
210 { SH64_COMPACT_INSN_STCL_VBR_COMPACT
, && case_sem_INSN_STCL_VBR_COMPACT
},
211 { SH64_COMPACT_INSN_STS_FPSCR_COMPACT
, && case_sem_INSN_STS_FPSCR_COMPACT
},
212 { SH64_COMPACT_INSN_STSL_FPSCR_COMPACT
, && case_sem_INSN_STSL_FPSCR_COMPACT
},
213 { SH64_COMPACT_INSN_STS_FPUL_COMPACT
, && case_sem_INSN_STS_FPUL_COMPACT
},
214 { SH64_COMPACT_INSN_STSL_FPUL_COMPACT
, && case_sem_INSN_STSL_FPUL_COMPACT
},
215 { SH64_COMPACT_INSN_STS_MACH_COMPACT
, && case_sem_INSN_STS_MACH_COMPACT
},
216 { SH64_COMPACT_INSN_STSL_MACH_COMPACT
, && case_sem_INSN_STSL_MACH_COMPACT
},
217 { SH64_COMPACT_INSN_STS_MACL_COMPACT
, && case_sem_INSN_STS_MACL_COMPACT
},
218 { SH64_COMPACT_INSN_STSL_MACL_COMPACT
, && case_sem_INSN_STSL_MACL_COMPACT
},
219 { SH64_COMPACT_INSN_STS_PR_COMPACT
, && case_sem_INSN_STS_PR_COMPACT
},
220 { SH64_COMPACT_INSN_STSL_PR_COMPACT
, && case_sem_INSN_STSL_PR_COMPACT
},
221 { SH64_COMPACT_INSN_SUB_COMPACT
, && case_sem_INSN_SUB_COMPACT
},
222 { SH64_COMPACT_INSN_SUBC_COMPACT
, && case_sem_INSN_SUBC_COMPACT
},
223 { SH64_COMPACT_INSN_SUBV_COMPACT
, && case_sem_INSN_SUBV_COMPACT
},
224 { SH64_COMPACT_INSN_SWAPB_COMPACT
, && case_sem_INSN_SWAPB_COMPACT
},
225 { SH64_COMPACT_INSN_SWAPW_COMPACT
, && case_sem_INSN_SWAPW_COMPACT
},
226 { SH64_COMPACT_INSN_TASB_COMPACT
, && case_sem_INSN_TASB_COMPACT
},
227 { SH64_COMPACT_INSN_TRAPA_COMPACT
, && case_sem_INSN_TRAPA_COMPACT
},
228 { SH64_COMPACT_INSN_TST_COMPACT
, && case_sem_INSN_TST_COMPACT
},
229 { SH64_COMPACT_INSN_TSTI_COMPACT
, && case_sem_INSN_TSTI_COMPACT
},
230 { SH64_COMPACT_INSN_TSTB_COMPACT
, && case_sem_INSN_TSTB_COMPACT
},
231 { SH64_COMPACT_INSN_XOR_COMPACT
, && case_sem_INSN_XOR_COMPACT
},
232 { SH64_COMPACT_INSN_XORI_COMPACT
, && case_sem_INSN_XORI_COMPACT
},
233 { SH64_COMPACT_INSN_XORB_COMPACT
, && case_sem_INSN_XORB_COMPACT
},
234 { SH64_COMPACT_INSN_XTRCT_COMPACT
, && case_sem_INSN_XTRCT_COMPACT
},
239 for (i
= 0; labels
[i
].label
!= 0; ++i
)
242 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
244 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
249 #endif /* DEFINE_LABELS */
253 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
254 off frills like tracing and profiling. */
255 /* FIXME: A better way would be to have TRACE_RESULT check for something
256 that can cause it to be optimized out. Another way would be to emit
257 special handlers into the instruction "stream". */
261 #define TRACE_RESULT(cpu, abuf, name, type, val)
265 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
266 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
268 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
275 /* Branch to next handler without going around main loop. */
276 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
277 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
279 #else /* ! WITH_SCACHE_PBB */
281 #define NEXT(vpc) BREAK (sem)
284 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
286 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
289 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
292 #endif /* ! WITH_SCACHE_PBB */
296 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
298 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
299 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
300 #define FLD(f) abuf->fields.fmt_empty.f
301 int UNUSED written
= 0;
302 IADDR UNUSED pc
= abuf
->addr
;
303 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
306 /* Update the recorded pc in the cpu state struct.
307 Only necessary for WITH_SCACHE case, but to avoid the
308 conditional compilation .... */
310 /* Virtual insns have zero size. Overwrite vpc with address of next insn
311 using the default-insn-bitsize spec. When executing insns in parallel
312 we may want to queue the fault and continue execution. */
313 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
314 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
321 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
323 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
324 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
325 #define FLD(f) abuf->fields.fmt_empty.f
326 int UNUSED written
= 0;
327 IADDR UNUSED pc
= abuf
->addr
;
328 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
331 #if WITH_SCACHE_PBB_SH64_COMPACT
332 sh64_compact_pbb_after (current_cpu
, sem_arg
);
340 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
342 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
343 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
344 #define FLD(f) abuf->fields.fmt_empty.f
345 int UNUSED written
= 0;
346 IADDR UNUSED pc
= abuf
->addr
;
347 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
350 #if WITH_SCACHE_PBB_SH64_COMPACT
351 sh64_compact_pbb_before (current_cpu
, sem_arg
);
359 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
361 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
363 #define FLD(f) abuf->fields.fmt_empty.f
364 int UNUSED written
= 0;
365 IADDR UNUSED pc
= abuf
->addr
;
366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
369 #if WITH_SCACHE_PBB_SH64_COMPACT
371 vpc
= sh64_compact_pbb_cti_chain (current_cpu
, sem_arg
,
372 pbb_br_type
, pbb_br_npc
);
375 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
376 vpc
= sh64_compact_pbb_cti_chain (current_cpu
, sem_arg
,
377 CPU_PBB_BR_TYPE (current_cpu
),
378 CPU_PBB_BR_NPC (current_cpu
));
387 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
389 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
390 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
391 #define FLD(f) abuf->fields.fmt_empty.f
392 int UNUSED written
= 0;
393 IADDR UNUSED pc
= abuf
->addr
;
394 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
397 #if WITH_SCACHE_PBB_SH64_COMPACT
398 vpc
= sh64_compact_pbb_chain (current_cpu
, sem_arg
);
409 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
411 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
412 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
413 #define FLD(f) abuf->fields.fmt_empty.f
414 int UNUSED written
= 0;
415 IADDR UNUSED pc
= abuf
->addr
;
416 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
419 #if WITH_SCACHE_PBB_SH64_COMPACT
420 #if defined DEFINE_SWITCH || defined FAST_P
421 /* In the switch case FAST_P is a constant, allowing several optimizations
422 in any called inline functions. */
423 vpc
= sh64_compact_pbb_begin (current_cpu
, FAST_P
);
425 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
426 vpc
= sh64_compact_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
428 vpc
= sh64_compact_pbb_begin (current_cpu
, 0);
438 CASE (sem
, INSN_ADD_COMPACT
) : /* add $rm, $rn */
440 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
441 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
442 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
443 int UNUSED written
= 0;
444 IADDR UNUSED pc
= abuf
->addr
;
445 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
448 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
449 SET_H_GRC (FLD (f_rn
), opval
);
450 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
457 CASE (sem
, INSN_ADDI_COMPACT
) : /* add #$imm8, $rn */
459 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
460 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
461 #define FLD(f) abuf->fields.sfmt_addi_compact.f
462 int UNUSED written
= 0;
463 IADDR UNUSED pc
= abuf
->addr
;
464 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
467 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), EXTQISI (ANDQI (FLD (f_imm8
), 255)));
468 SET_H_GRC (FLD (f_rn
), opval
);
469 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
476 CASE (sem
, INSN_ADDC_COMPACT
) : /* addc $rm, $rn */
478 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
479 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
480 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
481 int UNUSED written
= 0;
482 IADDR UNUSED pc
= abuf
->addr
;
483 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
487 tmp_flag
= ADDCFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
489 SI opval
= ADDCSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
490 SET_H_GRC (FLD (f_rn
), opval
);
491 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
496 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
504 CASE (sem
, INSN_ADDV_COMPACT
) : /* addv $rm, $rn */
506 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
508 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
509 int UNUSED written
= 0;
510 IADDR UNUSED pc
= abuf
->addr
;
511 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
515 tmp_t
= ADDOFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), 0);
517 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
518 SET_H_GRC (FLD (f_rn
), opval
);
519 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
524 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
532 CASE (sem
, INSN_AND_COMPACT
) : /* and $rm64, $rn64 */
534 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
536 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
537 int UNUSED written
= 0;
538 IADDR UNUSED pc
= abuf
->addr
;
539 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
542 DI opval
= ANDDI (GET_H_GR (FLD (f_rm
)), GET_H_GR (FLD (f_rn
)));
543 SET_H_GR (FLD (f_rn
), opval
);
544 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
551 CASE (sem
, INSN_ANDI_COMPACT
) : /* and #$uimm8, r0 */
553 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
554 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
555 #define FLD(f) abuf->fields.sfmt_addi_compact.f
556 int UNUSED written
= 0;
557 IADDR UNUSED pc
= abuf
->addr
;
558 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
561 SI opval
= ANDSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
562 SET_H_GRC (((UINT
) 0), opval
);
563 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
570 CASE (sem
, INSN_ANDB_COMPACT
) : /* and.b #$imm8, @(r0, gbr) */
572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
574 #define FLD(f) abuf->fields.sfmt_addi_compact.f
575 int UNUSED written
= 0;
576 IADDR UNUSED pc
= abuf
->addr
;
577 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
582 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
583 tmp_data
= ANDQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
585 UQI opval
= tmp_data
;
586 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
587 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
595 CASE (sem
, INSN_BF_COMPACT
) : /* bf $disp8 */
597 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
598 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
599 #define FLD(f) abuf->fields.sfmt_bf_compact.f
600 int UNUSED written
= 0;
601 IADDR UNUSED pc
= abuf
->addr
;
603 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
605 if (NOTBI (GET_H_TBIT ())) {
607 UDI opval
= FLD (i_disp8
);
608 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
610 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
614 abuf
->written
= written
;
615 SEM_BRANCH_FINI (vpc
);
620 CASE (sem
, INSN_BFS_COMPACT
) : /* bf/s $disp8 */
622 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
623 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
624 #define FLD(f) abuf->fields.sfmt_bf_compact.f
625 int UNUSED written
= 0;
626 IADDR UNUSED pc
= abuf
->addr
;
628 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
630 if (NOTBI (GET_H_TBIT ())) {
633 UDI opval
= ADDDI (pc
, 2);
634 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
636 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
641 UDI opval
= FLD (i_disp8
);
642 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
644 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
650 abuf
->written
= written
;
651 SEM_BRANCH_FINI (vpc
);
656 CASE (sem
, INSN_BRA_COMPACT
) : /* bra $disp12 */
658 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
659 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
660 #define FLD(f) abuf->fields.sfmt_bra_compact.f
661 int UNUSED written
= 0;
662 IADDR UNUSED pc
= abuf
->addr
;
664 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
668 UDI opval
= ADDDI (pc
, 2);
669 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
670 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
675 UDI opval
= FLD (i_disp12
);
676 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
677 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
682 SEM_BRANCH_FINI (vpc
);
687 CASE (sem
, INSN_BRAF_COMPACT
) : /* braf $rn */
689 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
690 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
691 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
692 int UNUSED written
= 0;
693 IADDR UNUSED pc
= abuf
->addr
;
695 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
699 UDI opval
= ADDDI (pc
, 2);
700 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
701 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
706 UDI opval
= ADDDI (EXTSIDI (GET_H_GRC (FLD (f_rn
))), ADDDI (pc
, 4));
707 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
708 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
713 SEM_BRANCH_FINI (vpc
);
718 CASE (sem
, INSN_BRK_COMPACT
) : /* brk */
720 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
721 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
722 #define FLD(f) abuf->fields.fmt_empty.f
723 int UNUSED written
= 0;
724 IADDR UNUSED pc
= abuf
->addr
;
725 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
727 sh64_break (current_cpu
, pc
);
733 CASE (sem
, INSN_BSR_COMPACT
) : /* bsr $disp12 */
735 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
736 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
737 #define FLD(f) abuf->fields.sfmt_bra_compact.f
738 int UNUSED written
= 0;
739 IADDR UNUSED pc
= abuf
->addr
;
741 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
746 SI opval
= ADDDI (pc
, 4);
748 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
752 UDI opval
= ADDDI (pc
, 2);
753 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
754 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
759 UDI opval
= FLD (i_disp12
);
760 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
761 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
766 SEM_BRANCH_FINI (vpc
);
771 CASE (sem
, INSN_BSRF_COMPACT
) : /* bsrf $rn */
773 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
774 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
775 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
776 int UNUSED written
= 0;
777 IADDR UNUSED pc
= abuf
->addr
;
779 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
784 SI opval
= ADDDI (pc
, 4);
786 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
790 UDI opval
= ADDDI (pc
, 2);
791 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
792 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
797 UDI opval
= ADDDI (EXTSIDI (GET_H_GRC (FLD (f_rn
))), ADDDI (pc
, 4));
798 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
799 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
804 SEM_BRANCH_FINI (vpc
);
809 CASE (sem
, INSN_BT_COMPACT
) : /* bt $disp8 */
811 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
812 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
813 #define FLD(f) abuf->fields.sfmt_bf_compact.f
814 int UNUSED written
= 0;
815 IADDR UNUSED pc
= abuf
->addr
;
817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
821 UDI opval
= FLD (i_disp8
);
822 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
824 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
828 abuf
->written
= written
;
829 SEM_BRANCH_FINI (vpc
);
834 CASE (sem
, INSN_BTS_COMPACT
) : /* bt/s $disp8 */
836 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
837 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
838 #define FLD(f) abuf->fields.sfmt_bf_compact.f
839 int UNUSED written
= 0;
840 IADDR UNUSED pc
= abuf
->addr
;
842 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
847 UDI opval
= ADDDI (pc
, 2);
848 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
850 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
855 UDI opval
= FLD (i_disp8
);
856 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
858 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
864 abuf
->written
= written
;
865 SEM_BRANCH_FINI (vpc
);
870 CASE (sem
, INSN_CLRMAC_COMPACT
) : /* clrmac */
872 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
873 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
874 #define FLD(f) abuf->fields.fmt_empty.f
875 int UNUSED written
= 0;
876 IADDR UNUSED pc
= abuf
->addr
;
877 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
883 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
888 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
896 CASE (sem
, INSN_CLRS_COMPACT
) : /* clrs */
898 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
899 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
900 #define FLD(f) abuf->fields.fmt_empty.f
901 int UNUSED written
= 0;
902 IADDR UNUSED pc
= abuf
->addr
;
903 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
908 TRACE_RESULT (current_cpu
, abuf
, "sbit", 'x', opval
);
915 CASE (sem
, INSN_CLRT_COMPACT
) : /* clrt */
917 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
918 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
919 #define FLD(f) abuf->fields.fmt_empty.f
920 int UNUSED written
= 0;
921 IADDR UNUSED pc
= abuf
->addr
;
922 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
927 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
934 CASE (sem
, INSN_CMPEQ_COMPACT
) : /* cmp/eq $rm, $rn */
936 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
937 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
938 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
939 int UNUSED written
= 0;
940 IADDR UNUSED pc
= abuf
->addr
;
941 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
944 BI opval
= EQSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
946 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
953 CASE (sem
, INSN_CMPEQI_COMPACT
) : /* cmp/eq #$imm8, r0 */
955 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
957 #define FLD(f) abuf->fields.sfmt_addi_compact.f
958 int UNUSED written
= 0;
959 IADDR UNUSED pc
= abuf
->addr
;
960 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
963 BI opval
= EQSI (GET_H_GRC (((UINT
) 0)), EXTQISI (ANDQI (FLD (f_imm8
), 255)));
965 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
972 CASE (sem
, INSN_CMPGE_COMPACT
) : /* cmp/ge $rm, $rn */
974 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
975 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
976 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
977 int UNUSED written
= 0;
978 IADDR UNUSED pc
= abuf
->addr
;
979 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
982 BI opval
= GESI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
984 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
991 CASE (sem
, INSN_CMPGT_COMPACT
) : /* cmp/gt $rm, $rn */
993 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
994 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
995 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
996 int UNUSED written
= 0;
997 IADDR UNUSED pc
= abuf
->addr
;
998 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1001 BI opval
= GTSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1003 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1010 CASE (sem
, INSN_CMPHI_COMPACT
) : /* cmp/hi $rm, $rn */
1012 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1013 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1014 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1015 int UNUSED written
= 0;
1016 IADDR UNUSED pc
= abuf
->addr
;
1017 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1020 BI opval
= GTUSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1022 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1029 CASE (sem
, INSN_CMPHS_COMPACT
) : /* cmp/hs $rm, $rn */
1031 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1032 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1033 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1034 int UNUSED written
= 0;
1035 IADDR UNUSED pc
= abuf
->addr
;
1036 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1039 BI opval
= GEUSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1041 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1048 CASE (sem
, INSN_CMPPL_COMPACT
) : /* cmp/pl $rn */
1050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1052 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1053 int UNUSED written
= 0;
1054 IADDR UNUSED pc
= abuf
->addr
;
1055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1058 BI opval
= GTSI (GET_H_GRC (FLD (f_rn
)), 0);
1060 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1067 CASE (sem
, INSN_CMPPZ_COMPACT
) : /* cmp/pz $rn */
1069 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1070 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1071 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1072 int UNUSED written
= 0;
1073 IADDR UNUSED pc
= abuf
->addr
;
1074 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1077 BI opval
= GESI (GET_H_GRC (FLD (f_rn
)), 0);
1079 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1086 CASE (sem
, INSN_CMPSTR_COMPACT
) : /* cmp/str $rm, $rn */
1088 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1089 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1090 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1091 int UNUSED written
= 0;
1092 IADDR UNUSED pc
= abuf
->addr
;
1093 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1098 tmp_temp
= XORSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
1099 tmp_t
= EQSI (ANDSI (tmp_temp
, 0xff000000), 0);
1100 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 16711680), 0), tmp_t
);
1101 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 65280), 0), tmp_t
);
1102 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 255), 0), tmp_t
);
1104 BI opval
= ((GTUBI (tmp_t
, 0)) ? (1) : (0));
1106 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1114 CASE (sem
, INSN_DIV0S_COMPACT
) : /* div0s $rm, $rn */
1116 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1117 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1118 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1119 int UNUSED written
= 0;
1120 IADDR UNUSED pc
= abuf
->addr
;
1121 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1125 BI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
1127 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1130 BI opval
= SRLSI (GET_H_GRC (FLD (f_rm
)), 31);
1132 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
1135 BI opval
= ((EQSI (SRLSI (GET_H_GRC (FLD (f_rm
)), 31), SRLSI (GET_H_GRC (FLD (f_rn
)), 31))) ? (0) : (1));
1137 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1145 CASE (sem
, INSN_DIV0U_COMPACT
) : /* div0u */
1147 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1148 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1149 #define FLD(f) abuf->fields.fmt_empty.f
1150 int UNUSED written
= 0;
1151 IADDR UNUSED pc
= abuf
->addr
;
1152 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1158 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1163 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1168 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
1176 CASE (sem
, INSN_DIV1_COMPACT
) : /* div1 $rm, $rn */
1178 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1179 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1180 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1181 int UNUSED written
= 0;
1182 IADDR UNUSED pc
= abuf
->addr
;
1183 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1189 tmp_oldq
= GET_H_QBIT ();
1191 BI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
1193 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1196 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), ZEXTBISI (GET_H_TBIT ()));
1197 SET_H_GRC (FLD (f_rn
), opval
);
1198 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1200 if (NOTBI (tmp_oldq
)) {
1201 if (NOTBI (GET_H_MBIT ())) {
1203 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1205 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1206 SET_H_GRC (FLD (f_rn
), opval
);
1207 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1209 tmp_tmp1
= GTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1210 if (NOTBI (GET_H_QBIT ())) {
1212 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1214 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1218 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1220 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1226 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1228 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1229 SET_H_GRC (FLD (f_rn
), opval
);
1230 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1232 tmp_tmp1
= LTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1233 if (NOTBI (GET_H_QBIT ())) {
1235 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1237 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1241 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1243 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1249 if (NOTBI (GET_H_MBIT ())) {
1251 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1253 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
1254 SET_H_GRC (FLD (f_rn
), opval
);
1255 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1257 tmp_tmp1
= LTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1258 if (NOTBI (GET_H_QBIT ())) {
1260 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1262 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1266 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1268 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1274 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1276 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1277 SET_H_GRC (FLD (f_rn
), opval
);
1278 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1280 tmp_tmp1
= GTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1281 if (NOTBI (GET_H_QBIT ())) {
1283 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1285 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1289 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1291 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1298 BI opval
= ((EQBI (GET_H_QBIT (), GET_H_MBIT ())) ? (1) : (0));
1300 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1308 CASE (sem
, INSN_DIVU_COMPACT
) : /* divu r0, $rn */
1310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1312 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1313 int UNUSED written
= 0;
1314 IADDR UNUSED pc
= abuf
->addr
;
1315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1318 SI opval
= UDIVSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (((UINT
) 0)));
1319 SET_H_GRC (FLD (f_rn
), opval
);
1320 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1327 CASE (sem
, INSN_MULR_COMPACT
) : /* mulr r0, $rn */
1329 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1330 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1331 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1332 int UNUSED written
= 0;
1333 IADDR UNUSED pc
= abuf
->addr
;
1334 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1337 SI opval
= MULSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (((UINT
) 0)));
1338 SET_H_GRC (FLD (f_rn
), opval
);
1339 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1346 CASE (sem
, INSN_DMULSL_COMPACT
) : /* dmuls.l $rm, $rn */
1348 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1349 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1350 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1351 int UNUSED written
= 0;
1352 IADDR UNUSED pc
= abuf
->addr
;
1353 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1357 tmp_result
= MULDI (EXTSIDI (GET_H_GRC (FLD (f_rm
))), EXTSIDI (GET_H_GRC (FLD (f_rn
))));
1359 SI opval
= SUBWORDDISI (tmp_result
, 0);
1361 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
1364 SI opval
= SUBWORDDISI (tmp_result
, 1);
1366 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
1374 CASE (sem
, INSN_DMULUL_COMPACT
) : /* dmulu.l $rm, $rn */
1376 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1377 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1378 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1379 int UNUSED written
= 0;
1380 IADDR UNUSED pc
= abuf
->addr
;
1381 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1385 tmp_result
= MULDI (ZEXTSIDI (GET_H_GRC (FLD (f_rm
))), ZEXTSIDI (GET_H_GRC (FLD (f_rn
))));
1387 SI opval
= SUBWORDDISI (tmp_result
, 0);
1389 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
1392 SI opval
= SUBWORDDISI (tmp_result
, 1);
1394 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
1402 CASE (sem
, INSN_DT_COMPACT
) : /* dt $rn */
1404 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1405 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1406 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1407 int UNUSED written
= 0;
1408 IADDR UNUSED pc
= abuf
->addr
;
1409 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1413 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 1);
1414 SET_H_GRC (FLD (f_rn
), opval
);
1415 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1418 BI opval
= EQSI (GET_H_GRC (FLD (f_rn
)), 0);
1420 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1428 CASE (sem
, INSN_EXTSB_COMPACT
) : /* exts.b $rm, $rn */
1430 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1431 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1432 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1433 int UNUSED written
= 0;
1434 IADDR UNUSED pc
= abuf
->addr
;
1435 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1438 SI opval
= EXTQISI (SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3));
1439 SET_H_GRC (FLD (f_rn
), opval
);
1440 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1447 CASE (sem
, INSN_EXTSW_COMPACT
) : /* exts.w $rm, $rn */
1449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1451 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1452 int UNUSED written
= 0;
1453 IADDR UNUSED pc
= abuf
->addr
;
1454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1457 SI opval
= EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1));
1458 SET_H_GRC (FLD (f_rn
), opval
);
1459 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1466 CASE (sem
, INSN_EXTUB_COMPACT
) : /* extu.b $rm, $rn */
1468 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1469 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1470 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1471 int UNUSED written
= 0;
1472 IADDR UNUSED pc
= abuf
->addr
;
1473 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1476 SI opval
= ZEXTQISI (SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3));
1477 SET_H_GRC (FLD (f_rn
), opval
);
1478 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1485 CASE (sem
, INSN_EXTUW_COMPACT
) : /* extu.w $rm, $rn */
1487 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1488 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1489 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1490 int UNUSED written
= 0;
1491 IADDR UNUSED pc
= abuf
->addr
;
1492 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1495 SI opval
= ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1));
1496 SET_H_GRC (FLD (f_rn
), opval
);
1497 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1504 CASE (sem
, INSN_FABS_COMPACT
) : /* fabs $fsdn */
1506 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1508 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1509 int UNUSED written
= 0;
1510 IADDR UNUSED pc
= abuf
->addr
;
1511 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1513 if (GET_H_PRBIT ()) {
1515 DF opval
= sh64_fabsd (current_cpu
, GET_H_FSD (FLD (f_rn
)));
1516 SET_H_FSD (FLD (f_rn
), opval
);
1517 written
|= (1 << 2);
1518 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1522 DF opval
= sh64_fabss (current_cpu
, GET_H_FSD (FLD (f_rn
)));
1523 SET_H_FSD (FLD (f_rn
), opval
);
1524 written
|= (1 << 2);
1525 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1529 abuf
->written
= written
;
1534 CASE (sem
, INSN_FADD_COMPACT
) : /* fadd $fsdm, $fsdn */
1536 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1537 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1538 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1539 int UNUSED written
= 0;
1540 IADDR UNUSED pc
= abuf
->addr
;
1541 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1543 if (GET_H_PRBIT ()) {
1545 DF opval
= sh64_faddd (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1546 SET_H_FSD (FLD (f_rn
), opval
);
1547 written
|= (1 << 3);
1548 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1552 DF opval
= sh64_fadds (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1553 SET_H_FSD (FLD (f_rn
), opval
);
1554 written
|= (1 << 3);
1555 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1559 abuf
->written
= written
;
1564 CASE (sem
, INSN_FCMPEQ_COMPACT
) : /* fcmp/eq $fsdm, $fsdn */
1566 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1567 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1568 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1569 int UNUSED written
= 0;
1570 IADDR UNUSED pc
= abuf
->addr
;
1571 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1573 if (GET_H_PRBIT ()) {
1575 BI opval
= sh64_fcmpeqd (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1577 written
|= (1 << 3);
1578 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1582 BI opval
= sh64_fcmpeqs (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1584 written
|= (1 << 3);
1585 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1589 abuf
->written
= written
;
1594 CASE (sem
, INSN_FCMPGT_COMPACT
) : /* fcmp/gt $fsdm, $fsdn */
1596 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1597 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1598 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1599 int UNUSED written
= 0;
1600 IADDR UNUSED pc
= abuf
->addr
;
1601 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1603 if (GET_H_PRBIT ()) {
1605 BI opval
= sh64_fcmpgtd (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1607 written
|= (1 << 3);
1608 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1612 BI opval
= sh64_fcmpgts (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1614 written
|= (1 << 3);
1615 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1619 abuf
->written
= written
;
1624 CASE (sem
, INSN_FCNVDS_COMPACT
) : /* fcnvds $drn, fpul */
1626 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1628 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
1629 int UNUSED written
= 0;
1630 IADDR UNUSED pc
= abuf
->addr
;
1631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1634 SF opval
= sh64_fcnvds (current_cpu
, GET_H_DRC (FLD (f_dn
)));
1635 CPU (h_fr
[((UINT
) 32)]) = opval
;
1636 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1643 CASE (sem
, INSN_FCNVSD_COMPACT
) : /* fcnvsd fpul, $drn */
1645 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1646 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1647 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
1648 int UNUSED written
= 0;
1649 IADDR UNUSED pc
= abuf
->addr
;
1650 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1653 DF opval
= sh64_fcnvsd (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1654 SET_H_DRC (FLD (f_dn
), opval
);
1655 TRACE_RESULT (current_cpu
, abuf
, "drc", 'f', opval
);
1662 CASE (sem
, INSN_FDIV_COMPACT
) : /* fdiv $fsdm, $fsdn */
1664 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1665 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1666 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1667 int UNUSED written
= 0;
1668 IADDR UNUSED pc
= abuf
->addr
;
1669 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1671 if (GET_H_PRBIT ()) {
1673 DF opval
= sh64_fdivd (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1674 SET_H_FSD (FLD (f_rn
), opval
);
1675 written
|= (1 << 3);
1676 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1680 DF opval
= sh64_fdivs (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1681 SET_H_FSD (FLD (f_rn
), opval
);
1682 written
|= (1 << 3);
1683 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1687 abuf
->written
= written
;
1692 CASE (sem
, INSN_FIPR_COMPACT
) : /* fipr $fvm, $fvn */
1694 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1695 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1696 #define FLD(f) abuf->fields.sfmt_fipr_compact.f
1697 int UNUSED written
= 0;
1698 IADDR UNUSED pc
= abuf
->addr
;
1699 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1701 sh64_fipr (current_cpu
, FLD (f_vm
), FLD (f_vn
));
1707 CASE (sem
, INSN_FLDS_COMPACT
) : /* flds $frn, fpul */
1709 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1710 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1711 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1712 int UNUSED written
= 0;
1713 IADDR UNUSED pc
= abuf
->addr
;
1714 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1717 SF opval
= GET_H_FRC (FLD (f_rn
));
1718 CPU (h_fr
[((UINT
) 32)]) = opval
;
1719 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1726 CASE (sem
, INSN_FLDI0_COMPACT
) : /* fldi0 $frn */
1728 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1730 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1731 int UNUSED written
= 0;
1732 IADDR UNUSED pc
= abuf
->addr
;
1733 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1736 SF opval
= sh64_fldi0 (current_cpu
);
1737 SET_H_FRC (FLD (f_rn
), opval
);
1738 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
1745 CASE (sem
, INSN_FLDI1_COMPACT
) : /* fldi1 $frn */
1747 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1748 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1749 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1750 int UNUSED written
= 0;
1751 IADDR UNUSED pc
= abuf
->addr
;
1752 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1755 SF opval
= sh64_fldi1 (current_cpu
);
1756 SET_H_FRC (FLD (f_rn
), opval
);
1757 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
1764 CASE (sem
, INSN_FLOAT_COMPACT
) : /* float fpul, $fsdn */
1766 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1767 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1768 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1769 int UNUSED written
= 0;
1770 IADDR UNUSED pc
= abuf
->addr
;
1771 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1773 if (GET_H_PRBIT ()) {
1775 DF opval
= sh64_floatld (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1776 SET_H_FSD (FLD (f_rn
), opval
);
1777 written
|= (1 << 2);
1778 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1782 DF opval
= sh64_floatls (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1783 SET_H_FSD (FLD (f_rn
), opval
);
1784 written
|= (1 << 2);
1785 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1789 abuf
->written
= written
;
1794 CASE (sem
, INSN_FMAC_COMPACT
) : /* fmac fr0, $frm, $frn */
1796 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1797 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1798 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1799 int UNUSED written
= 0;
1800 IADDR UNUSED pc
= abuf
->addr
;
1801 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1804 SF opval
= sh64_fmacs (current_cpu
, GET_H_FRC (((UINT
) 0)), GET_H_FRC (FLD (f_rm
)), GET_H_FRC (FLD (f_rn
)));
1805 SET_H_FRC (FLD (f_rn
), opval
);
1806 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
1813 CASE (sem
, INSN_FMOV1_COMPACT
) : /* fmov $fmovm, $fmovn */
1815 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1816 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1817 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1818 int UNUSED written
= 0;
1819 IADDR UNUSED pc
= abuf
->addr
;
1820 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1823 DF opval
= GET_H_FMOV (FLD (f_rm
));
1824 SET_H_FMOV (FLD (f_rn
), opval
);
1825 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1832 CASE (sem
, INSN_FMOV2_COMPACT
) : /* fmov @$rm, $fmovn */
1834 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1835 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1836 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1837 int UNUSED written
= 0;
1838 IADDR UNUSED pc
= abuf
->addr
;
1839 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1841 if (NOTBI (GET_H_SZBIT ())) {
1843 DF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1844 SET_H_FMOV (FLD (f_rn
), opval
);
1845 written
|= (1 << 4);
1846 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1850 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1851 SET_H_FMOV (FLD (f_rn
), opval
);
1852 written
|= (1 << 4);
1853 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1857 abuf
->written
= written
;
1862 CASE (sem
, INSN_FMOV3_COMPACT
) : /* fmov @${rm}+, fmovn */
1864 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1865 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1866 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1867 int UNUSED written
= 0;
1868 IADDR UNUSED pc
= abuf
->addr
;
1869 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1871 if (NOTBI (GET_H_SZBIT ())) {
1874 DF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1875 SET_H_FMOV (FLD (f_rn
), opval
);
1876 written
|= (1 << 4);
1877 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1880 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
1881 SET_H_GRC (FLD (f_rm
), opval
);
1882 written
|= (1 << 5);
1883 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1889 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1890 SET_H_FMOV (FLD (f_rn
), opval
);
1891 written
|= (1 << 4);
1892 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1895 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 8);
1896 SET_H_GRC (FLD (f_rm
), opval
);
1897 written
|= (1 << 5);
1898 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1903 abuf
->written
= written
;
1908 CASE (sem
, INSN_FMOV4_COMPACT
) : /* fmov @(r0, $rm), $fmovn */
1910 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1911 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1912 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1913 int UNUSED written
= 0;
1914 IADDR UNUSED pc
= abuf
->addr
;
1915 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1917 if (NOTBI (GET_H_SZBIT ())) {
1919 DF opval
= GETMEMSF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1920 SET_H_FMOV (FLD (f_rn
), opval
);
1921 written
|= (1 << 5);
1922 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1926 DF opval
= GETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1927 SET_H_FMOV (FLD (f_rn
), opval
);
1928 written
|= (1 << 5);
1929 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1933 abuf
->written
= written
;
1938 CASE (sem
, INSN_FMOV5_COMPACT
) : /* fmov $fmovm, @$rn */
1940 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1941 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1942 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1943 int UNUSED written
= 0;
1944 IADDR UNUSED pc
= abuf
->addr
;
1945 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1947 if (NOTBI (GET_H_SZBIT ())) {
1949 SF opval
= GET_H_FMOV (FLD (f_rm
));
1950 SETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1951 written
|= (1 << 4);
1952 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1956 DF opval
= GET_H_FMOV (FLD (f_rm
));
1957 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1958 written
|= (1 << 3);
1959 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1963 abuf
->written
= written
;
1968 CASE (sem
, INSN_FMOV6_COMPACT
) : /* fmov $fmovm, @-$rn */
1970 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1971 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1972 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1973 int UNUSED written
= 0;
1974 IADDR UNUSED pc
= abuf
->addr
;
1975 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1977 if (NOTBI (GET_H_SZBIT ())) {
1980 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
1981 SET_H_GRC (FLD (f_rn
), opval
);
1982 written
|= (1 << 5);
1983 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1986 SF opval
= GET_H_FMOV (FLD (f_rm
));
1987 SETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1988 written
|= (1 << 4);
1989 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1995 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 8);
1996 SET_H_GRC (FLD (f_rn
), opval
);
1997 written
|= (1 << 5);
1998 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2001 DF opval
= GET_H_FMOV (FLD (f_rm
));
2002 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
2003 written
|= (1 << 3);
2004 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
2009 abuf
->written
= written
;
2014 CASE (sem
, INSN_FMOV7_COMPACT
) : /* fmov $fmovm, @(r0, $rn) */
2016 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2017 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2018 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2019 int UNUSED written
= 0;
2020 IADDR UNUSED pc
= abuf
->addr
;
2021 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2023 if (NOTBI (GET_H_SZBIT ())) {
2025 SF opval
= GET_H_FMOV (FLD (f_rm
));
2026 SETMEMSF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
2027 written
|= (1 << 5);
2028 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
2032 DF opval
= GET_H_FMOV (FLD (f_rm
));
2033 SETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
2034 written
|= (1 << 4);
2035 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
2039 abuf
->written
= written
;
2044 CASE (sem
, INSN_FMOV8_COMPACT
) : /* fmov.d @($imm12x8, $rm), $drn */
2046 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2048 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
2049 int UNUSED written
= 0;
2050 IADDR UNUSED pc
= abuf
->addr
;
2051 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2054 DF opval
= GETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm12x8
)));
2055 SET_H_DRC (FLD (f_dn
), opval
);
2056 TRACE_RESULT (current_cpu
, abuf
, "drc", 'f', opval
);
2063 CASE (sem
, INSN_FMOV9_COMPACT
) : /* mov.l $drm, @($imm12x8, $rn) */
2065 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2066 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2067 #define FLD(f) abuf->fields.sfmt_fmov9_compact.f
2068 int UNUSED written
= 0;
2069 IADDR UNUSED pc
= abuf
->addr
;
2070 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2073 DF opval
= GET_H_DRC (FLD (f_dm
));
2074 SETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm12x8
)), opval
);
2075 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
2082 CASE (sem
, INSN_FMUL_COMPACT
) : /* fmul $fsdm, $fsdn */
2084 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2085 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2086 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2087 int UNUSED written
= 0;
2088 IADDR UNUSED pc
= abuf
->addr
;
2089 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2091 if (GET_H_PRBIT ()) {
2093 DF opval
= sh64_fmuld (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
2094 SET_H_FSD (FLD (f_rn
), opval
);
2095 written
|= (1 << 3);
2096 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2100 DF opval
= sh64_fmuls (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
2101 SET_H_FSD (FLD (f_rn
), opval
);
2102 written
|= (1 << 3);
2103 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2107 abuf
->written
= written
;
2112 CASE (sem
, INSN_FNEG_COMPACT
) : /* fneg $fsdn */
2114 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2115 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2116 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2117 int UNUSED written
= 0;
2118 IADDR UNUSED pc
= abuf
->addr
;
2119 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2121 if (GET_H_PRBIT ()) {
2123 DF opval
= sh64_fnegd (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2124 SET_H_FSD (FLD (f_rn
), opval
);
2125 written
|= (1 << 2);
2126 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2130 DF opval
= sh64_fnegs (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2131 SET_H_FSD (FLD (f_rn
), opval
);
2132 written
|= (1 << 2);
2133 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2137 abuf
->written
= written
;
2142 CASE (sem
, INSN_FRCHG_COMPACT
) : /* frchg */
2144 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2145 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2146 #define FLD(f) abuf->fields.fmt_empty.f
2147 int UNUSED written
= 0;
2148 IADDR UNUSED pc
= abuf
->addr
;
2149 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2152 BI opval
= NOTBI (GET_H_FRBIT ());
2153 SET_H_FRBIT (opval
);
2154 TRACE_RESULT (current_cpu
, abuf
, "frbit", 'x', opval
);
2161 CASE (sem
, INSN_FSCHG_COMPACT
) : /* fschg */
2163 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2164 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2165 #define FLD(f) abuf->fields.fmt_empty.f
2166 int UNUSED written
= 0;
2167 IADDR UNUSED pc
= abuf
->addr
;
2168 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2171 BI opval
= NOTBI (GET_H_SZBIT ());
2172 SET_H_SZBIT (opval
);
2173 TRACE_RESULT (current_cpu
, abuf
, "szbit", 'x', opval
);
2180 CASE (sem
, INSN_FSQRT_COMPACT
) : /* fsqrt $fsdn */
2182 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2183 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2184 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2185 int UNUSED written
= 0;
2186 IADDR UNUSED pc
= abuf
->addr
;
2187 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2189 if (GET_H_PRBIT ()) {
2191 DF opval
= sh64_fsqrtd (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2192 SET_H_FSD (FLD (f_rn
), opval
);
2193 written
|= (1 << 2);
2194 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2198 DF opval
= sh64_fsqrts (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2199 SET_H_FSD (FLD (f_rn
), opval
);
2200 written
|= (1 << 2);
2201 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2205 abuf
->written
= written
;
2210 CASE (sem
, INSN_FSTS_COMPACT
) : /* fsts fpul, $frn */
2212 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2213 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2214 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2215 int UNUSED written
= 0;
2216 IADDR UNUSED pc
= abuf
->addr
;
2217 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2220 SF opval
= CPU (h_fr
[((UINT
) 32)]);
2221 SET_H_FRC (FLD (f_rn
), opval
);
2222 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
2229 CASE (sem
, INSN_FSUB_COMPACT
) : /* fsub $fsdm, $fsdn */
2231 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2232 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2233 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2234 int UNUSED written
= 0;
2235 IADDR UNUSED pc
= abuf
->addr
;
2236 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2238 if (GET_H_PRBIT ()) {
2240 DF opval
= sh64_fsubd (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
2241 SET_H_FSD (FLD (f_rn
), opval
);
2242 written
|= (1 << 3);
2243 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2247 DF opval
= sh64_fsubs (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
2248 SET_H_FSD (FLD (f_rn
), opval
);
2249 written
|= (1 << 3);
2250 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2254 abuf
->written
= written
;
2259 CASE (sem
, INSN_FTRC_COMPACT
) : /* ftrc $fsdn, fpul */
2261 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2262 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2263 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2264 int UNUSED written
= 0;
2265 IADDR UNUSED pc
= abuf
->addr
;
2266 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2269 SF opval
= ((GET_H_PRBIT ()) ? (sh64_ftrcdl (current_cpu
, GET_H_FSD (FLD (f_rn
)))) : (sh64_ftrcsl (current_cpu
, GET_H_FSD (FLD (f_rn
)))));
2270 CPU (h_fr
[((UINT
) 32)]) = opval
;
2271 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2278 CASE (sem
, INSN_FTRV_COMPACT
) : /* ftrv xmtrx, $fvn */
2280 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2281 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2282 #define FLD(f) abuf->fields.sfmt_fipr_compact.f
2283 int UNUSED written
= 0;
2284 IADDR UNUSED pc
= abuf
->addr
;
2285 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2287 sh64_ftrv (current_cpu
, FLD (f_vn
));
2293 CASE (sem
, INSN_JMP_COMPACT
) : /* jmp @$rn */
2295 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2296 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2297 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2298 int UNUSED written
= 0;
2299 IADDR UNUSED pc
= abuf
->addr
;
2301 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2305 UDI opval
= ADDDI (pc
, 2);
2306 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2307 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2312 UDI opval
= GET_H_GRC (FLD (f_rn
));
2313 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2314 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2320 SEM_BRANCH_FINI (vpc
);
2325 CASE (sem
, INSN_JSR_COMPACT
) : /* jsr @$rn */
2327 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2328 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2329 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2330 int UNUSED written
= 0;
2331 IADDR UNUSED pc
= abuf
->addr
;
2333 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2338 SI opval
= ADDDI (pc
, 4);
2340 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2344 UDI opval
= ADDDI (pc
, 2);
2345 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2346 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2351 UDI opval
= GET_H_GRC (FLD (f_rn
));
2352 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2353 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2359 SEM_BRANCH_FINI (vpc
);
2364 CASE (sem
, INSN_LDC_GBR_COMPACT
) : /* ldc $rn, gbr */
2366 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2367 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2368 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2369 int UNUSED written
= 0;
2370 IADDR UNUSED pc
= abuf
->addr
;
2371 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2374 SI opval
= GET_H_GRC (FLD (f_rn
));
2376 TRACE_RESULT (current_cpu
, abuf
, "gbr", 'x', opval
);
2383 CASE (sem
, INSN_LDC_VBR_COMPACT
) : /* ldc $rn, vbr */
2385 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2386 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2387 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2388 int UNUSED written
= 0;
2389 IADDR UNUSED pc
= abuf
->addr
;
2390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2393 SI opval
= GET_H_GRC (FLD (f_rn
));
2395 TRACE_RESULT (current_cpu
, abuf
, "vbr", 'x', opval
);
2402 CASE (sem
, INSN_LDC_SR_COMPACT
) : /* ldc $rn, sr */
2404 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2405 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2406 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2407 int UNUSED written
= 0;
2408 IADDR UNUSED pc
= abuf
->addr
;
2409 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2412 SI opval
= GET_H_GRC (FLD (f_rn
));
2414 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
2421 CASE (sem
, INSN_LDCL_GBR_COMPACT
) : /* ldc.l @${rn}+, gbr */
2423 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2424 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2425 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2426 int UNUSED written
= 0;
2427 IADDR UNUSED pc
= abuf
->addr
;
2428 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2432 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2434 TRACE_RESULT (current_cpu
, abuf
, "gbr", 'x', opval
);
2437 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2438 SET_H_GRC (FLD (f_rn
), opval
);
2439 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2447 CASE (sem
, INSN_LDCL_VBR_COMPACT
) : /* ldc.l @${rn}+, vbr */
2449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2451 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2452 int UNUSED written
= 0;
2453 IADDR UNUSED pc
= abuf
->addr
;
2454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2458 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2460 TRACE_RESULT (current_cpu
, abuf
, "vbr", 'x', opval
);
2463 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2464 SET_H_GRC (FLD (f_rn
), opval
);
2465 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2473 CASE (sem
, INSN_LDS_FPSCR_COMPACT
) : /* lds $rn, fpscr */
2475 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2476 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2477 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2478 int UNUSED written
= 0;
2479 IADDR UNUSED pc
= abuf
->addr
;
2480 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2483 SI opval
= GET_H_GRC (FLD (f_rn
));
2484 CPU (h_fpscr
) = opval
;
2485 TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
2492 CASE (sem
, INSN_LDSL_FPSCR_COMPACT
) : /* lds.l @${rn}+, fpscr */
2494 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2495 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2496 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2497 int UNUSED written
= 0;
2498 IADDR UNUSED pc
= abuf
->addr
;
2499 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2503 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2504 CPU (h_fpscr
) = opval
;
2505 TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
2508 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2509 SET_H_GRC (FLD (f_rn
), opval
);
2510 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2518 CASE (sem
, INSN_LDS_FPUL_COMPACT
) : /* lds $rn, fpul */
2520 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2521 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2522 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2523 int UNUSED written
= 0;
2524 IADDR UNUSED pc
= abuf
->addr
;
2525 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2528 SF opval
= SUBWORDSISF (GET_H_GRC (FLD (f_rn
)));
2529 CPU (h_fr
[((UINT
) 32)]) = opval
;
2530 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2537 CASE (sem
, INSN_LDSL_FPUL_COMPACT
) : /* lds.l @${rn}+, fpul */
2539 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2540 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2541 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2542 int UNUSED written
= 0;
2543 IADDR UNUSED pc
= abuf
->addr
;
2544 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2548 SF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2549 CPU (h_fr
[((UINT
) 32)]) = opval
;
2550 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2553 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2554 SET_H_GRC (FLD (f_rn
), opval
);
2555 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2563 CASE (sem
, INSN_LDS_MACH_COMPACT
) : /* lds $rn, mach */
2565 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2566 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2567 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2568 int UNUSED written
= 0;
2569 IADDR UNUSED pc
= abuf
->addr
;
2570 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2573 SI opval
= GET_H_GRC (FLD (f_rn
));
2575 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2582 CASE (sem
, INSN_LDSL_MACH_COMPACT
) : /* lds.l @${rn}+, mach */
2584 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2585 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2586 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2587 int UNUSED written
= 0;
2588 IADDR UNUSED pc
= abuf
->addr
;
2589 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2593 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2595 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2598 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2599 SET_H_GRC (FLD (f_rn
), opval
);
2600 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2608 CASE (sem
, INSN_LDS_MACL_COMPACT
) : /* lds $rn, macl */
2610 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2611 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2612 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2613 int UNUSED written
= 0;
2614 IADDR UNUSED pc
= abuf
->addr
;
2615 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2618 SI opval
= GET_H_GRC (FLD (f_rn
));
2620 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2627 CASE (sem
, INSN_LDSL_MACL_COMPACT
) : /* lds.l @${rn}+, macl */
2629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2631 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2632 int UNUSED written
= 0;
2633 IADDR UNUSED pc
= abuf
->addr
;
2634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2638 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2640 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2643 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2644 SET_H_GRC (FLD (f_rn
), opval
);
2645 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2653 CASE (sem
, INSN_LDS_PR_COMPACT
) : /* lds $rn, pr */
2655 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2656 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2657 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2658 int UNUSED written
= 0;
2659 IADDR UNUSED pc
= abuf
->addr
;
2660 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2663 SI opval
= GET_H_GRC (FLD (f_rn
));
2665 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2672 CASE (sem
, INSN_LDSL_PR_COMPACT
) : /* lds.l @${rn}+, pr */
2674 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2675 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2676 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2677 int UNUSED written
= 0;
2678 IADDR UNUSED pc
= abuf
->addr
;
2679 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2683 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2685 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2688 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2689 SET_H_GRC (FLD (f_rn
), opval
);
2690 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2698 CASE (sem
, INSN_MACL_COMPACT
) : /* mac.l @${rm}+, @${rn}+ */
2700 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2701 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2702 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2703 int UNUSED written
= 0;
2704 IADDR UNUSED pc
= abuf
->addr
;
2705 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2713 tmp_x
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2715 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2716 SET_H_GRC (FLD (f_rn
), opval
);
2717 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2719 if (EQSI (FLD (f_rn
), FLD (f_rm
))) {
2722 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2723 SET_H_GRC (FLD (f_rn
), opval
);
2724 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2727 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
2728 SET_H_GRC (FLD (f_rm
), opval
);
2729 written
|= (1 << 11);
2730 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2734 tmp_y
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2736 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
2737 SET_H_GRC (FLD (f_rm
), opval
);
2738 written
|= (1 << 11);
2739 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2741 tmp_tmpry
= MULDI (ZEXTSIDI (tmp_x
), ZEXTSIDI (tmp_y
));
2742 tmp_mac
= ORDI (SLLDI (ZEXTSIDI (GET_H_MACH ()), 32), ZEXTSIDI (GET_H_MACL ()));
2743 tmp_result
= ADDDI (tmp_mac
, tmp_tmpry
);
2745 if (GET_H_SBIT ()) {
2749 tmp_max
= SRLDI (INVDI (0), 16);
2750 tmp_min
= SRLDI (INVDI (0), 15);
2751 if (GTDI (tmp_result
, tmp_max
)) {
2752 tmp_result
= tmp_max
;
2754 if (LTDI (tmp_result
, tmp_min
)) {
2755 tmp_result
= tmp_min
;
2761 SI opval
= SUBWORDDISI (tmp_result
, 0);
2763 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2766 SI opval
= SUBWORDDISI (tmp_result
, 1);
2768 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2773 abuf
->written
= written
;
2778 CASE (sem
, INSN_MACW_COMPACT
) : /* mac.w @${rm}+, @${rn}+ */
2780 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2781 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2782 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2783 int UNUSED written
= 0;
2784 IADDR UNUSED pc
= abuf
->addr
;
2785 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2793 tmp_x
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2795 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 2);
2796 SET_H_GRC (FLD (f_rn
), opval
);
2797 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2799 if (EQSI (FLD (f_rn
), FLD (f_rm
))) {
2802 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 2);
2803 SET_H_GRC (FLD (f_rn
), opval
);
2804 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2807 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
2808 SET_H_GRC (FLD (f_rm
), opval
);
2809 written
|= (1 << 11);
2810 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2814 tmp_y
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2816 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
2817 SET_H_GRC (FLD (f_rm
), opval
);
2818 written
|= (1 << 11);
2819 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2821 tmp_tmpry
= MULSI (ZEXTHISI (tmp_x
), ZEXTHISI (tmp_y
));
2822 if (GET_H_SBIT ()) {
2824 if (ADDOFSI (tmp_tmpry
, GET_H_MACL (), 0)) {
2828 written
|= (1 << 9);
2829 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2833 SI opval
= ADDSI (tmp_tmpry
, GET_H_MACL ());
2835 written
|= (1 << 10);
2836 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2841 tmp_mac
= ORDI (SLLDI (ZEXTSIDI (GET_H_MACH ()), 32), ZEXTSIDI (GET_H_MACL ()));
2842 tmp_result
= ADDDI (tmp_mac
, EXTSIDI (tmp_tmpry
));
2844 SI opval
= SUBWORDDISI (tmp_result
, 0);
2846 written
|= (1 << 9);
2847 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2850 SI opval
= SUBWORDDISI (tmp_result
, 1);
2852 written
|= (1 << 10);
2853 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2859 abuf
->written
= written
;
2864 CASE (sem
, INSN_MOV_COMPACT
) : /* mov $rm64, $rn64 */
2866 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2867 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2868 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2869 int UNUSED written
= 0;
2870 IADDR UNUSED pc
= abuf
->addr
;
2871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2874 DI opval
= GET_H_GR (FLD (f_rm
));
2875 SET_H_GR (FLD (f_rn
), opval
);
2876 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2883 CASE (sem
, INSN_MOVI_COMPACT
) : /* mov #$imm8, $rn */
2885 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2886 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2887 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2888 int UNUSED written
= 0;
2889 IADDR UNUSED pc
= abuf
->addr
;
2890 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2893 SI opval
= EXTQIDI (ANDQI (FLD (f_imm8
), 255));
2894 SET_H_GRC (FLD (f_rn
), opval
);
2895 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2902 CASE (sem
, INSN_MOVI20_COMPACT
) : /* movi20 #$imm20, $rn */
2904 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2905 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2906 #define FLD(f) abuf->fields.sfmt_movi20_compact.f
2907 int UNUSED written
= 0;
2908 IADDR UNUSED pc
= abuf
->addr
;
2909 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2912 SI opval
= FLD (f_imm20
);
2913 SET_H_GRC (FLD (f_rn
), opval
);
2914 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2921 CASE (sem
, INSN_MOVB1_COMPACT
) : /* mov.b $rm, @$rn */
2923 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2924 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2925 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2926 int UNUSED written
= 0;
2927 IADDR UNUSED pc
= abuf
->addr
;
2928 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2931 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2932 SETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
2933 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2940 CASE (sem
, INSN_MOVB2_COMPACT
) : /* mov.b $rm, @-$rn */
2942 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2943 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2944 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2945 int UNUSED written
= 0;
2946 IADDR UNUSED pc
= abuf
->addr
;
2947 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2951 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 1);
2953 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2954 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2955 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2958 SI opval
= tmp_addr
;
2959 SET_H_GRC (FLD (f_rn
), opval
);
2960 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2968 CASE (sem
, INSN_MOVB3_COMPACT
) : /* mov.b $rm, @(r0,$rn) */
2970 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2971 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2972 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2973 int UNUSED written
= 0;
2974 IADDR UNUSED pc
= abuf
->addr
;
2975 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2978 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2979 SETMEMUQI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
2980 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2987 CASE (sem
, INSN_MOVB4_COMPACT
) : /* mov.b r0, @($imm8, gbr) */
2989 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2990 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2991 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2992 int UNUSED written
= 0;
2993 IADDR UNUSED pc
= abuf
->addr
;
2994 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2998 tmp_addr
= ADDSI (GET_H_GBR (), FLD (f_imm8
));
3000 UQI opval
= SUBWORDSIUQI (GET_H_GRC (((UINT
) 0)), 3);
3001 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
3002 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3010 CASE (sem
, INSN_MOVB5_COMPACT
) : /* mov.b r0, @($imm4, $rm) */
3012 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3013 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3014 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
3015 int UNUSED written
= 0;
3016 IADDR UNUSED pc
= abuf
->addr
;
3017 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3021 tmp_addr
= ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4
));
3023 UQI opval
= SUBWORDSIUQI (GET_H_GRC (((UINT
) 0)), 3);
3024 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
3025 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3033 CASE (sem
, INSN_MOVB6_COMPACT
) : /* mov.b @$rm, $rn */
3035 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3036 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3037 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3038 int UNUSED written
= 0;
3039 IADDR UNUSED pc
= abuf
->addr
;
3040 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3043 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
))));
3044 SET_H_GRC (FLD (f_rn
), opval
);
3045 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3052 CASE (sem
, INSN_MOVB7_COMPACT
) : /* mov.b @${rm}+, $rn */
3054 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3055 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3056 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3057 int UNUSED written
= 0;
3058 IADDR UNUSED pc
= abuf
->addr
;
3059 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3063 tmp_data
= GETMEMQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3064 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3066 SI opval
= EXTQISI (tmp_data
);
3067 SET_H_GRC (FLD (f_rm
), opval
);
3068 written
|= (1 << 4);
3069 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3073 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 1);
3074 SET_H_GRC (FLD (f_rm
), opval
);
3075 written
|= (1 << 4);
3076 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3080 SI opval
= EXTQISI (tmp_data
);
3081 SET_H_GRC (FLD (f_rn
), opval
);
3082 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3086 abuf
->written
= written
;
3091 CASE (sem
, INSN_MOVB8_COMPACT
) : /* mov.b @(r0, $rm), $rn */
3093 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3095 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3096 int UNUSED written
= 0;
3097 IADDR UNUSED pc
= abuf
->addr
;
3098 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3101 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
)))));
3102 SET_H_GRC (FLD (f_rn
), opval
);
3103 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3110 CASE (sem
, INSN_MOVB9_COMPACT
) : /* mov.b @($imm8, gbr), r0 */
3112 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3113 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3114 #define FLD(f) abuf->fields.sfmt_addi_compact.f
3115 int UNUSED written
= 0;
3116 IADDR UNUSED pc
= abuf
->addr
;
3117 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3120 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8
))));
3121 SET_H_GRC (((UINT
) 0), opval
);
3122 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3129 CASE (sem
, INSN_MOVB10_COMPACT
) : /* mov.b @($imm4, $rm), r0 */
3131 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3132 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3133 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
3134 int UNUSED written
= 0;
3135 IADDR UNUSED pc
= abuf
->addr
;
3136 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3139 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4
))));
3140 SET_H_GRC (((UINT
) 0), opval
);
3141 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3148 CASE (sem
, INSN_MOVL1_COMPACT
) : /* mov.l $rm, @$rn */
3150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3152 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3153 int UNUSED written
= 0;
3154 IADDR UNUSED pc
= abuf
->addr
;
3155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3158 SI opval
= GET_H_GRC (FLD (f_rm
));
3159 SETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3160 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3167 CASE (sem
, INSN_MOVL2_COMPACT
) : /* mov.l $rm, @-$rn */
3169 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3170 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3171 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3172 int UNUSED written
= 0;
3173 IADDR UNUSED pc
= abuf
->addr
;
3174 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3178 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
3180 SI opval
= GET_H_GRC (FLD (f_rm
));
3181 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
3182 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3185 SI opval
= tmp_addr
;
3186 SET_H_GRC (FLD (f_rn
), opval
);
3187 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3195 CASE (sem
, INSN_MOVL3_COMPACT
) : /* mov.l $rm, @(r0, $rn) */
3197 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3198 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3199 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3200 int UNUSED written
= 0;
3201 IADDR UNUSED pc
= abuf
->addr
;
3202 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3205 SI opval
= GET_H_GRC (FLD (f_rm
));
3206 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
3207 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3214 CASE (sem
, INSN_MOVL4_COMPACT
) : /* mov.l r0, @($imm8x4, gbr) */
3216 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3217 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3218 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3219 int UNUSED written
= 0;
3220 IADDR UNUSED pc
= abuf
->addr
;
3221 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3224 SI opval
= GET_H_GRC (((UINT
) 0));
3225 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x4
)), opval
);
3226 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3233 CASE (sem
, INSN_MOVL5_COMPACT
) : /* mov.l $rm, @($imm4x4, $rn) */
3235 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3236 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3237 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3238 int UNUSED written
= 0;
3239 IADDR UNUSED pc
= abuf
->addr
;
3240 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3243 SI opval
= GET_H_GRC (FLD (f_rm
));
3244 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm4x4
)), opval
);
3245 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3252 CASE (sem
, INSN_MOVL6_COMPACT
) : /* mov.l @$rm, $rn */
3254 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3255 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3256 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3257 int UNUSED written
= 0;
3258 IADDR UNUSED pc
= abuf
->addr
;
3259 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3262 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3263 SET_H_GRC (FLD (f_rn
), opval
);
3264 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3271 CASE (sem
, INSN_MOVL7_COMPACT
) : /* mov.l @${rm}+, $rn */
3273 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3274 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3275 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3276 int UNUSED written
= 0;
3277 IADDR UNUSED pc
= abuf
->addr
;
3278 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3282 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3283 SET_H_GRC (FLD (f_rn
), opval
);
3284 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3286 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3288 SI opval
= GET_H_GRC (FLD (f_rn
));
3289 SET_H_GRC (FLD (f_rm
), opval
);
3290 written
|= (1 << 5);
3291 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3295 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
3296 SET_H_GRC (FLD (f_rm
), opval
);
3297 written
|= (1 << 5);
3298 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3303 abuf
->written
= written
;
3308 CASE (sem
, INSN_MOVL8_COMPACT
) : /* mov.l @(r0, $rm), $rn */
3310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3312 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3313 int UNUSED written
= 0;
3314 IADDR UNUSED pc
= abuf
->addr
;
3315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3318 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
3319 SET_H_GRC (FLD (f_rn
), opval
);
3320 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3327 CASE (sem
, INSN_MOVL9_COMPACT
) : /* mov.l @($imm8x4, gbr), r0 */
3329 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3330 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3331 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3332 int UNUSED written
= 0;
3333 IADDR UNUSED pc
= abuf
->addr
;
3334 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3337 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x4
)));
3338 SET_H_GRC (((UINT
) 0), opval
);
3339 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3346 CASE (sem
, INSN_MOVL10_COMPACT
) : /* mov.l @($imm8x4, pc), $rn */
3348 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3349 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3350 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3351 int UNUSED written
= 0;
3352 IADDR UNUSED pc
= abuf
->addr
;
3353 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3356 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (FLD (f_imm8x4
), ANDDI (ADDDI (pc
, 4), INVSI (3))));
3357 SET_H_GRC (FLD (f_rn
), opval
);
3358 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3365 CASE (sem
, INSN_MOVL11_COMPACT
) : /* mov.l @($imm4x4, $rm), $rn */
3367 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3368 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3369 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3370 int UNUSED written
= 0;
3371 IADDR UNUSED pc
= abuf
->addr
;
3372 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3375 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x4
)));
3376 SET_H_GRC (FLD (f_rn
), opval
);
3377 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3384 CASE (sem
, INSN_MOVL12_COMPACT
) : /* mov.l @($imm12x4, $rm), $rn */
3386 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3387 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3388 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3389 int UNUSED written
= 0;
3390 IADDR UNUSED pc
= abuf
->addr
;
3391 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3394 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm12x4
)));
3395 SET_H_GRC (FLD (f_rn
), opval
);
3396 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3403 CASE (sem
, INSN_MOVL13_COMPACT
) : /* mov.l $rm, @($imm12x4, $rn) */
3405 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3406 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3407 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3408 int UNUSED written
= 0;
3409 IADDR UNUSED pc
= abuf
->addr
;
3410 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3413 SI opval
= GET_H_GRC (FLD (f_rm
));
3414 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm12x4
)), opval
);
3415 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3422 CASE (sem
, INSN_MOVW1_COMPACT
) : /* mov.w $rm, @$rn */
3424 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3425 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3426 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3427 int UNUSED written
= 0;
3428 IADDR UNUSED pc
= abuf
->addr
;
3429 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3432 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3433 SETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3434 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3441 CASE (sem
, INSN_MOVW2_COMPACT
) : /* mov.w $rm, @-$rn */
3443 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3444 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3445 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3446 int UNUSED written
= 0;
3447 IADDR UNUSED pc
= abuf
->addr
;
3448 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3452 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 2);
3454 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3455 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
3456 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3459 SI opval
= tmp_addr
;
3460 SET_H_GRC (FLD (f_rn
), opval
);
3461 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3469 CASE (sem
, INSN_MOVW3_COMPACT
) : /* mov.w $rm, @(r0, $rn) */
3471 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3472 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3473 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3474 int UNUSED written
= 0;
3475 IADDR UNUSED pc
= abuf
->addr
;
3476 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3479 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3480 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
3481 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3488 CASE (sem
, INSN_MOVW4_COMPACT
) : /* mov.w r0, @($imm8x2, gbr) */
3490 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3491 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3492 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3493 int UNUSED written
= 0;
3494 IADDR UNUSED pc
= abuf
->addr
;
3495 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3498 HI opval
= SUBWORDSIHI (GET_H_GRC (((UINT
) 0)), 1);
3499 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x2
)), opval
);
3500 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3507 CASE (sem
, INSN_MOVW5_COMPACT
) : /* mov.w r0, @($imm4x2, $rm) */
3509 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3510 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3511 #define FLD(f) abuf->fields.sfmt_movw5_compact.f
3512 int UNUSED written
= 0;
3513 IADDR UNUSED pc
= abuf
->addr
;
3514 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3517 HI opval
= SUBWORDSIHI (GET_H_GRC (((UINT
) 0)), 1);
3518 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x2
)), opval
);
3519 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3526 CASE (sem
, INSN_MOVW6_COMPACT
) : /* mov.w @$rm, $rn */
3528 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3529 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3530 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3531 int UNUSED written
= 0;
3532 IADDR UNUSED pc
= abuf
->addr
;
3533 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3536 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
))));
3537 SET_H_GRC (FLD (f_rn
), opval
);
3538 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3545 CASE (sem
, INSN_MOVW7_COMPACT
) : /* mov.w @${rm}+, $rn */
3547 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3548 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3549 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3550 int UNUSED written
= 0;
3551 IADDR UNUSED pc
= abuf
->addr
;
3552 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3556 tmp_data
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3557 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3559 SI opval
= EXTHISI (tmp_data
);
3560 SET_H_GRC (FLD (f_rm
), opval
);
3561 written
|= (1 << 4);
3562 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3566 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
3567 SET_H_GRC (FLD (f_rm
), opval
);
3568 written
|= (1 << 4);
3569 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3573 SI opval
= EXTHISI (tmp_data
);
3574 SET_H_GRC (FLD (f_rn
), opval
);
3575 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3579 abuf
->written
= written
;
3584 CASE (sem
, INSN_MOVW8_COMPACT
) : /* mov.w @(r0, $rm), $rn */
3586 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3587 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3588 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3589 int UNUSED written
= 0;
3590 IADDR UNUSED pc
= abuf
->addr
;
3591 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3594 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
)))));
3595 SET_H_GRC (FLD (f_rn
), opval
);
3596 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3603 CASE (sem
, INSN_MOVW9_COMPACT
) : /* mov.w @($imm8x2, gbr), r0 */
3605 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3606 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3607 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3608 int UNUSED written
= 0;
3609 IADDR UNUSED pc
= abuf
->addr
;
3610 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3613 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x2
))));
3614 SET_H_GRC (((UINT
) 0), opval
);
3615 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3622 CASE (sem
, INSN_MOVW10_COMPACT
) : /* mov.w @($imm8x2, pc), $rn */
3624 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3625 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3626 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3627 int UNUSED written
= 0;
3628 IADDR UNUSED pc
= abuf
->addr
;
3629 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3632 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDDI (ADDDI (pc
, 4), FLD (f_imm8x2
))));
3633 SET_H_GRC (FLD (f_rn
), opval
);
3634 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3641 CASE (sem
, INSN_MOVW11_COMPACT
) : /* mov.w @($imm4x2, $rm), r0 */
3643 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3644 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3645 #define FLD(f) abuf->fields.sfmt_movw5_compact.f
3646 int UNUSED written
= 0;
3647 IADDR UNUSED pc
= abuf
->addr
;
3648 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3651 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x2
))));
3652 SET_H_GRC (((UINT
) 0), opval
);
3653 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3660 CASE (sem
, INSN_MOVA_COMPACT
) : /* mova @($imm8x4, pc), r0 */
3662 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3663 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3664 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3665 int UNUSED written
= 0;
3666 IADDR UNUSED pc
= abuf
->addr
;
3667 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3670 SI opval
= ADDDI (ANDDI (ADDDI (pc
, 4), INVSI (3)), FLD (f_imm8x4
));
3671 SET_H_GRC (((UINT
) 0), opval
);
3672 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3679 CASE (sem
, INSN_MOVCAL_COMPACT
) : /* movca.l r0, @$rn */
3681 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3682 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3683 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3684 int UNUSED written
= 0;
3685 IADDR UNUSED pc
= abuf
->addr
;
3686 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3689 SI opval
= GET_H_GRC (((UINT
) 0));
3690 SETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3691 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3698 CASE (sem
, INSN_MOVCOL_COMPACT
) : /* movco.l r0, @$rn */
3700 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3701 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3702 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3703 int UNUSED written
= 0;
3704 IADDR UNUSED pc
= abuf
->addr
;
3705 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3708 SI opval
= GET_H_GRC (FLD (f_rn
));
3709 SET_H_GRC (FLD (f_rn
), opval
);
3710 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3717 CASE (sem
, INSN_MOVT_COMPACT
) : /* movt $rn */
3719 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3720 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3721 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3722 int UNUSED written
= 0;
3723 IADDR UNUSED pc
= abuf
->addr
;
3724 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3727 SI opval
= ZEXTBISI (GET_H_TBIT ());
3728 SET_H_GRC (FLD (f_rn
), opval
);
3729 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3736 CASE (sem
, INSN_MOVUAL_COMPACT
) : /* movua.l @$rn, r0 */
3738 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3740 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3741 int UNUSED written
= 0;
3742 IADDR UNUSED pc
= abuf
->addr
;
3743 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3746 SI opval
= sh64_movua (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
3747 SET_H_GRC (((UINT
) 0), opval
);
3748 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3755 CASE (sem
, INSN_MOVUAL2_COMPACT
) : /* movua.l @$rn+, r0 */
3757 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3758 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3759 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3760 int UNUSED written
= 0;
3761 IADDR UNUSED pc
= abuf
->addr
;
3762 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3766 SI opval
= sh64_movua (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
3767 SET_H_GRC (((UINT
) 0), opval
);
3768 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3771 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
3772 SET_H_GRC (FLD (f_rn
), opval
);
3773 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3781 CASE (sem
, INSN_MULL_COMPACT
) : /* mul.l $rm, $rn */
3783 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3784 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3785 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3786 int UNUSED written
= 0;
3787 IADDR UNUSED pc
= abuf
->addr
;
3788 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3791 SI opval
= MULSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
3793 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3800 CASE (sem
, INSN_MULSW_COMPACT
) : /* muls.w $rm, $rn */
3802 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3803 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3804 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3805 int UNUSED written
= 0;
3806 IADDR UNUSED pc
= abuf
->addr
;
3807 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3810 SI opval
= MULSI (EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1)), EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rn
)), 1)));
3812 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3819 CASE (sem
, INSN_MULUW_COMPACT
) : /* mulu.w $rm, $rn */
3821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3823 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3824 int UNUSED written
= 0;
3825 IADDR UNUSED pc
= abuf
->addr
;
3826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3829 SI opval
= MULSI (ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1)), ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rn
)), 1)));
3831 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3838 CASE (sem
, INSN_NEG_COMPACT
) : /* neg $rm, $rn */
3840 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3841 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3842 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3843 int UNUSED written
= 0;
3844 IADDR UNUSED pc
= abuf
->addr
;
3845 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3848 SI opval
= NEGSI (GET_H_GRC (FLD (f_rm
)));
3849 SET_H_GRC (FLD (f_rn
), opval
);
3850 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3857 CASE (sem
, INSN_NEGC_COMPACT
) : /* negc $rm, $rn */
3859 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3860 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3861 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3862 int UNUSED written
= 0;
3863 IADDR UNUSED pc
= abuf
->addr
;
3864 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3868 tmp_flag
= SUBCFSI (0, GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
3870 SI opval
= SUBCSI (0, GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
3871 SET_H_GRC (FLD (f_rn
), opval
);
3872 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3875 BI opval
= tmp_flag
;
3877 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
3885 CASE (sem
, INSN_NOP_COMPACT
) : /* nop */
3887 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3888 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3889 #define FLD(f) abuf->fields.fmt_empty.f
3890 int UNUSED written
= 0;
3891 IADDR UNUSED pc
= abuf
->addr
;
3892 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3900 CASE (sem
, INSN_NOT_COMPACT
) : /* not $rm64, $rn64 */
3902 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3903 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3904 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3905 int UNUSED written
= 0;
3906 IADDR UNUSED pc
= abuf
->addr
;
3907 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3910 DI opval
= INVDI (GET_H_GR (FLD (f_rm
)));
3911 SET_H_GR (FLD (f_rn
), opval
);
3912 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3919 CASE (sem
, INSN_OCBI_COMPACT
) : /* ocbi @$rn */
3921 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3922 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3923 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3924 int UNUSED written
= 0;
3925 IADDR UNUSED pc
= abuf
->addr
;
3926 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3930 SI opval
= GET_H_GRC (FLD (f_rn
));
3931 SET_H_GRC (FLD (f_rn
), opval
);
3932 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3941 CASE (sem
, INSN_OCBP_COMPACT
) : /* ocbp @$rn */
3943 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3944 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3945 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3946 int UNUSED written
= 0;
3947 IADDR UNUSED pc
= abuf
->addr
;
3948 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3952 SI opval
= GET_H_GRC (FLD (f_rn
));
3953 SET_H_GRC (FLD (f_rn
), opval
);
3954 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3963 CASE (sem
, INSN_OCBWB_COMPACT
) : /* ocbwb @$rn */
3965 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3966 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3967 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3968 int UNUSED written
= 0;
3969 IADDR UNUSED pc
= abuf
->addr
;
3970 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3974 SI opval
= GET_H_GRC (FLD (f_rn
));
3975 SET_H_GRC (FLD (f_rn
), opval
);
3976 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3985 CASE (sem
, INSN_OR_COMPACT
) : /* or $rm64, $rn64 */
3987 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3989 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3990 int UNUSED written
= 0;
3991 IADDR UNUSED pc
= abuf
->addr
;
3992 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3995 DI opval
= ORDI (GET_H_GR (FLD (f_rm
)), GET_H_GR (FLD (f_rn
)));
3996 SET_H_GR (FLD (f_rn
), opval
);
3997 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4004 CASE (sem
, INSN_ORI_COMPACT
) : /* or #$uimm8, r0 */
4006 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4007 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4008 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4009 int UNUSED written
= 0;
4010 IADDR UNUSED pc
= abuf
->addr
;
4011 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4014 SI opval
= ORSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
4015 SET_H_GRC (((UINT
) 0), opval
);
4016 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4023 CASE (sem
, INSN_ORB_COMPACT
) : /* or.b #$imm8, @(r0, gbr) */
4025 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4026 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4027 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4028 int UNUSED written
= 0;
4029 IADDR UNUSED pc
= abuf
->addr
;
4030 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4035 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
4036 tmp_data
= ORQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
4038 UQI opval
= tmp_data
;
4039 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
4040 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4048 CASE (sem
, INSN_PREF_COMPACT
) : /* pref @$rn */
4050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4052 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4053 int UNUSED written
= 0;
4054 IADDR UNUSED pc
= abuf
->addr
;
4055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4057 sh64_pref (current_cpu
, GET_H_GRC (FLD (f_rn
)));
4063 CASE (sem
, INSN_ROTCL_COMPACT
) : /* rotcl $rn */
4065 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4066 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4067 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4068 int UNUSED written
= 0;
4069 IADDR UNUSED pc
= abuf
->addr
;
4070 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4074 tmp_temp
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4076 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), GET_H_TBIT ());
4077 SET_H_GRC (FLD (f_rn
), opval
);
4078 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4081 BI opval
= ((tmp_temp
) ? (1) : (0));
4083 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4091 CASE (sem
, INSN_ROTCR_COMPACT
) : /* rotcr $rn */
4093 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4095 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4096 int UNUSED written
= 0;
4097 IADDR UNUSED pc
= abuf
->addr
;
4098 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4103 tmp_lsbit
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rn
)), 1), 0)) ? (0) : (1));
4104 tmp_temp
= GET_H_TBIT ();
4106 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rn
)), 1), SLLSI (tmp_temp
, 31));
4107 SET_H_GRC (FLD (f_rn
), opval
);
4108 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4111 BI opval
= ((tmp_lsbit
) ? (1) : (0));
4113 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4121 CASE (sem
, INSN_ROTL_COMPACT
) : /* rotl $rn */
4123 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4125 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4126 int UNUSED written
= 0;
4127 IADDR UNUSED pc
= abuf
->addr
;
4128 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4132 tmp_temp
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4134 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), tmp_temp
);
4135 SET_H_GRC (FLD (f_rn
), opval
);
4136 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4139 BI opval
= ((tmp_temp
) ? (1) : (0));
4141 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4149 CASE (sem
, INSN_ROTR_COMPACT
) : /* rotr $rn */
4151 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4152 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4153 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4154 int UNUSED written
= 0;
4155 IADDR UNUSED pc
= abuf
->addr
;
4156 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4161 tmp_lsbit
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rn
)), 1), 0)) ? (0) : (1));
4162 tmp_temp
= tmp_lsbit
;
4164 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rn
)), 1), SLLSI (tmp_temp
, 31));
4165 SET_H_GRC (FLD (f_rn
), opval
);
4166 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4169 BI opval
= ((tmp_lsbit
) ? (1) : (0));
4171 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4179 CASE (sem
, INSN_RTS_COMPACT
) : /* rts */
4181 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4182 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4183 #define FLD(f) abuf->fields.fmt_empty.f
4184 int UNUSED written
= 0;
4185 IADDR UNUSED pc
= abuf
->addr
;
4187 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4191 UDI opval
= ADDDI (pc
, 2);
4192 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
4193 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
4198 UDI opval
= GET_H_PR ();
4199 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
4200 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
4206 SEM_BRANCH_FINI (vpc
);
4211 CASE (sem
, INSN_SETS_COMPACT
) : /* sets */
4213 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4214 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4215 #define FLD(f) abuf->fields.fmt_empty.f
4216 int UNUSED written
= 0;
4217 IADDR UNUSED pc
= abuf
->addr
;
4218 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4223 TRACE_RESULT (current_cpu
, abuf
, "sbit", 'x', opval
);
4230 CASE (sem
, INSN_SETT_COMPACT
) : /* sett */
4232 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4233 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4234 #define FLD(f) abuf->fields.fmt_empty.f
4235 int UNUSED written
= 0;
4236 IADDR UNUSED pc
= abuf
->addr
;
4237 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4242 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4249 CASE (sem
, INSN_SHAD_COMPACT
) : /* shad $rm, $rn */
4251 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4252 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4253 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4254 int UNUSED written
= 0;
4255 IADDR UNUSED pc
= abuf
->addr
;
4256 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4260 tmp_shamt
= ANDSI (GET_H_GRC (FLD (f_rm
)), 31);
4261 if (GESI (GET_H_GRC (FLD (f_rm
)), 0)) {
4263 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), tmp_shamt
);
4264 SET_H_GRC (FLD (f_rn
), opval
);
4265 written
|= (1 << 2);
4266 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4269 if (NESI (tmp_shamt
, 0)) {
4271 SI opval
= SRASI (GET_H_GRC (FLD (f_rn
)), SUBSI (32, tmp_shamt
));
4272 SET_H_GRC (FLD (f_rn
), opval
);
4273 written
|= (1 << 2);
4274 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4277 if (LTSI (GET_H_GRC (FLD (f_rn
)), 0)) {
4279 SI opval
= NEGSI (1);
4280 SET_H_GRC (FLD (f_rn
), opval
);
4281 written
|= (1 << 2);
4282 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4287 SET_H_GRC (FLD (f_rn
), opval
);
4288 written
|= (1 << 2);
4289 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4296 abuf
->written
= written
;
4301 CASE (sem
, INSN_SHAL_COMPACT
) : /* shal $rn */
4303 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4304 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4305 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4306 int UNUSED written
= 0;
4307 IADDR UNUSED pc
= abuf
->addr
;
4308 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4312 tmp_t
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4314 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 1);
4315 SET_H_GRC (FLD (f_rn
), opval
);
4316 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4319 BI opval
= ((tmp_t
) ? (1) : (0));
4321 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4329 CASE (sem
, INSN_SHAR_COMPACT
) : /* shar $rn */
4331 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4332 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4333 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4334 int UNUSED written
= 0;
4335 IADDR UNUSED pc
= abuf
->addr
;
4336 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4340 tmp_t
= ANDSI (GET_H_GRC (FLD (f_rn
)), 1);
4342 SI opval
= SRASI (GET_H_GRC (FLD (f_rn
)), 1);
4343 SET_H_GRC (FLD (f_rn
), opval
);
4344 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4347 BI opval
= ((tmp_t
) ? (1) : (0));
4349 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4357 CASE (sem
, INSN_SHLD_COMPACT
) : /* shld $rm, $rn */
4359 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4360 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4361 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4362 int UNUSED written
= 0;
4363 IADDR UNUSED pc
= abuf
->addr
;
4364 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4368 tmp_shamt
= ANDSI (GET_H_GRC (FLD (f_rm
)), 31);
4369 if (GESI (GET_H_GRC (FLD (f_rm
)), 0)) {
4371 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), tmp_shamt
);
4372 SET_H_GRC (FLD (f_rn
), opval
);
4373 written
|= (1 << 2);
4374 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4377 if (NESI (tmp_shamt
, 0)) {
4379 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), SUBSI (32, tmp_shamt
));
4380 SET_H_GRC (FLD (f_rn
), opval
);
4381 written
|= (1 << 2);
4382 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4387 SET_H_GRC (FLD (f_rn
), opval
);
4388 written
|= (1 << 2);
4389 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4395 abuf
->written
= written
;
4400 CASE (sem
, INSN_SHLL_COMPACT
) : /* shll $rn */
4402 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4403 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4404 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4405 int UNUSED written
= 0;
4406 IADDR UNUSED pc
= abuf
->addr
;
4407 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4411 tmp_t
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4413 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 1);
4414 SET_H_GRC (FLD (f_rn
), opval
);
4415 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4418 BI opval
= ((tmp_t
) ? (1) : (0));
4420 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4428 CASE (sem
, INSN_SHLL2_COMPACT
) : /* shll2 $rn */
4430 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4431 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4432 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4433 int UNUSED written
= 0;
4434 IADDR UNUSED pc
= abuf
->addr
;
4435 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4438 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 2);
4439 SET_H_GRC (FLD (f_rn
), opval
);
4440 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4447 CASE (sem
, INSN_SHLL8_COMPACT
) : /* shll8 $rn */
4449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4451 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4452 int UNUSED written
= 0;
4453 IADDR UNUSED pc
= abuf
->addr
;
4454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4457 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 8);
4458 SET_H_GRC (FLD (f_rn
), opval
);
4459 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4466 CASE (sem
, INSN_SHLL16_COMPACT
) : /* shll16 $rn */
4468 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4469 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4470 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4471 int UNUSED written
= 0;
4472 IADDR UNUSED pc
= abuf
->addr
;
4473 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4476 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 16);
4477 SET_H_GRC (FLD (f_rn
), opval
);
4478 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4485 CASE (sem
, INSN_SHLR_COMPACT
) : /* shlr $rn */
4487 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4488 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4489 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4490 int UNUSED written
= 0;
4491 IADDR UNUSED pc
= abuf
->addr
;
4492 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4496 tmp_t
= ANDSI (GET_H_GRC (FLD (f_rn
)), 1);
4498 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 1);
4499 SET_H_GRC (FLD (f_rn
), opval
);
4500 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4503 BI opval
= ((tmp_t
) ? (1) : (0));
4505 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4513 CASE (sem
, INSN_SHLR2_COMPACT
) : /* shlr2 $rn */
4515 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4516 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4517 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4518 int UNUSED written
= 0;
4519 IADDR UNUSED pc
= abuf
->addr
;
4520 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4523 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 2);
4524 SET_H_GRC (FLD (f_rn
), opval
);
4525 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4532 CASE (sem
, INSN_SHLR8_COMPACT
) : /* shlr8 $rn */
4534 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4536 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4537 int UNUSED written
= 0;
4538 IADDR UNUSED pc
= abuf
->addr
;
4539 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4542 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 8);
4543 SET_H_GRC (FLD (f_rn
), opval
);
4544 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4551 CASE (sem
, INSN_SHLR16_COMPACT
) : /* shlr16 $rn */
4553 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4554 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4555 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4556 int UNUSED written
= 0;
4557 IADDR UNUSED pc
= abuf
->addr
;
4558 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4561 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 16);
4562 SET_H_GRC (FLD (f_rn
), opval
);
4563 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4570 CASE (sem
, INSN_STC_GBR_COMPACT
) : /* stc gbr, $rn */
4572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4574 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4575 int UNUSED written
= 0;
4576 IADDR UNUSED pc
= abuf
->addr
;
4577 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4580 SI opval
= GET_H_GBR ();
4581 SET_H_GRC (FLD (f_rn
), opval
);
4582 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4589 CASE (sem
, INSN_STC_VBR_COMPACT
) : /* stc vbr, $rn */
4591 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4592 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4593 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4594 int UNUSED written
= 0;
4595 IADDR UNUSED pc
= abuf
->addr
;
4596 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4599 SI opval
= GET_H_VBR ();
4600 SET_H_GRC (FLD (f_rn
), opval
);
4601 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4608 CASE (sem
, INSN_STCL_GBR_COMPACT
) : /* stc.l gbr, @-$rn */
4610 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4611 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4612 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4613 int UNUSED written
= 0;
4614 IADDR UNUSED pc
= abuf
->addr
;
4615 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4619 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4621 SI opval
= GET_H_GBR ();
4622 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4623 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4626 SI opval
= tmp_addr
;
4627 SET_H_GRC (FLD (f_rn
), opval
);
4628 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4636 CASE (sem
, INSN_STCL_VBR_COMPACT
) : /* stc.l vbr, @-$rn */
4638 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4639 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4640 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4641 int UNUSED written
= 0;
4642 IADDR UNUSED pc
= abuf
->addr
;
4643 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4647 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4649 SI opval
= GET_H_VBR ();
4650 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4651 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4654 SI opval
= tmp_addr
;
4655 SET_H_GRC (FLD (f_rn
), opval
);
4656 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4664 CASE (sem
, INSN_STS_FPSCR_COMPACT
) : /* sts fpscr, $rn */
4666 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4667 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4668 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4669 int UNUSED written
= 0;
4670 IADDR UNUSED pc
= abuf
->addr
;
4671 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4674 SI opval
= CPU (h_fpscr
);
4675 SET_H_GRC (FLD (f_rn
), opval
);
4676 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4683 CASE (sem
, INSN_STSL_FPSCR_COMPACT
) : /* sts.l fpscr, @-$rn */
4685 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4686 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4687 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4688 int UNUSED written
= 0;
4689 IADDR UNUSED pc
= abuf
->addr
;
4690 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4694 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4696 SI opval
= CPU (h_fpscr
);
4697 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4698 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4701 SI opval
= tmp_addr
;
4702 SET_H_GRC (FLD (f_rn
), opval
);
4703 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4711 CASE (sem
, INSN_STS_FPUL_COMPACT
) : /* sts fpul, $rn */
4713 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4714 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4715 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4716 int UNUSED written
= 0;
4717 IADDR UNUSED pc
= abuf
->addr
;
4718 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4721 SI opval
= SUBWORDSFSI (CPU (h_fr
[((UINT
) 32)]));
4722 SET_H_GRC (FLD (f_rn
), opval
);
4723 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4730 CASE (sem
, INSN_STSL_FPUL_COMPACT
) : /* sts.l fpul, @-$rn */
4732 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4733 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4734 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4735 int UNUSED written
= 0;
4736 IADDR UNUSED pc
= abuf
->addr
;
4737 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4741 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4743 SF opval
= CPU (h_fr
[((UINT
) 32)]);
4744 SETMEMSF (current_cpu
, pc
, tmp_addr
, opval
);
4745 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
4748 SI opval
= tmp_addr
;
4749 SET_H_GRC (FLD (f_rn
), opval
);
4750 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4758 CASE (sem
, INSN_STS_MACH_COMPACT
) : /* sts mach, $rn */
4760 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4761 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4762 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4763 int UNUSED written
= 0;
4764 IADDR UNUSED pc
= abuf
->addr
;
4765 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4768 SI opval
= GET_H_MACH ();
4769 SET_H_GRC (FLD (f_rn
), opval
);
4770 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4777 CASE (sem
, INSN_STSL_MACH_COMPACT
) : /* sts.l mach, @-$rn */
4779 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4780 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4781 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4782 int UNUSED written
= 0;
4783 IADDR UNUSED pc
= abuf
->addr
;
4784 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4788 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4790 SI opval
= GET_H_MACH ();
4791 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4792 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4795 SI opval
= tmp_addr
;
4796 SET_H_GRC (FLD (f_rn
), opval
);
4797 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4805 CASE (sem
, INSN_STS_MACL_COMPACT
) : /* sts macl, $rn */
4807 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4808 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4809 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4810 int UNUSED written
= 0;
4811 IADDR UNUSED pc
= abuf
->addr
;
4812 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4815 SI opval
= GET_H_MACL ();
4816 SET_H_GRC (FLD (f_rn
), opval
);
4817 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4824 CASE (sem
, INSN_STSL_MACL_COMPACT
) : /* sts.l macl, @-$rn */
4826 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4827 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4828 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4829 int UNUSED written
= 0;
4830 IADDR UNUSED pc
= abuf
->addr
;
4831 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4835 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4837 SI opval
= GET_H_MACL ();
4838 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4839 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4842 SI opval
= tmp_addr
;
4843 SET_H_GRC (FLD (f_rn
), opval
);
4844 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4852 CASE (sem
, INSN_STS_PR_COMPACT
) : /* sts pr, $rn */
4854 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4855 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4856 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4857 int UNUSED written
= 0;
4858 IADDR UNUSED pc
= abuf
->addr
;
4859 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4862 SI opval
= GET_H_PR ();
4863 SET_H_GRC (FLD (f_rn
), opval
);
4864 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4871 CASE (sem
, INSN_STSL_PR_COMPACT
) : /* sts.l pr, @-$rn */
4873 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4874 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4875 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4876 int UNUSED written
= 0;
4877 IADDR UNUSED pc
= abuf
->addr
;
4878 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4882 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4884 SI opval
= GET_H_PR ();
4885 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4886 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4889 SI opval
= tmp_addr
;
4890 SET_H_GRC (FLD (f_rn
), opval
);
4891 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4899 CASE (sem
, INSN_SUB_COMPACT
) : /* sub $rm, $rn */
4901 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4902 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4903 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4904 int UNUSED written
= 0;
4905 IADDR UNUSED pc
= abuf
->addr
;
4906 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4909 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
4910 SET_H_GRC (FLD (f_rn
), opval
);
4911 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4918 CASE (sem
, INSN_SUBC_COMPACT
) : /* subc $rm, $rn */
4920 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4921 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4922 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4923 int UNUSED written
= 0;
4924 IADDR UNUSED pc
= abuf
->addr
;
4925 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4929 tmp_flag
= SUBCFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
4931 SI opval
= SUBCSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
4932 SET_H_GRC (FLD (f_rn
), opval
);
4933 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4936 BI opval
= tmp_flag
;
4938 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4946 CASE (sem
, INSN_SUBV_COMPACT
) : /* subv $rm, $rn */
4948 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4949 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4950 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4951 int UNUSED written
= 0;
4952 IADDR UNUSED pc
= abuf
->addr
;
4953 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4957 tmp_t
= SUBOFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), 0);
4959 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
4960 SET_H_GRC (FLD (f_rn
), opval
);
4961 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4964 BI opval
= ((tmp_t
) ? (1) : (0));
4966 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4974 CASE (sem
, INSN_SWAPB_COMPACT
) : /* swap.b $rm, $rn */
4976 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4978 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4979 int UNUSED written
= 0;
4980 IADDR UNUSED pc
= abuf
->addr
;
4981 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4987 tmp_top_half
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 0);
4988 tmp_byte1
= SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 2);
4989 tmp_byte0
= SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3);
4991 SI opval
= ORSI (SLLSI (tmp_top_half
, 16), ORSI (SLLSI (tmp_byte0
, 8), tmp_byte1
));
4992 SET_H_GRC (FLD (f_rn
), opval
);
4993 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5001 CASE (sem
, INSN_SWAPW_COMPACT
) : /* swap.w $rm, $rn */
5003 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5004 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5005 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5006 int UNUSED written
= 0;
5007 IADDR UNUSED pc
= abuf
->addr
;
5008 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5011 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rm
)), 16), SLLSI (GET_H_GRC (FLD (f_rm
)), 16));
5012 SET_H_GRC (FLD (f_rn
), opval
);
5013 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5020 CASE (sem
, INSN_TASB_COMPACT
) : /* tas.b @$rn */
5022 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5023 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5024 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
5025 int UNUSED written
= 0;
5026 IADDR UNUSED pc
= abuf
->addr
;
5027 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5031 tmp_byte
= GETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
5033 BI opval
= ((EQQI (tmp_byte
, 0)) ? (1) : (0));
5035 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5037 tmp_byte
= ORQI (tmp_byte
, 128);
5039 UQI opval
= tmp_byte
;
5040 SETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
5041 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5049 CASE (sem
, INSN_TRAPA_COMPACT
) : /* trapa #$uimm8 */
5051 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5052 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5053 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5054 int UNUSED written
= 0;
5055 IADDR UNUSED pc
= abuf
->addr
;
5056 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5058 sh64_compact_trapa (current_cpu
, FLD (f_imm8
), pc
);
5064 CASE (sem
, INSN_TST_COMPACT
) : /* tst $rm, $rn */
5066 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5067 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5068 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5069 int UNUSED written
= 0;
5070 IADDR UNUSED pc
= abuf
->addr
;
5071 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5074 BI opval
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
))), 0)) ? (1) : (0));
5076 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5083 CASE (sem
, INSN_TSTI_COMPACT
) : /* tst #$uimm8, r0 */
5085 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5086 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5087 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5088 int UNUSED written
= 0;
5089 IADDR UNUSED pc
= abuf
->addr
;
5090 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5093 BI opval
= ((EQSI (ANDSI (GET_H_GRC (((UINT
) 0)), ZEXTSISI (FLD (f_imm8
))), 0)) ? (1) : (0));
5095 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5102 CASE (sem
, INSN_TSTB_COMPACT
) : /* tst.b #$imm8, @(r0, gbr) */
5104 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5105 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5106 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5107 int UNUSED written
= 0;
5108 IADDR UNUSED pc
= abuf
->addr
;
5109 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5113 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
5115 BI opval
= ((EQQI (ANDQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
)), 0)) ? (1) : (0));
5117 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5125 CASE (sem
, INSN_XOR_COMPACT
) : /* xor $rm64, $rn64 */
5127 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5128 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5129 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5130 int UNUSED written
= 0;
5131 IADDR UNUSED pc
= abuf
->addr
;
5132 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5135 DI opval
= XORDI (GET_H_GR (FLD (f_rn
)), GET_H_GR (FLD (f_rm
)));
5136 SET_H_GR (FLD (f_rn
), opval
);
5137 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5144 CASE (sem
, INSN_XORI_COMPACT
) : /* xor #$uimm8, r0 */
5146 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5147 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5148 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5149 int UNUSED written
= 0;
5150 IADDR UNUSED pc
= abuf
->addr
;
5151 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5154 SI opval
= XORSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
5155 SET_H_GRC (((UINT
) 0), opval
);
5156 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5163 CASE (sem
, INSN_XORB_COMPACT
) : /* xor.b #$imm8, @(r0, gbr) */
5165 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5166 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5167 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5168 int UNUSED written
= 0;
5169 IADDR UNUSED pc
= abuf
->addr
;
5170 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5175 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
5176 tmp_data
= XORQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
5178 UQI opval
= tmp_data
;
5179 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5180 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5188 CASE (sem
, INSN_XTRCT_COMPACT
) : /* xtrct $rm, $rn */
5190 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5191 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5192 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5193 int UNUSED written
= 0;
5194 IADDR UNUSED pc
= abuf
->addr
;
5195 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5198 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rm
)), 16), SRLSI (GET_H_GRC (FLD (f_rn
)), 16));
5199 SET_H_GRC (FLD (f_rn
), opval
);
5200 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5209 ENDSWITCH (sem
) /* End of semantic switch. */
5211 /* At this point `vpc' contains the next insn to execute. */
5214 #undef DEFINE_SWITCH
5215 #endif /* DEFINE_SWITCH */