1 /* Simulator instruction semantics for crisv32f.
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 3 of the License, or
12 (at your option) any later version.
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
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 /* The labels have the case they have because the enum of insn types
27 is all uppercase and in the non-stdc case the insn symbol is built
28 into the enum name. */
34 { CRISV32F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
35 { CRISV32F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
36 { CRISV32F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
37 { CRISV32F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
38 { CRISV32F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
39 { CRISV32F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
40 { CRISV32F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
41 { CRISV32F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
42 { CRISV32F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
43 { CRISV32F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
44 { CRISV32F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
45 { CRISV32F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
46 { CRISV32F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
47 { CRISV32F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
48 { CRISV32F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
49 { CRISV32F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
50 { CRISV32F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
51 { CRISV32F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
52 { CRISV32F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
53 { CRISV32F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
54 { CRISV32F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
55 { CRISV32F_INSN_ADDQ, && case_sem_INSN_ADDQ },
56 { CRISV32F_INSN_SUBQ, && case_sem_INSN_SUBQ },
57 { CRISV32F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
58 { CRISV32F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
59 { CRISV32F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
60 { CRISV32F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
61 { CRISV32F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
62 { CRISV32F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
63 { CRISV32F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
64 { CRISV32F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
65 { CRISV32F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
66 { CRISV32F_INSN_CMPQ, && case_sem_INSN_CMPQ },
67 { CRISV32F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
68 { CRISV32F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
69 { CRISV32F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
70 { CRISV32F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
71 { CRISV32F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
72 { CRISV32F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
73 { CRISV32F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
74 { CRISV32F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
75 { CRISV32F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
76 { CRISV32F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
77 { CRISV32F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
78 { CRISV32F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
79 { CRISV32F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
80 { CRISV32F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
81 { CRISV32F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
82 { CRISV32F_INSN_MOVE_R_SPRV32, && case_sem_INSN_MOVE_R_SPRV32 },
83 { CRISV32F_INSN_MOVE_SPR_RV32, && case_sem_INSN_MOVE_SPR_RV32 },
84 { CRISV32F_INSN_MOVE_M_SPRV32, && case_sem_INSN_MOVE_M_SPRV32 },
85 { CRISV32F_INSN_MOVE_C_SPRV32_P2, && case_sem_INSN_MOVE_C_SPRV32_P2 },
86 { CRISV32F_INSN_MOVE_C_SPRV32_P3, && case_sem_INSN_MOVE_C_SPRV32_P3 },
87 { CRISV32F_INSN_MOVE_C_SPRV32_P5, && case_sem_INSN_MOVE_C_SPRV32_P5 },
88 { CRISV32F_INSN_MOVE_C_SPRV32_P6, && case_sem_INSN_MOVE_C_SPRV32_P6 },
89 { CRISV32F_INSN_MOVE_C_SPRV32_P7, && case_sem_INSN_MOVE_C_SPRV32_P7 },
90 { CRISV32F_INSN_MOVE_C_SPRV32_P9, && case_sem_INSN_MOVE_C_SPRV32_P9 },
91 { CRISV32F_INSN_MOVE_C_SPRV32_P10, && case_sem_INSN_MOVE_C_SPRV32_P10 },
92 { CRISV32F_INSN_MOVE_C_SPRV32_P11, && case_sem_INSN_MOVE_C_SPRV32_P11 },
93 { CRISV32F_INSN_MOVE_C_SPRV32_P12, && case_sem_INSN_MOVE_C_SPRV32_P12 },
94 { CRISV32F_INSN_MOVE_C_SPRV32_P13, && case_sem_INSN_MOVE_C_SPRV32_P13 },
95 { CRISV32F_INSN_MOVE_C_SPRV32_P14, && case_sem_INSN_MOVE_C_SPRV32_P14 },
96 { CRISV32F_INSN_MOVE_C_SPRV32_P15, && case_sem_INSN_MOVE_C_SPRV32_P15 },
97 { CRISV32F_INSN_MOVE_SPR_MV32, && case_sem_INSN_MOVE_SPR_MV32 },
98 { CRISV32F_INSN_MOVE_SS_R, && case_sem_INSN_MOVE_SS_R },
99 { CRISV32F_INSN_MOVE_R_SS, && case_sem_INSN_MOVE_R_SS },
100 { CRISV32F_INSN_MOVEM_R_M_V32, && case_sem_INSN_MOVEM_R_M_V32 },
101 { CRISV32F_INSN_MOVEM_M_R_V32, && case_sem_INSN_MOVEM_M_R_V32 },
102 { CRISV32F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
103 { CRISV32F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
104 { CRISV32F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
105 { CRISV32F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
106 { CRISV32F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
107 { CRISV32F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
108 { CRISV32F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
109 { CRISV32F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
110 { CRISV32F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
111 { CRISV32F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
112 { CRISV32F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
113 { CRISV32F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
114 { CRISV32F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
115 { CRISV32F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
116 { CRISV32F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
117 { CRISV32F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
118 { CRISV32F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
119 { CRISV32F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
120 { CRISV32F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
121 { CRISV32F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
122 { CRISV32F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
123 { CRISV32F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
124 { CRISV32F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
125 { CRISV32F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
126 { CRISV32F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
127 { CRISV32F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
128 { CRISV32F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
129 { CRISV32F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
130 { CRISV32F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
131 { CRISV32F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
132 { CRISV32F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
133 { CRISV32F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
134 { CRISV32F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
135 { CRISV32F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
136 { CRISV32F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
137 { CRISV32F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
138 { CRISV32F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
139 { CRISV32F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
140 { CRISV32F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
141 { CRISV32F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
142 { CRISV32F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
143 { CRISV32F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
144 { CRISV32F_INSN_ADDC_R, && case_sem_INSN_ADDC_R },
145 { CRISV32F_INSN_ADDC_M, && case_sem_INSN_ADDC_M },
146 { CRISV32F_INSN_ADDC_C, && case_sem_INSN_ADDC_C },
147 { CRISV32F_INSN_LAPC_D, && case_sem_INSN_LAPC_D },
148 { CRISV32F_INSN_LAPCQ, && case_sem_INSN_LAPCQ },
149 { CRISV32F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
150 { CRISV32F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
151 { CRISV32F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
152 { CRISV32F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
153 { CRISV32F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
154 { CRISV32F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
155 { CRISV32F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
156 { CRISV32F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
157 { CRISV32F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
158 { CRISV32F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
159 { CRISV32F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
160 { CRISV32F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
161 { CRISV32F_INSN_MULS_B, && case_sem_INSN_MULS_B },
162 { CRISV32F_INSN_MULS_W, && case_sem_INSN_MULS_W },
163 { CRISV32F_INSN_MULS_D, && case_sem_INSN_MULS_D },
164 { CRISV32F_INSN_MULU_B, && case_sem_INSN_MULU_B },
165 { CRISV32F_INSN_MULU_W, && case_sem_INSN_MULU_W },
166 { CRISV32F_INSN_MULU_D, && case_sem_INSN_MULU_D },
167 { CRISV32F_INSN_MCP, && case_sem_INSN_MCP },
168 { CRISV32F_INSN_DSTEP, && case_sem_INSN_DSTEP },
169 { CRISV32F_INSN_ABS, && case_sem_INSN_ABS },
170 { CRISV32F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
171 { CRISV32F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
172 { CRISV32F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
173 { CRISV32F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
174 { CRISV32F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
175 { CRISV32F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
176 { CRISV32F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
177 { CRISV32F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
178 { CRISV32F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
179 { CRISV32F_INSN_ANDQ, && case_sem_INSN_ANDQ },
180 { CRISV32F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
181 { CRISV32F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
182 { CRISV32F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
183 { CRISV32F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
184 { CRISV32F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
185 { CRISV32F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
186 { CRISV32F_INSN_ORCBR, && case_sem_INSN_ORCBR },
187 { CRISV32F_INSN_ORCWR, && case_sem_INSN_ORCWR },
188 { CRISV32F_INSN_ORCDR, && case_sem_INSN_ORCDR },
189 { CRISV32F_INSN_ORQ, && case_sem_INSN_ORQ },
190 { CRISV32F_INSN_XOR, && case_sem_INSN_XOR },
191 { CRISV32F_INSN_SWAP, && case_sem_INSN_SWAP },
192 { CRISV32F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
193 { CRISV32F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
194 { CRISV32F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
195 { CRISV32F_INSN_ASRQ, && case_sem_INSN_ASRQ },
196 { CRISV32F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
197 { CRISV32F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
198 { CRISV32F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
199 { CRISV32F_INSN_LSRQ, && case_sem_INSN_LSRQ },
200 { CRISV32F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
201 { CRISV32F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
202 { CRISV32F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
203 { CRISV32F_INSN_LSLQ, && case_sem_INSN_LSLQ },
204 { CRISV32F_INSN_BTST, && case_sem_INSN_BTST },
205 { CRISV32F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
206 { CRISV32F_INSN_SETF, && case_sem_INSN_SETF },
207 { CRISV32F_INSN_CLEARF, && case_sem_INSN_CLEARF },
208 { CRISV32F_INSN_RFE, && case_sem_INSN_RFE },
209 { CRISV32F_INSN_SFE, && case_sem_INSN_SFE },
210 { CRISV32F_INSN_RFG, && case_sem_INSN_RFG },
211 { CRISV32F_INSN_RFN, && case_sem_INSN_RFN },
212 { CRISV32F_INSN_HALT, && case_sem_INSN_HALT },
213 { CRISV32F_INSN_BCC_B, && case_sem_INSN_BCC_B },
214 { CRISV32F_INSN_BA_B, && case_sem_INSN_BA_B },
215 { CRISV32F_INSN_BCC_W, && case_sem_INSN_BCC_W },
216 { CRISV32F_INSN_BA_W, && case_sem_INSN_BA_W },
217 { CRISV32F_INSN_JAS_R, && case_sem_INSN_JAS_R },
218 { CRISV32F_INSN_JAS_C, && case_sem_INSN_JAS_C },
219 { CRISV32F_INSN_JUMP_P, && case_sem_INSN_JUMP_P },
220 { CRISV32F_INSN_BAS_C, && case_sem_INSN_BAS_C },
221 { CRISV32F_INSN_JASC_R, && case_sem_INSN_JASC_R },
222 { CRISV32F_INSN_JASC_C, && case_sem_INSN_JASC_C },
223 { CRISV32F_INSN_BASC_C, && case_sem_INSN_BASC_C },
224 { CRISV32F_INSN_BREAK, && case_sem_INSN_BREAK },
225 { CRISV32F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
226 { CRISV32F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
227 { CRISV32F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
228 { CRISV32F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
229 { CRISV32F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
230 { CRISV32F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
231 { CRISV32F_INSN_SCC, && case_sem_INSN_SCC },
232 { CRISV32F_INSN_LZ, && case_sem_INSN_LZ },
233 { CRISV32F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
234 { CRISV32F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
235 { CRISV32F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
236 { CRISV32F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
237 { CRISV32F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
238 { CRISV32F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
239 { CRISV32F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
240 { CRISV32F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
241 { CRISV32F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
242 { CRISV32F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
243 { CRISV32F_INSN_FIDXI, && case_sem_INSN_FIDXI },
244 { CRISV32F_INSN_FTAGI, && case_sem_INSN_FTAGI },
245 { CRISV32F_INSN_FIDXD, && case_sem_INSN_FIDXD },
246 { CRISV32F_INSN_FTAGD, && case_sem_INSN_FTAGD },
251 for (i = 0; labels[i].label != 0; ++i)
254 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
256 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
261 #endif /* DEFINE_LABELS */
265 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
266 off frills like tracing and profiling. */
267 /* FIXME: A better way would be to have TRACE_RESULT check for something
268 that can cause it to be optimized out. Another way would be to emit
269 special handlers into the instruction "stream". */
273 #define TRACE_RESULT(cpu, abuf, name, type, val)
277 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
278 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
280 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
287 /* Branch to next handler without going around main loop. */
288 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
289 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
291 #else /* ! WITH_SCACHE_PBB */
293 #define NEXT(vpc) BREAK (sem)
296 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
298 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
301 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
304 #endif /* ! WITH_SCACHE_PBB */
308 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
310 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
311 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
312 #define FLD(f) abuf->fields.fmt_empty.f
313 int UNUSED written = 0;
314 IADDR UNUSED pc = abuf->addr;
315 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
318 /* Update the recorded pc in the cpu state struct.
319 Only necessary for WITH_SCACHE case, but to avoid the
320 conditional compilation .... */
322 /* Virtual insns have zero size. Overwrite vpc with address of next insn
323 using the default-insn-bitsize spec. When executing insns in parallel
324 we may want to queue the fault and continue execution. */
325 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
326 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
333 CASE (sem, INSN_X_AFTER) : /* --after-- */
335 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
336 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
337 #define FLD(f) abuf->fields.fmt_empty.f
338 int UNUSED written = 0;
339 IADDR UNUSED pc = abuf->addr;
340 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
343 #if WITH_SCACHE_PBB_CRISV32F
344 crisv32f_pbb_after (current_cpu, sem_arg);
352 CASE (sem, INSN_X_BEFORE) : /* --before-- */
354 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
355 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
356 #define FLD(f) abuf->fields.fmt_empty.f
357 int UNUSED written = 0;
358 IADDR UNUSED pc = abuf->addr;
359 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
362 #if WITH_SCACHE_PBB_CRISV32F
363 crisv32f_pbb_before (current_cpu, sem_arg);
371 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
373 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
374 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
375 #define FLD(f) abuf->fields.fmt_empty.f
376 int UNUSED written = 0;
377 IADDR UNUSED pc = abuf->addr;
378 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
381 #if WITH_SCACHE_PBB_CRISV32F
383 vpc = crisv32f_pbb_cti_chain (current_cpu, sem_arg,
384 pbb_br_type, pbb_br_npc);
387 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
388 vpc = crisv32f_pbb_cti_chain (current_cpu, sem_arg,
389 CPU_PBB_BR_TYPE (current_cpu),
390 CPU_PBB_BR_NPC (current_cpu));
399 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
401 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
402 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
403 #define FLD(f) abuf->fields.fmt_empty.f
404 int UNUSED written = 0;
405 IADDR UNUSED pc = abuf->addr;
406 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
409 #if WITH_SCACHE_PBB_CRISV32F
410 vpc = crisv32f_pbb_chain (current_cpu, sem_arg);
421 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
423 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
424 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
425 #define FLD(f) abuf->fields.fmt_empty.f
426 int UNUSED written = 0;
427 IADDR UNUSED pc = abuf->addr;
428 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
431 #if WITH_SCACHE_PBB_CRISV32F
432 #if defined DEFINE_SWITCH || defined FAST_P
433 /* In the switch case FAST_P is a constant, allowing several optimizations
434 in any called inline functions. */
435 vpc = crisv32f_pbb_begin (current_cpu, FAST_P);
437 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
438 vpc = crisv32f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
440 vpc = crisv32f_pbb_begin (current_cpu, 0);
450 CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
452 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
453 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
454 #define FLD(f) abuf->fields.sfmt_addc_m.f
455 int UNUSED written = 0;
456 IADDR UNUSED pc = abuf->addr;
457 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
461 tmp_newval = GET_H_GR (FLD (f_operand1));
464 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
466 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
467 SET_H_GR (FLD (f_operand2), opval);
468 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
473 BI opval = LTQI (tmp_newval, 0);
474 CPU (h_nbit) = opval;
475 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
478 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
479 CPU (h_zbit) = opval;
480 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
487 CPU (h_xbit) = opval;
488 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
492 SET_H_INSN_PREFIXED_P (opval);
493 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
503 CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
505 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
506 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
507 #define FLD(f) abuf->fields.sfmt_addc_m.f
508 int UNUSED written = 0;
509 IADDR UNUSED pc = abuf->addr;
510 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
514 tmp_newval = GET_H_GR (FLD (f_operand1));
517 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
519 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
520 SET_H_GR (FLD (f_operand2), opval);
521 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
526 BI opval = LTHI (tmp_newval, 0);
527 CPU (h_nbit) = opval;
528 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
531 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
532 CPU (h_zbit) = opval;
533 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
540 CPU (h_xbit) = opval;
541 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
545 SET_H_INSN_PREFIXED_P (opval);
546 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
556 CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
558 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
559 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
560 #define FLD(f) abuf->fields.sfmt_addc_m.f
561 int UNUSED written = 0;
562 IADDR UNUSED pc = abuf->addr;
563 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
567 tmp_newval = GET_H_GR (FLD (f_operand1));
569 SI opval = tmp_newval;
570 SET_H_GR (FLD (f_operand2), opval);
571 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
575 BI opval = LTSI (tmp_newval, 0);
576 CPU (h_nbit) = opval;
577 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
580 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
581 CPU (h_zbit) = opval;
582 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
589 CPU (h_xbit) = opval;
590 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
594 SET_H_INSN_PREFIXED_P (opval);
595 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
605 CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
607 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
608 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
609 #define FLD(f) abuf->fields.sfmt_moveq.f
610 int UNUSED written = 0;
611 IADDR UNUSED pc = abuf->addr;
612 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
616 tmp_newval = FLD (f_s6);
618 SI opval = tmp_newval;
619 SET_H_GR (FLD (f_operand2), opval);
620 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
623 SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
624 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
630 CPU (h_xbit) = opval;
631 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
635 SET_H_INSN_PREFIXED_P (opval);
636 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
646 CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
648 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
649 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
650 #define FLD(f) abuf->fields.sfmt_muls_b.f
651 int UNUSED written = 0;
652 IADDR UNUSED pc = abuf->addr;
653 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
657 tmp_newval = GET_H_GR (FLD (f_operand1));
659 SI opval = EXTQISI (tmp_newval);
660 SET_H_GR (FLD (f_operand2), opval);
661 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
665 BI opval = LTSI (tmp_newval, 0);
666 CPU (h_nbit) = opval;
667 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
670 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
671 CPU (h_zbit) = opval;
672 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
679 CPU (h_xbit) = opval;
680 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
684 SET_H_INSN_PREFIXED_P (opval);
685 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
695 CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
697 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
698 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
699 #define FLD(f) abuf->fields.sfmt_muls_b.f
700 int UNUSED written = 0;
701 IADDR UNUSED pc = abuf->addr;
702 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
706 tmp_newval = GET_H_GR (FLD (f_operand1));
708 SI opval = EXTHISI (tmp_newval);
709 SET_H_GR (FLD (f_operand2), opval);
710 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
714 BI opval = LTSI (tmp_newval, 0);
715 CPU (h_nbit) = opval;
716 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
719 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
720 CPU (h_zbit) = opval;
721 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
728 CPU (h_xbit) = opval;
729 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
733 SET_H_INSN_PREFIXED_P (opval);
734 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
744 CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
746 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
747 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
748 #define FLD(f) abuf->fields.sfmt_muls_b.f
749 int UNUSED written = 0;
750 IADDR UNUSED pc = abuf->addr;
751 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
755 tmp_newval = GET_H_GR (FLD (f_operand1));
757 SI opval = ZEXTQISI (tmp_newval);
758 SET_H_GR (FLD (f_operand2), opval);
759 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
763 BI opval = LTSI (tmp_newval, 0);
764 CPU (h_nbit) = opval;
765 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
768 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
769 CPU (h_zbit) = opval;
770 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
777 CPU (h_xbit) = opval;
778 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
782 SET_H_INSN_PREFIXED_P (opval);
783 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
793 CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
795 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
796 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
797 #define FLD(f) abuf->fields.sfmt_muls_b.f
798 int UNUSED written = 0;
799 IADDR UNUSED pc = abuf->addr;
800 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
804 tmp_newval = GET_H_GR (FLD (f_operand1));
806 SI opval = ZEXTHISI (tmp_newval);
807 SET_H_GR (FLD (f_operand2), opval);
808 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
812 BI opval = LTSI (tmp_newval, 0);
813 CPU (h_nbit) = opval;
814 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
817 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
818 CPU (h_zbit) = opval;
819 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
826 CPU (h_xbit) = opval;
827 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
831 SET_H_INSN_PREFIXED_P (opval);
832 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
842 CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
844 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
845 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
846 #define FLD(f) abuf->fields.sfmt_addcbr.f
847 int UNUSED written = 0;
848 IADDR UNUSED pc = abuf->addr;
849 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
853 tmp_newval = FLD (f_indir_pc__byte);
856 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
858 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
859 SET_H_GR (FLD (f_operand2), opval);
860 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
865 BI opval = LTQI (tmp_newval, 0);
866 CPU (h_nbit) = opval;
867 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
870 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
871 CPU (h_zbit) = opval;
872 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
879 CPU (h_xbit) = opval;
880 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
884 SET_H_INSN_PREFIXED_P (opval);
885 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
895 CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
897 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
898 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
899 #define FLD(f) abuf->fields.sfmt_addcwr.f
900 int UNUSED written = 0;
901 IADDR UNUSED pc = abuf->addr;
902 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
906 tmp_newval = FLD (f_indir_pc__word);
909 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
911 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
912 SET_H_GR (FLD (f_operand2), opval);
913 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
918 BI opval = LTHI (tmp_newval, 0);
919 CPU (h_nbit) = opval;
920 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
923 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
924 CPU (h_zbit) = opval;
925 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
932 CPU (h_xbit) = opval;
933 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
937 SET_H_INSN_PREFIXED_P (opval);
938 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
948 CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
950 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
951 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
952 #define FLD(f) abuf->fields.sfmt_bound_cd.f
953 int UNUSED written = 0;
954 IADDR UNUSED pc = abuf->addr;
955 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
959 tmp_newval = FLD (f_indir_pc__dword);
961 SI opval = tmp_newval;
962 SET_H_GR (FLD (f_operand2), opval);
963 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
967 BI opval = LTSI (tmp_newval, 0);
968 CPU (h_nbit) = opval;
969 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
972 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
973 CPU (h_zbit) = opval;
974 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
981 CPU (h_xbit) = opval;
982 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
986 SET_H_INSN_PREFIXED_P (opval);
987 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
997 CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
999 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1000 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1001 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1002 int UNUSED written = 0;
1003 IADDR UNUSED pc = abuf->addr;
1004 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1008 tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1010 SI opval = tmp_newval;
1011 SET_H_GR (FLD (f_operand2), opval);
1012 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1016 BI opval = LTSI (tmp_newval, 0);
1017 CPU (h_nbit) = opval;
1018 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1021 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1022 CPU (h_zbit) = opval;
1023 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1025 SET_H_CBIT_MOVE (0);
1026 SET_H_VBIT_MOVE (0);
1030 CPU (h_xbit) = opval;
1031 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1035 SET_H_INSN_PREFIXED_P (opval);
1036 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1046 CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
1048 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1049 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1050 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1051 int UNUSED written = 0;
1052 IADDR UNUSED pc = abuf->addr;
1053 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1057 tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1059 SI opval = tmp_newval;
1060 SET_H_GR (FLD (f_operand2), opval);
1061 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1065 BI opval = LTSI (tmp_newval, 0);
1066 CPU (h_nbit) = opval;
1067 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1070 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1071 CPU (h_zbit) = opval;
1072 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1074 SET_H_CBIT_MOVE (0);
1075 SET_H_VBIT_MOVE (0);
1079 CPU (h_xbit) = opval;
1080 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1084 SET_H_INSN_PREFIXED_P (opval);
1085 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1095 CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
1097 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1098 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1099 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1100 int UNUSED written = 0;
1101 IADDR UNUSED pc = abuf->addr;
1102 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1106 tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1108 SI opval = tmp_newval;
1109 SET_H_GR (FLD (f_operand2), opval);
1110 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1114 BI opval = LTSI (tmp_newval, 0);
1115 CPU (h_nbit) = opval;
1116 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1119 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1120 CPU (h_zbit) = opval;
1121 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1123 SET_H_CBIT_MOVE (0);
1124 SET_H_VBIT_MOVE (0);
1128 CPU (h_xbit) = opval;
1129 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1133 SET_H_INSN_PREFIXED_P (opval);
1134 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1144 CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
1146 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1147 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1148 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1149 int UNUSED written = 0;
1150 IADDR UNUSED pc = abuf->addr;
1151 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1155 tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1157 SI opval = tmp_newval;
1158 SET_H_GR (FLD (f_operand2), opval);
1159 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1163 BI opval = LTSI (tmp_newval, 0);
1164 CPU (h_nbit) = opval;
1165 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1168 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1169 CPU (h_zbit) = opval;
1170 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1172 SET_H_CBIT_MOVE (0);
1173 SET_H_VBIT_MOVE (0);
1177 CPU (h_xbit) = opval;
1178 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1182 SET_H_INSN_PREFIXED_P (opval);
1183 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1193 CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
1195 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1196 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1197 #define FLD(f) abuf->fields.sfmt_addq.f
1198 int UNUSED written = 0;
1199 IADDR UNUSED pc = abuf->addr;
1200 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1207 tmp_tmpops = FLD (f_u6);
1208 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1209 tmp_carry = CPU (h_cbit);
1210 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1212 SI opval = tmp_newval;
1213 SET_H_GR (FLD (f_operand2), opval);
1214 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1218 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
1219 CPU (h_cbit) = opval;
1220 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1223 BI opval = LTSI (tmp_newval, 0);
1224 CPU (h_nbit) = opval;
1225 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1228 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1229 CPU (h_zbit) = opval;
1230 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1233 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1234 CPU (h_vbit) = opval;
1235 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1240 CPU (h_xbit) = opval;
1241 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1245 SET_H_INSN_PREFIXED_P (opval);
1246 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1256 CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
1258 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1259 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1260 #define FLD(f) abuf->fields.sfmt_addq.f
1261 int UNUSED written = 0;
1262 IADDR UNUSED pc = abuf->addr;
1263 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1270 tmp_tmpops = FLD (f_u6);
1271 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1272 tmp_carry = CPU (h_cbit);
1273 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1275 SI opval = tmp_newval;
1276 SET_H_GR (FLD (f_operand2), opval);
1277 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1281 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1282 CPU (h_cbit) = opval;
1283 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1286 BI opval = LTSI (tmp_newval, 0);
1287 CPU (h_nbit) = opval;
1288 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1291 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1292 CPU (h_zbit) = opval;
1293 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1296 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1297 CPU (h_vbit) = opval;
1298 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1303 CPU (h_xbit) = opval;
1304 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1308 SET_H_INSN_PREFIXED_P (opval);
1309 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1319 CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
1321 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1322 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1323 #define FLD(f) abuf->fields.sfmt_muls_b.f
1324 int UNUSED written = 0;
1325 IADDR UNUSED pc = abuf->addr;
1326 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1333 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1334 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1335 tmp_carry = CPU (h_cbit);
1336 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1340 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
1341 CPU (h_cbit) = opval;
1342 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1345 BI opval = LTQI (tmp_newval, 0);
1346 CPU (h_nbit) = opval;
1347 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1350 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1351 CPU (h_zbit) = opval;
1352 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1355 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
1356 CPU (h_vbit) = opval;
1357 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1362 CPU (h_xbit) = opval;
1363 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1367 SET_H_INSN_PREFIXED_P (opval);
1368 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1378 CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
1380 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1381 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1382 #define FLD(f) abuf->fields.sfmt_muls_b.f
1383 int UNUSED written = 0;
1384 IADDR UNUSED pc = abuf->addr;
1385 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1392 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1393 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1394 tmp_carry = CPU (h_cbit);
1395 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1399 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
1400 CPU (h_cbit) = opval;
1401 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1404 BI opval = LTHI (tmp_newval, 0);
1405 CPU (h_nbit) = opval;
1406 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1409 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1410 CPU (h_zbit) = opval;
1411 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1414 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
1415 CPU (h_vbit) = opval;
1416 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1421 CPU (h_xbit) = opval;
1422 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1426 SET_H_INSN_PREFIXED_P (opval);
1427 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1437 CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
1439 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1440 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1441 #define FLD(f) abuf->fields.sfmt_muls_b.f
1442 int UNUSED written = 0;
1443 IADDR UNUSED pc = abuf->addr;
1444 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1451 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1452 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1453 tmp_carry = CPU (h_cbit);
1454 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1458 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1459 CPU (h_cbit) = opval;
1460 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1463 BI opval = LTSI (tmp_newval, 0);
1464 CPU (h_nbit) = opval;
1465 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1468 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1469 CPU (h_zbit) = opval;
1470 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1473 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1474 CPU (h_vbit) = opval;
1475 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1480 CPU (h_xbit) = opval;
1481 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1485 SET_H_INSN_PREFIXED_P (opval);
1486 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1496 CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1498 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1499 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1500 #define FLD(f) abuf->fields.sfmt_addc_m.f
1501 int UNUSED written = 0;
1502 IADDR UNUSED pc = abuf->addr;
1503 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1510 tmp_tmpops = ({ SI tmp_addr;
1513 tmp_postinc = FLD (f_memmode);
1514 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1515 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1516 ; if (NEBI (tmp_postinc, 0)) {
1518 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1519 tmp_addr = ADDSI (tmp_addr, 1);
1522 SI opval = tmp_addr;
1523 SET_H_GR (FLD (f_operand1), opval);
1524 written |= (1 << 9);
1525 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1530 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1531 tmp_carry = CPU (h_cbit);
1532 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1536 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
1537 CPU (h_cbit) = opval;
1538 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1541 BI opval = LTQI (tmp_newval, 0);
1542 CPU (h_nbit) = opval;
1543 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1546 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1547 CPU (h_zbit) = opval;
1548 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1551 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
1552 CPU (h_vbit) = opval;
1553 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1558 CPU (h_xbit) = opval;
1559 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1563 SET_H_INSN_PREFIXED_P (opval);
1564 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1570 abuf->written = written;
1575 CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1577 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1578 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1579 #define FLD(f) abuf->fields.sfmt_addc_m.f
1580 int UNUSED written = 0;
1581 IADDR UNUSED pc = abuf->addr;
1582 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1589 tmp_tmpops = ({ SI tmp_addr;
1592 tmp_postinc = FLD (f_memmode);
1593 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1594 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
1595 ; if (NEBI (tmp_postinc, 0)) {
1597 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1598 tmp_addr = ADDSI (tmp_addr, 2);
1601 SI opval = tmp_addr;
1602 SET_H_GR (FLD (f_operand1), opval);
1603 written |= (1 << 9);
1604 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1609 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1610 tmp_carry = CPU (h_cbit);
1611 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1615 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
1616 CPU (h_cbit) = opval;
1617 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1620 BI opval = LTHI (tmp_newval, 0);
1621 CPU (h_nbit) = opval;
1622 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1625 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1626 CPU (h_zbit) = opval;
1627 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1630 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
1631 CPU (h_vbit) = opval;
1632 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1637 CPU (h_xbit) = opval;
1638 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1642 SET_H_INSN_PREFIXED_P (opval);
1643 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1649 abuf->written = written;
1654 CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1656 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1657 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1658 #define FLD(f) abuf->fields.sfmt_addc_m.f
1659 int UNUSED written = 0;
1660 IADDR UNUSED pc = abuf->addr;
1661 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1668 tmp_tmpops = ({ SI tmp_addr;
1671 tmp_postinc = FLD (f_memmode);
1672 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1673 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
1674 ; if (NEBI (tmp_postinc, 0)) {
1676 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1677 tmp_addr = ADDSI (tmp_addr, 4);
1680 SI opval = tmp_addr;
1681 SET_H_GR (FLD (f_operand1), opval);
1682 written |= (1 << 9);
1683 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1688 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1689 tmp_carry = CPU (h_cbit);
1690 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1694 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1695 CPU (h_cbit) = opval;
1696 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1699 BI opval = LTSI (tmp_newval, 0);
1700 CPU (h_nbit) = opval;
1701 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1704 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1705 CPU (h_zbit) = opval;
1706 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1709 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1710 CPU (h_vbit) = opval;
1711 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1716 CPU (h_xbit) = opval;
1717 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1721 SET_H_INSN_PREFIXED_P (opval);
1722 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1728 abuf->written = written;
1733 CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
1735 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1736 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1737 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1738 int UNUSED written = 0;
1739 IADDR UNUSED pc = abuf->addr;
1740 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1747 tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
1748 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1749 tmp_carry = CPU (h_cbit);
1750 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1754 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
1755 CPU (h_cbit) = opval;
1756 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1759 BI opval = LTQI (tmp_newval, 0);
1760 CPU (h_nbit) = opval;
1761 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1764 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1765 CPU (h_zbit) = opval;
1766 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1769 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
1770 CPU (h_vbit) = opval;
1771 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1776 CPU (h_xbit) = opval;
1777 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1781 SET_H_INSN_PREFIXED_P (opval);
1782 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1792 CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
1794 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1795 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1796 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1797 int UNUSED written = 0;
1798 IADDR UNUSED pc = abuf->addr;
1799 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1806 tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
1807 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1808 tmp_carry = CPU (h_cbit);
1809 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1813 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
1814 CPU (h_cbit) = opval;
1815 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1818 BI opval = LTHI (tmp_newval, 0);
1819 CPU (h_nbit) = opval;
1820 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1823 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1824 CPU (h_zbit) = opval;
1825 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1828 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
1829 CPU (h_vbit) = opval;
1830 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1835 CPU (h_xbit) = opval;
1836 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1840 SET_H_INSN_PREFIXED_P (opval);
1841 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1851 CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
1853 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1854 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1855 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1856 int UNUSED written = 0;
1857 IADDR UNUSED pc = abuf->addr;
1858 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1865 tmp_tmpops = FLD (f_indir_pc__dword);
1866 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1867 tmp_carry = CPU (h_cbit);
1868 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1872 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1873 CPU (h_cbit) = opval;
1874 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1877 BI opval = LTSI (tmp_newval, 0);
1878 CPU (h_nbit) = opval;
1879 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1882 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1883 CPU (h_zbit) = opval;
1884 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1887 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1888 CPU (h_vbit) = opval;
1889 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1894 CPU (h_xbit) = opval;
1895 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1899 SET_H_INSN_PREFIXED_P (opval);
1900 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1910 CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
1912 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1913 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1914 #define FLD(f) abuf->fields.sfmt_andq.f
1915 int UNUSED written = 0;
1916 IADDR UNUSED pc = abuf->addr;
1917 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1924 tmp_tmpops = FLD (f_s6);
1925 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1926 tmp_carry = CPU (h_cbit);
1927 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1931 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1932 CPU (h_cbit) = opval;
1933 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1936 BI opval = LTSI (tmp_newval, 0);
1937 CPU (h_nbit) = opval;
1938 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1941 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1942 CPU (h_zbit) = opval;
1943 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1946 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1947 CPU (h_vbit) = opval;
1948 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1953 CPU (h_xbit) = opval;
1954 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1958 SET_H_INSN_PREFIXED_P (opval);
1959 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1969 CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
1971 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1972 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1973 #define FLD(f) abuf->fields.sfmt_addc_m.f
1974 int UNUSED written = 0;
1975 IADDR UNUSED pc = abuf->addr;
1976 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1983 tmp_tmpops = EXTQISI (({ SI tmp_addr;
1986 tmp_postinc = FLD (f_memmode);
1987 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1988 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1989 ; if (NEBI (tmp_postinc, 0)) {
1991 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1992 tmp_addr = ADDSI (tmp_addr, 1);
1995 SI opval = tmp_addr;
1996 SET_H_GR (FLD (f_operand1), opval);
1997 written |= (1 << 9);
1998 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2003 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2004 tmp_carry = CPU (h_cbit);
2005 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2009 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2010 CPU (h_cbit) = opval;
2011 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2014 BI opval = LTSI (tmp_newval, 0);
2015 CPU (h_nbit) = opval;
2016 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2019 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2020 CPU (h_zbit) = opval;
2021 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2024 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2025 CPU (h_vbit) = opval;
2026 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2031 CPU (h_xbit) = opval;
2032 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2036 SET_H_INSN_PREFIXED_P (opval);
2037 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2043 abuf->written = written;
2048 CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
2050 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2051 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2052 #define FLD(f) abuf->fields.sfmt_addc_m.f
2053 int UNUSED written = 0;
2054 IADDR UNUSED pc = abuf->addr;
2055 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2062 tmp_tmpops = EXTHISI (({ SI tmp_addr;
2065 tmp_postinc = FLD (f_memmode);
2066 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2067 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2068 ; if (NEBI (tmp_postinc, 0)) {
2070 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2071 tmp_addr = ADDSI (tmp_addr, 2);
2074 SI opval = tmp_addr;
2075 SET_H_GR (FLD (f_operand1), opval);
2076 written |= (1 << 9);
2077 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2082 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2083 tmp_carry = CPU (h_cbit);
2084 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2088 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2089 CPU (h_cbit) = opval;
2090 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2093 BI opval = LTSI (tmp_newval, 0);
2094 CPU (h_nbit) = opval;
2095 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2098 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2099 CPU (h_zbit) = opval;
2100 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2103 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2104 CPU (h_vbit) = opval;
2105 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2110 CPU (h_xbit) = opval;
2111 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2115 SET_H_INSN_PREFIXED_P (opval);
2116 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2122 abuf->written = written;
2127 CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
2129 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2130 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2131 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2132 int UNUSED written = 0;
2133 IADDR UNUSED pc = abuf->addr;
2134 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2141 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2142 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2143 tmp_carry = CPU (h_cbit);
2144 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2148 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2149 CPU (h_cbit) = opval;
2150 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2153 BI opval = LTSI (tmp_newval, 0);
2154 CPU (h_nbit) = opval;
2155 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2158 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2159 CPU (h_zbit) = opval;
2160 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2163 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2164 CPU (h_vbit) = opval;
2165 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2170 CPU (h_xbit) = opval;
2171 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2175 SET_H_INSN_PREFIXED_P (opval);
2176 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2186 CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
2188 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2189 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2190 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2191 int UNUSED written = 0;
2192 IADDR UNUSED pc = abuf->addr;
2193 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2200 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2201 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2202 tmp_carry = CPU (h_cbit);
2203 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2207 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2208 CPU (h_cbit) = opval;
2209 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2212 BI opval = LTSI (tmp_newval, 0);
2213 CPU (h_nbit) = opval;
2214 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2217 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2218 CPU (h_zbit) = opval;
2219 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2222 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2223 CPU (h_vbit) = opval;
2224 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2229 CPU (h_xbit) = opval;
2230 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2234 SET_H_INSN_PREFIXED_P (opval);
2235 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2245 CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2247 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2248 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2249 #define FLD(f) abuf->fields.sfmt_addc_m.f
2250 int UNUSED written = 0;
2251 IADDR UNUSED pc = abuf->addr;
2252 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2259 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
2262 tmp_postinc = FLD (f_memmode);
2263 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2264 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2265 ; if (NEBI (tmp_postinc, 0)) {
2267 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2268 tmp_addr = ADDSI (tmp_addr, 1);
2271 SI opval = tmp_addr;
2272 SET_H_GR (FLD (f_operand1), opval);
2273 written |= (1 << 9);
2274 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2279 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2280 tmp_carry = CPU (h_cbit);
2281 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2285 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2286 CPU (h_cbit) = opval;
2287 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2290 BI opval = LTSI (tmp_newval, 0);
2291 CPU (h_nbit) = opval;
2292 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2295 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2296 CPU (h_zbit) = opval;
2297 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2300 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2301 CPU (h_vbit) = opval;
2302 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2307 CPU (h_xbit) = opval;
2308 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2312 SET_H_INSN_PREFIXED_P (opval);
2313 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2319 abuf->written = written;
2324 CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2326 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2327 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2328 #define FLD(f) abuf->fields.sfmt_addc_m.f
2329 int UNUSED written = 0;
2330 IADDR UNUSED pc = abuf->addr;
2331 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2338 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
2341 tmp_postinc = FLD (f_memmode);
2342 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2343 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2344 ; if (NEBI (tmp_postinc, 0)) {
2346 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2347 tmp_addr = ADDSI (tmp_addr, 2);
2350 SI opval = tmp_addr;
2351 SET_H_GR (FLD (f_operand1), opval);
2352 written |= (1 << 9);
2353 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2358 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2359 tmp_carry = CPU (h_cbit);
2360 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2364 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2365 CPU (h_cbit) = opval;
2366 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2369 BI opval = LTSI (tmp_newval, 0);
2370 CPU (h_nbit) = opval;
2371 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2374 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2375 CPU (h_zbit) = opval;
2376 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2379 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2380 CPU (h_vbit) = opval;
2381 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2386 CPU (h_xbit) = opval;
2387 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2391 SET_H_INSN_PREFIXED_P (opval);
2392 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2398 abuf->written = written;
2403 CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
2405 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2406 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2407 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2408 int UNUSED written = 0;
2409 IADDR UNUSED pc = abuf->addr;
2410 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2417 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2418 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2419 tmp_carry = CPU (h_cbit);
2420 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2424 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2425 CPU (h_cbit) = opval;
2426 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2429 BI opval = LTSI (tmp_newval, 0);
2430 CPU (h_nbit) = opval;
2431 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2434 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2435 CPU (h_zbit) = opval;
2436 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2439 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2440 CPU (h_vbit) = opval;
2441 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2446 CPU (h_xbit) = opval;
2447 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2451 SET_H_INSN_PREFIXED_P (opval);
2452 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2462 CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
2464 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2465 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2466 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2467 int UNUSED written = 0;
2468 IADDR UNUSED pc = abuf->addr;
2469 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2476 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2477 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2478 tmp_carry = CPU (h_cbit);
2479 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2483 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2484 CPU (h_cbit) = opval;
2485 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2488 BI opval = LTSI (tmp_newval, 0);
2489 CPU (h_nbit) = opval;
2490 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2493 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2494 CPU (h_zbit) = opval;
2495 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2498 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2499 CPU (h_vbit) = opval;
2500 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2505 CPU (h_xbit) = opval;
2506 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2510 SET_H_INSN_PREFIXED_P (opval);
2511 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2521 CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
2523 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2524 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2525 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2526 int UNUSED written = 0;
2527 IADDR UNUSED pc = abuf->addr;
2528 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2532 tmp_tmp = ({ SI tmp_addr;
2535 tmp_postinc = FLD (f_memmode);
2536 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2537 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2538 ; if (NEBI (tmp_postinc, 0)) {
2540 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2541 tmp_addr = ADDSI (tmp_addr, 1);
2544 SI opval = tmp_addr;
2545 SET_H_GR (FLD (f_operand1), opval);
2546 written |= (1 << 10);
2547 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2554 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2556 SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
2557 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2558 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2563 BI opval = LTQI (tmp_tmp, 0);
2564 CPU (h_nbit) = opval;
2565 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2568 BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2569 CPU (h_zbit) = opval;
2570 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2572 SET_H_CBIT_MOVE (0);
2573 SET_H_VBIT_MOVE (0);
2577 CPU (h_xbit) = opval;
2578 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2582 SET_H_INSN_PREFIXED_P (opval);
2583 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2589 abuf->written = written;
2594 CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
2596 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2597 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2598 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2599 int UNUSED written = 0;
2600 IADDR UNUSED pc = abuf->addr;
2601 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2605 tmp_tmp = ({ SI tmp_addr;
2608 tmp_postinc = FLD (f_memmode);
2609 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2610 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2611 ; if (NEBI (tmp_postinc, 0)) {
2613 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2614 tmp_addr = ADDSI (tmp_addr, 2);
2617 SI opval = tmp_addr;
2618 SET_H_GR (FLD (f_operand1), opval);
2619 written |= (1 << 10);
2620 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2627 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2629 SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
2630 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2631 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2636 BI opval = LTHI (tmp_tmp, 0);
2637 CPU (h_nbit) = opval;
2638 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2641 BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2642 CPU (h_zbit) = opval;
2643 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2645 SET_H_CBIT_MOVE (0);
2646 SET_H_VBIT_MOVE (0);
2650 CPU (h_xbit) = opval;
2651 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2655 SET_H_INSN_PREFIXED_P (opval);
2656 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2662 abuf->written = written;
2667 CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
2669 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2670 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2671 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2672 int UNUSED written = 0;
2673 IADDR UNUSED pc = abuf->addr;
2674 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2678 tmp_tmp = ({ SI tmp_addr;
2681 tmp_postinc = FLD (f_memmode);
2682 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2683 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
2684 ; if (NEBI (tmp_postinc, 0)) {
2686 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2687 tmp_addr = ADDSI (tmp_addr, 4);
2690 SI opval = tmp_addr;
2691 SET_H_GR (FLD (f_operand1), opval);
2692 written |= (1 << 9);
2693 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2700 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2701 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2705 BI opval = LTSI (tmp_tmp, 0);
2706 CPU (h_nbit) = opval;
2707 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2710 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2711 CPU (h_zbit) = opval;
2712 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2714 SET_H_CBIT_MOVE (0);
2715 SET_H_VBIT_MOVE (0);
2719 CPU (h_xbit) = opval;
2720 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2724 SET_H_INSN_PREFIXED_P (opval);
2725 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2731 abuf->written = written;
2736 CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
2738 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2739 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2740 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2741 int UNUSED written = 0;
2742 IADDR UNUSED pc = abuf->addr;
2743 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2747 tmp_tmp = EXTQISI (({ SI tmp_addr;
2750 tmp_postinc = FLD (f_memmode);
2751 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2752 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2753 ; if (NEBI (tmp_postinc, 0)) {
2755 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2756 tmp_addr = ADDSI (tmp_addr, 1);
2759 SI opval = tmp_addr;
2760 SET_H_GR (FLD (f_operand1), opval);
2761 written |= (1 << 8);
2762 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2767 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2770 SET_H_GR (FLD (f_operand1), opval);
2771 written |= (1 << 8);
2772 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2777 SET_H_GR (FLD (f_operand2), opval);
2778 written |= (1 << 7);
2779 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2784 BI opval = LTSI (tmp_tmp, 0);
2785 CPU (h_nbit) = opval;
2786 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2789 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2790 CPU (h_zbit) = opval;
2791 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2793 SET_H_CBIT_MOVE (0);
2794 SET_H_VBIT_MOVE (0);
2798 CPU (h_xbit) = opval;
2799 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2803 SET_H_INSN_PREFIXED_P (opval);
2804 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2810 abuf->written = written;
2815 CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
2817 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2818 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2819 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2820 int UNUSED written = 0;
2821 IADDR UNUSED pc = abuf->addr;
2822 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2826 tmp_tmp = EXTHISI (({ SI tmp_addr;
2829 tmp_postinc = FLD (f_memmode);
2830 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2831 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2832 ; if (NEBI (tmp_postinc, 0)) {
2834 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2835 tmp_addr = ADDSI (tmp_addr, 2);
2838 SI opval = tmp_addr;
2839 SET_H_GR (FLD (f_operand1), opval);
2840 written |= (1 << 8);
2841 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2846 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2849 SET_H_GR (FLD (f_operand1), opval);
2850 written |= (1 << 8);
2851 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2856 SET_H_GR (FLD (f_operand2), opval);
2857 written |= (1 << 7);
2858 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2863 BI opval = LTSI (tmp_tmp, 0);
2864 CPU (h_nbit) = opval;
2865 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2868 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2869 CPU (h_zbit) = opval;
2870 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2872 SET_H_CBIT_MOVE (0);
2873 SET_H_VBIT_MOVE (0);
2877 CPU (h_xbit) = opval;
2878 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2882 SET_H_INSN_PREFIXED_P (opval);
2883 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2889 abuf->written = written;
2894 CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
2896 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2897 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2898 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2899 int UNUSED written = 0;
2900 IADDR UNUSED pc = abuf->addr;
2901 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2905 tmp_tmp = ZEXTQISI (({ SI tmp_addr;
2908 tmp_postinc = FLD (f_memmode);
2909 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2910 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2911 ; if (NEBI (tmp_postinc, 0)) {
2913 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2914 tmp_addr = ADDSI (tmp_addr, 1);
2917 SI opval = tmp_addr;
2918 SET_H_GR (FLD (f_operand1), opval);
2919 written |= (1 << 8);
2920 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2925 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2928 SET_H_GR (FLD (f_operand1), opval);
2929 written |= (1 << 8);
2930 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2935 SET_H_GR (FLD (f_operand2), opval);
2936 written |= (1 << 7);
2937 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2942 BI opval = LTSI (tmp_tmp, 0);
2943 CPU (h_nbit) = opval;
2944 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2947 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2948 CPU (h_zbit) = opval;
2949 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2951 SET_H_CBIT_MOVE (0);
2952 SET_H_VBIT_MOVE (0);
2956 CPU (h_xbit) = opval;
2957 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2961 SET_H_INSN_PREFIXED_P (opval);
2962 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2968 abuf->written = written;
2973 CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
2975 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2976 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2977 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2978 int UNUSED written = 0;
2979 IADDR UNUSED pc = abuf->addr;
2980 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2984 tmp_tmp = ZEXTHISI (({ SI tmp_addr;
2987 tmp_postinc = FLD (f_memmode);
2988 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2989 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2990 ; if (NEBI (tmp_postinc, 0)) {
2992 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2993 tmp_addr = ADDSI (tmp_addr, 2);
2996 SI opval = tmp_addr;
2997 SET_H_GR (FLD (f_operand1), opval);
2998 written |= (1 << 8);
2999 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3004 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3007 SET_H_GR (FLD (f_operand1), opval);
3008 written |= (1 << 8);
3009 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3014 SET_H_GR (FLD (f_operand2), opval);
3015 written |= (1 << 7);
3016 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3021 BI opval = LTSI (tmp_tmp, 0);
3022 CPU (h_nbit) = opval;
3023 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3026 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3027 CPU (h_zbit) = opval;
3028 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3030 SET_H_CBIT_MOVE (0);
3031 SET_H_VBIT_MOVE (0);
3035 CPU (h_xbit) = opval;
3036 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3040 SET_H_INSN_PREFIXED_P (opval);
3041 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3047 abuf->written = written;
3052 CASE (sem, INSN_MOVE_R_SPRV32) : /* move ${Rs},${Pd} */
3054 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3055 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3056 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3057 int UNUSED written = 0;
3058 IADDR UNUSED pc = abuf->addr;
3059 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3064 tmp_tmp = GET_H_GR (FLD (f_operand1));
3065 tmp_rno = FLD (f_operand2);
3066 if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
3067 cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
3072 SET_H_SR (FLD (f_operand2), opval);
3073 written |= (1 << 2);
3074 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3080 CPU (h_xbit) = opval;
3081 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3085 SET_H_INSN_PREFIXED_P (opval);
3086 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3091 abuf->written = written;
3096 CASE (sem, INSN_MOVE_SPR_RV32) : /* move ${Ps},${Rd-sfield} */
3098 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3099 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3100 #define FLD(f) abuf->fields.sfmt_mcp.f
3101 int UNUSED written = 0;
3102 IADDR UNUSED pc = abuf->addr;
3103 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3109 tmp_prno = FLD (f_operand2);
3110 tmp_newval = GET_H_SR (FLD (f_operand2));
3111 if (EQSI (tmp_prno, 2)) {
3114 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3116 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3117 SET_H_GR (FLD (f_operand1), opval);
3118 written |= (1 << 4);
3119 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3123 else if (EQSI (tmp_prno, 3)) {
3126 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3128 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3129 SET_H_GR (FLD (f_operand1), opval);
3130 written |= (1 << 4);
3131 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3135 else if (EQSI (tmp_prno, 5)) {
3137 SI opval = tmp_newval;
3138 SET_H_GR (FLD (f_operand1), opval);
3139 written |= (1 << 4);
3140 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3143 else if (EQSI (tmp_prno, 6)) {
3145 SI opval = tmp_newval;
3146 SET_H_GR (FLD (f_operand1), opval);
3147 written |= (1 << 4);
3148 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3151 else if (EQSI (tmp_prno, 7)) {
3153 SI opval = tmp_newval;
3154 SET_H_GR (FLD (f_operand1), opval);
3155 written |= (1 << 4);
3156 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3159 else if (EQSI (tmp_prno, 9)) {
3161 SI opval = tmp_newval;
3162 SET_H_GR (FLD (f_operand1), opval);
3163 written |= (1 << 4);
3164 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3167 else if (EQSI (tmp_prno, 10)) {
3169 SI opval = tmp_newval;
3170 SET_H_GR (FLD (f_operand1), opval);
3171 written |= (1 << 4);
3172 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3175 else if (EQSI (tmp_prno, 11)) {
3177 SI opval = tmp_newval;
3178 SET_H_GR (FLD (f_operand1), opval);
3179 written |= (1 << 4);
3180 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3183 else if (EQSI (tmp_prno, 12)) {
3185 SI opval = tmp_newval;
3186 SET_H_GR (FLD (f_operand1), opval);
3187 written |= (1 << 4);
3188 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3191 else if (EQSI (tmp_prno, 13)) {
3193 SI opval = tmp_newval;
3194 SET_H_GR (FLD (f_operand1), opval);
3195 written |= (1 << 4);
3196 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3199 else if (EQSI (tmp_prno, 14)) {
3201 SI opval = tmp_newval;
3202 SET_H_GR (FLD (f_operand1), opval);
3203 written |= (1 << 4);
3204 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3207 else if (EQSI (tmp_prno, 15)) {
3209 SI opval = tmp_newval;
3210 SET_H_GR (FLD (f_operand1), opval);
3211 written |= (1 << 4);
3212 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3215 else if (EQSI (tmp_prno, 0)) {
3218 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3220 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3221 SET_H_GR (FLD (f_operand1), opval);
3222 written |= (1 << 4);
3223 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3227 else if (EQSI (tmp_prno, 1)) {
3230 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3232 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3233 SET_H_GR (FLD (f_operand1), opval);
3234 written |= (1 << 4);
3235 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3239 else if (EQSI (tmp_prno, 4)) {
3242 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3244 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3245 SET_H_GR (FLD (f_operand1), opval);
3246 written |= (1 << 4);
3247 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3251 else if (EQSI (tmp_prno, 8)) {
3253 SI opval = tmp_newval;
3254 SET_H_GR (FLD (f_operand1), opval);
3255 written |= (1 << 4);
3256 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3260 cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
3265 CPU (h_xbit) = opval;
3266 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3270 SET_H_INSN_PREFIXED_P (opval);
3271 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3276 abuf->written = written;
3281 CASE (sem, INSN_MOVE_M_SPRV32) : /* move [${Rs}${inc}],${Pd} */
3283 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3284 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3285 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3286 int UNUSED written = 0;
3287 IADDR UNUSED pc = abuf->addr;
3288 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3293 tmp_rno = FLD (f_operand2);
3294 if (EQSI (tmp_rno, 2)) {
3295 tmp_newval = EXTQISI (({ SI tmp_addr;
3298 tmp_postinc = FLD (f_memmode);
3299 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3300 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
3301 ; if (NEBI (tmp_postinc, 0)) {
3303 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3304 tmp_addr = ADDSI (tmp_addr, 1);
3307 SI opval = tmp_addr;
3308 SET_H_GR (FLD (f_operand1), opval);
3309 written |= (1 << 8);
3310 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3316 else if (EQSI (tmp_rno, 3)) {
3317 tmp_newval = EXTQISI (({ SI tmp_addr;
3320 tmp_postinc = FLD (f_memmode);
3321 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3322 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
3323 ; if (NEBI (tmp_postinc, 0)) {
3325 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3326 tmp_addr = ADDSI (tmp_addr, 1);
3329 SI opval = tmp_addr;
3330 SET_H_GR (FLD (f_operand1), opval);
3331 written |= (1 << 8);
3332 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3338 else if (EQSI (tmp_rno, 5)) {
3339 tmp_newval = ({ SI tmp_addr;
3342 tmp_postinc = FLD (f_memmode);
3343 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3344 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3345 ; if (NEBI (tmp_postinc, 0)) {
3347 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3348 tmp_addr = ADDSI (tmp_addr, 4);
3351 SI opval = tmp_addr;
3352 SET_H_GR (FLD (f_operand1), opval);
3353 written |= (1 << 8);
3354 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3360 else if (EQSI (tmp_rno, 6)) {
3361 tmp_newval = ({ SI tmp_addr;
3364 tmp_postinc = FLD (f_memmode);
3365 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3366 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3367 ; if (NEBI (tmp_postinc, 0)) {
3369 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3370 tmp_addr = ADDSI (tmp_addr, 4);
3373 SI opval = tmp_addr;
3374 SET_H_GR (FLD (f_operand1), opval);
3375 written |= (1 << 8);
3376 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3382 else if (EQSI (tmp_rno, 7)) {
3383 tmp_newval = ({ SI tmp_addr;
3386 tmp_postinc = FLD (f_memmode);
3387 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3388 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3389 ; if (NEBI (tmp_postinc, 0)) {
3391 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3392 tmp_addr = ADDSI (tmp_addr, 4);
3395 SI opval = tmp_addr;
3396 SET_H_GR (FLD (f_operand1), opval);
3397 written |= (1 << 8);
3398 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3404 else if (EQSI (tmp_rno, 9)) {
3405 tmp_newval = ({ SI tmp_addr;
3408 tmp_postinc = FLD (f_memmode);
3409 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3410 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3411 ; if (NEBI (tmp_postinc, 0)) {
3413 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3414 tmp_addr = ADDSI (tmp_addr, 4);
3417 SI opval = tmp_addr;
3418 SET_H_GR (FLD (f_operand1), opval);
3419 written |= (1 << 8);
3420 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3426 else if (EQSI (tmp_rno, 10)) {
3427 tmp_newval = ({ SI tmp_addr;
3430 tmp_postinc = FLD (f_memmode);
3431 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3432 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3433 ; if (NEBI (tmp_postinc, 0)) {
3435 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3436 tmp_addr = ADDSI (tmp_addr, 4);
3439 SI opval = tmp_addr;
3440 SET_H_GR (FLD (f_operand1), opval);
3441 written |= (1 << 8);
3442 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3448 else if (EQSI (tmp_rno, 11)) {
3449 tmp_newval = ({ SI tmp_addr;
3452 tmp_postinc = FLD (f_memmode);
3453 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3454 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3455 ; if (NEBI (tmp_postinc, 0)) {
3457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3458 tmp_addr = ADDSI (tmp_addr, 4);
3461 SI opval = tmp_addr;
3462 SET_H_GR (FLD (f_operand1), opval);
3463 written |= (1 << 8);
3464 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3470 else if (EQSI (tmp_rno, 12)) {
3471 tmp_newval = ({ SI tmp_addr;
3474 tmp_postinc = FLD (f_memmode);
3475 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3476 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3477 ; if (NEBI (tmp_postinc, 0)) {
3479 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3480 tmp_addr = ADDSI (tmp_addr, 4);
3483 SI opval = tmp_addr;
3484 SET_H_GR (FLD (f_operand1), opval);
3485 written |= (1 << 8);
3486 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3492 else if (EQSI (tmp_rno, 13)) {
3493 tmp_newval = ({ SI tmp_addr;
3496 tmp_postinc = FLD (f_memmode);
3497 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3498 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3499 ; if (NEBI (tmp_postinc, 0)) {
3501 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3502 tmp_addr = ADDSI (tmp_addr, 4);
3505 SI opval = tmp_addr;
3506 SET_H_GR (FLD (f_operand1), opval);
3507 written |= (1 << 8);
3508 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3514 else if (EQSI (tmp_rno, 14)) {
3515 tmp_newval = ({ SI tmp_addr;
3518 tmp_postinc = FLD (f_memmode);
3519 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3520 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3521 ; if (NEBI (tmp_postinc, 0)) {
3523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3524 tmp_addr = ADDSI (tmp_addr, 4);
3527 SI opval = tmp_addr;
3528 SET_H_GR (FLD (f_operand1), opval);
3529 written |= (1 << 8);
3530 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3536 else if (EQSI (tmp_rno, 15)) {
3537 tmp_newval = ({ SI tmp_addr;
3540 tmp_postinc = FLD (f_memmode);
3541 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3542 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3543 ; if (NEBI (tmp_postinc, 0)) {
3545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3546 tmp_addr = ADDSI (tmp_addr, 4);
3549 SI opval = tmp_addr;
3550 SET_H_GR (FLD (f_operand1), opval);
3551 written |= (1 << 8);
3552 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3559 cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
3562 SI opval = tmp_newval;
3563 SET_H_SR (FLD (f_operand2), opval);
3564 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3569 CPU (h_xbit) = opval;
3570 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3574 SET_H_INSN_PREFIXED_P (opval);
3575 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3580 abuf->written = written;
3585 CASE (sem, INSN_MOVE_C_SPRV32_P2) : /* move ${const32},${Pd} */
3587 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3588 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3589 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3590 int UNUSED written = 0;
3591 IADDR UNUSED pc = abuf->addr;
3592 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3596 SI opval = FLD (f_indir_pc__dword);
3597 SET_H_SR (FLD (f_operand2), opval);
3598 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3603 CPU (h_xbit) = opval;
3604 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3608 SET_H_INSN_PREFIXED_P (opval);
3609 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3618 CASE (sem, INSN_MOVE_C_SPRV32_P3) : /* move ${const32},${Pd} */
3620 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3621 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3622 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3623 int UNUSED written = 0;
3624 IADDR UNUSED pc = abuf->addr;
3625 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3629 SI opval = FLD (f_indir_pc__dword);
3630 SET_H_SR (FLD (f_operand2), opval);
3631 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3636 CPU (h_xbit) = opval;
3637 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3641 SET_H_INSN_PREFIXED_P (opval);
3642 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3651 CASE (sem, INSN_MOVE_C_SPRV32_P5) : /* move ${const32},${Pd} */
3653 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3654 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3655 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3656 int UNUSED written = 0;
3657 IADDR UNUSED pc = abuf->addr;
3658 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3662 SI opval = FLD (f_indir_pc__dword);
3663 SET_H_SR (FLD (f_operand2), opval);
3664 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3669 CPU (h_xbit) = opval;
3670 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3674 SET_H_INSN_PREFIXED_P (opval);
3675 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3684 CASE (sem, INSN_MOVE_C_SPRV32_P6) : /* move ${const32},${Pd} */
3686 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3687 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3688 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3689 int UNUSED written = 0;
3690 IADDR UNUSED pc = abuf->addr;
3691 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3695 SI opval = FLD (f_indir_pc__dword);
3696 SET_H_SR (FLD (f_operand2), opval);
3697 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3702 CPU (h_xbit) = opval;
3703 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3707 SET_H_INSN_PREFIXED_P (opval);
3708 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3717 CASE (sem, INSN_MOVE_C_SPRV32_P7) : /* move ${const32},${Pd} */
3719 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3720 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3721 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3722 int UNUSED written = 0;
3723 IADDR UNUSED pc = abuf->addr;
3724 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3728 SI opval = FLD (f_indir_pc__dword);
3729 SET_H_SR (FLD (f_operand2), opval);
3730 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3735 CPU (h_xbit) = opval;
3736 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3740 SET_H_INSN_PREFIXED_P (opval);
3741 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3750 CASE (sem, INSN_MOVE_C_SPRV32_P9) : /* move ${const32},${Pd} */
3752 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3753 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3754 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3755 int UNUSED written = 0;
3756 IADDR UNUSED pc = abuf->addr;
3757 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3761 SI opval = FLD (f_indir_pc__dword);
3762 SET_H_SR (FLD (f_operand2), opval);
3763 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3768 CPU (h_xbit) = opval;
3769 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3773 SET_H_INSN_PREFIXED_P (opval);
3774 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3783 CASE (sem, INSN_MOVE_C_SPRV32_P10) : /* move ${const32},${Pd} */
3785 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3786 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3787 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3788 int UNUSED written = 0;
3789 IADDR UNUSED pc = abuf->addr;
3790 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3794 SI opval = FLD (f_indir_pc__dword);
3795 SET_H_SR (FLD (f_operand2), opval);
3796 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3801 CPU (h_xbit) = opval;
3802 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3806 SET_H_INSN_PREFIXED_P (opval);
3807 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3816 CASE (sem, INSN_MOVE_C_SPRV32_P11) : /* move ${const32},${Pd} */
3818 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3819 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3820 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3821 int UNUSED written = 0;
3822 IADDR UNUSED pc = abuf->addr;
3823 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3827 SI opval = FLD (f_indir_pc__dword);
3828 SET_H_SR (FLD (f_operand2), opval);
3829 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3834 CPU (h_xbit) = opval;
3835 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3839 SET_H_INSN_PREFIXED_P (opval);
3840 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3849 CASE (sem, INSN_MOVE_C_SPRV32_P12) : /* move ${const32},${Pd} */
3851 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3852 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3853 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3854 int UNUSED written = 0;
3855 IADDR UNUSED pc = abuf->addr;
3856 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3860 SI opval = FLD (f_indir_pc__dword);
3861 SET_H_SR (FLD (f_operand2), opval);
3862 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3867 CPU (h_xbit) = opval;
3868 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3872 SET_H_INSN_PREFIXED_P (opval);
3873 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3882 CASE (sem, INSN_MOVE_C_SPRV32_P13) : /* move ${const32},${Pd} */
3884 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3885 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3886 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3887 int UNUSED written = 0;
3888 IADDR UNUSED pc = abuf->addr;
3889 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3893 SI opval = FLD (f_indir_pc__dword);
3894 SET_H_SR (FLD (f_operand2), opval);
3895 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3900 CPU (h_xbit) = opval;
3901 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3905 SET_H_INSN_PREFIXED_P (opval);
3906 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3915 CASE (sem, INSN_MOVE_C_SPRV32_P14) : /* move ${const32},${Pd} */
3917 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3918 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3919 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3920 int UNUSED written = 0;
3921 IADDR UNUSED pc = abuf->addr;
3922 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3926 SI opval = FLD (f_indir_pc__dword);
3927 SET_H_SR (FLD (f_operand2), opval);
3928 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3933 CPU (h_xbit) = opval;
3934 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3938 SET_H_INSN_PREFIXED_P (opval);
3939 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3948 CASE (sem, INSN_MOVE_C_SPRV32_P15) : /* move ${const32},${Pd} */
3950 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3951 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3952 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3953 int UNUSED written = 0;
3954 IADDR UNUSED pc = abuf->addr;
3955 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3959 SI opval = FLD (f_indir_pc__dword);
3960 SET_H_SR (FLD (f_operand2), opval);
3961 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3966 CPU (h_xbit) = opval;
3967 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3971 SET_H_INSN_PREFIXED_P (opval);
3972 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3981 CASE (sem, INSN_MOVE_SPR_MV32) : /* move ${Ps},[${Rd-sfield}${inc}] */
3983 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3984 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3985 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3986 int UNUSED written = 0;
3987 IADDR UNUSED pc = abuf->addr;
3988 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3992 tmp_rno = FLD (f_operand2);
3993 if (EQSI (tmp_rno, 2)) {
3997 tmp_postinc = FLD (f_memmode);
3998 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3999 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4000 if (EQBI (CPU (h_pbit), 0)) {
4003 QI opval = GET_H_SR (FLD (f_operand2));
4004 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4005 written |= (1 << 12);
4006 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4009 BI opval = CPU (h_pbit);
4010 CPU (h_cbit) = opval;
4011 written |= (1 << 10);
4012 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4018 CPU (h_cbit) = opval;
4019 written |= (1 << 10);
4020 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4025 QI opval = GET_H_SR (FLD (f_operand2));
4026 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4027 written |= (1 << 12);
4028 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4031 if (NEBI (tmp_postinc, 0)) {
4033 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4034 tmp_addr = ADDSI (tmp_addr, 1);
4037 SI opval = tmp_addr;
4038 SET_H_GR (FLD (f_operand1), opval);
4039 written |= (1 << 9);
4040 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4046 else if (EQSI (tmp_rno, 3)) {
4050 tmp_postinc = FLD (f_memmode);
4051 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4052 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4053 if (EQBI (CPU (h_pbit), 0)) {
4056 QI opval = GET_H_SR (FLD (f_operand2));
4057 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4058 written |= (1 << 12);
4059 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4062 BI opval = CPU (h_pbit);
4063 CPU (h_cbit) = opval;
4064 written |= (1 << 10);
4065 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4071 CPU (h_cbit) = opval;
4072 written |= (1 << 10);
4073 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4078 QI opval = GET_H_SR (FLD (f_operand2));
4079 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4080 written |= (1 << 12);
4081 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4084 if (NEBI (tmp_postinc, 0)) {
4086 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4087 tmp_addr = ADDSI (tmp_addr, 1);
4090 SI opval = tmp_addr;
4091 SET_H_GR (FLD (f_operand1), opval);
4092 written |= (1 << 9);
4093 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4099 else if (EQSI (tmp_rno, 5)) {
4103 tmp_postinc = FLD (f_memmode);
4104 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4105 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4106 if (EQBI (CPU (h_pbit), 0)) {
4109 SI opval = GET_H_SR (FLD (f_operand2));
4110 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4111 written |= (1 << 13);
4112 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4115 BI opval = CPU (h_pbit);
4116 CPU (h_cbit) = opval;
4117 written |= (1 << 10);
4118 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4124 CPU (h_cbit) = opval;
4125 written |= (1 << 10);
4126 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4131 SI opval = GET_H_SR (FLD (f_operand2));
4132 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4133 written |= (1 << 13);
4134 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4137 if (NEBI (tmp_postinc, 0)) {
4139 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4140 tmp_addr = ADDSI (tmp_addr, 4);
4143 SI opval = tmp_addr;
4144 SET_H_GR (FLD (f_operand1), opval);
4145 written |= (1 << 9);
4146 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4152 else if (EQSI (tmp_rno, 6)) {
4156 tmp_postinc = FLD (f_memmode);
4157 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4158 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4159 if (EQBI (CPU (h_pbit), 0)) {
4162 SI opval = GET_H_SR (FLD (f_operand2));
4163 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4164 written |= (1 << 13);
4165 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4168 BI opval = CPU (h_pbit);
4169 CPU (h_cbit) = opval;
4170 written |= (1 << 10);
4171 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4177 CPU (h_cbit) = opval;
4178 written |= (1 << 10);
4179 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4184 SI opval = GET_H_SR (FLD (f_operand2));
4185 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4186 written |= (1 << 13);
4187 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4190 if (NEBI (tmp_postinc, 0)) {
4192 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4193 tmp_addr = ADDSI (tmp_addr, 4);
4196 SI opval = tmp_addr;
4197 SET_H_GR (FLD (f_operand1), opval);
4198 written |= (1 << 9);
4199 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4205 else if (EQSI (tmp_rno, 7)) {
4209 tmp_postinc = FLD (f_memmode);
4210 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4211 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4212 if (EQBI (CPU (h_pbit), 0)) {
4215 SI opval = GET_H_SR (FLD (f_operand2));
4216 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4217 written |= (1 << 13);
4218 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4221 BI opval = CPU (h_pbit);
4222 CPU (h_cbit) = opval;
4223 written |= (1 << 10);
4224 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4230 CPU (h_cbit) = opval;
4231 written |= (1 << 10);
4232 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4237 SI opval = GET_H_SR (FLD (f_operand2));
4238 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4239 written |= (1 << 13);
4240 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4243 if (NEBI (tmp_postinc, 0)) {
4245 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4246 tmp_addr = ADDSI (tmp_addr, 4);
4249 SI opval = tmp_addr;
4250 SET_H_GR (FLD (f_operand1), opval);
4251 written |= (1 << 9);
4252 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4258 else if (EQSI (tmp_rno, 9)) {
4262 tmp_postinc = FLD (f_memmode);
4263 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4264 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4265 if (EQBI (CPU (h_pbit), 0)) {
4268 SI opval = GET_H_SR (FLD (f_operand2));
4269 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4270 written |= (1 << 13);
4271 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4274 BI opval = CPU (h_pbit);
4275 CPU (h_cbit) = opval;
4276 written |= (1 << 10);
4277 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4283 CPU (h_cbit) = opval;
4284 written |= (1 << 10);
4285 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4290 SI opval = GET_H_SR (FLD (f_operand2));
4291 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4292 written |= (1 << 13);
4293 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4296 if (NEBI (tmp_postinc, 0)) {
4298 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4299 tmp_addr = ADDSI (tmp_addr, 4);
4302 SI opval = tmp_addr;
4303 SET_H_GR (FLD (f_operand1), opval);
4304 written |= (1 << 9);
4305 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4311 else if (EQSI (tmp_rno, 10)) {
4315 tmp_postinc = FLD (f_memmode);
4316 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4317 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4318 if (EQBI (CPU (h_pbit), 0)) {
4321 SI opval = GET_H_SR (FLD (f_operand2));
4322 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4323 written |= (1 << 13);
4324 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4327 BI opval = CPU (h_pbit);
4328 CPU (h_cbit) = opval;
4329 written |= (1 << 10);
4330 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4336 CPU (h_cbit) = opval;
4337 written |= (1 << 10);
4338 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4343 SI opval = GET_H_SR (FLD (f_operand2));
4344 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4345 written |= (1 << 13);
4346 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4349 if (NEBI (tmp_postinc, 0)) {
4351 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4352 tmp_addr = ADDSI (tmp_addr, 4);
4355 SI opval = tmp_addr;
4356 SET_H_GR (FLD (f_operand1), opval);
4357 written |= (1 << 9);
4358 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4364 else if (EQSI (tmp_rno, 11)) {
4368 tmp_postinc = FLD (f_memmode);
4369 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4370 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4371 if (EQBI (CPU (h_pbit), 0)) {
4374 SI opval = GET_H_SR (FLD (f_operand2));
4375 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4376 written |= (1 << 13);
4377 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4380 BI opval = CPU (h_pbit);
4381 CPU (h_cbit) = opval;
4382 written |= (1 << 10);
4383 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4389 CPU (h_cbit) = opval;
4390 written |= (1 << 10);
4391 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4396 SI opval = GET_H_SR (FLD (f_operand2));
4397 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4398 written |= (1 << 13);
4399 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4402 if (NEBI (tmp_postinc, 0)) {
4404 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4405 tmp_addr = ADDSI (tmp_addr, 4);
4408 SI opval = tmp_addr;
4409 SET_H_GR (FLD (f_operand1), opval);
4410 written |= (1 << 9);
4411 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4417 else if (EQSI (tmp_rno, 12)) {
4421 tmp_postinc = FLD (f_memmode);
4422 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4423 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4424 if (EQBI (CPU (h_pbit), 0)) {
4427 SI opval = GET_H_SR (FLD (f_operand2));
4428 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4429 written |= (1 << 13);
4430 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4433 BI opval = CPU (h_pbit);
4434 CPU (h_cbit) = opval;
4435 written |= (1 << 10);
4436 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4442 CPU (h_cbit) = opval;
4443 written |= (1 << 10);
4444 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4449 SI opval = GET_H_SR (FLD (f_operand2));
4450 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4451 written |= (1 << 13);
4452 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4455 if (NEBI (tmp_postinc, 0)) {
4457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4458 tmp_addr = ADDSI (tmp_addr, 4);
4461 SI opval = tmp_addr;
4462 SET_H_GR (FLD (f_operand1), opval);
4463 written |= (1 << 9);
4464 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4470 else if (EQSI (tmp_rno, 13)) {
4474 tmp_postinc = FLD (f_memmode);
4475 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4476 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4477 if (EQBI (CPU (h_pbit), 0)) {
4480 SI opval = GET_H_SR (FLD (f_operand2));
4481 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4482 written |= (1 << 13);
4483 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4486 BI opval = CPU (h_pbit);
4487 CPU (h_cbit) = opval;
4488 written |= (1 << 10);
4489 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4495 CPU (h_cbit) = opval;
4496 written |= (1 << 10);
4497 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4502 SI opval = GET_H_SR (FLD (f_operand2));
4503 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4504 written |= (1 << 13);
4505 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4508 if (NEBI (tmp_postinc, 0)) {
4510 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4511 tmp_addr = ADDSI (tmp_addr, 4);
4514 SI opval = tmp_addr;
4515 SET_H_GR (FLD (f_operand1), opval);
4516 written |= (1 << 9);
4517 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4523 else if (EQSI (tmp_rno, 14)) {
4527 tmp_postinc = FLD (f_memmode);
4528 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4529 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4530 if (EQBI (CPU (h_pbit), 0)) {
4533 SI opval = GET_H_SR (FLD (f_operand2));
4534 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4535 written |= (1 << 13);
4536 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4539 BI opval = CPU (h_pbit);
4540 CPU (h_cbit) = opval;
4541 written |= (1 << 10);
4542 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4548 CPU (h_cbit) = opval;
4549 written |= (1 << 10);
4550 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4555 SI opval = GET_H_SR (FLD (f_operand2));
4556 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4557 written |= (1 << 13);
4558 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4561 if (NEBI (tmp_postinc, 0)) {
4563 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4564 tmp_addr = ADDSI (tmp_addr, 4);
4567 SI opval = tmp_addr;
4568 SET_H_GR (FLD (f_operand1), opval);
4569 written |= (1 << 9);
4570 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4576 else if (EQSI (tmp_rno, 15)) {
4580 tmp_postinc = FLD (f_memmode);
4581 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4582 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4583 if (EQBI (CPU (h_pbit), 0)) {
4586 SI opval = GET_H_SR (FLD (f_operand2));
4587 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4588 written |= (1 << 13);
4589 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4592 BI opval = CPU (h_pbit);
4593 CPU (h_cbit) = opval;
4594 written |= (1 << 10);
4595 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4601 CPU (h_cbit) = opval;
4602 written |= (1 << 10);
4603 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4608 SI opval = GET_H_SR (FLD (f_operand2));
4609 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4610 written |= (1 << 13);
4611 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4614 if (NEBI (tmp_postinc, 0)) {
4616 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4617 tmp_addr = ADDSI (tmp_addr, 4);
4620 SI opval = tmp_addr;
4621 SET_H_GR (FLD (f_operand1), opval);
4622 written |= (1 << 9);
4623 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4629 else if (EQSI (tmp_rno, 0)) {
4633 tmp_postinc = FLD (f_memmode);
4634 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4635 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4636 if (EQBI (CPU (h_pbit), 0)) {
4639 QI opval = GET_H_SR (FLD (f_operand2));
4640 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4641 written |= (1 << 12);
4642 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4645 BI opval = CPU (h_pbit);
4646 CPU (h_cbit) = opval;
4647 written |= (1 << 10);
4648 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4654 CPU (h_cbit) = opval;
4655 written |= (1 << 10);
4656 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4661 QI opval = GET_H_SR (FLD (f_operand2));
4662 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4663 written |= (1 << 12);
4664 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4667 if (NEBI (tmp_postinc, 0)) {
4669 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4670 tmp_addr = ADDSI (tmp_addr, 1);
4673 SI opval = tmp_addr;
4674 SET_H_GR (FLD (f_operand1), opval);
4675 written |= (1 << 9);
4676 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4682 else if (EQSI (tmp_rno, 1)) {
4686 tmp_postinc = FLD (f_memmode);
4687 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4688 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4689 if (EQBI (CPU (h_pbit), 0)) {
4692 QI opval = GET_H_SR (FLD (f_operand2));
4693 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4694 written |= (1 << 12);
4695 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4698 BI opval = CPU (h_pbit);
4699 CPU (h_cbit) = opval;
4700 written |= (1 << 10);
4701 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4707 CPU (h_cbit) = opval;
4708 written |= (1 << 10);
4709 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4714 QI opval = GET_H_SR (FLD (f_operand2));
4715 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4716 written |= (1 << 12);
4717 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4720 if (NEBI (tmp_postinc, 0)) {
4722 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4723 tmp_addr = ADDSI (tmp_addr, 1);
4726 SI opval = tmp_addr;
4727 SET_H_GR (FLD (f_operand1), opval);
4728 written |= (1 << 9);
4729 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4735 else if (EQSI (tmp_rno, 4)) {
4739 tmp_postinc = FLD (f_memmode);
4740 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4741 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4742 if (EQBI (CPU (h_pbit), 0)) {
4745 HI opval = GET_H_SR (FLD (f_operand2));
4746 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4747 written |= (1 << 11);
4748 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4751 BI opval = CPU (h_pbit);
4752 CPU (h_cbit) = opval;
4753 written |= (1 << 10);
4754 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4760 CPU (h_cbit) = opval;
4761 written |= (1 << 10);
4762 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4767 HI opval = GET_H_SR (FLD (f_operand2));
4768 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4769 written |= (1 << 11);
4770 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4773 if (NEBI (tmp_postinc, 0)) {
4775 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4776 tmp_addr = ADDSI (tmp_addr, 2);
4779 SI opval = tmp_addr;
4780 SET_H_GR (FLD (f_operand1), opval);
4781 written |= (1 << 9);
4782 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4788 else if (EQSI (tmp_rno, 8)) {
4792 tmp_postinc = FLD (f_memmode);
4793 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4794 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4795 if (EQBI (CPU (h_pbit), 0)) {
4798 SI opval = GET_H_SR (FLD (f_operand2));
4799 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4800 written |= (1 << 13);
4801 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4804 BI opval = CPU (h_pbit);
4805 CPU (h_cbit) = opval;
4806 written |= (1 << 10);
4807 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4813 CPU (h_cbit) = opval;
4814 written |= (1 << 10);
4815 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4820 SI opval = GET_H_SR (FLD (f_operand2));
4821 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4822 written |= (1 << 13);
4823 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4826 if (NEBI (tmp_postinc, 0)) {
4828 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4829 tmp_addr = ADDSI (tmp_addr, 4);
4832 SI opval = tmp_addr;
4833 SET_H_GR (FLD (f_operand1), opval);
4834 written |= (1 << 9);
4835 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4842 cgen_rtx_error (current_cpu, "write from unimplemented special register");
4847 CPU (h_xbit) = opval;
4848 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4852 SET_H_INSN_PREFIXED_P (opval);
4853 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4858 abuf->written = written;
4863 CASE (sem, INSN_MOVE_SS_R) : /* move ${Ss},${Rd-sfield} */
4865 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4866 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4867 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4868 int UNUSED written = 0;
4869 IADDR UNUSED pc = abuf->addr;
4870 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4874 SI opval = GET_H_SUPR (FLD (f_operand2));
4875 SET_H_GR (FLD (f_operand1), opval);
4876 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4881 CPU (h_xbit) = opval;
4882 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4886 SET_H_INSN_PREFIXED_P (opval);
4887 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4896 CASE (sem, INSN_MOVE_R_SS) : /* move ${Rs},${Sd} */
4898 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4899 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4900 #define FLD(f) abuf->fields.sfmt_mcp.f
4901 int UNUSED written = 0;
4902 IADDR UNUSED pc = abuf->addr;
4903 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4907 SI opval = GET_H_GR (FLD (f_operand1));
4908 SET_H_SUPR (FLD (f_operand2), opval);
4909 TRACE_RESULT (current_cpu, abuf, "supr", 'x', opval);
4914 CPU (h_xbit) = opval;
4915 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4919 SET_H_INSN_PREFIXED_P (opval);
4920 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4929 CASE (sem, INSN_MOVEM_R_M_V32) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4931 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4932 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4933 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
4934 int UNUSED written = 0;
4935 IADDR UNUSED pc = abuf->addr;
4936 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4941 tmp_postinc = FLD (f_memmode);
4944 tmp_dummy = GET_H_GR (FLD (f_operand2));
4946 tmp_addr = GET_H_GR (FLD (f_operand1));
4948 if (GESI (FLD (f_operand2), 0)) {
4951 tmp_tmp = GET_H_GR (((UINT) 0));
4954 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4955 written |= (1 << 21);
4956 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4958 tmp_addr = ADDSI (tmp_addr, 4);
4961 if (GESI (FLD (f_operand2), 1)) {
4964 tmp_tmp = GET_H_GR (((UINT) 1));
4967 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4968 written |= (1 << 21);
4969 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4971 tmp_addr = ADDSI (tmp_addr, 4);
4974 if (GESI (FLD (f_operand2), 2)) {
4977 tmp_tmp = GET_H_GR (((UINT) 2));
4980 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4981 written |= (1 << 21);
4982 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4984 tmp_addr = ADDSI (tmp_addr, 4);
4987 if (GESI (FLD (f_operand2), 3)) {
4990 tmp_tmp = GET_H_GR (((UINT) 3));
4993 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4994 written |= (1 << 21);
4995 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4997 tmp_addr = ADDSI (tmp_addr, 4);
5000 if (GESI (FLD (f_operand2), 4)) {
5003 tmp_tmp = GET_H_GR (((UINT) 4));
5006 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5007 written |= (1 << 21);
5008 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5010 tmp_addr = ADDSI (tmp_addr, 4);
5013 if (GESI (FLD (f_operand2), 5)) {
5016 tmp_tmp = GET_H_GR (((UINT) 5));
5019 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5020 written |= (1 << 21);
5021 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5023 tmp_addr = ADDSI (tmp_addr, 4);
5026 if (GESI (FLD (f_operand2), 6)) {
5029 tmp_tmp = GET_H_GR (((UINT) 6));
5032 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5033 written |= (1 << 21);
5034 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5036 tmp_addr = ADDSI (tmp_addr, 4);
5039 if (GESI (FLD (f_operand2), 7)) {
5042 tmp_tmp = GET_H_GR (((UINT) 7));
5045 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5046 written |= (1 << 21);
5047 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5049 tmp_addr = ADDSI (tmp_addr, 4);
5052 if (GESI (FLD (f_operand2), 8)) {
5055 tmp_tmp = GET_H_GR (((UINT) 8));
5058 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5059 written |= (1 << 21);
5060 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5062 tmp_addr = ADDSI (tmp_addr, 4);
5065 if (GESI (FLD (f_operand2), 9)) {
5068 tmp_tmp = GET_H_GR (((UINT) 9));
5071 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5072 written |= (1 << 21);
5073 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5075 tmp_addr = ADDSI (tmp_addr, 4);
5078 if (GESI (FLD (f_operand2), 10)) {
5081 tmp_tmp = GET_H_GR (((UINT) 10));
5084 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5085 written |= (1 << 21);
5086 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5088 tmp_addr = ADDSI (tmp_addr, 4);
5091 if (GESI (FLD (f_operand2), 11)) {
5094 tmp_tmp = GET_H_GR (((UINT) 11));
5097 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5098 written |= (1 << 21);
5099 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5101 tmp_addr = ADDSI (tmp_addr, 4);
5104 if (GESI (FLD (f_operand2), 12)) {
5107 tmp_tmp = GET_H_GR (((UINT) 12));
5110 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5111 written |= (1 << 21);
5112 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5114 tmp_addr = ADDSI (tmp_addr, 4);
5117 if (GESI (FLD (f_operand2), 13)) {
5120 tmp_tmp = GET_H_GR (((UINT) 13));
5123 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5124 written |= (1 << 21);
5125 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5127 tmp_addr = ADDSI (tmp_addr, 4);
5130 if (GESI (FLD (f_operand2), 14)) {
5133 tmp_tmp = GET_H_GR (((UINT) 14));
5136 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5137 written |= (1 << 21);
5138 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5140 tmp_addr = ADDSI (tmp_addr, 4);
5143 if (GESI (FLD (f_operand2), 15)) {
5146 tmp_tmp = GET_H_GR (((UINT) 15));
5149 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5150 written |= (1 << 21);
5151 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5153 tmp_addr = ADDSI (tmp_addr, 4);
5157 if (NEBI (tmp_postinc, 0)) {
5159 SI opval = tmp_addr;
5160 SET_H_GR (FLD (f_operand1), opval);
5161 written |= (1 << 20);
5162 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5168 CPU (h_xbit) = opval;
5169 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5173 SET_H_INSN_PREFIXED_P (opval);
5174 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5179 abuf->written = written;
5184 CASE (sem, INSN_MOVEM_M_R_V32) : /* movem [${Rs}${inc}],${Rd} */
5186 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5187 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5188 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5189 int UNUSED written = 0;
5190 IADDR UNUSED pc = abuf->addr;
5191 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5196 tmp_postinc = FLD (f_memmode);
5197 tmp_addr = GET_H_GR (FLD (f_operand1));
5200 tmp_dummy = GET_H_GR (FLD (f_operand2));
5203 if (GESI (FLD (f_operand2), 0)) {
5206 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5209 SET_H_GR (((UINT) 0), opval);
5210 written |= (1 << 6);
5211 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5213 tmp_addr = ADDSI (tmp_addr, 4);
5216 if (GESI (FLD (f_operand2), 1)) {
5219 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5222 SET_H_GR (((UINT) 1), opval);
5223 written |= (1 << 7);
5224 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5226 tmp_addr = ADDSI (tmp_addr, 4);
5229 if (GESI (FLD (f_operand2), 2)) {
5232 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5235 SET_H_GR (((UINT) 2), opval);
5236 written |= (1 << 14);
5237 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5239 tmp_addr = ADDSI (tmp_addr, 4);
5242 if (GESI (FLD (f_operand2), 3)) {
5245 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5248 SET_H_GR (((UINT) 3), opval);
5249 written |= (1 << 15);
5250 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5252 tmp_addr = ADDSI (tmp_addr, 4);
5255 if (GESI (FLD (f_operand2), 4)) {
5258 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5261 SET_H_GR (((UINT) 4), opval);
5262 written |= (1 << 16);
5263 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5265 tmp_addr = ADDSI (tmp_addr, 4);
5268 if (GESI (FLD (f_operand2), 5)) {
5271 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5274 SET_H_GR (((UINT) 5), opval);
5275 written |= (1 << 17);
5276 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5278 tmp_addr = ADDSI (tmp_addr, 4);
5281 if (GESI (FLD (f_operand2), 6)) {
5284 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5287 SET_H_GR (((UINT) 6), opval);
5288 written |= (1 << 18);
5289 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5291 tmp_addr = ADDSI (tmp_addr, 4);
5294 if (GESI (FLD (f_operand2), 7)) {
5297 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5300 SET_H_GR (((UINT) 7), opval);
5301 written |= (1 << 19);
5302 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5304 tmp_addr = ADDSI (tmp_addr, 4);
5307 if (GESI (FLD (f_operand2), 8)) {
5310 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5313 SET_H_GR (((UINT) 8), opval);
5314 written |= (1 << 20);
5315 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5317 tmp_addr = ADDSI (tmp_addr, 4);
5320 if (GESI (FLD (f_operand2), 9)) {
5323 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5326 SET_H_GR (((UINT) 9), opval);
5327 written |= (1 << 21);
5328 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5330 tmp_addr = ADDSI (tmp_addr, 4);
5333 if (GESI (FLD (f_operand2), 10)) {
5336 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5339 SET_H_GR (((UINT) 10), opval);
5340 written |= (1 << 8);
5341 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5343 tmp_addr = ADDSI (tmp_addr, 4);
5346 if (GESI (FLD (f_operand2), 11)) {
5349 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5352 SET_H_GR (((UINT) 11), opval);
5353 written |= (1 << 9);
5354 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5356 tmp_addr = ADDSI (tmp_addr, 4);
5359 if (GESI (FLD (f_operand2), 12)) {
5362 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5365 SET_H_GR (((UINT) 12), opval);
5366 written |= (1 << 10);
5367 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5369 tmp_addr = ADDSI (tmp_addr, 4);
5372 if (GESI (FLD (f_operand2), 13)) {
5375 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5378 SET_H_GR (((UINT) 13), opval);
5379 written |= (1 << 11);
5380 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5382 tmp_addr = ADDSI (tmp_addr, 4);
5385 if (GESI (FLD (f_operand2), 14)) {
5388 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5391 SET_H_GR (((UINT) 14), opval);
5392 written |= (1 << 12);
5393 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5395 tmp_addr = ADDSI (tmp_addr, 4);
5398 if (GESI (FLD (f_operand2), 15)) {
5401 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5404 SET_H_GR (((UINT) 15), opval);
5405 written |= (1 << 13);
5406 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5408 tmp_addr = ADDSI (tmp_addr, 4);
5412 if (NEBI (tmp_postinc, 0)) {
5414 SI opval = tmp_addr;
5415 SET_H_GR (FLD (f_operand1), opval);
5416 written |= (1 << 5);
5417 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5423 CPU (h_xbit) = opval;
5424 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5428 SET_H_INSN_PREFIXED_P (opval);
5429 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5434 abuf->written = written;
5439 CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
5441 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5442 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5443 #define FLD(f) abuf->fields.sfmt_addc_m.f
5444 int UNUSED written = 0;
5445 IADDR UNUSED pc = abuf->addr;
5446 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5453 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5454 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5455 tmp_carry = CPU (h_cbit);
5456 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5459 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5461 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5462 SET_H_GR (FLD (f_operand2), opval);
5463 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5468 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
5469 CPU (h_cbit) = opval;
5470 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5473 BI opval = LTQI (tmp_newval, 0);
5474 CPU (h_nbit) = opval;
5475 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5478 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5479 CPU (h_zbit) = opval;
5480 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5483 BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
5484 CPU (h_vbit) = opval;
5485 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5490 CPU (h_xbit) = opval;
5491 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5495 SET_H_INSN_PREFIXED_P (opval);
5496 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5506 CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
5508 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5509 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5510 #define FLD(f) abuf->fields.sfmt_addc_m.f
5511 int UNUSED written = 0;
5512 IADDR UNUSED pc = abuf->addr;
5513 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5520 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5521 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5522 tmp_carry = CPU (h_cbit);
5523 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5526 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5528 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5529 SET_H_GR (FLD (f_operand2), opval);
5530 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5535 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
5536 CPU (h_cbit) = opval;
5537 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5540 BI opval = LTHI (tmp_newval, 0);
5541 CPU (h_nbit) = opval;
5542 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5545 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5546 CPU (h_zbit) = opval;
5547 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5550 BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
5551 CPU (h_vbit) = opval;
5552 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5557 CPU (h_xbit) = opval;
5558 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5562 SET_H_INSN_PREFIXED_P (opval);
5563 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5573 CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
5575 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5576 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5577 #define FLD(f) abuf->fields.sfmt_addc_m.f
5578 int UNUSED written = 0;
5579 IADDR UNUSED pc = abuf->addr;
5580 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5587 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5588 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5589 tmp_carry = CPU (h_cbit);
5590 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5592 SI opval = tmp_newval;
5593 SET_H_GR (FLD (f_operand2), opval);
5594 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5598 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
5599 CPU (h_cbit) = opval;
5600 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5603 BI opval = LTSI (tmp_newval, 0);
5604 CPU (h_nbit) = opval;
5605 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5608 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5609 CPU (h_zbit) = opval;
5610 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5613 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
5614 CPU (h_vbit) = opval;
5615 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5620 CPU (h_xbit) = opval;
5621 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5625 SET_H_INSN_PREFIXED_P (opval);
5626 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5636 CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
5638 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5639 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5640 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5641 int UNUSED written = 0;
5642 IADDR UNUSED pc = abuf->addr;
5643 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5650 tmp_tmpops = ({ SI tmp_addr;
5653 tmp_postinc = FLD (f_memmode);
5654 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5655 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
5656 ; if (NEBI (tmp_postinc, 0)) {
5658 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5659 tmp_addr = ADDSI (tmp_addr, 1);
5662 SI opval = tmp_addr;
5663 SET_H_GR (FLD (f_operand1), opval);
5664 written |= (1 << 12);
5665 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5670 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5671 tmp_carry = CPU (h_cbit);
5672 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5675 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5677 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5678 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5679 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5684 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
5685 CPU (h_cbit) = opval;
5686 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5689 BI opval = LTQI (tmp_newval, 0);
5690 CPU (h_nbit) = opval;
5691 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5694 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5695 CPU (h_zbit) = opval;
5696 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5699 BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
5700 CPU (h_vbit) = opval;
5701 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5706 CPU (h_xbit) = opval;
5707 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5711 SET_H_INSN_PREFIXED_P (opval);
5712 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5718 abuf->written = written;
5723 CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
5725 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5726 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5727 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5728 int UNUSED written = 0;
5729 IADDR UNUSED pc = abuf->addr;
5730 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5737 tmp_tmpops = ({ SI tmp_addr;
5740 tmp_postinc = FLD (f_memmode);
5741 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5742 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
5743 ; if (NEBI (tmp_postinc, 0)) {
5745 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5746 tmp_addr = ADDSI (tmp_addr, 2);
5749 SI opval = tmp_addr;
5750 SET_H_GR (FLD (f_operand1), opval);
5751 written |= (1 << 12);
5752 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5757 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5758 tmp_carry = CPU (h_cbit);
5759 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5762 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5764 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5765 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5766 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5771 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
5772 CPU (h_cbit) = opval;
5773 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5776 BI opval = LTHI (tmp_newval, 0);
5777 CPU (h_nbit) = opval;
5778 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5781 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5782 CPU (h_zbit) = opval;
5783 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5786 BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
5787 CPU (h_vbit) = opval;
5788 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5793 CPU (h_xbit) = opval;
5794 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5798 SET_H_INSN_PREFIXED_P (opval);
5799 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5805 abuf->written = written;
5810 CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
5812 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5813 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5814 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5815 int UNUSED written = 0;
5816 IADDR UNUSED pc = abuf->addr;
5817 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5824 tmp_tmpops = ({ SI tmp_addr;
5827 tmp_postinc = FLD (f_memmode);
5828 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5829 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
5830 ; if (NEBI (tmp_postinc, 0)) {
5832 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5833 tmp_addr = ADDSI (tmp_addr, 4);
5836 SI opval = tmp_addr;
5837 SET_H_GR (FLD (f_operand1), opval);
5838 written |= (1 << 11);
5839 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5844 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5845 tmp_carry = CPU (h_cbit);
5846 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5848 SI opval = tmp_newval;
5849 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5850 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5854 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
5855 CPU (h_cbit) = opval;
5856 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5859 BI opval = LTSI (tmp_newval, 0);
5860 CPU (h_nbit) = opval;
5861 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5864 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5865 CPU (h_zbit) = opval;
5866 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5869 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
5870 CPU (h_vbit) = opval;
5871 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5876 CPU (h_xbit) = opval;
5877 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5881 SET_H_INSN_PREFIXED_P (opval);
5882 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5888 abuf->written = written;
5893 CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
5895 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5896 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5897 #define FLD(f) abuf->fields.sfmt_addcbr.f
5898 int UNUSED written = 0;
5899 IADDR UNUSED pc = abuf->addr;
5900 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5907 tmp_tmpops = FLD (f_indir_pc__byte);
5908 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5909 tmp_carry = CPU (h_cbit);
5910 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5913 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5915 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5916 SET_H_GR (FLD (f_operand2), opval);
5917 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5922 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
5923 CPU (h_cbit) = opval;
5924 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5927 BI opval = LTQI (tmp_newval, 0);
5928 CPU (h_nbit) = opval;
5929 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5932 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5933 CPU (h_zbit) = opval;
5934 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5937 BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
5938 CPU (h_vbit) = opval;
5939 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5944 CPU (h_xbit) = opval;
5945 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5949 SET_H_INSN_PREFIXED_P (opval);
5950 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5960 CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
5962 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5963 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5964 #define FLD(f) abuf->fields.sfmt_addcwr.f
5965 int UNUSED written = 0;
5966 IADDR UNUSED pc = abuf->addr;
5967 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5974 tmp_tmpops = FLD (f_indir_pc__word);
5975 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5976 tmp_carry = CPU (h_cbit);
5977 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5980 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5982 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5983 SET_H_GR (FLD (f_operand2), opval);
5984 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5989 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
5990 CPU (h_cbit) = opval;
5991 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5994 BI opval = LTHI (tmp_newval, 0);
5995 CPU (h_nbit) = opval;
5996 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5999 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6000 CPU (h_zbit) = opval;
6001 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6004 BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
6005 CPU (h_vbit) = opval;
6006 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6011 CPU (h_xbit) = opval;
6012 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6016 SET_H_INSN_PREFIXED_P (opval);
6017 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6027 CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
6029 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6030 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6031 #define FLD(f) abuf->fields.sfmt_addcdr.f
6032 int UNUSED written = 0;
6033 IADDR UNUSED pc = abuf->addr;
6034 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
6041 tmp_tmpops = FLD (f_indir_pc__dword);
6042 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6043 tmp_carry = CPU (h_cbit);
6044 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6046 SI opval = tmp_newval;
6047 SET_H_GR (FLD (f_operand2), opval);
6048 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6052 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6053 CPU (h_cbit) = opval;
6054 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6057 BI opval = LTSI (tmp_newval, 0);
6058 CPU (h_nbit) = opval;
6059 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6062 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6063 CPU (h_zbit) = opval;
6064 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6067 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6068 CPU (h_vbit) = opval;
6069 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6074 CPU (h_xbit) = opval;
6075 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6079 SET_H_INSN_PREFIXED_P (opval);
6080 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6090 CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
6092 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6093 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6094 #define FLD(f) abuf->fields.sfmt_addc_m.f
6095 int UNUSED written = 0;
6096 IADDR UNUSED pc = abuf->addr;
6097 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6104 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6105 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6106 tmp_carry = CPU (h_cbit);
6107 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6109 SI opval = tmp_newval;
6110 SET_H_GR (FLD (f_operand2), opval);
6111 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6115 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6116 CPU (h_cbit) = opval;
6117 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6120 BI opval = LTSI (tmp_newval, 0);
6121 CPU (h_nbit) = opval;
6122 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6125 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6126 CPU (h_zbit) = opval;
6127 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6130 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6131 CPU (h_vbit) = opval;
6132 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6137 CPU (h_xbit) = opval;
6138 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6142 SET_H_INSN_PREFIXED_P (opval);
6143 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6153 CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
6155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6157 #define FLD(f) abuf->fields.sfmt_addc_m.f
6158 int UNUSED written = 0;
6159 IADDR UNUSED pc = abuf->addr;
6160 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6167 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6168 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6169 tmp_carry = CPU (h_cbit);
6170 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6172 SI opval = tmp_newval;
6173 SET_H_GR (FLD (f_operand2), opval);
6174 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6178 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6179 CPU (h_cbit) = opval;
6180 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6183 BI opval = LTSI (tmp_newval, 0);
6184 CPU (h_nbit) = opval;
6185 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6188 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6189 CPU (h_zbit) = opval;
6190 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6193 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6194 CPU (h_vbit) = opval;
6195 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6200 CPU (h_xbit) = opval;
6201 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6205 SET_H_INSN_PREFIXED_P (opval);
6206 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6216 CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
6218 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6219 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6220 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6221 int UNUSED written = 0;
6222 IADDR UNUSED pc = abuf->addr;
6223 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6230 tmp_tmpops = EXTQISI (({ SI tmp_addr;
6233 tmp_postinc = FLD (f_memmode);
6234 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6235 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6236 ; if (NEBI (tmp_postinc, 0)) {
6238 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6239 tmp_addr = ADDSI (tmp_addr, 1);
6242 SI opval = tmp_addr;
6243 SET_H_GR (FLD (f_operand1), opval);
6244 written |= (1 << 11);
6245 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6250 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6251 tmp_carry = CPU (h_cbit);
6252 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6254 SI opval = tmp_newval;
6255 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6256 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6260 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6261 CPU (h_cbit) = opval;
6262 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6265 BI opval = LTSI (tmp_newval, 0);
6266 CPU (h_nbit) = opval;
6267 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6270 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6271 CPU (h_zbit) = opval;
6272 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6275 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6276 CPU (h_vbit) = opval;
6277 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6282 CPU (h_xbit) = opval;
6283 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6287 SET_H_INSN_PREFIXED_P (opval);
6288 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6294 abuf->written = written;
6299 CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
6301 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6302 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6303 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6304 int UNUSED written = 0;
6305 IADDR UNUSED pc = abuf->addr;
6306 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6313 tmp_tmpops = EXTHISI (({ SI tmp_addr;
6316 tmp_postinc = FLD (f_memmode);
6317 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6318 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6319 ; if (NEBI (tmp_postinc, 0)) {
6321 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6322 tmp_addr = ADDSI (tmp_addr, 2);
6325 SI opval = tmp_addr;
6326 SET_H_GR (FLD (f_operand1), opval);
6327 written |= (1 << 11);
6328 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6333 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6334 tmp_carry = CPU (h_cbit);
6335 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6337 SI opval = tmp_newval;
6338 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6339 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6343 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6344 CPU (h_cbit) = opval;
6345 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6348 BI opval = LTSI (tmp_newval, 0);
6349 CPU (h_nbit) = opval;
6350 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6353 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6354 CPU (h_zbit) = opval;
6355 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6358 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6359 CPU (h_vbit) = opval;
6360 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6365 CPU (h_xbit) = opval;
6366 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6370 SET_H_INSN_PREFIXED_P (opval);
6371 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6377 abuf->written = written;
6382 CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
6384 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6385 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6386 #define FLD(f) abuf->fields.sfmt_addcbr.f
6387 int UNUSED written = 0;
6388 IADDR UNUSED pc = abuf->addr;
6389 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6396 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6397 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6398 tmp_carry = CPU (h_cbit);
6399 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6401 SI opval = tmp_newval;
6402 SET_H_GR (FLD (f_operand2), opval);
6403 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6407 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6408 CPU (h_cbit) = opval;
6409 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6412 BI opval = LTSI (tmp_newval, 0);
6413 CPU (h_nbit) = opval;
6414 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6417 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6418 CPU (h_zbit) = opval;
6419 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6422 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6423 CPU (h_vbit) = opval;
6424 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6429 CPU (h_xbit) = opval;
6430 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6434 SET_H_INSN_PREFIXED_P (opval);
6435 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6445 CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
6447 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6448 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6449 #define FLD(f) abuf->fields.sfmt_addcwr.f
6450 int UNUSED written = 0;
6451 IADDR UNUSED pc = abuf->addr;
6452 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6459 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6460 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6461 tmp_carry = CPU (h_cbit);
6462 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6464 SI opval = tmp_newval;
6465 SET_H_GR (FLD (f_operand2), opval);
6466 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6470 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6471 CPU (h_cbit) = opval;
6472 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6475 BI opval = LTSI (tmp_newval, 0);
6476 CPU (h_nbit) = opval;
6477 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6480 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6481 CPU (h_zbit) = opval;
6482 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6485 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6486 CPU (h_vbit) = opval;
6487 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6492 CPU (h_xbit) = opval;
6493 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6497 SET_H_INSN_PREFIXED_P (opval);
6498 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6508 CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
6510 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6511 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6512 #define FLD(f) abuf->fields.sfmt_addc_m.f
6513 int UNUSED written = 0;
6514 IADDR UNUSED pc = abuf->addr;
6515 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6522 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6523 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6524 tmp_carry = CPU (h_cbit);
6525 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6527 SI opval = tmp_newval;
6528 SET_H_GR (FLD (f_operand2), opval);
6529 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6533 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6534 CPU (h_cbit) = opval;
6535 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6538 BI opval = LTSI (tmp_newval, 0);
6539 CPU (h_nbit) = opval;
6540 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6543 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6544 CPU (h_zbit) = opval;
6545 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6548 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6549 CPU (h_vbit) = opval;
6550 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6555 CPU (h_xbit) = opval;
6556 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6560 SET_H_INSN_PREFIXED_P (opval);
6561 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6571 CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
6573 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6574 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6575 #define FLD(f) abuf->fields.sfmt_addc_m.f
6576 int UNUSED written = 0;
6577 IADDR UNUSED pc = abuf->addr;
6578 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6585 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6586 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6587 tmp_carry = CPU (h_cbit);
6588 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6590 SI opval = tmp_newval;
6591 SET_H_GR (FLD (f_operand2), opval);
6592 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6596 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6597 CPU (h_cbit) = opval;
6598 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6601 BI opval = LTSI (tmp_newval, 0);
6602 CPU (h_nbit) = opval;
6603 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6606 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6607 CPU (h_zbit) = opval;
6608 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6611 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6612 CPU (h_vbit) = opval;
6613 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6618 CPU (h_xbit) = opval;
6619 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6623 SET_H_INSN_PREFIXED_P (opval);
6624 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6634 CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
6636 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6637 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6638 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6639 int UNUSED written = 0;
6640 IADDR UNUSED pc = abuf->addr;
6641 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6648 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
6651 tmp_postinc = FLD (f_memmode);
6652 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6653 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6654 ; if (NEBI (tmp_postinc, 0)) {
6656 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6657 tmp_addr = ADDSI (tmp_addr, 1);
6660 SI opval = tmp_addr;
6661 SET_H_GR (FLD (f_operand1), opval);
6662 written |= (1 << 11);
6663 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6668 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6669 tmp_carry = CPU (h_cbit);
6670 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6672 SI opval = tmp_newval;
6673 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6674 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6678 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6679 CPU (h_cbit) = opval;
6680 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6683 BI opval = LTSI (tmp_newval, 0);
6684 CPU (h_nbit) = opval;
6685 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6688 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6689 CPU (h_zbit) = opval;
6690 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6693 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6694 CPU (h_vbit) = opval;
6695 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6700 CPU (h_xbit) = opval;
6701 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6705 SET_H_INSN_PREFIXED_P (opval);
6706 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6712 abuf->written = written;
6717 CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
6719 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6720 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6721 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6722 int UNUSED written = 0;
6723 IADDR UNUSED pc = abuf->addr;
6724 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6731 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
6734 tmp_postinc = FLD (f_memmode);
6735 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6736 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6737 ; if (NEBI (tmp_postinc, 0)) {
6739 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6740 tmp_addr = ADDSI (tmp_addr, 2);
6743 SI opval = tmp_addr;
6744 SET_H_GR (FLD (f_operand1), opval);
6745 written |= (1 << 11);
6746 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6751 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6752 tmp_carry = CPU (h_cbit);
6753 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6755 SI opval = tmp_newval;
6756 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6757 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6761 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6762 CPU (h_cbit) = opval;
6763 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6766 BI opval = LTSI (tmp_newval, 0);
6767 CPU (h_nbit) = opval;
6768 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6771 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6772 CPU (h_zbit) = opval;
6773 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6776 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6777 CPU (h_vbit) = opval;
6778 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6783 CPU (h_xbit) = opval;
6784 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6788 SET_H_INSN_PREFIXED_P (opval);
6789 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6795 abuf->written = written;
6800 CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
6802 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6803 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6804 #define FLD(f) abuf->fields.sfmt_addcbr.f
6805 int UNUSED written = 0;
6806 IADDR UNUSED pc = abuf->addr;
6807 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6814 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6815 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6816 tmp_carry = CPU (h_cbit);
6817 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6819 SI opval = tmp_newval;
6820 SET_H_GR (FLD (f_operand2), opval);
6821 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6825 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6826 CPU (h_cbit) = opval;
6827 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6830 BI opval = LTSI (tmp_newval, 0);
6831 CPU (h_nbit) = opval;
6832 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6835 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6836 CPU (h_zbit) = opval;
6837 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6840 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6841 CPU (h_vbit) = opval;
6842 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6847 CPU (h_xbit) = opval;
6848 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6852 SET_H_INSN_PREFIXED_P (opval);
6853 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6863 CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
6865 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6866 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6867 #define FLD(f) abuf->fields.sfmt_addcwr.f
6868 int UNUSED written = 0;
6869 IADDR UNUSED pc = abuf->addr;
6870 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6877 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6878 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6879 tmp_carry = CPU (h_cbit);
6880 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6882 SI opval = tmp_newval;
6883 SET_H_GR (FLD (f_operand2), opval);
6884 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6888 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6889 CPU (h_cbit) = opval;
6890 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6893 BI opval = LTSI (tmp_newval, 0);
6894 CPU (h_nbit) = opval;
6895 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6898 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6899 CPU (h_zbit) = opval;
6900 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6903 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6904 CPU (h_vbit) = opval;
6905 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6910 CPU (h_xbit) = opval;
6911 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6915 SET_H_INSN_PREFIXED_P (opval);
6916 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6926 CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
6928 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6929 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6930 #define FLD(f) abuf->fields.sfmt_addc_m.f
6931 int UNUSED written = 0;
6932 IADDR UNUSED pc = abuf->addr;
6933 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6940 tmp_tmpops = GET_H_GR (FLD (f_operand1));
6941 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6942 tmp_carry = CPU (h_cbit);
6943 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6946 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
6948 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
6949 SET_H_GR (FLD (f_operand2), opval);
6950 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6955 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
6956 CPU (h_cbit) = opval;
6957 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6960 BI opval = LTQI (tmp_newval, 0);
6961 CPU (h_nbit) = opval;
6962 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6965 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6966 CPU (h_zbit) = opval;
6967 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6970 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
6971 CPU (h_vbit) = opval;
6972 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6977 CPU (h_xbit) = opval;
6978 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6982 SET_H_INSN_PREFIXED_P (opval);
6983 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6993 CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
6995 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6996 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6997 #define FLD(f) abuf->fields.sfmt_addc_m.f
6998 int UNUSED written = 0;
6999 IADDR UNUSED pc = abuf->addr;
7000 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7007 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7008 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7009 tmp_carry = CPU (h_cbit);
7010 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7013 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7015 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7016 SET_H_GR (FLD (f_operand2), opval);
7017 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7022 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
7023 CPU (h_cbit) = opval;
7024 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7027 BI opval = LTHI (tmp_newval, 0);
7028 CPU (h_nbit) = opval;
7029 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7032 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7033 CPU (h_zbit) = opval;
7034 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7037 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
7038 CPU (h_vbit) = opval;
7039 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7044 CPU (h_xbit) = opval;
7045 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7049 SET_H_INSN_PREFIXED_P (opval);
7050 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7060 CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
7062 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7063 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7064 #define FLD(f) abuf->fields.sfmt_addc_m.f
7065 int UNUSED written = 0;
7066 IADDR UNUSED pc = abuf->addr;
7067 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7074 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7075 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7076 tmp_carry = CPU (h_cbit);
7077 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7079 SI opval = tmp_newval;
7080 SET_H_GR (FLD (f_operand2), opval);
7081 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7085 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7086 CPU (h_cbit) = opval;
7087 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7090 BI opval = LTSI (tmp_newval, 0);
7091 CPU (h_nbit) = opval;
7092 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7095 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7096 CPU (h_zbit) = opval;
7097 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7100 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7101 CPU (h_vbit) = opval;
7102 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7107 CPU (h_xbit) = opval;
7108 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7112 SET_H_INSN_PREFIXED_P (opval);
7113 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7123 CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
7125 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7126 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7127 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7128 int UNUSED written = 0;
7129 IADDR UNUSED pc = abuf->addr;
7130 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7137 tmp_tmpops = ({ SI tmp_addr;
7140 tmp_postinc = FLD (f_memmode);
7141 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7142 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7143 ; if (NEBI (tmp_postinc, 0)) {
7145 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7146 tmp_addr = ADDSI (tmp_addr, 1);
7149 SI opval = tmp_addr;
7150 SET_H_GR (FLD (f_operand1), opval);
7151 written |= (1 << 12);
7152 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7157 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7158 tmp_carry = CPU (h_cbit);
7159 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7162 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7164 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7165 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7166 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7171 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
7172 CPU (h_cbit) = opval;
7173 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7176 BI opval = LTQI (tmp_newval, 0);
7177 CPU (h_nbit) = opval;
7178 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7181 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7182 CPU (h_zbit) = opval;
7183 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7186 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
7187 CPU (h_vbit) = opval;
7188 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7193 CPU (h_xbit) = opval;
7194 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7198 SET_H_INSN_PREFIXED_P (opval);
7199 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7205 abuf->written = written;
7210 CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
7212 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7213 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7214 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7215 int UNUSED written = 0;
7216 IADDR UNUSED pc = abuf->addr;
7217 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7224 tmp_tmpops = ({ SI tmp_addr;
7227 tmp_postinc = FLD (f_memmode);
7228 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7229 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7230 ; if (NEBI (tmp_postinc, 0)) {
7232 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7233 tmp_addr = ADDSI (tmp_addr, 2);
7236 SI opval = tmp_addr;
7237 SET_H_GR (FLD (f_operand1), opval);
7238 written |= (1 << 12);
7239 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7244 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7245 tmp_carry = CPU (h_cbit);
7246 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7249 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7251 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7252 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7253 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7258 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
7259 CPU (h_cbit) = opval;
7260 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7263 BI opval = LTHI (tmp_newval, 0);
7264 CPU (h_nbit) = opval;
7265 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7268 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7269 CPU (h_zbit) = opval;
7270 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7273 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
7274 CPU (h_vbit) = opval;
7275 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7280 CPU (h_xbit) = opval;
7281 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7285 SET_H_INSN_PREFIXED_P (opval);
7286 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7292 abuf->written = written;
7297 CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
7299 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7300 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7301 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7302 int UNUSED written = 0;
7303 IADDR UNUSED pc = abuf->addr;
7304 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7311 tmp_tmpops = ({ SI tmp_addr;
7314 tmp_postinc = FLD (f_memmode);
7315 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7316 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
7317 ; if (NEBI (tmp_postinc, 0)) {
7319 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7320 tmp_addr = ADDSI (tmp_addr, 4);
7323 SI opval = tmp_addr;
7324 SET_H_GR (FLD (f_operand1), opval);
7325 written |= (1 << 11);
7326 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7331 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7332 tmp_carry = CPU (h_cbit);
7333 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7335 SI opval = tmp_newval;
7336 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7337 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7341 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7342 CPU (h_cbit) = opval;
7343 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7346 BI opval = LTSI (tmp_newval, 0);
7347 CPU (h_nbit) = opval;
7348 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7351 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7352 CPU (h_zbit) = opval;
7353 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7356 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7357 CPU (h_vbit) = opval;
7358 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7363 CPU (h_xbit) = opval;
7364 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7368 SET_H_INSN_PREFIXED_P (opval);
7369 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7375 abuf->written = written;
7380 CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
7382 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7383 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7384 #define FLD(f) abuf->fields.sfmt_addcbr.f
7385 int UNUSED written = 0;
7386 IADDR UNUSED pc = abuf->addr;
7387 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7394 tmp_tmpops = FLD (f_indir_pc__byte);
7395 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7396 tmp_carry = CPU (h_cbit);
7397 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7400 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7402 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7403 SET_H_GR (FLD (f_operand2), opval);
7404 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7409 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
7410 CPU (h_cbit) = opval;
7411 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7414 BI opval = LTQI (tmp_newval, 0);
7415 CPU (h_nbit) = opval;
7416 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7419 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7420 CPU (h_zbit) = opval;
7421 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7424 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
7425 CPU (h_vbit) = opval;
7426 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7431 CPU (h_xbit) = opval;
7432 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7436 SET_H_INSN_PREFIXED_P (opval);
7437 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7447 CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
7449 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7450 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7451 #define FLD(f) abuf->fields.sfmt_addcwr.f
7452 int UNUSED written = 0;
7453 IADDR UNUSED pc = abuf->addr;
7454 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7461 tmp_tmpops = FLD (f_indir_pc__word);
7462 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7463 tmp_carry = CPU (h_cbit);
7464 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7467 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7469 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7470 SET_H_GR (FLD (f_operand2), opval);
7471 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7476 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
7477 CPU (h_cbit) = opval;
7478 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7481 BI opval = LTHI (tmp_newval, 0);
7482 CPU (h_nbit) = opval;
7483 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7486 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7487 CPU (h_zbit) = opval;
7488 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7491 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
7492 CPU (h_vbit) = opval;
7493 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7498 CPU (h_xbit) = opval;
7499 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7503 SET_H_INSN_PREFIXED_P (opval);
7504 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7514 CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
7516 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7517 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7518 #define FLD(f) abuf->fields.sfmt_addcdr.f
7519 int UNUSED written = 0;
7520 IADDR UNUSED pc = abuf->addr;
7521 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
7528 tmp_tmpops = FLD (f_indir_pc__dword);
7529 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7530 tmp_carry = CPU (h_cbit);
7531 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7533 SI opval = tmp_newval;
7534 SET_H_GR (FLD (f_operand2), opval);
7535 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7539 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7540 CPU (h_cbit) = opval;
7541 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7544 BI opval = LTSI (tmp_newval, 0);
7545 CPU (h_nbit) = opval;
7546 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7549 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7550 CPU (h_zbit) = opval;
7551 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7554 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7555 CPU (h_vbit) = opval;
7556 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7561 CPU (h_xbit) = opval;
7562 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7566 SET_H_INSN_PREFIXED_P (opval);
7567 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7577 CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
7579 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7580 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7581 #define FLD(f) abuf->fields.sfmt_addc_m.f
7582 int UNUSED written = 0;
7583 IADDR UNUSED pc = abuf->addr;
7584 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7591 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
7592 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7593 tmp_carry = CPU (h_cbit);
7594 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7596 SI opval = tmp_newval;
7597 SET_H_GR (FLD (f_operand2), opval);
7598 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7602 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7603 CPU (h_cbit) = opval;
7604 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7607 BI opval = LTSI (tmp_newval, 0);
7608 CPU (h_nbit) = opval;
7609 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7612 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7613 CPU (h_zbit) = opval;
7614 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7617 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7618 CPU (h_vbit) = opval;
7619 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7624 CPU (h_xbit) = opval;
7625 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7629 SET_H_INSN_PREFIXED_P (opval);
7630 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7640 CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
7642 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7643 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7644 #define FLD(f) abuf->fields.sfmt_addc_m.f
7645 int UNUSED written = 0;
7646 IADDR UNUSED pc = abuf->addr;
7647 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7654 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
7655 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7656 tmp_carry = CPU (h_cbit);
7657 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7659 SI opval = tmp_newval;
7660 SET_H_GR (FLD (f_operand2), opval);
7661 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7665 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7666 CPU (h_cbit) = opval;
7667 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7670 BI opval = LTSI (tmp_newval, 0);
7671 CPU (h_nbit) = opval;
7672 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7675 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7676 CPU (h_zbit) = opval;
7677 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7680 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7681 CPU (h_vbit) = opval;
7682 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7687 CPU (h_xbit) = opval;
7688 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7692 SET_H_INSN_PREFIXED_P (opval);
7693 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7703 CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
7705 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7706 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7707 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7708 int UNUSED written = 0;
7709 IADDR UNUSED pc = abuf->addr;
7710 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7717 tmp_tmpops = EXTQISI (({ SI tmp_addr;
7720 tmp_postinc = FLD (f_memmode);
7721 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7722 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7723 ; if (NEBI (tmp_postinc, 0)) {
7725 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7726 tmp_addr = ADDSI (tmp_addr, 1);
7729 SI opval = tmp_addr;
7730 SET_H_GR (FLD (f_operand1), opval);
7731 written |= (1 << 11);
7732 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7737 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7738 tmp_carry = CPU (h_cbit);
7739 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7741 SI opval = tmp_newval;
7742 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7743 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7747 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7748 CPU (h_cbit) = opval;
7749 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7752 BI opval = LTSI (tmp_newval, 0);
7753 CPU (h_nbit) = opval;
7754 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7757 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7758 CPU (h_zbit) = opval;
7759 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7762 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7763 CPU (h_vbit) = opval;
7764 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7769 CPU (h_xbit) = opval;
7770 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7774 SET_H_INSN_PREFIXED_P (opval);
7775 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7781 abuf->written = written;
7786 CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
7788 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7789 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7790 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7791 int UNUSED written = 0;
7792 IADDR UNUSED pc = abuf->addr;
7793 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7800 tmp_tmpops = EXTHISI (({ SI tmp_addr;
7803 tmp_postinc = FLD (f_memmode);
7804 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7805 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7806 ; if (NEBI (tmp_postinc, 0)) {
7808 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7809 tmp_addr = ADDSI (tmp_addr, 2);
7812 SI opval = tmp_addr;
7813 SET_H_GR (FLD (f_operand1), opval);
7814 written |= (1 << 11);
7815 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7820 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7821 tmp_carry = CPU (h_cbit);
7822 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7824 SI opval = tmp_newval;
7825 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7826 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7830 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7831 CPU (h_cbit) = opval;
7832 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7835 BI opval = LTSI (tmp_newval, 0);
7836 CPU (h_nbit) = opval;
7837 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7840 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7841 CPU (h_zbit) = opval;
7842 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7845 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7846 CPU (h_vbit) = opval;
7847 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7852 CPU (h_xbit) = opval;
7853 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7857 SET_H_INSN_PREFIXED_P (opval);
7858 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7864 abuf->written = written;
7869 CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
7871 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7872 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7873 #define FLD(f) abuf->fields.sfmt_addcbr.f
7874 int UNUSED written = 0;
7875 IADDR UNUSED pc = abuf->addr;
7876 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7883 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
7884 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7885 tmp_carry = CPU (h_cbit);
7886 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7888 SI opval = tmp_newval;
7889 SET_H_GR (FLD (f_operand2), opval);
7890 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7894 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7895 CPU (h_cbit) = opval;
7896 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7899 BI opval = LTSI (tmp_newval, 0);
7900 CPU (h_nbit) = opval;
7901 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7904 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7905 CPU (h_zbit) = opval;
7906 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7909 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7910 CPU (h_vbit) = opval;
7911 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7916 CPU (h_xbit) = opval;
7917 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7921 SET_H_INSN_PREFIXED_P (opval);
7922 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7932 CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
7934 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7935 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7936 #define FLD(f) abuf->fields.sfmt_addcwr.f
7937 int UNUSED written = 0;
7938 IADDR UNUSED pc = abuf->addr;
7939 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7946 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
7947 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7948 tmp_carry = CPU (h_cbit);
7949 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7951 SI opval = tmp_newval;
7952 SET_H_GR (FLD (f_operand2), opval);
7953 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7957 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7958 CPU (h_cbit) = opval;
7959 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7962 BI opval = LTSI (tmp_newval, 0);
7963 CPU (h_nbit) = opval;
7964 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7967 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7968 CPU (h_zbit) = opval;
7969 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7972 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7973 CPU (h_vbit) = opval;
7974 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7979 CPU (h_xbit) = opval;
7980 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7984 SET_H_INSN_PREFIXED_P (opval);
7985 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7995 CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
7997 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7998 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7999 #define FLD(f) abuf->fields.sfmt_addc_m.f
8000 int UNUSED written = 0;
8001 IADDR UNUSED pc = abuf->addr;
8002 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8009 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
8010 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8011 tmp_carry = CPU (h_cbit);
8012 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8014 SI opval = tmp_newval;
8015 SET_H_GR (FLD (f_operand2), opval);
8016 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8020 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8021 CPU (h_cbit) = opval;
8022 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8025 BI opval = LTSI (tmp_newval, 0);
8026 CPU (h_nbit) = opval;
8027 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8030 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8031 CPU (h_zbit) = opval;
8032 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8035 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8036 CPU (h_vbit) = opval;
8037 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8042 CPU (h_xbit) = opval;
8043 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8047 SET_H_INSN_PREFIXED_P (opval);
8048 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8058 CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
8060 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8061 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8062 #define FLD(f) abuf->fields.sfmt_addc_m.f
8063 int UNUSED written = 0;
8064 IADDR UNUSED pc = abuf->addr;
8065 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8072 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
8073 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8074 tmp_carry = CPU (h_cbit);
8075 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8077 SI opval = tmp_newval;
8078 SET_H_GR (FLD (f_operand2), opval);
8079 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8083 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8084 CPU (h_cbit) = opval;
8085 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8088 BI opval = LTSI (tmp_newval, 0);
8089 CPU (h_nbit) = opval;
8090 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8093 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8094 CPU (h_zbit) = opval;
8095 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8098 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8099 CPU (h_vbit) = opval;
8100 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8105 CPU (h_xbit) = opval;
8106 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8110 SET_H_INSN_PREFIXED_P (opval);
8111 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8121 CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
8123 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8124 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8125 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8126 int UNUSED written = 0;
8127 IADDR UNUSED pc = abuf->addr;
8128 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8135 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
8138 tmp_postinc = FLD (f_memmode);
8139 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8140 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8141 ; if (NEBI (tmp_postinc, 0)) {
8143 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8144 tmp_addr = ADDSI (tmp_addr, 1);
8147 SI opval = tmp_addr;
8148 SET_H_GR (FLD (f_operand1), opval);
8149 written |= (1 << 11);
8150 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8155 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8156 tmp_carry = CPU (h_cbit);
8157 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8159 SI opval = tmp_newval;
8160 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8161 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8165 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8166 CPU (h_cbit) = opval;
8167 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8170 BI opval = LTSI (tmp_newval, 0);
8171 CPU (h_nbit) = opval;
8172 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8175 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8176 CPU (h_zbit) = opval;
8177 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8180 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8181 CPU (h_vbit) = opval;
8182 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8187 CPU (h_xbit) = opval;
8188 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8192 SET_H_INSN_PREFIXED_P (opval);
8193 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8199 abuf->written = written;
8204 CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
8206 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8207 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8208 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8209 int UNUSED written = 0;
8210 IADDR UNUSED pc = abuf->addr;
8211 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8218 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
8221 tmp_postinc = FLD (f_memmode);
8222 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8223 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8224 ; if (NEBI (tmp_postinc, 0)) {
8226 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8227 tmp_addr = ADDSI (tmp_addr, 2);
8230 SI opval = tmp_addr;
8231 SET_H_GR (FLD (f_operand1), opval);
8232 written |= (1 << 11);
8233 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8238 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8239 tmp_carry = CPU (h_cbit);
8240 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8242 SI opval = tmp_newval;
8243 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8244 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8248 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8249 CPU (h_cbit) = opval;
8250 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8253 BI opval = LTSI (tmp_newval, 0);
8254 CPU (h_nbit) = opval;
8255 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8258 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8259 CPU (h_zbit) = opval;
8260 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8263 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8264 CPU (h_vbit) = opval;
8265 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8270 CPU (h_xbit) = opval;
8271 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8275 SET_H_INSN_PREFIXED_P (opval);
8276 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8282 abuf->written = written;
8287 CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
8289 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8290 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8291 #define FLD(f) abuf->fields.sfmt_addcbr.f
8292 int UNUSED written = 0;
8293 IADDR UNUSED pc = abuf->addr;
8294 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8301 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
8302 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8303 tmp_carry = CPU (h_cbit);
8304 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8306 SI opval = tmp_newval;
8307 SET_H_GR (FLD (f_operand2), opval);
8308 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8312 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8313 CPU (h_cbit) = opval;
8314 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8317 BI opval = LTSI (tmp_newval, 0);
8318 CPU (h_nbit) = opval;
8319 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8322 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8323 CPU (h_zbit) = opval;
8324 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8327 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8328 CPU (h_vbit) = opval;
8329 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8334 CPU (h_xbit) = opval;
8335 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8339 SET_H_INSN_PREFIXED_P (opval);
8340 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8350 CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
8352 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8353 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8354 #define FLD(f) abuf->fields.sfmt_addcwr.f
8355 int UNUSED written = 0;
8356 IADDR UNUSED pc = abuf->addr;
8357 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8364 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
8365 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8366 tmp_carry = CPU (h_cbit);
8367 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8369 SI opval = tmp_newval;
8370 SET_H_GR (FLD (f_operand2), opval);
8371 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8375 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8376 CPU (h_cbit) = opval;
8377 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8380 BI opval = LTSI (tmp_newval, 0);
8381 CPU (h_nbit) = opval;
8382 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8385 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8386 CPU (h_zbit) = opval;
8387 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8390 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8391 CPU (h_vbit) = opval;
8392 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8397 CPU (h_xbit) = opval;
8398 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8402 SET_H_INSN_PREFIXED_P (opval);
8403 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8413 CASE (sem, INSN_ADDC_R) : /* addc $Rs,$Rd */
8415 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8416 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8417 #define FLD(f) abuf->fields.sfmt_addc_m.f
8418 int UNUSED written = 0;
8419 IADDR UNUSED pc = abuf->addr;
8420 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8429 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8430 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8431 tmp_carry = CPU (h_cbit);
8432 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8434 SI opval = tmp_newval;
8435 SET_H_GR (FLD (f_operand2), opval);
8436 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8440 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
8441 CPU (h_cbit) = opval;
8442 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8445 BI opval = LTSI (tmp_newval, 0);
8446 CPU (h_nbit) = opval;
8447 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8450 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8451 CPU (h_zbit) = opval;
8452 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8455 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8456 CPU (h_vbit) = opval;
8457 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8462 CPU (h_xbit) = opval;
8463 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8467 SET_H_INSN_PREFIXED_P (opval);
8468 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8479 CASE (sem, INSN_ADDC_M) : /* addc [${Rs}${inc}],${Rd} */
8481 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8482 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8483 #define FLD(f) abuf->fields.sfmt_addc_m.f
8484 int UNUSED written = 0;
8485 IADDR UNUSED pc = abuf->addr;
8486 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8495 tmp_tmpops = ({ SI tmp_addr;
8498 tmp_postinc = FLD (f_memmode);
8499 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8500 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
8501 ; if (NEBI (tmp_postinc, 0)) {
8503 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8504 tmp_addr = ADDSI (tmp_addr, 4);
8507 SI opval = tmp_addr;
8508 SET_H_GR (FLD (f_operand1), opval);
8509 written |= (1 << 10);
8510 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8515 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8516 tmp_carry = CPU (h_cbit);
8517 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8519 SI opval = tmp_newval;
8520 SET_H_GR (FLD (f_operand2), opval);
8521 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8525 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
8526 CPU (h_cbit) = opval;
8527 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8530 BI opval = LTSI (tmp_newval, 0);
8531 CPU (h_nbit) = opval;
8532 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8535 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8536 CPU (h_zbit) = opval;
8537 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8540 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8541 CPU (h_vbit) = opval;
8542 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8547 CPU (h_xbit) = opval;
8548 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8552 SET_H_INSN_PREFIXED_P (opval);
8553 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8560 abuf->written = written;
8565 CASE (sem, INSN_ADDC_C) : /* addc ${const32},${Rd} */
8567 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8568 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8569 #define FLD(f) abuf->fields.sfmt_addcdr.f
8570 int UNUSED written = 0;
8571 IADDR UNUSED pc = abuf->addr;
8572 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
8581 tmp_tmpops = FLD (f_indir_pc__dword);
8582 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8583 tmp_carry = CPU (h_cbit);
8584 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8586 SI opval = tmp_newval;
8587 SET_H_GR (FLD (f_operand2), opval);
8588 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8592 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
8593 CPU (h_cbit) = opval;
8594 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8597 BI opval = LTSI (tmp_newval, 0);
8598 CPU (h_nbit) = opval;
8599 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8602 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8603 CPU (h_zbit) = opval;
8604 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8607 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8608 CPU (h_vbit) = opval;
8609 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8614 CPU (h_xbit) = opval;
8615 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8619 SET_H_INSN_PREFIXED_P (opval);
8620 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8631 CASE (sem, INSN_LAPC_D) : /* lapc.d ${const32-pcrel},${Rd} */
8633 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8634 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8635 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8636 int UNUSED written = 0;
8637 IADDR UNUSED pc = abuf->addr;
8638 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
8642 SI opval = FLD (i_const32_pcrel);
8643 SET_H_GR (FLD (f_operand2), opval);
8644 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8649 CPU (h_xbit) = opval;
8650 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8654 SET_H_INSN_PREFIXED_P (opval);
8655 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8664 CASE (sem, INSN_LAPCQ) : /* lapcq ${qo},${Rd} */
8666 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8667 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8668 #define FLD(f) abuf->fields.sfmt_lapcq.f
8669 int UNUSED written = 0;
8670 IADDR UNUSED pc = abuf->addr;
8671 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8675 SI opval = FLD (i_qo);
8676 SET_H_GR (FLD (f_operand2), opval);
8677 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8682 CPU (h_xbit) = opval;
8683 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8687 SET_H_INSN_PREFIXED_P (opval);
8688 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8697 CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8699 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8700 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8701 #define FLD(f) abuf->fields.sfmt_addc_m.f
8702 int UNUSED written = 0;
8703 IADDR UNUSED pc = abuf->addr;
8704 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8708 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
8709 SET_H_GR (FLD (f_operand1), opval);
8710 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8715 CPU (h_xbit) = opval;
8716 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8720 SET_H_INSN_PREFIXED_P (opval);
8721 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8730 CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8732 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8733 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8734 #define FLD(f) abuf->fields.sfmt_addc_m.f
8735 int UNUSED written = 0;
8736 IADDR UNUSED pc = abuf->addr;
8737 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8741 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
8742 SET_H_GR (FLD (f_operand1), opval);
8743 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8748 CPU (h_xbit) = opval;
8749 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8753 SET_H_INSN_PREFIXED_P (opval);
8754 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8763 CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8765 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8766 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8767 #define FLD(f) abuf->fields.sfmt_addc_m.f
8768 int UNUSED written = 0;
8769 IADDR UNUSED pc = abuf->addr;
8770 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8774 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
8775 SET_H_GR (FLD (f_operand1), opval);
8776 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8781 CPU (h_xbit) = opval;
8782 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8786 SET_H_INSN_PREFIXED_P (opval);
8787 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8796 CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
8798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8799 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8800 #define FLD(f) abuf->fields.sfmt_addc_m.f
8801 int UNUSED written = 0;
8802 IADDR UNUSED pc = abuf->addr;
8803 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8810 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8812 tmp_carry = CPU (h_cbit);
8813 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8816 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
8818 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
8819 SET_H_GR (FLD (f_operand2), opval);
8820 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8825 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
8826 CPU (h_cbit) = opval;
8827 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8830 BI opval = LTQI (tmp_newval, 0);
8831 CPU (h_nbit) = opval;
8832 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8835 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8836 CPU (h_zbit) = opval;
8837 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8840 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
8841 CPU (h_vbit) = opval;
8842 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8847 CPU (h_xbit) = opval;
8848 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8852 SET_H_INSN_PREFIXED_P (opval);
8853 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8863 CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
8865 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8866 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8867 #define FLD(f) abuf->fields.sfmt_addc_m.f
8868 int UNUSED written = 0;
8869 IADDR UNUSED pc = abuf->addr;
8870 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8877 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8879 tmp_carry = CPU (h_cbit);
8880 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8883 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
8885 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
8886 SET_H_GR (FLD (f_operand2), opval);
8887 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8892 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
8893 CPU (h_cbit) = opval;
8894 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8897 BI opval = LTHI (tmp_newval, 0);
8898 CPU (h_nbit) = opval;
8899 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8902 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8903 CPU (h_zbit) = opval;
8904 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8907 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
8908 CPU (h_vbit) = opval;
8909 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8914 CPU (h_xbit) = opval;
8915 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8919 SET_H_INSN_PREFIXED_P (opval);
8920 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8930 CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
8932 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8933 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8934 #define FLD(f) abuf->fields.sfmt_addc_m.f
8935 int UNUSED written = 0;
8936 IADDR UNUSED pc = abuf->addr;
8937 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8944 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8946 tmp_carry = CPU (h_cbit);
8947 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8949 SI opval = tmp_newval;
8950 SET_H_GR (FLD (f_operand2), opval);
8951 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8955 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8956 CPU (h_cbit) = opval;
8957 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8960 BI opval = LTSI (tmp_newval, 0);
8961 CPU (h_nbit) = opval;
8962 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8965 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8966 CPU (h_zbit) = opval;
8967 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8970 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8971 CPU (h_vbit) = opval;
8972 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8977 CPU (h_xbit) = opval;
8978 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8982 SET_H_INSN_PREFIXED_P (opval);
8983 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8993 CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
8995 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8996 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8997 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
8998 int UNUSED written = 0;
8999 IADDR UNUSED pc = abuf->addr;
9000 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9004 tmp_tmpd = ({ SI tmp_addr;
9007 tmp_postinc = FLD (f_memmode);
9008 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9009 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
9010 ; if (NEBI (tmp_postinc, 0)) {
9012 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9013 tmp_addr = ADDSI (tmp_addr, 1);
9016 SI opval = tmp_addr;
9017 SET_H_GR (FLD (f_operand1), opval);
9018 written |= (1 << 8);
9019 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9030 tmp_tmpopd = tmp_tmpd;
9031 tmp_carry = CPU (h_cbit);
9032 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9036 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
9037 CPU (h_cbit) = opval;
9038 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9041 BI opval = LTQI (tmp_newval, 0);
9042 CPU (h_nbit) = opval;
9043 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9046 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9047 CPU (h_zbit) = opval;
9048 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9051 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
9052 CPU (h_vbit) = opval;
9053 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9058 CPU (h_xbit) = opval;
9059 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9063 SET_H_INSN_PREFIXED_P (opval);
9064 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9071 abuf->written = written;
9076 CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
9078 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9079 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9080 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9081 int UNUSED written = 0;
9082 IADDR UNUSED pc = abuf->addr;
9083 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9087 tmp_tmpd = ({ SI tmp_addr;
9090 tmp_postinc = FLD (f_memmode);
9091 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9092 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
9093 ; if (NEBI (tmp_postinc, 0)) {
9095 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9096 tmp_addr = ADDSI (tmp_addr, 2);
9099 SI opval = tmp_addr;
9100 SET_H_GR (FLD (f_operand1), opval);
9101 written |= (1 << 8);
9102 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9113 tmp_tmpopd = tmp_tmpd;
9114 tmp_carry = CPU (h_cbit);
9115 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9119 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
9120 CPU (h_cbit) = opval;
9121 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9124 BI opval = LTHI (tmp_newval, 0);
9125 CPU (h_nbit) = opval;
9126 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9129 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9130 CPU (h_zbit) = opval;
9131 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9134 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
9135 CPU (h_vbit) = opval;
9136 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9141 CPU (h_xbit) = opval;
9142 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9146 SET_H_INSN_PREFIXED_P (opval);
9147 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9154 abuf->written = written;
9159 CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
9161 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9162 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9163 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9164 int UNUSED written = 0;
9165 IADDR UNUSED pc = abuf->addr;
9166 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9170 tmp_tmpd = ({ SI tmp_addr;
9173 tmp_postinc = FLD (f_memmode);
9174 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9175 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
9176 ; if (NEBI (tmp_postinc, 0)) {
9178 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9179 tmp_addr = ADDSI (tmp_addr, 4);
9182 SI opval = tmp_addr;
9183 SET_H_GR (FLD (f_operand1), opval);
9184 written |= (1 << 8);
9185 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9196 tmp_tmpopd = tmp_tmpd;
9197 tmp_carry = CPU (h_cbit);
9198 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9202 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
9203 CPU (h_cbit) = opval;
9204 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9207 BI opval = LTSI (tmp_newval, 0);
9208 CPU (h_nbit) = opval;
9209 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9212 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9213 CPU (h_zbit) = opval;
9214 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9217 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
9218 CPU (h_vbit) = opval;
9219 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9224 CPU (h_xbit) = opval;
9225 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9229 SET_H_INSN_PREFIXED_P (opval);
9230 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9237 abuf->written = written;
9242 CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9244 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9245 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9246 #define FLD(f) abuf->fields.sfmt_addc_m.f
9247 int UNUSED written = 0;
9248 IADDR UNUSED pc = abuf->addr;
9249 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9253 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9257 tmp_postinc = FLD (f_memmode);
9258 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9259 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9260 if (EQBI (CPU (h_pbit), 0)) {
9263 QI opval = tmp_tmpd;
9264 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9265 written |= (1 << 10);
9266 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9269 BI opval = CPU (h_pbit);
9270 CPU (h_cbit) = opval;
9271 written |= (1 << 9);
9272 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9278 CPU (h_cbit) = opval;
9279 written |= (1 << 9);
9280 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9285 QI opval = tmp_tmpd;
9286 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9287 written |= (1 << 10);
9288 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9291 if (NEBI (tmp_postinc, 0)) {
9293 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9294 tmp_addr = ADDSI (tmp_addr, 1);
9297 SI opval = tmp_addr;
9298 SET_H_GR (FLD (f_operand1), opval);
9299 written |= (1 << 8);
9300 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9308 CPU (h_xbit) = opval;
9309 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9313 SET_H_INSN_PREFIXED_P (opval);
9314 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9319 abuf->written = written;
9324 CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9326 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9327 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9328 #define FLD(f) abuf->fields.sfmt_addc_m.f
9329 int UNUSED written = 0;
9330 IADDR UNUSED pc = abuf->addr;
9331 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9335 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9339 tmp_postinc = FLD (f_memmode);
9340 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9341 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9342 if (EQBI (CPU (h_pbit), 0)) {
9345 HI opval = tmp_tmpd;
9346 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9347 written |= (1 << 10);
9348 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9351 BI opval = CPU (h_pbit);
9352 CPU (h_cbit) = opval;
9353 written |= (1 << 9);
9354 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9360 CPU (h_cbit) = opval;
9361 written |= (1 << 9);
9362 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9367 HI opval = tmp_tmpd;
9368 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9369 written |= (1 << 10);
9370 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9373 if (NEBI (tmp_postinc, 0)) {
9375 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9376 tmp_addr = ADDSI (tmp_addr, 2);
9379 SI opval = tmp_addr;
9380 SET_H_GR (FLD (f_operand1), opval);
9381 written |= (1 << 8);
9382 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9390 CPU (h_xbit) = opval;
9391 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9395 SET_H_INSN_PREFIXED_P (opval);
9396 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9401 abuf->written = written;
9406 CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9408 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9409 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9410 #define FLD(f) abuf->fields.sfmt_addc_m.f
9411 int UNUSED written = 0;
9412 IADDR UNUSED pc = abuf->addr;
9413 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9417 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9421 tmp_postinc = FLD (f_memmode);
9422 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9423 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9424 if (EQBI (CPU (h_pbit), 0)) {
9427 SI opval = tmp_tmpd;
9428 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9429 written |= (1 << 10);
9430 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9433 BI opval = CPU (h_pbit);
9434 CPU (h_cbit) = opval;
9435 written |= (1 << 9);
9436 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9442 CPU (h_cbit) = opval;
9443 written |= (1 << 9);
9444 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9449 SI opval = tmp_tmpd;
9450 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9451 written |= (1 << 10);
9452 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9455 if (NEBI (tmp_postinc, 0)) {
9457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9458 tmp_addr = ADDSI (tmp_addr, 4);
9461 SI opval = tmp_addr;
9462 SET_H_GR (FLD (f_operand1), opval);
9463 written |= (1 << 8);
9464 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9472 CPU (h_xbit) = opval;
9473 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9477 SET_H_INSN_PREFIXED_P (opval);
9478 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9483 abuf->written = written;
9488 CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
9490 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9491 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9492 #define FLD(f) abuf->fields.sfmt_muls_b.f
9493 int UNUSED written = 0;
9494 IADDR UNUSED pc = abuf->addr;
9495 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9501 tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9502 tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9503 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9505 SI opval = TRUNCDISI (tmp_tmpr);
9506 SET_H_GR (FLD (f_operand2), opval);
9507 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9510 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9511 SET_H_SR (((UINT) 7), opval);
9512 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9516 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9517 CPU (h_cbit) = opval;
9518 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9521 BI opval = LTDI (tmp_tmpr, 0);
9522 CPU (h_nbit) = opval;
9523 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9526 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9527 CPU (h_zbit) = opval;
9528 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9531 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9532 CPU (h_vbit) = opval;
9533 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9538 CPU (h_xbit) = opval;
9539 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9543 SET_H_INSN_PREFIXED_P (opval);
9544 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9554 CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
9556 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9557 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9558 #define FLD(f) abuf->fields.sfmt_muls_b.f
9559 int UNUSED written = 0;
9560 IADDR UNUSED pc = abuf->addr;
9561 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9567 tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9568 tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9569 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9571 SI opval = TRUNCDISI (tmp_tmpr);
9572 SET_H_GR (FLD (f_operand2), opval);
9573 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9576 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9577 SET_H_SR (((UINT) 7), opval);
9578 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9582 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9583 CPU (h_cbit) = opval;
9584 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9587 BI opval = LTDI (tmp_tmpr, 0);
9588 CPU (h_nbit) = opval;
9589 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9592 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9593 CPU (h_zbit) = opval;
9594 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9597 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9598 CPU (h_vbit) = opval;
9599 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9604 CPU (h_xbit) = opval;
9605 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9609 SET_H_INSN_PREFIXED_P (opval);
9610 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9620 CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
9622 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9623 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9624 #define FLD(f) abuf->fields.sfmt_muls_b.f
9625 int UNUSED written = 0;
9626 IADDR UNUSED pc = abuf->addr;
9627 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9633 tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9634 tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9635 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9637 SI opval = TRUNCDISI (tmp_tmpr);
9638 SET_H_GR (FLD (f_operand2), opval);
9639 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9642 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9643 SET_H_SR (((UINT) 7), opval);
9644 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9648 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9649 CPU (h_cbit) = opval;
9650 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9653 BI opval = LTDI (tmp_tmpr, 0);
9654 CPU (h_nbit) = opval;
9655 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9658 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9659 CPU (h_zbit) = opval;
9660 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9663 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9664 CPU (h_vbit) = opval;
9665 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9670 CPU (h_xbit) = opval;
9671 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9675 SET_H_INSN_PREFIXED_P (opval);
9676 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9686 CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
9688 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9689 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9690 #define FLD(f) abuf->fields.sfmt_muls_b.f
9691 int UNUSED written = 0;
9692 IADDR UNUSED pc = abuf->addr;
9693 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9699 tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9700 tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9701 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9703 SI opval = TRUNCDISI (tmp_tmpr);
9704 SET_H_GR (FLD (f_operand2), opval);
9705 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9708 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9709 SET_H_SR (((UINT) 7), opval);
9710 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9714 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9715 CPU (h_cbit) = opval;
9716 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9719 BI opval = LTDI (tmp_tmpr, 0);
9720 CPU (h_nbit) = opval;
9721 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9724 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9725 CPU (h_zbit) = opval;
9726 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9729 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9730 CPU (h_vbit) = opval;
9731 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9736 CPU (h_xbit) = opval;
9737 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9741 SET_H_INSN_PREFIXED_P (opval);
9742 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9752 CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
9754 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9755 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9756 #define FLD(f) abuf->fields.sfmt_muls_b.f
9757 int UNUSED written = 0;
9758 IADDR UNUSED pc = abuf->addr;
9759 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9765 tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9766 tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9767 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9769 SI opval = TRUNCDISI (tmp_tmpr);
9770 SET_H_GR (FLD (f_operand2), opval);
9771 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9774 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9775 SET_H_SR (((UINT) 7), opval);
9776 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9780 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9781 CPU (h_cbit) = opval;
9782 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9785 BI opval = LTDI (tmp_tmpr, 0);
9786 CPU (h_nbit) = opval;
9787 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9790 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9791 CPU (h_zbit) = opval;
9792 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9795 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9796 CPU (h_vbit) = opval;
9797 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9802 CPU (h_xbit) = opval;
9803 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9807 SET_H_INSN_PREFIXED_P (opval);
9808 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9818 CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
9820 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9821 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9822 #define FLD(f) abuf->fields.sfmt_muls_b.f
9823 int UNUSED written = 0;
9824 IADDR UNUSED pc = abuf->addr;
9825 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9831 tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9832 tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9833 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9835 SI opval = TRUNCDISI (tmp_tmpr);
9836 SET_H_GR (FLD (f_operand2), opval);
9837 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9840 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9841 SET_H_SR (((UINT) 7), opval);
9842 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9846 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9847 CPU (h_cbit) = opval;
9848 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9851 BI opval = LTDI (tmp_tmpr, 0);
9852 CPU (h_nbit) = opval;
9853 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9856 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9857 CPU (h_zbit) = opval;
9858 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9861 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9862 CPU (h_vbit) = opval;
9863 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9868 CPU (h_xbit) = opval;
9869 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9873 SET_H_INSN_PREFIXED_P (opval);
9874 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9884 CASE (sem, INSN_MCP) : /* mcp $Ps,$Rd */
9886 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9887 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9888 #define FLD(f) abuf->fields.sfmt_mcp.f
9889 int UNUSED written = 0;
9890 IADDR UNUSED pc = abuf->addr;
9891 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9901 tmp_tmpops = GET_H_SR (FLD (f_operand2));
9902 tmp_tmpopd = GET_H_GR (FLD (f_operand1));
9903 tmp_carry = CPU (h_rbit);
9904 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9906 SI opval = tmp_newval;
9907 SET_H_GR (FLD (f_operand1), opval);
9908 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9912 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
9913 CPU (h_rbit) = opval;
9914 TRACE_RESULT (current_cpu, abuf, "rbit", 'x', opval);
9917 BI opval = LTSI (tmp_newval, 0);
9918 CPU (h_nbit) = opval;
9919 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9922 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9923 CPU (h_zbit) = opval;
9924 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9927 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
9928 CPU (h_vbit) = opval;
9929 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9934 CPU (h_xbit) = opval;
9935 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9939 SET_H_INSN_PREFIXED_P (opval);
9940 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9951 CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
9953 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9954 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9955 #define FLD(f) abuf->fields.sfmt_muls_b.f
9956 int UNUSED written = 0;
9957 IADDR UNUSED pc = abuf->addr;
9958 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9964 tmp_tmps = GET_H_GR (FLD (f_operand1));
9965 tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
9966 tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
9968 SI opval = tmp_tmpd;
9969 SET_H_GR (FLD (f_operand2), opval);
9970 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9974 BI opval = LTSI (tmp_tmpd, 0);
9975 CPU (h_nbit) = opval;
9976 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9979 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9980 CPU (h_zbit) = opval;
9981 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9983 SET_H_CBIT_MOVE (0);
9984 SET_H_VBIT_MOVE (0);
9988 CPU (h_xbit) = opval;
9989 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9993 SET_H_INSN_PREFIXED_P (opval);
9994 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10004 CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
10006 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10007 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10008 #define FLD(f) abuf->fields.sfmt_muls_b.f
10009 int UNUSED written = 0;
10010 IADDR UNUSED pc = abuf->addr;
10011 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10015 tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
10017 SI opval = tmp_tmpd;
10018 SET_H_GR (FLD (f_operand2), opval);
10019 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10023 BI opval = LTSI (tmp_tmpd, 0);
10024 CPU (h_nbit) = opval;
10025 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10028 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10029 CPU (h_zbit) = opval;
10030 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10032 SET_H_CBIT_MOVE (0);
10033 SET_H_VBIT_MOVE (0);
10037 CPU (h_xbit) = opval;
10038 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10042 SET_H_INSN_PREFIXED_P (opval);
10043 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10053 CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
10055 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10056 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10057 #define FLD(f) abuf->fields.sfmt_addc_m.f
10058 int UNUSED written = 0;
10059 IADDR UNUSED pc = abuf->addr;
10060 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10064 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10067 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10069 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10070 SET_H_GR (FLD (f_operand2), opval);
10071 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10076 BI opval = LTQI (tmp_tmpd, 0);
10077 CPU (h_nbit) = opval;
10078 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10081 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10082 CPU (h_zbit) = opval;
10083 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10085 SET_H_CBIT_MOVE (0);
10086 SET_H_VBIT_MOVE (0);
10090 CPU (h_xbit) = opval;
10091 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10095 SET_H_INSN_PREFIXED_P (opval);
10096 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10106 CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
10108 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10109 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10110 #define FLD(f) abuf->fields.sfmt_addc_m.f
10111 int UNUSED written = 0;
10112 IADDR UNUSED pc = abuf->addr;
10113 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10117 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10120 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10122 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10123 SET_H_GR (FLD (f_operand2), opval);
10124 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10129 BI opval = LTHI (tmp_tmpd, 0);
10130 CPU (h_nbit) = opval;
10131 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10134 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10135 CPU (h_zbit) = opval;
10136 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10138 SET_H_CBIT_MOVE (0);
10139 SET_H_VBIT_MOVE (0);
10143 CPU (h_xbit) = opval;
10144 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10148 SET_H_INSN_PREFIXED_P (opval);
10149 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10159 CASE (sem, INSN_AND_D_R) : /* and.d $Rs,$Rd */
10161 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10162 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10163 #define FLD(f) abuf->fields.sfmt_addc_m.f
10164 int UNUSED written = 0;
10165 IADDR UNUSED pc = abuf->addr;
10166 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10170 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10172 SI opval = tmp_tmpd;
10173 SET_H_GR (FLD (f_operand2), opval);
10174 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10178 BI opval = LTSI (tmp_tmpd, 0);
10179 CPU (h_nbit) = opval;
10180 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10183 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10184 CPU (h_zbit) = opval;
10185 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10187 SET_H_CBIT_MOVE (0);
10188 SET_H_VBIT_MOVE (0);
10192 CPU (h_xbit) = opval;
10193 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10197 SET_H_INSN_PREFIXED_P (opval);
10198 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10208 CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
10210 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10211 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10212 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10213 int UNUSED written = 0;
10214 IADDR UNUSED pc = abuf->addr;
10215 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10219 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10222 tmp_postinc = FLD (f_memmode);
10223 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10224 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10225 ; if (NEBI (tmp_postinc, 0)) {
10227 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10228 tmp_addr = ADDSI (tmp_addr, 1);
10231 SI opval = tmp_addr;
10232 SET_H_GR (FLD (f_operand1), opval);
10233 written |= (1 << 11);
10234 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10238 ; tmp_tmp_mem; }));
10241 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10243 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10244 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10245 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10250 BI opval = LTQI (tmp_tmpd, 0);
10251 CPU (h_nbit) = opval;
10252 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10255 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10256 CPU (h_zbit) = opval;
10257 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10259 SET_H_CBIT_MOVE (0);
10260 SET_H_VBIT_MOVE (0);
10264 CPU (h_xbit) = opval;
10265 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10269 SET_H_INSN_PREFIXED_P (opval);
10270 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10276 abuf->written = written;
10281 CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
10283 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10284 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10285 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10286 int UNUSED written = 0;
10287 IADDR UNUSED pc = abuf->addr;
10288 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10292 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10295 tmp_postinc = FLD (f_memmode);
10296 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10297 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10298 ; if (NEBI (tmp_postinc, 0)) {
10300 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10301 tmp_addr = ADDSI (tmp_addr, 2);
10304 SI opval = tmp_addr;
10305 SET_H_GR (FLD (f_operand1), opval);
10306 written |= (1 << 11);
10307 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10311 ; tmp_tmp_mem; }));
10314 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10316 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10317 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10318 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10323 BI opval = LTHI (tmp_tmpd, 0);
10324 CPU (h_nbit) = opval;
10325 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10328 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10329 CPU (h_zbit) = opval;
10330 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10332 SET_H_CBIT_MOVE (0);
10333 SET_H_VBIT_MOVE (0);
10337 CPU (h_xbit) = opval;
10338 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10342 SET_H_INSN_PREFIXED_P (opval);
10343 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10349 abuf->written = written;
10354 CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
10356 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10357 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10358 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10359 int UNUSED written = 0;
10360 IADDR UNUSED pc = abuf->addr;
10361 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10365 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10368 tmp_postinc = FLD (f_memmode);
10369 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10370 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10371 ; if (NEBI (tmp_postinc, 0)) {
10373 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10374 tmp_addr = ADDSI (tmp_addr, 4);
10377 SI opval = tmp_addr;
10378 SET_H_GR (FLD (f_operand1), opval);
10379 written |= (1 << 10);
10380 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10384 ; tmp_tmp_mem; }));
10386 SI opval = tmp_tmpd;
10387 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10388 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10392 BI opval = LTSI (tmp_tmpd, 0);
10393 CPU (h_nbit) = opval;
10394 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10397 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10398 CPU (h_zbit) = opval;
10399 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10401 SET_H_CBIT_MOVE (0);
10402 SET_H_VBIT_MOVE (0);
10406 CPU (h_xbit) = opval;
10407 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10411 SET_H_INSN_PREFIXED_P (opval);
10412 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10418 abuf->written = written;
10423 CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
10425 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10426 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10427 #define FLD(f) abuf->fields.sfmt_addcbr.f
10428 int UNUSED written = 0;
10429 IADDR UNUSED pc = abuf->addr;
10430 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10434 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10437 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10439 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10440 SET_H_GR (FLD (f_operand2), opval);
10441 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10446 BI opval = LTQI (tmp_tmpd, 0);
10447 CPU (h_nbit) = opval;
10448 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10451 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10452 CPU (h_zbit) = opval;
10453 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10455 SET_H_CBIT_MOVE (0);
10456 SET_H_VBIT_MOVE (0);
10460 CPU (h_xbit) = opval;
10461 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10465 SET_H_INSN_PREFIXED_P (opval);
10466 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10476 CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
10478 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10479 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10480 #define FLD(f) abuf->fields.sfmt_addcwr.f
10481 int UNUSED written = 0;
10482 IADDR UNUSED pc = abuf->addr;
10483 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10487 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10490 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10492 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10493 SET_H_GR (FLD (f_operand2), opval);
10494 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10499 BI opval = LTHI (tmp_tmpd, 0);
10500 CPU (h_nbit) = opval;
10501 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10504 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10505 CPU (h_zbit) = opval;
10506 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10508 SET_H_CBIT_MOVE (0);
10509 SET_H_VBIT_MOVE (0);
10513 CPU (h_xbit) = opval;
10514 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10518 SET_H_INSN_PREFIXED_P (opval);
10519 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10529 CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
10531 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10532 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10533 #define FLD(f) abuf->fields.sfmt_addcdr.f
10534 int UNUSED written = 0;
10535 IADDR UNUSED pc = abuf->addr;
10536 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10540 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10542 SI opval = tmp_tmpd;
10543 SET_H_GR (FLD (f_operand2), opval);
10544 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10548 BI opval = LTSI (tmp_tmpd, 0);
10549 CPU (h_nbit) = opval;
10550 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10553 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10554 CPU (h_zbit) = opval;
10555 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10557 SET_H_CBIT_MOVE (0);
10558 SET_H_VBIT_MOVE (0);
10562 CPU (h_xbit) = opval;
10563 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10567 SET_H_INSN_PREFIXED_P (opval);
10568 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10578 CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
10580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10581 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10582 #define FLD(f) abuf->fields.sfmt_andq.f
10583 int UNUSED written = 0;
10584 IADDR UNUSED pc = abuf->addr;
10585 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10589 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10591 SI opval = tmp_tmpd;
10592 SET_H_GR (FLD (f_operand2), opval);
10593 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10597 BI opval = LTSI (tmp_tmpd, 0);
10598 CPU (h_nbit) = opval;
10599 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10602 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10603 CPU (h_zbit) = opval;
10604 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10606 SET_H_CBIT_MOVE (0);
10607 SET_H_VBIT_MOVE (0);
10611 CPU (h_xbit) = opval;
10612 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10616 SET_H_INSN_PREFIXED_P (opval);
10617 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10627 CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
10629 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10630 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10631 #define FLD(f) abuf->fields.sfmt_addc_m.f
10632 int UNUSED written = 0;
10633 IADDR UNUSED pc = abuf->addr;
10634 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10638 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10641 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10643 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10644 SET_H_GR (FLD (f_operand2), opval);
10645 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10650 BI opval = LTQI (tmp_tmpd, 0);
10651 CPU (h_nbit) = opval;
10652 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10655 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10656 CPU (h_zbit) = opval;
10657 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10659 SET_H_CBIT_MOVE (0);
10660 SET_H_VBIT_MOVE (0);
10664 CPU (h_xbit) = opval;
10665 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10669 SET_H_INSN_PREFIXED_P (opval);
10670 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10680 CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
10682 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10683 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10684 #define FLD(f) abuf->fields.sfmt_addc_m.f
10685 int UNUSED written = 0;
10686 IADDR UNUSED pc = abuf->addr;
10687 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10691 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10694 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10696 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10697 SET_H_GR (FLD (f_operand2), opval);
10698 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10703 BI opval = LTHI (tmp_tmpd, 0);
10704 CPU (h_nbit) = opval;
10705 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10708 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10709 CPU (h_zbit) = opval;
10710 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10712 SET_H_CBIT_MOVE (0);
10713 SET_H_VBIT_MOVE (0);
10717 CPU (h_xbit) = opval;
10718 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10722 SET_H_INSN_PREFIXED_P (opval);
10723 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10733 CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
10735 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10736 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10737 #define FLD(f) abuf->fields.sfmt_addc_m.f
10738 int UNUSED written = 0;
10739 IADDR UNUSED pc = abuf->addr;
10740 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10744 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10746 SI opval = tmp_tmpd;
10747 SET_H_GR (FLD (f_operand2), opval);
10748 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10752 BI opval = LTSI (tmp_tmpd, 0);
10753 CPU (h_nbit) = opval;
10754 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10757 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10758 CPU (h_zbit) = opval;
10759 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10761 SET_H_CBIT_MOVE (0);
10762 SET_H_VBIT_MOVE (0);
10766 CPU (h_xbit) = opval;
10767 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10771 SET_H_INSN_PREFIXED_P (opval);
10772 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10782 CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
10784 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10785 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10786 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10787 int UNUSED written = 0;
10788 IADDR UNUSED pc = abuf->addr;
10789 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10793 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10796 tmp_postinc = FLD (f_memmode);
10797 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10798 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10799 ; if (NEBI (tmp_postinc, 0)) {
10801 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10802 tmp_addr = ADDSI (tmp_addr, 1);
10805 SI opval = tmp_addr;
10806 SET_H_GR (FLD (f_operand1), opval);
10807 written |= (1 << 11);
10808 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10812 ; tmp_tmp_mem; }));
10815 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10817 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10818 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10819 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10824 BI opval = LTQI (tmp_tmpd, 0);
10825 CPU (h_nbit) = opval;
10826 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10829 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10830 CPU (h_zbit) = opval;
10831 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10833 SET_H_CBIT_MOVE (0);
10834 SET_H_VBIT_MOVE (0);
10838 CPU (h_xbit) = opval;
10839 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10843 SET_H_INSN_PREFIXED_P (opval);
10844 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10850 abuf->written = written;
10855 CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
10857 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10858 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10859 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10860 int UNUSED written = 0;
10861 IADDR UNUSED pc = abuf->addr;
10862 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10866 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10869 tmp_postinc = FLD (f_memmode);
10870 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10871 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10872 ; if (NEBI (tmp_postinc, 0)) {
10874 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10875 tmp_addr = ADDSI (tmp_addr, 2);
10878 SI opval = tmp_addr;
10879 SET_H_GR (FLD (f_operand1), opval);
10880 written |= (1 << 11);
10881 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10885 ; tmp_tmp_mem; }));
10888 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10890 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10891 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10892 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10897 BI opval = LTHI (tmp_tmpd, 0);
10898 CPU (h_nbit) = opval;
10899 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10902 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10903 CPU (h_zbit) = opval;
10904 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10906 SET_H_CBIT_MOVE (0);
10907 SET_H_VBIT_MOVE (0);
10911 CPU (h_xbit) = opval;
10912 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10916 SET_H_INSN_PREFIXED_P (opval);
10917 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10923 abuf->written = written;
10928 CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
10930 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10931 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10932 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10933 int UNUSED written = 0;
10934 IADDR UNUSED pc = abuf->addr;
10935 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10939 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10942 tmp_postinc = FLD (f_memmode);
10943 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10944 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10945 ; if (NEBI (tmp_postinc, 0)) {
10947 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10948 tmp_addr = ADDSI (tmp_addr, 4);
10951 SI opval = tmp_addr;
10952 SET_H_GR (FLD (f_operand1), opval);
10953 written |= (1 << 10);
10954 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10958 ; tmp_tmp_mem; }));
10960 SI opval = tmp_tmpd;
10961 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10962 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10966 BI opval = LTSI (tmp_tmpd, 0);
10967 CPU (h_nbit) = opval;
10968 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10971 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10972 CPU (h_zbit) = opval;
10973 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10975 SET_H_CBIT_MOVE (0);
10976 SET_H_VBIT_MOVE (0);
10980 CPU (h_xbit) = opval;
10981 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10985 SET_H_INSN_PREFIXED_P (opval);
10986 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10992 abuf->written = written;
10997 CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
10999 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11000 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11001 #define FLD(f) abuf->fields.sfmt_addcbr.f
11002 int UNUSED written = 0;
11003 IADDR UNUSED pc = abuf->addr;
11004 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11008 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
11011 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11013 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11014 SET_H_GR (FLD (f_operand2), opval);
11015 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11020 BI opval = LTQI (tmp_tmpd, 0);
11021 CPU (h_nbit) = opval;
11022 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11025 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11026 CPU (h_zbit) = opval;
11027 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11029 SET_H_CBIT_MOVE (0);
11030 SET_H_VBIT_MOVE (0);
11034 CPU (h_xbit) = opval;
11035 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11039 SET_H_INSN_PREFIXED_P (opval);
11040 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11050 CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
11052 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11053 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11054 #define FLD(f) abuf->fields.sfmt_addcwr.f
11055 int UNUSED written = 0;
11056 IADDR UNUSED pc = abuf->addr;
11057 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11061 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
11064 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11066 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11067 SET_H_GR (FLD (f_operand2), opval);
11068 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11073 BI opval = LTHI (tmp_tmpd, 0);
11074 CPU (h_nbit) = opval;
11075 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11078 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11079 CPU (h_zbit) = opval;
11080 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11082 SET_H_CBIT_MOVE (0);
11083 SET_H_VBIT_MOVE (0);
11087 CPU (h_xbit) = opval;
11088 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11092 SET_H_INSN_PREFIXED_P (opval);
11093 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11103 CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
11105 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11106 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11107 #define FLD(f) abuf->fields.sfmt_addcdr.f
11108 int UNUSED written = 0;
11109 IADDR UNUSED pc = abuf->addr;
11110 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
11114 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
11116 SI opval = tmp_tmpd;
11117 SET_H_GR (FLD (f_operand2), opval);
11118 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11122 BI opval = LTSI (tmp_tmpd, 0);
11123 CPU (h_nbit) = opval;
11124 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11127 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11128 CPU (h_zbit) = opval;
11129 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11131 SET_H_CBIT_MOVE (0);
11132 SET_H_VBIT_MOVE (0);
11136 CPU (h_xbit) = opval;
11137 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11141 SET_H_INSN_PREFIXED_P (opval);
11142 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11152 CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
11154 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11155 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11156 #define FLD(f) abuf->fields.sfmt_andq.f
11157 int UNUSED written = 0;
11158 IADDR UNUSED pc = abuf->addr;
11159 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11163 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
11165 SI opval = tmp_tmpd;
11166 SET_H_GR (FLD (f_operand2), opval);
11167 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11171 BI opval = LTSI (tmp_tmpd, 0);
11172 CPU (h_nbit) = opval;
11173 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11176 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11177 CPU (h_zbit) = opval;
11178 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11180 SET_H_CBIT_MOVE (0);
11181 SET_H_VBIT_MOVE (0);
11185 CPU (h_xbit) = opval;
11186 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11190 SET_H_INSN_PREFIXED_P (opval);
11191 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11201 CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
11203 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11204 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11205 #define FLD(f) abuf->fields.sfmt_muls_b.f
11206 int UNUSED written = 0;
11207 IADDR UNUSED pc = abuf->addr;
11208 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11212 tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
11214 SI opval = tmp_tmpd;
11215 SET_H_GR (FLD (f_operand2), opval);
11216 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11220 BI opval = LTSI (tmp_tmpd, 0);
11221 CPU (h_nbit) = opval;
11222 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11225 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11226 CPU (h_zbit) = opval;
11227 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11229 SET_H_CBIT_MOVE (0);
11230 SET_H_VBIT_MOVE (0);
11234 CPU (h_xbit) = opval;
11235 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11239 SET_H_INSN_PREFIXED_P (opval);
11240 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11250 CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
11252 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11253 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11254 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11255 int UNUSED written = 0;
11256 IADDR UNUSED pc = abuf->addr;
11257 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11262 tmp_tmps = GET_H_GR (FLD (f_operand1));
11263 tmp_tmpd = ({ SI tmp_tmpcode;
11266 tmp_tmpcode = FLD (f_operand2);
11267 ; tmp_tmpval = tmp_tmps;
11268 ; if (EQSI (tmp_tmpcode, 0)) {
11269 tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
11271 else if (EQSI (tmp_tmpcode, 1)) {
11272 tmp_tmpres = ({ SI tmp_tmpr;
11273 tmp_tmpr = tmp_tmpval;
11274 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11276 else if (EQSI (tmp_tmpcode, 2)) {
11277 tmp_tmpres = ({ SI tmp_tmpb;
11278 tmp_tmpb = tmp_tmpval;
11279 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11281 else if (EQSI (tmp_tmpcode, 3)) {
11282 tmp_tmpres = ({ SI tmp_tmpr;
11283 tmp_tmpr = ({ SI tmp_tmpb;
11284 tmp_tmpb = tmp_tmpval;
11285 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11286 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11288 else if (EQSI (tmp_tmpcode, 4)) {
11289 tmp_tmpres = ({ SI tmp_tmpb;
11290 tmp_tmpb = tmp_tmpval;
11291 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11293 else if (EQSI (tmp_tmpcode, 5)) {
11294 tmp_tmpres = ({ SI tmp_tmpr;
11295 tmp_tmpr = ({ SI tmp_tmpb;
11296 tmp_tmpb = tmp_tmpval;
11297 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11298 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11300 else if (EQSI (tmp_tmpcode, 6)) {
11301 tmp_tmpres = ({ SI tmp_tmpb;
11302 tmp_tmpb = ({ SI tmp_tmpb;
11303 tmp_tmpb = tmp_tmpval;
11304 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11305 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11307 else if (EQSI (tmp_tmpcode, 7)) {
11308 tmp_tmpres = ({ SI tmp_tmpr;
11309 tmp_tmpr = ({ SI tmp_tmpb;
11310 tmp_tmpb = ({ SI tmp_tmpb;
11311 tmp_tmpb = tmp_tmpval;
11312 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11313 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11314 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11316 else if (EQSI (tmp_tmpcode, 8)) {
11317 tmp_tmpres = INVSI (tmp_tmpval);
11319 else if (EQSI (tmp_tmpcode, 9)) {
11320 tmp_tmpres = ({ SI tmp_tmpr;
11321 tmp_tmpr = INVSI (tmp_tmpval);
11322 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11324 else if (EQSI (tmp_tmpcode, 10)) {
11325 tmp_tmpres = ({ SI tmp_tmpb;
11326 tmp_tmpb = INVSI (tmp_tmpval);
11327 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11329 else if (EQSI (tmp_tmpcode, 11)) {
11330 tmp_tmpres = ({ SI tmp_tmpr;
11331 tmp_tmpr = ({ SI tmp_tmpb;
11332 tmp_tmpb = INVSI (tmp_tmpval);
11333 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11334 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11336 else if (EQSI (tmp_tmpcode, 12)) {
11337 tmp_tmpres = ({ SI tmp_tmpb;
11338 tmp_tmpb = INVSI (tmp_tmpval);
11339 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11341 else if (EQSI (tmp_tmpcode, 13)) {
11342 tmp_tmpres = ({ SI tmp_tmpr;
11343 tmp_tmpr = ({ SI tmp_tmpb;
11344 tmp_tmpb = INVSI (tmp_tmpval);
11345 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11346 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11348 else if (EQSI (tmp_tmpcode, 14)) {
11349 tmp_tmpres = ({ SI tmp_tmpb;
11350 tmp_tmpb = ({ SI tmp_tmpb;
11351 tmp_tmpb = INVSI (tmp_tmpval);
11352 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11353 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11355 else if (EQSI (tmp_tmpcode, 15)) {
11356 tmp_tmpres = ({ SI tmp_tmpr;
11357 tmp_tmpr = ({ SI tmp_tmpb;
11358 tmp_tmpb = ({ SI tmp_tmpb;
11359 tmp_tmpb = INVSI (tmp_tmpval);
11360 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11361 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11362 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11366 SI opval = tmp_tmpd;
11367 SET_H_GR (FLD (f_operand1), opval);
11368 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11372 BI opval = LTSI (tmp_tmpd, 0);
11373 CPU (h_nbit) = opval;
11374 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11377 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11378 CPU (h_zbit) = opval;
11379 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11381 SET_H_CBIT_MOVE (0);
11382 SET_H_VBIT_MOVE (0);
11386 CPU (h_xbit) = opval;
11387 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11391 SET_H_INSN_PREFIXED_P (opval);
11392 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11402 CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
11404 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11405 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11406 #define FLD(f) abuf->fields.sfmt_addc_m.f
11407 int UNUSED written = 0;
11408 IADDR UNUSED pc = abuf->addr;
11409 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11415 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11416 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11417 tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11420 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11422 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11423 SET_H_GR (FLD (f_operand2), opval);
11424 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11429 BI opval = LTQI (tmp_tmpd, 0);
11430 CPU (h_nbit) = opval;
11431 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11434 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11435 CPU (h_zbit) = opval;
11436 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11438 SET_H_CBIT_MOVE (0);
11439 SET_H_VBIT_MOVE (0);
11443 CPU (h_xbit) = opval;
11444 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11448 SET_H_INSN_PREFIXED_P (opval);
11449 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11459 CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
11461 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11462 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11463 #define FLD(f) abuf->fields.sfmt_addc_m.f
11464 int UNUSED written = 0;
11465 IADDR UNUSED pc = abuf->addr;
11466 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11472 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11473 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11474 tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11477 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11479 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11480 SET_H_GR (FLD (f_operand2), opval);
11481 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11486 BI opval = LTHI (tmp_tmpd, 0);
11487 CPU (h_nbit) = opval;
11488 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11491 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11492 CPU (h_zbit) = opval;
11493 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11495 SET_H_CBIT_MOVE (0);
11496 SET_H_VBIT_MOVE (0);
11500 CPU (h_xbit) = opval;
11501 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11505 SET_H_INSN_PREFIXED_P (opval);
11506 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11516 CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
11518 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11519 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11520 #define FLD(f) abuf->fields.sfmt_addc_m.f
11521 int UNUSED written = 0;
11522 IADDR UNUSED pc = abuf->addr;
11523 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11529 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11530 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11531 tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11533 SI opval = tmp_tmpd;
11534 SET_H_GR (FLD (f_operand2), opval);
11535 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11539 BI opval = LTSI (tmp_tmpd, 0);
11540 CPU (h_nbit) = opval;
11541 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11544 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11545 CPU (h_zbit) = opval;
11546 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11548 SET_H_CBIT_MOVE (0);
11549 SET_H_VBIT_MOVE (0);
11553 CPU (h_xbit) = opval;
11554 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11558 SET_H_INSN_PREFIXED_P (opval);
11559 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11569 CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
11571 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11572 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11573 #define FLD(f) abuf->fields.sfmt_asrq.f
11574 int UNUSED written = 0;
11575 IADDR UNUSED pc = abuf->addr;
11576 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11580 tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11582 SI opval = tmp_tmpd;
11583 SET_H_GR (FLD (f_operand2), opval);
11584 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11588 BI opval = LTSI (tmp_tmpd, 0);
11589 CPU (h_nbit) = opval;
11590 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11593 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11594 CPU (h_zbit) = opval;
11595 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11597 SET_H_CBIT_MOVE (0);
11598 SET_H_VBIT_MOVE (0);
11602 CPU (h_xbit) = opval;
11603 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11607 SET_H_INSN_PREFIXED_P (opval);
11608 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11618 CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
11620 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11621 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11622 #define FLD(f) abuf->fields.sfmt_addc_m.f
11623 int UNUSED written = 0;
11624 IADDR UNUSED pc = abuf->addr;
11625 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11630 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11631 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11634 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11636 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11637 SET_H_GR (FLD (f_operand2), opval);
11638 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11643 BI opval = LTQI (tmp_tmpd, 0);
11644 CPU (h_nbit) = opval;
11645 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11648 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11649 CPU (h_zbit) = opval;
11650 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11652 SET_H_CBIT_MOVE (0);
11653 SET_H_VBIT_MOVE (0);
11657 CPU (h_xbit) = opval;
11658 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11662 SET_H_INSN_PREFIXED_P (opval);
11663 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11673 CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $Rs,$Rd */
11675 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11676 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11677 #define FLD(f) abuf->fields.sfmt_addc_m.f
11678 int UNUSED written = 0;
11679 IADDR UNUSED pc = abuf->addr;
11680 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11685 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11686 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11689 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11691 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11692 SET_H_GR (FLD (f_operand2), opval);
11693 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11698 BI opval = LTHI (tmp_tmpd, 0);
11699 CPU (h_nbit) = opval;
11700 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11703 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11704 CPU (h_zbit) = opval;
11705 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11707 SET_H_CBIT_MOVE (0);
11708 SET_H_VBIT_MOVE (0);
11712 CPU (h_xbit) = opval;
11713 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11717 SET_H_INSN_PREFIXED_P (opval);
11718 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11728 CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
11730 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11731 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11732 #define FLD(f) abuf->fields.sfmt_addc_m.f
11733 int UNUSED written = 0;
11734 IADDR UNUSED pc = abuf->addr;
11735 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11740 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11741 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11743 SI opval = tmp_tmpd;
11744 SET_H_GR (FLD (f_operand2), opval);
11745 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11749 BI opval = LTSI (tmp_tmpd, 0);
11750 CPU (h_nbit) = opval;
11751 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11754 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11755 CPU (h_zbit) = opval;
11756 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11758 SET_H_CBIT_MOVE (0);
11759 SET_H_VBIT_MOVE (0);
11763 CPU (h_xbit) = opval;
11764 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11768 SET_H_INSN_PREFIXED_P (opval);
11769 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11779 CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
11781 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11782 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11783 #define FLD(f) abuf->fields.sfmt_asrq.f
11784 int UNUSED written = 0;
11785 IADDR UNUSED pc = abuf->addr;
11786 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11790 tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11792 SI opval = tmp_tmpd;
11793 SET_H_GR (FLD (f_operand2), opval);
11794 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11798 BI opval = LTSI (tmp_tmpd, 0);
11799 CPU (h_nbit) = opval;
11800 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11803 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11804 CPU (h_zbit) = opval;
11805 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11807 SET_H_CBIT_MOVE (0);
11808 SET_H_VBIT_MOVE (0);
11812 CPU (h_xbit) = opval;
11813 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11817 SET_H_INSN_PREFIXED_P (opval);
11818 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11828 CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
11830 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11831 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11832 #define FLD(f) abuf->fields.sfmt_addc_m.f
11833 int UNUSED written = 0;
11834 IADDR UNUSED pc = abuf->addr;
11835 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11840 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11841 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11844 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11846 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11847 SET_H_GR (FLD (f_operand2), opval);
11848 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11853 BI opval = LTQI (tmp_tmpd, 0);
11854 CPU (h_nbit) = opval;
11855 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11858 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11859 CPU (h_zbit) = opval;
11860 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11862 SET_H_CBIT_MOVE (0);
11863 SET_H_VBIT_MOVE (0);
11867 CPU (h_xbit) = opval;
11868 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11872 SET_H_INSN_PREFIXED_P (opval);
11873 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11883 CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
11885 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11886 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11887 #define FLD(f) abuf->fields.sfmt_addc_m.f
11888 int UNUSED written = 0;
11889 IADDR UNUSED pc = abuf->addr;
11890 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11895 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11896 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11899 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11901 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11902 SET_H_GR (FLD (f_operand2), opval);
11903 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11908 BI opval = LTHI (tmp_tmpd, 0);
11909 CPU (h_nbit) = opval;
11910 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11913 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11914 CPU (h_zbit) = opval;
11915 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11917 SET_H_CBIT_MOVE (0);
11918 SET_H_VBIT_MOVE (0);
11922 CPU (h_xbit) = opval;
11923 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11927 SET_H_INSN_PREFIXED_P (opval);
11928 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11938 CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
11940 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11941 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11942 #define FLD(f) abuf->fields.sfmt_addc_m.f
11943 int UNUSED written = 0;
11944 IADDR UNUSED pc = abuf->addr;
11945 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11950 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11951 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11953 SI opval = tmp_tmpd;
11954 SET_H_GR (FLD (f_operand2), opval);
11955 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11959 BI opval = LTSI (tmp_tmpd, 0);
11960 CPU (h_nbit) = opval;
11961 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11964 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11965 CPU (h_zbit) = opval;
11966 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11968 SET_H_CBIT_MOVE (0);
11969 SET_H_VBIT_MOVE (0);
11973 CPU (h_xbit) = opval;
11974 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11978 SET_H_INSN_PREFIXED_P (opval);
11979 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11989 CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
11991 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11992 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11993 #define FLD(f) abuf->fields.sfmt_asrq.f
11994 int UNUSED written = 0;
11995 IADDR UNUSED pc = abuf->addr;
11996 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12000 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
12002 SI opval = tmp_tmpd;
12003 SET_H_GR (FLD (f_operand2), opval);
12004 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12008 BI opval = LTSI (tmp_tmpd, 0);
12009 CPU (h_nbit) = opval;
12010 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12013 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12014 CPU (h_zbit) = opval;
12015 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12017 SET_H_CBIT_MOVE (0);
12018 SET_H_VBIT_MOVE (0);
12022 CPU (h_xbit) = opval;
12023 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12027 SET_H_INSN_PREFIXED_P (opval);
12028 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12038 CASE (sem, INSN_BTST) : /* $Rs,$Rd */
12040 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12041 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12042 #define FLD(f) abuf->fields.sfmt_muls_b.f
12043 int UNUSED written = 0;
12044 IADDR UNUSED pc = abuf->addr;
12045 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12050 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
12053 BI opval = LTSI (tmp_tmpd, 0);
12054 CPU (h_nbit) = opval;
12055 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12058 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12059 CPU (h_zbit) = opval;
12060 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12062 SET_H_CBIT_MOVE (0);
12063 SET_H_VBIT_MOVE (0);
12067 CPU (h_xbit) = opval;
12068 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12072 SET_H_INSN_PREFIXED_P (opval);
12073 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12083 CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
12085 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12086 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12087 #define FLD(f) abuf->fields.sfmt_asrq.f
12088 int UNUSED written = 0;
12089 IADDR UNUSED pc = abuf->addr;
12090 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12094 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
12097 BI opval = LTSI (tmp_tmpd, 0);
12098 CPU (h_nbit) = opval;
12099 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12102 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12103 CPU (h_zbit) = opval;
12104 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12106 SET_H_CBIT_MOVE (0);
12107 SET_H_VBIT_MOVE (0);
12111 CPU (h_xbit) = opval;
12112 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12116 SET_H_INSN_PREFIXED_P (opval);
12117 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12127 CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
12129 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12130 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12131 #define FLD(f) abuf->fields.sfmt_setf.f
12132 int UNUSED written = 0;
12133 IADDR UNUSED pc = abuf->addr;
12134 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12138 tmp_tmp = FLD (f_dstsrc);
12139 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
12142 CPU (h_cbit) = opval;
12143 written |= (1 << 1);
12144 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
12147 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
12150 CPU (h_vbit) = opval;
12151 written |= (1 << 7);
12152 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
12155 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
12158 CPU (h_zbit) = opval;
12159 written |= (1 << 9);
12160 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12163 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
12166 CPU (h_nbit) = opval;
12167 written |= (1 << 3);
12168 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12171 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12174 CPU (h_xbit) = opval;
12175 written |= (1 << 8);
12176 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12179 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12182 SET_H_IBIT (opval);
12183 written |= (1 << 2);
12184 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12187 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12190 SET_H_UBIT (opval);
12191 written |= (1 << 6);
12192 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12195 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12198 CPU (h_pbit) = opval;
12199 written |= (1 << 4);
12200 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12205 SET_H_INSN_PREFIXED_P (opval);
12206 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12208 if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12211 CPU (h_xbit) = opval;
12212 written |= (1 << 8);
12213 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12218 abuf->written = written;
12223 CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
12225 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12226 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12227 #define FLD(f) abuf->fields.sfmt_setf.f
12228 int UNUSED written = 0;
12229 IADDR UNUSED pc = abuf->addr;
12230 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12234 tmp_tmp = FLD (f_dstsrc);
12235 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
12238 CPU (h_cbit) = opval;
12239 written |= (1 << 1);
12240 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
12243 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
12246 CPU (h_vbit) = opval;
12247 written |= (1 << 7);
12248 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
12251 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
12254 CPU (h_zbit) = opval;
12255 written |= (1 << 9);
12256 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12259 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
12262 CPU (h_nbit) = opval;
12263 written |= (1 << 3);
12264 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12267 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12270 CPU (h_xbit) = opval;
12271 written |= (1 << 8);
12272 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12275 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12278 SET_H_IBIT (opval);
12279 written |= (1 << 2);
12280 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12283 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12286 SET_H_UBIT (opval);
12287 written |= (1 << 6);
12288 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12291 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12294 CPU (h_pbit) = opval;
12295 written |= (1 << 4);
12296 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12302 CPU (h_xbit) = opval;
12303 written |= (1 << 8);
12304 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12308 SET_H_INSN_PREFIXED_P (opval);
12309 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12314 abuf->written = written;
12319 CASE (sem, INSN_RFE) : /* rfe */
12321 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12322 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12323 #define FLD(f) abuf->fields.sfmt_rfe.f
12324 int UNUSED written = 0;
12325 IADDR UNUSED pc = abuf->addr;
12326 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12334 tmp_oldccs = GET_H_SR (((UINT) 13));
12335 tmp_keepmask = 0xc0000000;
12336 tmp_samebits = ANDSI (tmp_oldccs, tmp_keepmask);
12337 tmp_shiftbits = ANDSI (SRLSI (ANDSI (tmp_oldccs, 1073609728), 10), INVSI (tmp_keepmask));
12338 tmp_p1 = NESI (0, ANDSI (tmp_oldccs, 131072));
12340 SI opval = ORSI (ORSI (tmp_samebits, tmp_shiftbits), ((ANDBI (CPU (h_rbit), NOTBI (tmp_p1))) ? (0) : (128)));
12341 SET_H_SR (((UINT) 13), opval);
12342 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12350 CASE (sem, INSN_SFE) : /* sfe */
12352 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12353 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12354 #define FLD(f) abuf->fields.sfmt_rfe.f
12355 int UNUSED written = 0;
12356 IADDR UNUSED pc = abuf->addr;
12357 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12362 tmp_savemask = 0xc0000000;
12363 tmp_oldccs = GET_H_SR (((UINT) 13));
12365 SI opval = ORSI (ANDSI (tmp_savemask, tmp_oldccs), ANDSI (INVSI (tmp_savemask), SLLSI (tmp_oldccs, 10)));
12366 SET_H_SR (((UINT) 13), opval);
12367 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12375 CASE (sem, INSN_RFG) : /* rfg */
12377 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12378 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12379 #define FLD(f) abuf->fields.fmt_empty.f
12380 int UNUSED written = 0;
12381 IADDR UNUSED pc = abuf->addr;
12382 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12384 crisv32f_rfg_handler (current_cpu, pc);
12390 CASE (sem, INSN_RFN) : /* rfn */
12392 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12393 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12394 #define FLD(f) abuf->fields.sfmt_rfe.f
12395 int UNUSED written = 0;
12396 IADDR UNUSED pc = abuf->addr;
12397 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12406 tmp_oldccs = GET_H_SR (((UINT) 13));
12407 tmp_keepmask = 0xc0000000;
12408 tmp_samebits = ANDSI (tmp_oldccs, tmp_keepmask);
12409 tmp_shiftbits = ANDSI (SRLSI (ANDSI (tmp_oldccs, 1073609728), 10), INVSI (tmp_keepmask));
12410 tmp_p1 = NESI (0, ANDSI (tmp_oldccs, 131072));
12412 SI opval = ORSI (ORSI (tmp_samebits, tmp_shiftbits), ((ANDBI (CPU (h_rbit), NOTBI (tmp_p1))) ? (0) : (128)));
12413 SET_H_SR (((UINT) 13), opval);
12414 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12419 SET_H_MBIT (opval);
12420 TRACE_RESULT (current_cpu, abuf, "mbit", 'x', opval);
12428 CASE (sem, INSN_HALT) : /* halt */
12430 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12431 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12432 #define FLD(f) abuf->fields.fmt_empty.f
12433 int UNUSED written = 0;
12434 IADDR UNUSED pc = abuf->addr;
12436 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12439 USI opval = crisv32f_halt_handler (current_cpu, pc);
12440 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12441 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12444 SEM_BRANCH_FINI (vpc);
12449 CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
12451 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12452 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12453 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12454 int UNUSED written = 0;
12455 IADDR UNUSED pc = abuf->addr;
12457 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12461 tmp_truthval = ({ SI tmp_tmpcond;
12463 tmp_tmpcond = FLD (f_operand2);
12464 ; if (EQSI (tmp_tmpcond, 0)) {
12465 tmp_condres = NOTBI (CPU (h_cbit));
12467 else if (EQSI (tmp_tmpcond, 1)) {
12468 tmp_condres = CPU (h_cbit);
12470 else if (EQSI (tmp_tmpcond, 2)) {
12471 tmp_condres = NOTBI (CPU (h_zbit));
12473 else if (EQSI (tmp_tmpcond, 3)) {
12474 tmp_condres = CPU (h_zbit);
12476 else if (EQSI (tmp_tmpcond, 4)) {
12477 tmp_condres = NOTBI (CPU (h_vbit));
12479 else if (EQSI (tmp_tmpcond, 5)) {
12480 tmp_condres = CPU (h_vbit);
12482 else if (EQSI (tmp_tmpcond, 6)) {
12483 tmp_condres = NOTBI (CPU (h_nbit));
12485 else if (EQSI (tmp_tmpcond, 7)) {
12486 tmp_condres = CPU (h_nbit);
12488 else if (EQSI (tmp_tmpcond, 8)) {
12489 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12491 else if (EQSI (tmp_tmpcond, 9)) {
12492 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12494 else if (EQSI (tmp_tmpcond, 10)) {
12495 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12497 else if (EQSI (tmp_tmpcond, 11)) {
12498 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12500 else if (EQSI (tmp_tmpcond, 12)) {
12501 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12503 else if (EQSI (tmp_tmpcond, 13)) {
12504 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12506 else if (EQSI (tmp_tmpcond, 14)) {
12509 else if (EQSI (tmp_tmpcond, 15)) {
12510 tmp_condres = CPU (h_pbit);
12513 crisv32f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
12517 CPU (h_xbit) = opval;
12518 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12522 SET_H_INSN_PREFIXED_P (opval);
12523 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12526 if (tmp_truthval) {
12529 USI opval = FLD (i_o_pcrel);
12530 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12531 written |= (1 << 8);
12532 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12538 abuf->written = written;
12539 SEM_BRANCH_FINI (vpc);
12544 CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
12546 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12547 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12548 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12549 int UNUSED written = 0;
12550 IADDR UNUSED pc = abuf->addr;
12552 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12558 CPU (h_xbit) = opval;
12559 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12563 SET_H_INSN_PREFIXED_P (opval);
12564 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12569 USI opval = FLD (i_o_pcrel);
12570 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12571 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12576 SEM_BRANCH_FINI (vpc);
12581 CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
12583 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12584 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12585 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12586 int UNUSED written = 0;
12587 IADDR UNUSED pc = abuf->addr;
12589 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12593 tmp_truthval = ({ SI tmp_tmpcond;
12595 tmp_tmpcond = FLD (f_operand2);
12596 ; if (EQSI (tmp_tmpcond, 0)) {
12597 tmp_condres = NOTBI (CPU (h_cbit));
12599 else if (EQSI (tmp_tmpcond, 1)) {
12600 tmp_condres = CPU (h_cbit);
12602 else if (EQSI (tmp_tmpcond, 2)) {
12603 tmp_condres = NOTBI (CPU (h_zbit));
12605 else if (EQSI (tmp_tmpcond, 3)) {
12606 tmp_condres = CPU (h_zbit);
12608 else if (EQSI (tmp_tmpcond, 4)) {
12609 tmp_condres = NOTBI (CPU (h_vbit));
12611 else if (EQSI (tmp_tmpcond, 5)) {
12612 tmp_condres = CPU (h_vbit);
12614 else if (EQSI (tmp_tmpcond, 6)) {
12615 tmp_condres = NOTBI (CPU (h_nbit));
12617 else if (EQSI (tmp_tmpcond, 7)) {
12618 tmp_condres = CPU (h_nbit);
12620 else if (EQSI (tmp_tmpcond, 8)) {
12621 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12623 else if (EQSI (tmp_tmpcond, 9)) {
12624 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12626 else if (EQSI (tmp_tmpcond, 10)) {
12627 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12629 else if (EQSI (tmp_tmpcond, 11)) {
12630 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12632 else if (EQSI (tmp_tmpcond, 12)) {
12633 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12635 else if (EQSI (tmp_tmpcond, 13)) {
12636 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12638 else if (EQSI (tmp_tmpcond, 14)) {
12641 else if (EQSI (tmp_tmpcond, 15)) {
12642 tmp_condres = CPU (h_pbit);
12645 crisv32f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
12649 CPU (h_xbit) = opval;
12650 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12654 SET_H_INSN_PREFIXED_P (opval);
12655 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12658 if (tmp_truthval) {
12661 USI opval = FLD (i_o_word_pcrel);
12662 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12663 written |= (1 << 8);
12664 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12670 abuf->written = written;
12671 SEM_BRANCH_FINI (vpc);
12676 CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
12678 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12679 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12680 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12681 int UNUSED written = 0;
12682 IADDR UNUSED pc = abuf->addr;
12684 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12690 CPU (h_xbit) = opval;
12691 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12695 SET_H_INSN_PREFIXED_P (opval);
12696 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12701 USI opval = FLD (i_o_word_pcrel);
12702 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12703 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12708 SEM_BRANCH_FINI (vpc);
12713 CASE (sem, INSN_JAS_R) : /* jas ${Rs},${Pd} */
12715 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12716 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12717 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12718 int UNUSED written = 0;
12719 IADDR UNUSED pc = abuf->addr;
12721 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12727 CPU (h_xbit) = opval;
12728 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12732 SET_H_INSN_PREFIXED_P (opval);
12733 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12736 if (ANDIF (EQSI (FLD (f_operand1), 1), EQSI (FLD (f_operand2), 11))) {
12737 cris_flush_simulator_decode_cache (current_cpu, pc);
12742 SI opval = ADDSI (pc, 4);
12743 SET_H_SR (FLD (f_operand2), opval);
12744 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12747 USI opval = GET_H_GR (FLD (f_operand1));
12748 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12749 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12755 SEM_BRANCH_FINI (vpc);
12760 CASE (sem, INSN_JAS_C) : /* jas ${const32},${Pd} */
12762 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12763 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12764 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12765 int UNUSED written = 0;
12766 IADDR UNUSED pc = abuf->addr;
12768 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12774 CPU (h_xbit) = opval;
12775 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12779 SET_H_INSN_PREFIXED_P (opval);
12780 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12786 SI opval = ADDSI (pc, 8);
12787 SET_H_SR (FLD (f_operand2), opval);
12788 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12791 USI opval = FLD (f_indir_pc__dword);
12792 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12793 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12799 SEM_BRANCH_FINI (vpc);
12804 CASE (sem, INSN_JUMP_P) : /* jump ${Ps} */
12806 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12807 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12808 #define FLD(f) abuf->fields.sfmt_mcp.f
12809 int UNUSED written = 0;
12810 IADDR UNUSED pc = abuf->addr;
12812 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12818 CPU (h_xbit) = opval;
12819 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12823 SET_H_INSN_PREFIXED_P (opval);
12824 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12829 USI opval = GET_H_SR (FLD (f_operand2));
12830 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12831 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12836 SEM_BRANCH_FINI (vpc);
12841 CASE (sem, INSN_BAS_C) : /* bas ${const32},${Pd} */
12843 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12844 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12845 #define FLD(f) abuf->fields.sfmt_bas_c.f
12846 int UNUSED written = 0;
12847 IADDR UNUSED pc = abuf->addr;
12849 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12855 CPU (h_xbit) = opval;
12856 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12860 SET_H_INSN_PREFIXED_P (opval);
12861 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12867 SI opval = ADDSI (pc, 8);
12868 SET_H_SR (FLD (f_operand2), opval);
12869 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12872 USI opval = FLD (i_const32_pcrel);
12873 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12874 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12880 SEM_BRANCH_FINI (vpc);
12885 CASE (sem, INSN_JASC_R) : /* jasc ${Rs},${Pd} */
12887 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12888 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12889 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12890 int UNUSED written = 0;
12891 IADDR UNUSED pc = abuf->addr;
12893 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12899 CPU (h_xbit) = opval;
12900 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12904 SET_H_INSN_PREFIXED_P (opval);
12905 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12911 SI opval = ADDSI (pc, 8);
12912 SET_H_SR (FLD (f_operand2), opval);
12913 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12916 USI opval = GET_H_GR (FLD (f_operand1));
12917 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12918 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12924 SEM_BRANCH_FINI (vpc);
12929 CASE (sem, INSN_JASC_C) : /* jasc ${const32},${Pd} */
12931 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12932 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12933 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12934 int UNUSED written = 0;
12935 IADDR UNUSED pc = abuf->addr;
12937 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12943 CPU (h_xbit) = opval;
12944 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12948 SET_H_INSN_PREFIXED_P (opval);
12949 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12955 SI opval = ADDSI (pc, 12);
12956 SET_H_SR (FLD (f_operand2), opval);
12957 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12960 USI opval = FLD (f_indir_pc__dword);
12961 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12962 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12968 SEM_BRANCH_FINI (vpc);
12973 CASE (sem, INSN_BASC_C) : /* basc ${const32},${Pd} */
12975 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12976 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12977 #define FLD(f) abuf->fields.sfmt_bas_c.f
12978 int UNUSED written = 0;
12979 IADDR UNUSED pc = abuf->addr;
12981 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12987 CPU (h_xbit) = opval;
12988 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12992 SET_H_INSN_PREFIXED_P (opval);
12993 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12999 SI opval = ADDSI (pc, 12);
13000 SET_H_SR (FLD (f_operand2), opval);
13001 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
13004 USI opval = FLD (i_const32_pcrel);
13005 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13006 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13012 SEM_BRANCH_FINI (vpc);
13017 CASE (sem, INSN_BREAK) : /* break $n */
13019 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13020 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13021 #define FLD(f) abuf->fields.sfmt_break.f
13022 int UNUSED written = 0;
13023 IADDR UNUSED pc = abuf->addr;
13025 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13031 CPU (h_xbit) = opval;
13032 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13036 SET_H_INSN_PREFIXED_P (opval);
13037 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13041 USI opval = crisv32f_break_handler (current_cpu, FLD (f_u4), pc);
13042 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13043 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13047 SEM_BRANCH_FINI (vpc);
13052 CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
13054 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13055 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13056 #define FLD(f) abuf->fields.sfmt_muls_b.f
13057 int UNUSED written = 0;
13058 IADDR UNUSED pc = abuf->addr;
13059 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13065 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
13066 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13067 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13069 SI opval = tmp_newval;
13070 SET_H_GR (FLD (f_operand2), opval);
13071 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13075 BI opval = LTSI (tmp_newval, 0);
13076 CPU (h_nbit) = opval;
13077 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13080 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13081 CPU (h_zbit) = opval;
13082 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13084 SET_H_CBIT_MOVE (0);
13085 SET_H_VBIT_MOVE (0);
13089 CPU (h_xbit) = opval;
13090 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13094 SET_H_INSN_PREFIXED_P (opval);
13095 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13105 CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
13107 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13108 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13109 #define FLD(f) abuf->fields.sfmt_muls_b.f
13110 int UNUSED written = 0;
13111 IADDR UNUSED pc = abuf->addr;
13112 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13118 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
13119 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13120 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13122 SI opval = tmp_newval;
13123 SET_H_GR (FLD (f_operand2), opval);
13124 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13128 BI opval = LTSI (tmp_newval, 0);
13129 CPU (h_nbit) = opval;
13130 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13133 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13134 CPU (h_zbit) = opval;
13135 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13137 SET_H_CBIT_MOVE (0);
13138 SET_H_VBIT_MOVE (0);
13142 CPU (h_xbit) = opval;
13143 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13147 SET_H_INSN_PREFIXED_P (opval);
13148 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13158 CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
13160 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13161 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13162 #define FLD(f) abuf->fields.sfmt_muls_b.f
13163 int UNUSED written = 0;
13164 IADDR UNUSED pc = abuf->addr;
13165 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13171 tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
13172 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13173 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13175 SI opval = tmp_newval;
13176 SET_H_GR (FLD (f_operand2), opval);
13177 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13181 BI opval = LTSI (tmp_newval, 0);
13182 CPU (h_nbit) = opval;
13183 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13186 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13187 CPU (h_zbit) = opval;
13188 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13190 SET_H_CBIT_MOVE (0);
13191 SET_H_VBIT_MOVE (0);
13195 CPU (h_xbit) = opval;
13196 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13200 SET_H_INSN_PREFIXED_P (opval);
13201 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13211 CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
13213 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13214 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13215 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13216 int UNUSED written = 0;
13217 IADDR UNUSED pc = abuf->addr;
13218 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13224 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
13225 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13226 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13228 SI opval = tmp_newval;
13229 SET_H_GR (FLD (f_operand2), opval);
13230 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13234 BI opval = LTSI (tmp_newval, 0);
13235 CPU (h_nbit) = opval;
13236 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13239 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13240 CPU (h_zbit) = opval;
13241 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13243 SET_H_CBIT_MOVE (0);
13244 SET_H_VBIT_MOVE (0);
13248 CPU (h_xbit) = opval;
13249 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13253 SET_H_INSN_PREFIXED_P (opval);
13254 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13264 CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
13266 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13267 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13268 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13269 int UNUSED written = 0;
13270 IADDR UNUSED pc = abuf->addr;
13271 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13277 tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
13278 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13279 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13281 SI opval = tmp_newval;
13282 SET_H_GR (FLD (f_operand2), opval);
13283 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13287 BI opval = LTSI (tmp_newval, 0);
13288 CPU (h_nbit) = opval;
13289 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13292 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13293 CPU (h_zbit) = opval;
13294 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13296 SET_H_CBIT_MOVE (0);
13297 SET_H_VBIT_MOVE (0);
13301 CPU (h_xbit) = opval;
13302 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13306 SET_H_INSN_PREFIXED_P (opval);
13307 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13317 CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
13319 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13320 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13321 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13322 int UNUSED written = 0;
13323 IADDR UNUSED pc = abuf->addr;
13324 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13330 tmp_tmpops = FLD (f_indir_pc__dword);
13331 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13332 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13334 SI opval = tmp_newval;
13335 SET_H_GR (FLD (f_operand2), opval);
13336 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13340 BI opval = LTSI (tmp_newval, 0);
13341 CPU (h_nbit) = opval;
13342 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13345 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13346 CPU (h_zbit) = opval;
13347 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13349 SET_H_CBIT_MOVE (0);
13350 SET_H_VBIT_MOVE (0);
13354 CPU (h_xbit) = opval;
13355 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13359 SET_H_INSN_PREFIXED_P (opval);
13360 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13370 CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
13372 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13373 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13374 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13375 int UNUSED written = 0;
13376 IADDR UNUSED pc = abuf->addr;
13377 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13381 tmp_truthval = ({ SI tmp_tmpcond;
13383 tmp_tmpcond = FLD (f_operand2);
13384 ; if (EQSI (tmp_tmpcond, 0)) {
13385 tmp_condres = NOTBI (CPU (h_cbit));
13387 else if (EQSI (tmp_tmpcond, 1)) {
13388 tmp_condres = CPU (h_cbit);
13390 else if (EQSI (tmp_tmpcond, 2)) {
13391 tmp_condres = NOTBI (CPU (h_zbit));
13393 else if (EQSI (tmp_tmpcond, 3)) {
13394 tmp_condres = CPU (h_zbit);
13396 else if (EQSI (tmp_tmpcond, 4)) {
13397 tmp_condres = NOTBI (CPU (h_vbit));
13399 else if (EQSI (tmp_tmpcond, 5)) {
13400 tmp_condres = CPU (h_vbit);
13402 else if (EQSI (tmp_tmpcond, 6)) {
13403 tmp_condres = NOTBI (CPU (h_nbit));
13405 else if (EQSI (tmp_tmpcond, 7)) {
13406 tmp_condres = CPU (h_nbit);
13408 else if (EQSI (tmp_tmpcond, 8)) {
13409 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
13411 else if (EQSI (tmp_tmpcond, 9)) {
13412 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
13414 else if (EQSI (tmp_tmpcond, 10)) {
13415 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
13417 else if (EQSI (tmp_tmpcond, 11)) {
13418 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
13420 else if (EQSI (tmp_tmpcond, 12)) {
13421 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
13423 else if (EQSI (tmp_tmpcond, 13)) {
13424 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
13426 else if (EQSI (tmp_tmpcond, 14)) {
13429 else if (EQSI (tmp_tmpcond, 15)) {
13430 tmp_condres = CPU (h_pbit);
13434 SI opval = ZEXTBISI (tmp_truthval);
13435 SET_H_GR (FLD (f_operand1), opval);
13436 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13441 CPU (h_xbit) = opval;
13442 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13446 SET_H_INSN_PREFIXED_P (opval);
13447 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13456 CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
13458 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13459 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13460 #define FLD(f) abuf->fields.sfmt_muls_b.f
13461 int UNUSED written = 0;
13462 IADDR UNUSED pc = abuf->addr;
13463 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13468 tmp_tmp = GET_H_GR (FLD (f_operand1));
13471 if (GESI (tmp_tmp, 0)) {
13473 tmp_tmp = SLLSI (tmp_tmp, 1);
13474 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13477 if (GESI (tmp_tmp, 0)) {
13479 tmp_tmp = SLLSI (tmp_tmp, 1);
13480 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13483 if (GESI (tmp_tmp, 0)) {
13485 tmp_tmp = SLLSI (tmp_tmp, 1);
13486 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13489 if (GESI (tmp_tmp, 0)) {
13491 tmp_tmp = SLLSI (tmp_tmp, 1);
13492 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13495 if (GESI (tmp_tmp, 0)) {
13497 tmp_tmp = SLLSI (tmp_tmp, 1);
13498 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13501 if (GESI (tmp_tmp, 0)) {
13503 tmp_tmp = SLLSI (tmp_tmp, 1);
13504 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13507 if (GESI (tmp_tmp, 0)) {
13509 tmp_tmp = SLLSI (tmp_tmp, 1);
13510 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13513 if (GESI (tmp_tmp, 0)) {
13515 tmp_tmp = SLLSI (tmp_tmp, 1);
13516 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13519 if (GESI (tmp_tmp, 0)) {
13521 tmp_tmp = SLLSI (tmp_tmp, 1);
13522 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13525 if (GESI (tmp_tmp, 0)) {
13527 tmp_tmp = SLLSI (tmp_tmp, 1);
13528 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13531 if (GESI (tmp_tmp, 0)) {
13533 tmp_tmp = SLLSI (tmp_tmp, 1);
13534 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13537 if (GESI (tmp_tmp, 0)) {
13539 tmp_tmp = SLLSI (tmp_tmp, 1);
13540 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13543 if (GESI (tmp_tmp, 0)) {
13545 tmp_tmp = SLLSI (tmp_tmp, 1);
13546 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13549 if (GESI (tmp_tmp, 0)) {
13551 tmp_tmp = SLLSI (tmp_tmp, 1);
13552 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13555 if (GESI (tmp_tmp, 0)) {
13557 tmp_tmp = SLLSI (tmp_tmp, 1);
13558 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13561 if (GESI (tmp_tmp, 0)) {
13563 tmp_tmp = SLLSI (tmp_tmp, 1);
13564 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13567 if (GESI (tmp_tmp, 0)) {
13569 tmp_tmp = SLLSI (tmp_tmp, 1);
13570 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13573 if (GESI (tmp_tmp, 0)) {
13575 tmp_tmp = SLLSI (tmp_tmp, 1);
13576 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13579 if (GESI (tmp_tmp, 0)) {
13581 tmp_tmp = SLLSI (tmp_tmp, 1);
13582 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13585 if (GESI (tmp_tmp, 0)) {
13587 tmp_tmp = SLLSI (tmp_tmp, 1);
13588 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13591 if (GESI (tmp_tmp, 0)) {
13593 tmp_tmp = SLLSI (tmp_tmp, 1);
13594 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13597 if (GESI (tmp_tmp, 0)) {
13599 tmp_tmp = SLLSI (tmp_tmp, 1);
13600 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13603 if (GESI (tmp_tmp, 0)) {
13605 tmp_tmp = SLLSI (tmp_tmp, 1);
13606 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13609 if (GESI (tmp_tmp, 0)) {
13611 tmp_tmp = SLLSI (tmp_tmp, 1);
13612 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13615 if (GESI (tmp_tmp, 0)) {
13617 tmp_tmp = SLLSI (tmp_tmp, 1);
13618 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13621 if (GESI (tmp_tmp, 0)) {
13623 tmp_tmp = SLLSI (tmp_tmp, 1);
13624 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13627 if (GESI (tmp_tmp, 0)) {
13629 tmp_tmp = SLLSI (tmp_tmp, 1);
13630 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13633 if (GESI (tmp_tmp, 0)) {
13635 tmp_tmp = SLLSI (tmp_tmp, 1);
13636 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13639 if (GESI (tmp_tmp, 0)) {
13641 tmp_tmp = SLLSI (tmp_tmp, 1);
13642 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13645 if (GESI (tmp_tmp, 0)) {
13647 tmp_tmp = SLLSI (tmp_tmp, 1);
13648 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13651 if (GESI (tmp_tmp, 0)) {
13653 tmp_tmp = SLLSI (tmp_tmp, 1);
13654 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13657 if (GESI (tmp_tmp, 0)) {
13659 tmp_tmp = SLLSI (tmp_tmp, 1);
13660 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13665 SI opval = tmp_tmpd;
13666 SET_H_GR (FLD (f_operand2), opval);
13667 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13671 BI opval = LTSI (tmp_tmpd, 0);
13672 CPU (h_nbit) = opval;
13673 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13676 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13677 CPU (h_zbit) = opval;
13678 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13680 SET_H_CBIT_MOVE (0);
13681 SET_H_VBIT_MOVE (0);
13685 CPU (h_xbit) = opval;
13686 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13690 SET_H_INSN_PREFIXED_P (opval);
13691 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13701 CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
13703 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13704 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13705 #define FLD(f) abuf->fields.sfmt_addoq.f
13706 int UNUSED written = 0;
13707 IADDR UNUSED pc = abuf->addr;
13708 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13712 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
13713 SET_H_PREFIXREG_V32 (opval);
13714 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13718 SET_H_INSN_PREFIXED_P (opval);
13719 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13727 CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13729 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13730 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13731 #define FLD(f) abuf->fields.sfmt_addc_m.f
13732 int UNUSED written = 0;
13733 IADDR UNUSED pc = abuf->addr;
13734 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13738 tmp_tmps = ({ SI tmp_addr;
13741 tmp_postinc = FLD (f_memmode);
13742 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13743 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13744 ; if (NEBI (tmp_postinc, 0)) {
13746 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13747 tmp_addr = ADDSI (tmp_addr, 1);
13750 SI opval = tmp_addr;
13751 SET_H_GR (FLD (f_operand1), opval);
13752 written |= (1 << 6);
13753 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13759 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
13760 SET_H_PREFIXREG_V32 (opval);
13761 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13765 SET_H_INSN_PREFIXED_P (opval);
13766 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13770 abuf->written = written;
13775 CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13777 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13778 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13779 #define FLD(f) abuf->fields.sfmt_addc_m.f
13780 int UNUSED written = 0;
13781 IADDR UNUSED pc = abuf->addr;
13782 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13786 tmp_tmps = ({ SI tmp_addr;
13789 tmp_postinc = FLD (f_memmode);
13790 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13791 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
13792 ; if (NEBI (tmp_postinc, 0)) {
13794 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13795 tmp_addr = ADDSI (tmp_addr, 2);
13798 SI opval = tmp_addr;
13799 SET_H_GR (FLD (f_operand1), opval);
13800 written |= (1 << 6);
13801 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13807 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
13808 SET_H_PREFIXREG_V32 (opval);
13809 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13813 SET_H_INSN_PREFIXED_P (opval);
13814 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13818 abuf->written = written;
13823 CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13825 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13826 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13827 #define FLD(f) abuf->fields.sfmt_addc_m.f
13828 int UNUSED written = 0;
13829 IADDR UNUSED pc = abuf->addr;
13830 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13834 tmp_tmps = ({ SI tmp_addr;
13837 tmp_postinc = FLD (f_memmode);
13838 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13839 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13840 ; if (NEBI (tmp_postinc, 0)) {
13842 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13843 tmp_addr = ADDSI (tmp_addr, 4);
13846 SI opval = tmp_addr;
13847 SET_H_GR (FLD (f_operand1), opval);
13848 written |= (1 << 6);
13849 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13855 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
13856 SET_H_PREFIXREG_V32 (opval);
13857 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13861 SET_H_INSN_PREFIXED_P (opval);
13862 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13866 abuf->written = written;
13871 CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
13873 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13874 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13875 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13876 int UNUSED written = 0;
13877 IADDR UNUSED pc = abuf->addr;
13878 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13882 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
13883 SET_H_PREFIXREG_V32 (opval);
13884 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13888 SET_H_INSN_PREFIXED_P (opval);
13889 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13897 CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
13899 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13900 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13901 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13902 int UNUSED written = 0;
13903 IADDR UNUSED pc = abuf->addr;
13904 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13908 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
13909 SET_H_PREFIXREG_V32 (opval);
13910 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13914 SET_H_INSN_PREFIXED_P (opval);
13915 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13923 CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
13925 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13926 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13927 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13928 int UNUSED written = 0;
13929 IADDR UNUSED pc = abuf->addr;
13930 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13934 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
13935 SET_H_PREFIXREG_V32 (opval);
13936 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13940 SET_H_INSN_PREFIXED_P (opval);
13941 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13949 CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13951 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13952 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13953 #define FLD(f) abuf->fields.sfmt_muls_b.f
13954 int UNUSED written = 0;
13955 IADDR UNUSED pc = abuf->addr;
13956 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13960 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13961 SET_H_PREFIXREG_V32 (opval);
13962 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13966 SET_H_INSN_PREFIXED_P (opval);
13967 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13975 CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13977 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13978 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13979 #define FLD(f) abuf->fields.sfmt_muls_b.f
13980 int UNUSED written = 0;
13981 IADDR UNUSED pc = abuf->addr;
13982 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13986 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13987 SET_H_PREFIXREG_V32 (opval);
13988 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13992 SET_H_INSN_PREFIXED_P (opval);
13993 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14001 CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14003 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14004 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14005 #define FLD(f) abuf->fields.sfmt_muls_b.f
14006 int UNUSED written = 0;
14007 IADDR UNUSED pc = abuf->addr;
14008 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14012 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
14013 SET_H_PREFIXREG_V32 (opval);
14014 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14018 SET_H_INSN_PREFIXED_P (opval);
14019 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14027 CASE (sem, INSN_FIDXI) : /* fidxi [$Rs] */
14029 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14030 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14031 #define FLD(f) abuf->fields.sfmt_mcp.f
14032 int UNUSED written = 0;
14033 IADDR UNUSED pc = abuf->addr;
14035 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14038 USI opval = crisv32f_fidxi_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14039 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14040 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14043 SEM_BRANCH_FINI (vpc);
14048 CASE (sem, INSN_FTAGI) : /* fidxi [$Rs] */
14050 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14051 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14052 #define FLD(f) abuf->fields.sfmt_mcp.f
14053 int UNUSED written = 0;
14054 IADDR UNUSED pc = abuf->addr;
14056 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14059 USI opval = crisv32f_ftagi_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14060 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14061 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14064 SEM_BRANCH_FINI (vpc);
14069 CASE (sem, INSN_FIDXD) : /* fidxd [$Rs] */
14071 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14072 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14073 #define FLD(f) abuf->fields.sfmt_mcp.f
14074 int UNUSED written = 0;
14075 IADDR UNUSED pc = abuf->addr;
14077 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14080 USI opval = crisv32f_fidxd_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14081 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14082 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14085 SEM_BRANCH_FINI (vpc);
14090 CASE (sem, INSN_FTAGD) : /* ftagd [$Rs] */
14092 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14093 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14094 #define FLD(f) abuf->fields.sfmt_mcp.f
14095 int UNUSED written = 0;
14096 IADDR UNUSED pc = abuf->addr;
14098 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14101 USI opval = crisv32f_ftagd_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14102 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14103 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14106 SEM_BRANCH_FINI (vpc);
14113 ENDSWITCH (sem) /* End of semantic switch. */
14115 /* At this point `vpc' contains the next insn to execute. */
14118 #undef DEFINE_SWITCH
14119 #endif /* DEFINE_SWITCH */