1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2010 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file 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, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { CRISV32F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
36 { CRISV32F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
37 { CRISV32F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
38 { CRISV32F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
39 { CRISV32F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
40 { CRISV32F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
41 { CRISV32F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
42 { CRISV32F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
43 { CRISV32F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
44 { CRISV32F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
45 { CRISV32F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
46 { CRISV32F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
47 { CRISV32F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
48 { CRISV32F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
49 { CRISV32F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
50 { CRISV32F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
51 { CRISV32F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
52 { CRISV32F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
53 { CRISV32F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
54 { CRISV32F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
55 { CRISV32F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
56 { CRISV32F_INSN_ADDQ, && case_sem_INSN_ADDQ },
57 { CRISV32F_INSN_SUBQ, && case_sem_INSN_SUBQ },
58 { CRISV32F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
59 { CRISV32F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
60 { CRISV32F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
61 { CRISV32F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
62 { CRISV32F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
63 { CRISV32F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
64 { CRISV32F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
65 { CRISV32F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
66 { CRISV32F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
67 { CRISV32F_INSN_CMPQ, && case_sem_INSN_CMPQ },
68 { CRISV32F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
69 { CRISV32F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
70 { CRISV32F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
71 { CRISV32F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
72 { CRISV32F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
73 { CRISV32F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
74 { CRISV32F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
75 { CRISV32F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
76 { CRISV32F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
77 { CRISV32F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
78 { CRISV32F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
79 { CRISV32F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
80 { CRISV32F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
81 { CRISV32F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
82 { CRISV32F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
83 { CRISV32F_INSN_MOVE_R_SPRV32, && case_sem_INSN_MOVE_R_SPRV32 },
84 { CRISV32F_INSN_MOVE_SPR_RV32, && case_sem_INSN_MOVE_SPR_RV32 },
85 { CRISV32F_INSN_MOVE_M_SPRV32, && case_sem_INSN_MOVE_M_SPRV32 },
86 { CRISV32F_INSN_MOVE_C_SPRV32_P2, && case_sem_INSN_MOVE_C_SPRV32_P2 },
87 { CRISV32F_INSN_MOVE_C_SPRV32_P3, && case_sem_INSN_MOVE_C_SPRV32_P3 },
88 { CRISV32F_INSN_MOVE_C_SPRV32_P5, && case_sem_INSN_MOVE_C_SPRV32_P5 },
89 { CRISV32F_INSN_MOVE_C_SPRV32_P6, && case_sem_INSN_MOVE_C_SPRV32_P6 },
90 { CRISV32F_INSN_MOVE_C_SPRV32_P7, && case_sem_INSN_MOVE_C_SPRV32_P7 },
91 { CRISV32F_INSN_MOVE_C_SPRV32_P9, && case_sem_INSN_MOVE_C_SPRV32_P9 },
92 { CRISV32F_INSN_MOVE_C_SPRV32_P10, && case_sem_INSN_MOVE_C_SPRV32_P10 },
93 { CRISV32F_INSN_MOVE_C_SPRV32_P11, && case_sem_INSN_MOVE_C_SPRV32_P11 },
94 { CRISV32F_INSN_MOVE_C_SPRV32_P12, && case_sem_INSN_MOVE_C_SPRV32_P12 },
95 { CRISV32F_INSN_MOVE_C_SPRV32_P13, && case_sem_INSN_MOVE_C_SPRV32_P13 },
96 { CRISV32F_INSN_MOVE_C_SPRV32_P14, && case_sem_INSN_MOVE_C_SPRV32_P14 },
97 { CRISV32F_INSN_MOVE_C_SPRV32_P15, && case_sem_INSN_MOVE_C_SPRV32_P15 },
98 { CRISV32F_INSN_MOVE_SPR_MV32, && case_sem_INSN_MOVE_SPR_MV32 },
99 { CRISV32F_INSN_MOVE_SS_R, && case_sem_INSN_MOVE_SS_R },
100 { CRISV32F_INSN_MOVE_R_SS, && case_sem_INSN_MOVE_R_SS },
101 { CRISV32F_INSN_MOVEM_R_M_V32, && case_sem_INSN_MOVEM_R_M_V32 },
102 { CRISV32F_INSN_MOVEM_M_R_V32, && case_sem_INSN_MOVEM_M_R_V32 },
103 { CRISV32F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
104 { CRISV32F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
105 { CRISV32F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
106 { CRISV32F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
107 { CRISV32F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
108 { CRISV32F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
109 { CRISV32F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
110 { CRISV32F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
111 { CRISV32F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
112 { CRISV32F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
113 { CRISV32F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
114 { CRISV32F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
115 { CRISV32F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
116 { CRISV32F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
117 { CRISV32F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
118 { CRISV32F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
119 { CRISV32F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
120 { CRISV32F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
121 { CRISV32F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
122 { CRISV32F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
123 { CRISV32F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
124 { CRISV32F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
125 { CRISV32F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
126 { CRISV32F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
127 { CRISV32F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
128 { CRISV32F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
129 { CRISV32F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
130 { CRISV32F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
131 { CRISV32F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
132 { CRISV32F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
133 { CRISV32F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
134 { CRISV32F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
135 { CRISV32F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
136 { CRISV32F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
137 { CRISV32F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
138 { CRISV32F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
139 { CRISV32F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
140 { CRISV32F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
141 { CRISV32F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
142 { CRISV32F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
143 { CRISV32F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
144 { CRISV32F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
145 { CRISV32F_INSN_ADDC_R, && case_sem_INSN_ADDC_R },
146 { CRISV32F_INSN_ADDC_M, && case_sem_INSN_ADDC_M },
147 { CRISV32F_INSN_ADDC_C, && case_sem_INSN_ADDC_C },
148 { CRISV32F_INSN_LAPC_D, && case_sem_INSN_LAPC_D },
149 { CRISV32F_INSN_LAPCQ, && case_sem_INSN_LAPCQ },
150 { CRISV32F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
151 { CRISV32F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
152 { CRISV32F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
153 { CRISV32F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
154 { CRISV32F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
155 { CRISV32F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
156 { CRISV32F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
157 { CRISV32F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
158 { CRISV32F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
159 { CRISV32F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
160 { CRISV32F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
161 { CRISV32F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
162 { CRISV32F_INSN_MULS_B, && case_sem_INSN_MULS_B },
163 { CRISV32F_INSN_MULS_W, && case_sem_INSN_MULS_W },
164 { CRISV32F_INSN_MULS_D, && case_sem_INSN_MULS_D },
165 { CRISV32F_INSN_MULU_B, && case_sem_INSN_MULU_B },
166 { CRISV32F_INSN_MULU_W, && case_sem_INSN_MULU_W },
167 { CRISV32F_INSN_MULU_D, && case_sem_INSN_MULU_D },
168 { CRISV32F_INSN_MCP, && case_sem_INSN_MCP },
169 { CRISV32F_INSN_DSTEP, && case_sem_INSN_DSTEP },
170 { CRISV32F_INSN_ABS, && case_sem_INSN_ABS },
171 { CRISV32F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
172 { CRISV32F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
173 { CRISV32F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
174 { CRISV32F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
175 { CRISV32F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
176 { CRISV32F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
177 { CRISV32F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
178 { CRISV32F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
179 { CRISV32F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
180 { CRISV32F_INSN_ANDQ, && case_sem_INSN_ANDQ },
181 { CRISV32F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
182 { CRISV32F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
183 { CRISV32F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
184 { CRISV32F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
185 { CRISV32F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
186 { CRISV32F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
187 { CRISV32F_INSN_ORCBR, && case_sem_INSN_ORCBR },
188 { CRISV32F_INSN_ORCWR, && case_sem_INSN_ORCWR },
189 { CRISV32F_INSN_ORCDR, && case_sem_INSN_ORCDR },
190 { CRISV32F_INSN_ORQ, && case_sem_INSN_ORQ },
191 { CRISV32F_INSN_XOR, && case_sem_INSN_XOR },
192 { CRISV32F_INSN_SWAP, && case_sem_INSN_SWAP },
193 { CRISV32F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
194 { CRISV32F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
195 { CRISV32F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
196 { CRISV32F_INSN_ASRQ, && case_sem_INSN_ASRQ },
197 { CRISV32F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
198 { CRISV32F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
199 { CRISV32F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
200 { CRISV32F_INSN_LSRQ, && case_sem_INSN_LSRQ },
201 { CRISV32F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
202 { CRISV32F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
203 { CRISV32F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
204 { CRISV32F_INSN_LSLQ, && case_sem_INSN_LSLQ },
205 { CRISV32F_INSN_BTST, && case_sem_INSN_BTST },
206 { CRISV32F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
207 { CRISV32F_INSN_SETF, && case_sem_INSN_SETF },
208 { CRISV32F_INSN_CLEARF, && case_sem_INSN_CLEARF },
209 { CRISV32F_INSN_RFE, && case_sem_INSN_RFE },
210 { CRISV32F_INSN_SFE, && case_sem_INSN_SFE },
211 { CRISV32F_INSN_RFG, && case_sem_INSN_RFG },
212 { CRISV32F_INSN_RFN, && case_sem_INSN_RFN },
213 { CRISV32F_INSN_HALT, && case_sem_INSN_HALT },
214 { CRISV32F_INSN_BCC_B, && case_sem_INSN_BCC_B },
215 { CRISV32F_INSN_BA_B, && case_sem_INSN_BA_B },
216 { CRISV32F_INSN_BCC_W, && case_sem_INSN_BCC_W },
217 { CRISV32F_INSN_BA_W, && case_sem_INSN_BA_W },
218 { CRISV32F_INSN_JAS_R, && case_sem_INSN_JAS_R },
219 { CRISV32F_INSN_JAS_C, && case_sem_INSN_JAS_C },
220 { CRISV32F_INSN_JUMP_P, && case_sem_INSN_JUMP_P },
221 { CRISV32F_INSN_BAS_C, && case_sem_INSN_BAS_C },
222 { CRISV32F_INSN_JASC_R, && case_sem_INSN_JASC_R },
223 { CRISV32F_INSN_JASC_C, && case_sem_INSN_JASC_C },
224 { CRISV32F_INSN_BASC_C, && case_sem_INSN_BASC_C },
225 { CRISV32F_INSN_BREAK, && case_sem_INSN_BREAK },
226 { CRISV32F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
227 { CRISV32F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
228 { CRISV32F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
229 { CRISV32F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
230 { CRISV32F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
231 { CRISV32F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
232 { CRISV32F_INSN_SCC, && case_sem_INSN_SCC },
233 { CRISV32F_INSN_LZ, && case_sem_INSN_LZ },
234 { CRISV32F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
235 { CRISV32F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
236 { CRISV32F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
237 { CRISV32F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
238 { CRISV32F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
239 { CRISV32F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
240 { CRISV32F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
241 { CRISV32F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
242 { CRISV32F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
243 { CRISV32F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
244 { CRISV32F_INSN_FIDXI, && case_sem_INSN_FIDXI },
245 { CRISV32F_INSN_FTAGI, && case_sem_INSN_FTAGI },
246 { CRISV32F_INSN_FIDXD, && case_sem_INSN_FIDXD },
247 { CRISV32F_INSN_FTAGD, && case_sem_INSN_FTAGD },
252 for (i = 0; labels[i].label != 0; ++i)
255 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
257 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
262 #endif /* DEFINE_LABELS */
266 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
267 off frills like tracing and profiling. */
268 /* FIXME: A better way would be to have TRACE_RESULT check for something
269 that can cause it to be optimized out. Another way would be to emit
270 special handlers into the instruction "stream". */
274 #define TRACE_RESULT(cpu, abuf, name, type, val)
278 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
284 /* Branch to next handler without going around main loop. */
285 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
286 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
288 #else /* ! WITH_SCACHE_PBB */
290 #define NEXT(vpc) BREAK (sem)
293 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
295 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
298 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
301 #endif /* ! WITH_SCACHE_PBB */
305 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
307 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
308 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
309 #define FLD(f) abuf->fields.sfmt_empty.f
310 int UNUSED written = 0;
311 IADDR UNUSED pc = abuf->addr;
312 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
315 /* Update the recorded pc in the cpu state struct.
316 Only necessary for WITH_SCACHE case, but to avoid the
317 conditional compilation .... */
319 /* Virtual insns have zero size. Overwrite vpc with address of next insn
320 using the default-insn-bitsize spec. When executing insns in parallel
321 we may want to queue the fault and continue execution. */
322 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
323 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
330 CASE (sem, INSN_X_AFTER) : /* --after-- */
332 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
333 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
334 #define FLD(f) abuf->fields.sfmt_empty.f
335 int UNUSED written = 0;
336 IADDR UNUSED pc = abuf->addr;
337 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
340 #if WITH_SCACHE_PBB_CRISV32F
341 crisv32f_pbb_after (current_cpu, sem_arg);
349 CASE (sem, INSN_X_BEFORE) : /* --before-- */
351 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
352 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
353 #define FLD(f) abuf->fields.sfmt_empty.f
354 int UNUSED written = 0;
355 IADDR UNUSED pc = abuf->addr;
356 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
359 #if WITH_SCACHE_PBB_CRISV32F
360 crisv32f_pbb_before (current_cpu, sem_arg);
368 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
370 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
371 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
372 #define FLD(f) abuf->fields.sfmt_empty.f
373 int UNUSED written = 0;
374 IADDR UNUSED pc = abuf->addr;
375 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
378 #if WITH_SCACHE_PBB_CRISV32F
380 vpc = crisv32f_pbb_cti_chain (current_cpu, sem_arg,
381 pbb_br_type, pbb_br_npc);
384 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
385 vpc = crisv32f_pbb_cti_chain (current_cpu, sem_arg,
386 CPU_PBB_BR_TYPE (current_cpu),
387 CPU_PBB_BR_NPC (current_cpu));
396 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
398 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
399 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
400 #define FLD(f) abuf->fields.sfmt_empty.f
401 int UNUSED written = 0;
402 IADDR UNUSED pc = abuf->addr;
403 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
406 #if WITH_SCACHE_PBB_CRISV32F
407 vpc = crisv32f_pbb_chain (current_cpu, sem_arg);
418 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
420 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
421 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
422 #define FLD(f) abuf->fields.sfmt_empty.f
423 int UNUSED written = 0;
424 IADDR UNUSED pc = abuf->addr;
425 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
428 #if WITH_SCACHE_PBB_CRISV32F
429 #if defined DEFINE_SWITCH || defined FAST_P
430 /* In the switch case FAST_P is a constant, allowing several optimizations
431 in any called inline functions. */
432 vpc = crisv32f_pbb_begin (current_cpu, FAST_P);
434 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
435 vpc = crisv32f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
437 vpc = crisv32f_pbb_begin (current_cpu, 0);
447 CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
449 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
450 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
451 #define FLD(f) abuf->fields.sfmt_addc_m.f
452 int UNUSED written = 0;
453 IADDR UNUSED pc = abuf->addr;
454 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
458 tmp_newval = GET_H_GR (FLD (f_operand1));
461 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
463 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
464 SET_H_GR (FLD (f_operand2), opval);
465 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
470 BI opval = LTQI (tmp_newval, 0);
471 CPU (h_nbit) = opval;
472 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
475 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
476 CPU (h_zbit) = opval;
477 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
484 CPU (h_xbit) = opval;
485 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
489 SET_H_INSN_PREFIXED_P (opval);
490 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
500 CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
502 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
503 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
504 #define FLD(f) abuf->fields.sfmt_addc_m.f
505 int UNUSED written = 0;
506 IADDR UNUSED pc = abuf->addr;
507 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
511 tmp_newval = GET_H_GR (FLD (f_operand1));
514 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
516 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
517 SET_H_GR (FLD (f_operand2), opval);
518 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
523 BI opval = LTHI (tmp_newval, 0);
524 CPU (h_nbit) = opval;
525 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
528 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
529 CPU (h_zbit) = opval;
530 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
537 CPU (h_xbit) = opval;
538 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
542 SET_H_INSN_PREFIXED_P (opval);
543 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
553 CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
555 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
556 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
557 #define FLD(f) abuf->fields.sfmt_addc_m.f
558 int UNUSED written = 0;
559 IADDR UNUSED pc = abuf->addr;
560 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
564 tmp_newval = GET_H_GR (FLD (f_operand1));
566 SI opval = tmp_newval;
567 SET_H_GR (FLD (f_operand2), opval);
568 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
572 BI opval = LTSI (tmp_newval, 0);
573 CPU (h_nbit) = opval;
574 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
577 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
578 CPU (h_zbit) = opval;
579 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
586 CPU (h_xbit) = opval;
587 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
591 SET_H_INSN_PREFIXED_P (opval);
592 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
602 CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
604 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
605 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
606 #define FLD(f) abuf->fields.sfmt_moveq.f
607 int UNUSED written = 0;
608 IADDR UNUSED pc = abuf->addr;
609 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
613 tmp_newval = FLD (f_s6);
615 SI opval = tmp_newval;
616 SET_H_GR (FLD (f_operand2), opval);
617 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
620 SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
621 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
627 CPU (h_xbit) = opval;
628 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
632 SET_H_INSN_PREFIXED_P (opval);
633 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
643 CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
645 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
646 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
647 #define FLD(f) abuf->fields.sfmt_muls_b.f
648 int UNUSED written = 0;
649 IADDR UNUSED pc = abuf->addr;
650 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
655 tmp_tmpops = GET_H_GR (FLD (f_operand1));
656 tmp_newval = EXTQISI (tmp_tmpops);
658 SI opval = tmp_newval;
659 SET_H_GR (FLD (f_operand2), opval);
660 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
664 BI opval = LTSI (tmp_newval, 0);
665 CPU (h_nbit) = opval;
666 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
669 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
670 CPU (h_zbit) = opval;
671 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
678 CPU (h_xbit) = opval;
679 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
683 SET_H_INSN_PREFIXED_P (opval);
684 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
694 CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
696 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
697 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
698 #define FLD(f) abuf->fields.sfmt_muls_b.f
699 int UNUSED written = 0;
700 IADDR UNUSED pc = abuf->addr;
701 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
706 tmp_tmpops = GET_H_GR (FLD (f_operand1));
707 tmp_newval = EXTHISI (tmp_tmpops);
709 SI opval = tmp_newval;
710 SET_H_GR (FLD (f_operand2), opval);
711 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
715 BI opval = LTSI (tmp_newval, 0);
716 CPU (h_nbit) = opval;
717 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
720 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
721 CPU (h_zbit) = opval;
722 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
729 CPU (h_xbit) = opval;
730 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
734 SET_H_INSN_PREFIXED_P (opval);
735 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
745 CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
747 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
748 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
749 #define FLD(f) abuf->fields.sfmt_muls_b.f
750 int UNUSED written = 0;
751 IADDR UNUSED pc = abuf->addr;
752 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
757 tmp_tmpops = GET_H_GR (FLD (f_operand1));
758 tmp_newval = ZEXTQISI (tmp_tmpops);
760 SI opval = tmp_newval;
761 SET_H_GR (FLD (f_operand2), opval);
762 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
766 BI opval = LTSI (tmp_newval, 0);
767 CPU (h_nbit) = opval;
768 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
771 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
772 CPU (h_zbit) = opval;
773 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
780 CPU (h_xbit) = opval;
781 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
785 SET_H_INSN_PREFIXED_P (opval);
786 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
796 CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
799 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
800 #define FLD(f) abuf->fields.sfmt_muls_b.f
801 int UNUSED written = 0;
802 IADDR UNUSED pc = abuf->addr;
803 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
808 tmp_tmpops = GET_H_GR (FLD (f_operand1));
809 tmp_newval = ZEXTHISI (tmp_tmpops);
811 SI opval = tmp_newval;
812 SET_H_GR (FLD (f_operand2), opval);
813 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
817 BI opval = LTSI (tmp_newval, 0);
818 CPU (h_nbit) = opval;
819 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
822 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
823 CPU (h_zbit) = opval;
824 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
831 CPU (h_xbit) = opval;
832 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
836 SET_H_INSN_PREFIXED_P (opval);
837 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
847 CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
849 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
850 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
851 #define FLD(f) abuf->fields.sfmt_addcbr.f
852 int UNUSED written = 0;
853 IADDR UNUSED pc = abuf->addr;
854 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
858 tmp_newval = FLD (f_indir_pc__byte);
861 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
863 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
864 SET_H_GR (FLD (f_operand2), opval);
865 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
870 BI opval = LTQI (tmp_newval, 0);
871 CPU (h_nbit) = opval;
872 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
875 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
876 CPU (h_zbit) = opval;
877 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
884 CPU (h_xbit) = opval;
885 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
889 SET_H_INSN_PREFIXED_P (opval);
890 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
900 CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
902 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
903 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
904 #define FLD(f) abuf->fields.sfmt_addcwr.f
905 int UNUSED written = 0;
906 IADDR UNUSED pc = abuf->addr;
907 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
911 tmp_newval = FLD (f_indir_pc__word);
914 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
916 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
917 SET_H_GR (FLD (f_operand2), opval);
918 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
923 BI opval = LTHI (tmp_newval, 0);
924 CPU (h_nbit) = opval;
925 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
928 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
929 CPU (h_zbit) = opval;
930 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
937 CPU (h_xbit) = opval;
938 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
942 SET_H_INSN_PREFIXED_P (opval);
943 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
953 CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
955 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
956 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
957 #define FLD(f) abuf->fields.sfmt_bound_cd.f
958 int UNUSED written = 0;
959 IADDR UNUSED pc = abuf->addr;
960 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
964 tmp_newval = FLD (f_indir_pc__dword);
966 SI opval = tmp_newval;
967 SET_H_GR (FLD (f_operand2), opval);
968 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
972 BI opval = LTSI (tmp_newval, 0);
973 CPU (h_nbit) = opval;
974 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
977 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
978 CPU (h_zbit) = opval;
979 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
986 CPU (h_xbit) = opval;
987 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
991 SET_H_INSN_PREFIXED_P (opval);
992 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1002 CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
1004 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1005 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1006 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1007 int UNUSED written = 0;
1008 IADDR UNUSED pc = abuf->addr;
1009 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1013 tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1015 SI opval = tmp_newval;
1016 SET_H_GR (FLD (f_operand2), opval);
1017 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1021 BI opval = LTSI (tmp_newval, 0);
1022 CPU (h_nbit) = opval;
1023 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1026 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1027 CPU (h_zbit) = opval;
1028 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1030 SET_H_CBIT_MOVE (0);
1031 SET_H_VBIT_MOVE (0);
1035 CPU (h_xbit) = opval;
1036 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1040 SET_H_INSN_PREFIXED_P (opval);
1041 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1051 CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
1053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1055 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1056 int UNUSED written = 0;
1057 IADDR UNUSED pc = abuf->addr;
1058 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1062 tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1064 SI opval = tmp_newval;
1065 SET_H_GR (FLD (f_operand2), opval);
1066 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1070 BI opval = LTSI (tmp_newval, 0);
1071 CPU (h_nbit) = opval;
1072 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1075 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1076 CPU (h_zbit) = opval;
1077 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1079 SET_H_CBIT_MOVE (0);
1080 SET_H_VBIT_MOVE (0);
1084 CPU (h_xbit) = opval;
1085 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1089 SET_H_INSN_PREFIXED_P (opval);
1090 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1100 CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
1102 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1103 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1104 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1105 int UNUSED written = 0;
1106 IADDR UNUSED pc = abuf->addr;
1107 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1111 tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1113 SI opval = tmp_newval;
1114 SET_H_GR (FLD (f_operand2), opval);
1115 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1119 BI opval = LTSI (tmp_newval, 0);
1120 CPU (h_nbit) = opval;
1121 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1124 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1125 CPU (h_zbit) = opval;
1126 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1128 SET_H_CBIT_MOVE (0);
1129 SET_H_VBIT_MOVE (0);
1133 CPU (h_xbit) = opval;
1134 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1138 SET_H_INSN_PREFIXED_P (opval);
1139 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1149 CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
1151 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1152 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1153 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1154 int UNUSED written = 0;
1155 IADDR UNUSED pc = abuf->addr;
1156 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1160 tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1162 SI opval = tmp_newval;
1163 SET_H_GR (FLD (f_operand2), opval);
1164 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1168 BI opval = LTSI (tmp_newval, 0);
1169 CPU (h_nbit) = opval;
1170 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1173 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1174 CPU (h_zbit) = opval;
1175 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1177 SET_H_CBIT_MOVE (0);
1178 SET_H_VBIT_MOVE (0);
1182 CPU (h_xbit) = opval;
1183 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1187 SET_H_INSN_PREFIXED_P (opval);
1188 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1198 CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
1200 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1201 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1202 #define FLD(f) abuf->fields.sfmt_addq.f
1203 int UNUSED written = 0;
1204 IADDR UNUSED pc = abuf->addr;
1205 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1212 tmp_tmpops = FLD (f_u6);
1213 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1214 tmp_carry = CPU (h_cbit);
1215 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1217 SI opval = tmp_newval;
1218 SET_H_GR (FLD (f_operand2), opval);
1219 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1223 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))));
1224 CPU (h_cbit) = opval;
1225 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1228 BI opval = LTSI (tmp_newval, 0);
1229 CPU (h_nbit) = opval;
1230 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1233 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1234 CPU (h_zbit) = opval;
1235 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1238 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)));
1239 CPU (h_vbit) = opval;
1240 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1245 CPU (h_xbit) = opval;
1246 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1250 SET_H_INSN_PREFIXED_P (opval);
1251 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1261 CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
1263 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1264 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1265 #define FLD(f) abuf->fields.sfmt_addq.f
1266 int UNUSED written = 0;
1267 IADDR UNUSED pc = abuf->addr;
1268 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1275 tmp_tmpops = FLD (f_u6);
1276 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1277 tmp_carry = CPU (h_cbit);
1278 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1280 SI opval = tmp_newval;
1281 SET_H_GR (FLD (f_operand2), opval);
1282 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1286 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))));
1287 CPU (h_cbit) = opval;
1288 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1291 BI opval = LTSI (tmp_newval, 0);
1292 CPU (h_nbit) = opval;
1293 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1296 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1297 CPU (h_zbit) = opval;
1298 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1301 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)));
1302 CPU (h_vbit) = opval;
1303 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1308 CPU (h_xbit) = opval;
1309 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1313 SET_H_INSN_PREFIXED_P (opval);
1314 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1324 CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
1326 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1327 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1328 #define FLD(f) abuf->fields.sfmt_muls_b.f
1329 int UNUSED written = 0;
1330 IADDR UNUSED pc = abuf->addr;
1331 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1338 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1339 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1340 tmp_carry = CPU (h_cbit);
1341 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1345 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))));
1346 CPU (h_cbit) = opval;
1347 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1350 BI opval = LTQI (tmp_newval, 0);
1351 CPU (h_nbit) = opval;
1352 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1355 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1356 CPU (h_zbit) = opval;
1357 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1360 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)));
1361 CPU (h_vbit) = opval;
1362 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1367 CPU (h_xbit) = opval;
1368 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1372 SET_H_INSN_PREFIXED_P (opval);
1373 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1383 CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
1385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1387 #define FLD(f) abuf->fields.sfmt_muls_b.f
1388 int UNUSED written = 0;
1389 IADDR UNUSED pc = abuf->addr;
1390 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1397 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1398 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1399 tmp_carry = CPU (h_cbit);
1400 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1404 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))));
1405 CPU (h_cbit) = opval;
1406 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1409 BI opval = LTHI (tmp_newval, 0);
1410 CPU (h_nbit) = opval;
1411 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1414 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1415 CPU (h_zbit) = opval;
1416 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1419 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)));
1420 CPU (h_vbit) = opval;
1421 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1426 CPU (h_xbit) = opval;
1427 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1431 SET_H_INSN_PREFIXED_P (opval);
1432 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1442 CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
1444 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1445 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1446 #define FLD(f) abuf->fields.sfmt_muls_b.f
1447 int UNUSED written = 0;
1448 IADDR UNUSED pc = abuf->addr;
1449 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1456 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1457 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1458 tmp_carry = CPU (h_cbit);
1459 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1463 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))));
1464 CPU (h_cbit) = opval;
1465 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1468 BI opval = LTSI (tmp_newval, 0);
1469 CPU (h_nbit) = opval;
1470 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1473 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1474 CPU (h_zbit) = opval;
1475 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1478 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)));
1479 CPU (h_vbit) = opval;
1480 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1485 CPU (h_xbit) = opval;
1486 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1490 SET_H_INSN_PREFIXED_P (opval);
1491 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1501 CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1503 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1504 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1505 #define FLD(f) abuf->fields.sfmt_addc_m.f
1506 int UNUSED written = 0;
1507 IADDR UNUSED pc = abuf->addr;
1508 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1515 tmp_tmpops = ({ SI tmp_addr;
1518 tmp_postinc = FLD (f_memmode);
1519 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1520 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1521 ; if (NEBI (tmp_postinc, 0)) {
1523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1524 tmp_addr = ADDSI (tmp_addr, 1);
1527 SI opval = tmp_addr;
1528 SET_H_GR (FLD (f_operand1), opval);
1529 written |= (1 << 9);
1530 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1535 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1536 tmp_carry = CPU (h_cbit);
1537 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1541 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))));
1542 CPU (h_cbit) = opval;
1543 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1546 BI opval = LTQI (tmp_newval, 0);
1547 CPU (h_nbit) = opval;
1548 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1551 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1552 CPU (h_zbit) = opval;
1553 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1556 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)));
1557 CPU (h_vbit) = opval;
1558 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1563 CPU (h_xbit) = opval;
1564 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1568 SET_H_INSN_PREFIXED_P (opval);
1569 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1575 abuf->written = written;
1580 CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1582 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1583 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1584 #define FLD(f) abuf->fields.sfmt_addc_m.f
1585 int UNUSED written = 0;
1586 IADDR UNUSED pc = abuf->addr;
1587 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1594 tmp_tmpops = ({ SI tmp_addr;
1597 tmp_postinc = FLD (f_memmode);
1598 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1599 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
1600 ; if (NEBI (tmp_postinc, 0)) {
1602 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1603 tmp_addr = ADDSI (tmp_addr, 2);
1606 SI opval = tmp_addr;
1607 SET_H_GR (FLD (f_operand1), opval);
1608 written |= (1 << 9);
1609 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1614 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1615 tmp_carry = CPU (h_cbit);
1616 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1620 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))));
1621 CPU (h_cbit) = opval;
1622 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1625 BI opval = LTHI (tmp_newval, 0);
1626 CPU (h_nbit) = opval;
1627 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1630 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1631 CPU (h_zbit) = opval;
1632 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1635 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)));
1636 CPU (h_vbit) = opval;
1637 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1642 CPU (h_xbit) = opval;
1643 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1647 SET_H_INSN_PREFIXED_P (opval);
1648 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1654 abuf->written = written;
1659 CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1661 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1662 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1663 #define FLD(f) abuf->fields.sfmt_addc_m.f
1664 int UNUSED written = 0;
1665 IADDR UNUSED pc = abuf->addr;
1666 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1673 tmp_tmpops = ({ SI tmp_addr;
1676 tmp_postinc = FLD (f_memmode);
1677 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1678 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
1679 ; if (NEBI (tmp_postinc, 0)) {
1681 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1682 tmp_addr = ADDSI (tmp_addr, 4);
1685 SI opval = tmp_addr;
1686 SET_H_GR (FLD (f_operand1), opval);
1687 written |= (1 << 9);
1688 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1693 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1694 tmp_carry = CPU (h_cbit);
1695 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1699 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))));
1700 CPU (h_cbit) = opval;
1701 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1704 BI opval = LTSI (tmp_newval, 0);
1705 CPU (h_nbit) = opval;
1706 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1709 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1710 CPU (h_zbit) = opval;
1711 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1714 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)));
1715 CPU (h_vbit) = opval;
1716 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1721 CPU (h_xbit) = opval;
1722 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1726 SET_H_INSN_PREFIXED_P (opval);
1727 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1733 abuf->written = written;
1738 CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
1740 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1741 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1742 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1743 int UNUSED written = 0;
1744 IADDR UNUSED pc = abuf->addr;
1745 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1752 tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
1753 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1754 tmp_carry = CPU (h_cbit);
1755 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1759 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))));
1760 CPU (h_cbit) = opval;
1761 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1764 BI opval = LTQI (tmp_newval, 0);
1765 CPU (h_nbit) = opval;
1766 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1769 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1770 CPU (h_zbit) = opval;
1771 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1774 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)));
1775 CPU (h_vbit) = opval;
1776 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1781 CPU (h_xbit) = opval;
1782 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1786 SET_H_INSN_PREFIXED_P (opval);
1787 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1797 CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
1799 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1800 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1801 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1802 int UNUSED written = 0;
1803 IADDR UNUSED pc = abuf->addr;
1804 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1811 tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
1812 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1813 tmp_carry = CPU (h_cbit);
1814 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1818 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))));
1819 CPU (h_cbit) = opval;
1820 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1823 BI opval = LTHI (tmp_newval, 0);
1824 CPU (h_nbit) = opval;
1825 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1828 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1829 CPU (h_zbit) = opval;
1830 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1833 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)));
1834 CPU (h_vbit) = opval;
1835 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1840 CPU (h_xbit) = opval;
1841 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1845 SET_H_INSN_PREFIXED_P (opval);
1846 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1856 CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
1858 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1859 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1860 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1861 int UNUSED written = 0;
1862 IADDR UNUSED pc = abuf->addr;
1863 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1870 tmp_tmpops = FLD (f_indir_pc__dword);
1871 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1872 tmp_carry = CPU (h_cbit);
1873 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1877 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))));
1878 CPU (h_cbit) = opval;
1879 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1882 BI opval = LTSI (tmp_newval, 0);
1883 CPU (h_nbit) = opval;
1884 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1887 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1888 CPU (h_zbit) = opval;
1889 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1892 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)));
1893 CPU (h_vbit) = opval;
1894 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1899 CPU (h_xbit) = opval;
1900 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1904 SET_H_INSN_PREFIXED_P (opval);
1905 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1915 CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
1917 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1918 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1919 #define FLD(f) abuf->fields.sfmt_andq.f
1920 int UNUSED written = 0;
1921 IADDR UNUSED pc = abuf->addr;
1922 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1929 tmp_tmpops = FLD (f_s6);
1930 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1931 tmp_carry = CPU (h_cbit);
1932 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1936 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))));
1937 CPU (h_cbit) = opval;
1938 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1941 BI opval = LTSI (tmp_newval, 0);
1942 CPU (h_nbit) = opval;
1943 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1946 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1947 CPU (h_zbit) = opval;
1948 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1951 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)));
1952 CPU (h_vbit) = opval;
1953 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1958 CPU (h_xbit) = opval;
1959 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1963 SET_H_INSN_PREFIXED_P (opval);
1964 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1974 CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
1976 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1977 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1978 #define FLD(f) abuf->fields.sfmt_addc_m.f
1979 int UNUSED written = 0;
1980 IADDR UNUSED pc = abuf->addr;
1981 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1988 tmp_tmpops = EXTQISI (({ SI tmp_addr;
1991 tmp_postinc = FLD (f_memmode);
1992 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1993 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1994 ; if (NEBI (tmp_postinc, 0)) {
1996 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1997 tmp_addr = ADDSI (tmp_addr, 1);
2000 SI opval = tmp_addr;
2001 SET_H_GR (FLD (f_operand1), opval);
2002 written |= (1 << 9);
2003 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2008 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2009 tmp_carry = CPU (h_cbit);
2010 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2014 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))));
2015 CPU (h_cbit) = opval;
2016 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2019 BI opval = LTSI (tmp_newval, 0);
2020 CPU (h_nbit) = opval;
2021 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2024 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2025 CPU (h_zbit) = opval;
2026 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2029 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)));
2030 CPU (h_vbit) = opval;
2031 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2036 CPU (h_xbit) = opval;
2037 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2041 SET_H_INSN_PREFIXED_P (opval);
2042 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2048 abuf->written = written;
2053 CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
2055 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2056 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2057 #define FLD(f) abuf->fields.sfmt_addc_m.f
2058 int UNUSED written = 0;
2059 IADDR UNUSED pc = abuf->addr;
2060 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2067 tmp_tmpops = EXTHISI (({ SI tmp_addr;
2070 tmp_postinc = FLD (f_memmode);
2071 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2072 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2073 ; if (NEBI (tmp_postinc, 0)) {
2075 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2076 tmp_addr = ADDSI (tmp_addr, 2);
2079 SI opval = tmp_addr;
2080 SET_H_GR (FLD (f_operand1), opval);
2081 written |= (1 << 9);
2082 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2087 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2088 tmp_carry = CPU (h_cbit);
2089 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2093 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))));
2094 CPU (h_cbit) = opval;
2095 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2098 BI opval = LTSI (tmp_newval, 0);
2099 CPU (h_nbit) = opval;
2100 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2103 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2104 CPU (h_zbit) = opval;
2105 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2108 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)));
2109 CPU (h_vbit) = opval;
2110 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2115 CPU (h_xbit) = opval;
2116 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2120 SET_H_INSN_PREFIXED_P (opval);
2121 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2127 abuf->written = written;
2132 CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
2134 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2135 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2136 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2137 int UNUSED written = 0;
2138 IADDR UNUSED pc = abuf->addr;
2139 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2146 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2147 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2148 tmp_carry = CPU (h_cbit);
2149 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2153 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))));
2154 CPU (h_cbit) = opval;
2155 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2158 BI opval = LTSI (tmp_newval, 0);
2159 CPU (h_nbit) = opval;
2160 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2163 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2164 CPU (h_zbit) = opval;
2165 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2168 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)));
2169 CPU (h_vbit) = opval;
2170 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2175 CPU (h_xbit) = opval;
2176 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2180 SET_H_INSN_PREFIXED_P (opval);
2181 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2191 CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
2193 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2194 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2195 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2196 int UNUSED written = 0;
2197 IADDR UNUSED pc = abuf->addr;
2198 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2205 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2206 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2207 tmp_carry = CPU (h_cbit);
2208 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2212 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))));
2213 CPU (h_cbit) = opval;
2214 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2217 BI opval = LTSI (tmp_newval, 0);
2218 CPU (h_nbit) = opval;
2219 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2222 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2223 CPU (h_zbit) = opval;
2224 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2227 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)));
2228 CPU (h_vbit) = opval;
2229 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2234 CPU (h_xbit) = opval;
2235 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2239 SET_H_INSN_PREFIXED_P (opval);
2240 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2250 CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2252 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2253 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2254 #define FLD(f) abuf->fields.sfmt_addc_m.f
2255 int UNUSED written = 0;
2256 IADDR UNUSED pc = abuf->addr;
2257 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2264 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
2267 tmp_postinc = FLD (f_memmode);
2268 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2269 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2270 ; if (NEBI (tmp_postinc, 0)) {
2272 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2273 tmp_addr = ADDSI (tmp_addr, 1);
2276 SI opval = tmp_addr;
2277 SET_H_GR (FLD (f_operand1), opval);
2278 written |= (1 << 9);
2279 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2284 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2285 tmp_carry = CPU (h_cbit);
2286 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2290 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))));
2291 CPU (h_cbit) = opval;
2292 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2295 BI opval = LTSI (tmp_newval, 0);
2296 CPU (h_nbit) = opval;
2297 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2300 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2301 CPU (h_zbit) = opval;
2302 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2305 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)));
2306 CPU (h_vbit) = opval;
2307 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2312 CPU (h_xbit) = opval;
2313 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2317 SET_H_INSN_PREFIXED_P (opval);
2318 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2324 abuf->written = written;
2329 CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2331 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2332 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2333 #define FLD(f) abuf->fields.sfmt_addc_m.f
2334 int UNUSED written = 0;
2335 IADDR UNUSED pc = abuf->addr;
2336 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2343 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
2346 tmp_postinc = FLD (f_memmode);
2347 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2348 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2349 ; if (NEBI (tmp_postinc, 0)) {
2351 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2352 tmp_addr = ADDSI (tmp_addr, 2);
2355 SI opval = tmp_addr;
2356 SET_H_GR (FLD (f_operand1), opval);
2357 written |= (1 << 9);
2358 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2363 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2364 tmp_carry = CPU (h_cbit);
2365 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2369 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))));
2370 CPU (h_cbit) = opval;
2371 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2374 BI opval = LTSI (tmp_newval, 0);
2375 CPU (h_nbit) = opval;
2376 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2379 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2380 CPU (h_zbit) = opval;
2381 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2384 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)));
2385 CPU (h_vbit) = opval;
2386 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2391 CPU (h_xbit) = opval;
2392 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2396 SET_H_INSN_PREFIXED_P (opval);
2397 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2403 abuf->written = written;
2408 CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
2410 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2411 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2412 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2413 int UNUSED written = 0;
2414 IADDR UNUSED pc = abuf->addr;
2415 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2422 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2423 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2424 tmp_carry = CPU (h_cbit);
2425 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2429 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))));
2430 CPU (h_cbit) = opval;
2431 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2434 BI opval = LTSI (tmp_newval, 0);
2435 CPU (h_nbit) = opval;
2436 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2439 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2440 CPU (h_zbit) = opval;
2441 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2444 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)));
2445 CPU (h_vbit) = opval;
2446 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2451 CPU (h_xbit) = opval;
2452 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2456 SET_H_INSN_PREFIXED_P (opval);
2457 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2467 CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
2469 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2470 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2471 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2472 int UNUSED written = 0;
2473 IADDR UNUSED pc = abuf->addr;
2474 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2481 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2482 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2483 tmp_carry = CPU (h_cbit);
2484 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2488 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))));
2489 CPU (h_cbit) = opval;
2490 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2493 BI opval = LTSI (tmp_newval, 0);
2494 CPU (h_nbit) = opval;
2495 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2498 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2499 CPU (h_zbit) = opval;
2500 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2503 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)));
2504 CPU (h_vbit) = opval;
2505 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2510 CPU (h_xbit) = opval;
2511 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2515 SET_H_INSN_PREFIXED_P (opval);
2516 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2526 CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
2528 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2529 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2530 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2531 int UNUSED written = 0;
2532 IADDR UNUSED pc = abuf->addr;
2533 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2537 tmp_tmp = ({ SI tmp_addr;
2540 tmp_postinc = FLD (f_memmode);
2541 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2542 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2543 ; if (NEBI (tmp_postinc, 0)) {
2545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2546 tmp_addr = ADDSI (tmp_addr, 1);
2549 SI opval = tmp_addr;
2550 SET_H_GR (FLD (f_operand1), opval);
2551 written |= (1 << 10);
2552 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2559 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2561 SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
2562 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2563 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2568 BI opval = LTQI (tmp_tmp, 0);
2569 CPU (h_nbit) = opval;
2570 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2573 BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2574 CPU (h_zbit) = opval;
2575 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2577 SET_H_CBIT_MOVE (0);
2578 SET_H_VBIT_MOVE (0);
2582 CPU (h_xbit) = opval;
2583 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2587 SET_H_INSN_PREFIXED_P (opval);
2588 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2594 abuf->written = written;
2599 CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
2601 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2602 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2603 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2604 int UNUSED written = 0;
2605 IADDR UNUSED pc = abuf->addr;
2606 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2610 tmp_tmp = ({ SI tmp_addr;
2613 tmp_postinc = FLD (f_memmode);
2614 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2615 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2616 ; if (NEBI (tmp_postinc, 0)) {
2618 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2619 tmp_addr = ADDSI (tmp_addr, 2);
2622 SI opval = tmp_addr;
2623 SET_H_GR (FLD (f_operand1), opval);
2624 written |= (1 << 10);
2625 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2632 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2634 SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
2635 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2636 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2641 BI opval = LTHI (tmp_tmp, 0);
2642 CPU (h_nbit) = opval;
2643 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2646 BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2647 CPU (h_zbit) = opval;
2648 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2650 SET_H_CBIT_MOVE (0);
2651 SET_H_VBIT_MOVE (0);
2655 CPU (h_xbit) = opval;
2656 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2660 SET_H_INSN_PREFIXED_P (opval);
2661 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2667 abuf->written = written;
2672 CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
2674 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2675 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2676 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2677 int UNUSED written = 0;
2678 IADDR UNUSED pc = abuf->addr;
2679 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2683 tmp_tmp = ({ SI tmp_addr;
2686 tmp_postinc = FLD (f_memmode);
2687 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2688 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
2689 ; if (NEBI (tmp_postinc, 0)) {
2691 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2692 tmp_addr = ADDSI (tmp_addr, 4);
2695 SI opval = tmp_addr;
2696 SET_H_GR (FLD (f_operand1), opval);
2697 written |= (1 << 9);
2698 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2705 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2706 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2710 BI opval = LTSI (tmp_tmp, 0);
2711 CPU (h_nbit) = opval;
2712 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2715 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2716 CPU (h_zbit) = opval;
2717 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2719 SET_H_CBIT_MOVE (0);
2720 SET_H_VBIT_MOVE (0);
2724 CPU (h_xbit) = opval;
2725 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2729 SET_H_INSN_PREFIXED_P (opval);
2730 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2736 abuf->written = written;
2741 CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
2743 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2744 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2745 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2746 int UNUSED written = 0;
2747 IADDR UNUSED pc = abuf->addr;
2748 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2752 tmp_tmp = EXTQISI (({ SI tmp_addr;
2755 tmp_postinc = FLD (f_memmode);
2756 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2757 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2758 ; if (NEBI (tmp_postinc, 0)) {
2760 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2761 tmp_addr = ADDSI (tmp_addr, 1);
2764 SI opval = tmp_addr;
2765 SET_H_GR (FLD (f_operand1), opval);
2766 written |= (1 << 8);
2767 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2772 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2775 SET_H_GR (FLD (f_operand1), opval);
2776 written |= (1 << 8);
2777 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2782 SET_H_GR (FLD (f_operand2), opval);
2783 written |= (1 << 7);
2784 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2789 BI opval = LTSI (tmp_tmp, 0);
2790 CPU (h_nbit) = opval;
2791 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2794 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2795 CPU (h_zbit) = opval;
2796 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2798 SET_H_CBIT_MOVE (0);
2799 SET_H_VBIT_MOVE (0);
2803 CPU (h_xbit) = opval;
2804 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2808 SET_H_INSN_PREFIXED_P (opval);
2809 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2815 abuf->written = written;
2820 CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
2822 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2823 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2824 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2825 int UNUSED written = 0;
2826 IADDR UNUSED pc = abuf->addr;
2827 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2831 tmp_tmp = EXTHISI (({ SI tmp_addr;
2834 tmp_postinc = FLD (f_memmode);
2835 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2836 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2837 ; if (NEBI (tmp_postinc, 0)) {
2839 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2840 tmp_addr = ADDSI (tmp_addr, 2);
2843 SI opval = tmp_addr;
2844 SET_H_GR (FLD (f_operand1), opval);
2845 written |= (1 << 8);
2846 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2851 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2854 SET_H_GR (FLD (f_operand1), opval);
2855 written |= (1 << 8);
2856 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2861 SET_H_GR (FLD (f_operand2), opval);
2862 written |= (1 << 7);
2863 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2868 BI opval = LTSI (tmp_tmp, 0);
2869 CPU (h_nbit) = opval;
2870 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2873 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2874 CPU (h_zbit) = opval;
2875 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2877 SET_H_CBIT_MOVE (0);
2878 SET_H_VBIT_MOVE (0);
2882 CPU (h_xbit) = opval;
2883 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2887 SET_H_INSN_PREFIXED_P (opval);
2888 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2894 abuf->written = written;
2899 CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
2901 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2902 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2903 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2904 int UNUSED written = 0;
2905 IADDR UNUSED pc = abuf->addr;
2906 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2910 tmp_tmp = ZEXTQISI (({ SI tmp_addr;
2913 tmp_postinc = FLD (f_memmode);
2914 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2915 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2916 ; if (NEBI (tmp_postinc, 0)) {
2918 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2919 tmp_addr = ADDSI (tmp_addr, 1);
2922 SI opval = tmp_addr;
2923 SET_H_GR (FLD (f_operand1), opval);
2924 written |= (1 << 8);
2925 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2930 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2933 SET_H_GR (FLD (f_operand1), opval);
2934 written |= (1 << 8);
2935 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2940 SET_H_GR (FLD (f_operand2), opval);
2941 written |= (1 << 7);
2942 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2947 BI opval = LTSI (tmp_tmp, 0);
2948 CPU (h_nbit) = opval;
2949 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2952 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2953 CPU (h_zbit) = opval;
2954 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2956 SET_H_CBIT_MOVE (0);
2957 SET_H_VBIT_MOVE (0);
2961 CPU (h_xbit) = opval;
2962 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2966 SET_H_INSN_PREFIXED_P (opval);
2967 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2973 abuf->written = written;
2978 CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
2980 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2981 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2982 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2983 int UNUSED written = 0;
2984 IADDR UNUSED pc = abuf->addr;
2985 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2989 tmp_tmp = ZEXTHISI (({ SI tmp_addr;
2992 tmp_postinc = FLD (f_memmode);
2993 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2994 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2995 ; if (NEBI (tmp_postinc, 0)) {
2997 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2998 tmp_addr = ADDSI (tmp_addr, 2);
3001 SI opval = tmp_addr;
3002 SET_H_GR (FLD (f_operand1), opval);
3003 written |= (1 << 8);
3004 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3009 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3012 SET_H_GR (FLD (f_operand1), opval);
3013 written |= (1 << 8);
3014 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3019 SET_H_GR (FLD (f_operand2), opval);
3020 written |= (1 << 7);
3021 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3026 BI opval = LTSI (tmp_tmp, 0);
3027 CPU (h_nbit) = opval;
3028 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3031 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3032 CPU (h_zbit) = opval;
3033 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3035 SET_H_CBIT_MOVE (0);
3036 SET_H_VBIT_MOVE (0);
3040 CPU (h_xbit) = opval;
3041 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3045 SET_H_INSN_PREFIXED_P (opval);
3046 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3052 abuf->written = written;
3057 CASE (sem, INSN_MOVE_R_SPRV32) : /* move ${Rs},${Pd} */
3059 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3060 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3061 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3062 int UNUSED written = 0;
3063 IADDR UNUSED pc = abuf->addr;
3064 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3069 tmp_tmp = GET_H_GR (FLD (f_operand1));
3070 tmp_rno = FLD (f_operand2);
3071 if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
3072 cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
3077 SET_H_SR (FLD (f_operand2), opval);
3078 written |= (1 << 2);
3079 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3085 CPU (h_xbit) = opval;
3086 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3090 SET_H_INSN_PREFIXED_P (opval);
3091 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3096 abuf->written = written;
3101 CASE (sem, INSN_MOVE_SPR_RV32) : /* move ${Ps},${Rd-sfield} */
3103 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3104 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3105 #define FLD(f) abuf->fields.sfmt_mcp.f
3106 int UNUSED written = 0;
3107 IADDR UNUSED pc = abuf->addr;
3108 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3114 tmp_prno = FLD (f_operand2);
3115 tmp_newval = GET_H_SR (FLD (f_operand2));
3116 if (EQSI (tmp_prno, 2)) {
3118 SI opval = tmp_newval;
3119 SET_H_GR (FLD (f_operand1), opval);
3120 written |= (1 << 4);
3121 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3124 else if (EQSI (tmp_prno, 3)) {
3127 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3129 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3130 SET_H_GR (FLD (f_operand1), opval);
3131 written |= (1 << 4);
3132 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3136 else if (EQSI (tmp_prno, 5)) {
3138 SI opval = tmp_newval;
3139 SET_H_GR (FLD (f_operand1), opval);
3140 written |= (1 << 4);
3141 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3144 else if (EQSI (tmp_prno, 6)) {
3146 SI opval = tmp_newval;
3147 SET_H_GR (FLD (f_operand1), opval);
3148 written |= (1 << 4);
3149 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3152 else if (EQSI (tmp_prno, 7)) {
3154 SI opval = tmp_newval;
3155 SET_H_GR (FLD (f_operand1), opval);
3156 written |= (1 << 4);
3157 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3160 else if (EQSI (tmp_prno, 9)) {
3162 SI opval = tmp_newval;
3163 SET_H_GR (FLD (f_operand1), opval);
3164 written |= (1 << 4);
3165 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3168 else if (EQSI (tmp_prno, 10)) {
3170 SI opval = tmp_newval;
3171 SET_H_GR (FLD (f_operand1), opval);
3172 written |= (1 << 4);
3173 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3176 else if (EQSI (tmp_prno, 11)) {
3178 SI opval = tmp_newval;
3179 SET_H_GR (FLD (f_operand1), opval);
3180 written |= (1 << 4);
3181 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3184 else if (EQSI (tmp_prno, 12)) {
3186 SI opval = tmp_newval;
3187 SET_H_GR (FLD (f_operand1), opval);
3188 written |= (1 << 4);
3189 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3192 else if (EQSI (tmp_prno, 13)) {
3194 SI opval = tmp_newval;
3195 SET_H_GR (FLD (f_operand1), opval);
3196 written |= (1 << 4);
3197 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3200 else if (EQSI (tmp_prno, 14)) {
3202 SI opval = tmp_newval;
3203 SET_H_GR (FLD (f_operand1), opval);
3204 written |= (1 << 4);
3205 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3208 else if (EQSI (tmp_prno, 15)) {
3210 SI opval = tmp_newval;
3211 SET_H_GR (FLD (f_operand1), opval);
3212 written |= (1 << 4);
3213 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3216 else if (EQSI (tmp_prno, 0)) {
3219 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3221 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3222 SET_H_GR (FLD (f_operand1), opval);
3223 written |= (1 << 4);
3224 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3228 else if (EQSI (tmp_prno, 1)) {
3231 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3233 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3234 SET_H_GR (FLD (f_operand1), opval);
3235 written |= (1 << 4);
3236 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3240 else if (EQSI (tmp_prno, 4)) {
3243 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3245 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3246 SET_H_GR (FLD (f_operand1), opval);
3247 written |= (1 << 4);
3248 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3252 else if (EQSI (tmp_prno, 8)) {
3254 SI opval = tmp_newval;
3255 SET_H_GR (FLD (f_operand1), opval);
3256 written |= (1 << 4);
3257 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3261 cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
3266 CPU (h_xbit) = opval;
3267 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3271 SET_H_INSN_PREFIXED_P (opval);
3272 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3277 abuf->written = written;
3282 CASE (sem, INSN_MOVE_M_SPRV32) : /* move [${Rs}${inc}],${Pd} */
3284 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3285 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3286 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3287 int UNUSED written = 0;
3288 IADDR UNUSED pc = abuf->addr;
3289 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3294 tmp_rno = FLD (f_operand2);
3295 if (EQSI (tmp_rno, 2)) {
3296 tmp_newval = ({ SI tmp_addr;
3299 tmp_postinc = FLD (f_memmode);
3300 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3301 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3302 ; if (NEBI (tmp_postinc, 0)) {
3304 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3305 tmp_addr = ADDSI (tmp_addr, 4);
3308 SI opval = tmp_addr;
3309 SET_H_GR (FLD (f_operand1), opval);
3310 written |= (1 << 8);
3311 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3317 else if (EQSI (tmp_rno, 3)) {
3318 tmp_newval = EXTQISI (({ SI tmp_addr;
3321 tmp_postinc = FLD (f_memmode);
3322 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3323 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
3324 ; if (NEBI (tmp_postinc, 0)) {
3326 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3327 tmp_addr = ADDSI (tmp_addr, 1);
3330 SI opval = tmp_addr;
3331 SET_H_GR (FLD (f_operand1), opval);
3332 written |= (1 << 8);
3333 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3339 else if (EQSI (tmp_rno, 5)) {
3340 tmp_newval = ({ SI tmp_addr;
3343 tmp_postinc = FLD (f_memmode);
3344 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3345 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3346 ; if (NEBI (tmp_postinc, 0)) {
3348 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3349 tmp_addr = ADDSI (tmp_addr, 4);
3352 SI opval = tmp_addr;
3353 SET_H_GR (FLD (f_operand1), opval);
3354 written |= (1 << 8);
3355 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3361 else if (EQSI (tmp_rno, 6)) {
3362 tmp_newval = ({ SI tmp_addr;
3365 tmp_postinc = FLD (f_memmode);
3366 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3367 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3368 ; if (NEBI (tmp_postinc, 0)) {
3370 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3371 tmp_addr = ADDSI (tmp_addr, 4);
3374 SI opval = tmp_addr;
3375 SET_H_GR (FLD (f_operand1), opval);
3376 written |= (1 << 8);
3377 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3383 else if (EQSI (tmp_rno, 7)) {
3384 tmp_newval = ({ SI tmp_addr;
3387 tmp_postinc = FLD (f_memmode);
3388 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3389 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3390 ; if (NEBI (tmp_postinc, 0)) {
3392 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3393 tmp_addr = ADDSI (tmp_addr, 4);
3396 SI opval = tmp_addr;
3397 SET_H_GR (FLD (f_operand1), opval);
3398 written |= (1 << 8);
3399 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3405 else if (EQSI (tmp_rno, 9)) {
3406 tmp_newval = ({ SI tmp_addr;
3409 tmp_postinc = FLD (f_memmode);
3410 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3411 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3412 ; if (NEBI (tmp_postinc, 0)) {
3414 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3415 tmp_addr = ADDSI (tmp_addr, 4);
3418 SI opval = tmp_addr;
3419 SET_H_GR (FLD (f_operand1), opval);
3420 written |= (1 << 8);
3421 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3427 else if (EQSI (tmp_rno, 10)) {
3428 tmp_newval = ({ SI tmp_addr;
3431 tmp_postinc = FLD (f_memmode);
3432 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3433 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3434 ; if (NEBI (tmp_postinc, 0)) {
3436 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3437 tmp_addr = ADDSI (tmp_addr, 4);
3440 SI opval = tmp_addr;
3441 SET_H_GR (FLD (f_operand1), opval);
3442 written |= (1 << 8);
3443 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3449 else if (EQSI (tmp_rno, 11)) {
3450 tmp_newval = ({ SI tmp_addr;
3453 tmp_postinc = FLD (f_memmode);
3454 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3455 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3456 ; if (NEBI (tmp_postinc, 0)) {
3458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3459 tmp_addr = ADDSI (tmp_addr, 4);
3462 SI opval = tmp_addr;
3463 SET_H_GR (FLD (f_operand1), opval);
3464 written |= (1 << 8);
3465 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3471 else if (EQSI (tmp_rno, 12)) {
3472 tmp_newval = ({ SI tmp_addr;
3475 tmp_postinc = FLD (f_memmode);
3476 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3477 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3478 ; if (NEBI (tmp_postinc, 0)) {
3480 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3481 tmp_addr = ADDSI (tmp_addr, 4);
3484 SI opval = tmp_addr;
3485 SET_H_GR (FLD (f_operand1), opval);
3486 written |= (1 << 8);
3487 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3493 else if (EQSI (tmp_rno, 13)) {
3494 tmp_newval = ({ SI tmp_addr;
3497 tmp_postinc = FLD (f_memmode);
3498 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3499 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3500 ; if (NEBI (tmp_postinc, 0)) {
3502 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3503 tmp_addr = ADDSI (tmp_addr, 4);
3506 SI opval = tmp_addr;
3507 SET_H_GR (FLD (f_operand1), opval);
3508 written |= (1 << 8);
3509 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3515 else if (EQSI (tmp_rno, 14)) {
3516 tmp_newval = ({ SI tmp_addr;
3519 tmp_postinc = FLD (f_memmode);
3520 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3521 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3522 ; if (NEBI (tmp_postinc, 0)) {
3524 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3525 tmp_addr = ADDSI (tmp_addr, 4);
3528 SI opval = tmp_addr;
3529 SET_H_GR (FLD (f_operand1), opval);
3530 written |= (1 << 8);
3531 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3537 else if (EQSI (tmp_rno, 15)) {
3538 tmp_newval = ({ SI tmp_addr;
3541 tmp_postinc = FLD (f_memmode);
3542 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3543 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3544 ; if (NEBI (tmp_postinc, 0)) {
3546 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3547 tmp_addr = ADDSI (tmp_addr, 4);
3550 SI opval = tmp_addr;
3551 SET_H_GR (FLD (f_operand1), opval);
3552 written |= (1 << 8);
3553 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3560 cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
3563 SI opval = tmp_newval;
3564 SET_H_SR (FLD (f_operand2), opval);
3565 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3570 CPU (h_xbit) = opval;
3571 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3575 SET_H_INSN_PREFIXED_P (opval);
3576 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3581 abuf->written = written;
3586 CASE (sem, INSN_MOVE_C_SPRV32_P2) : /* move ${const32},${Pd} */
3588 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3589 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3590 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3591 int UNUSED written = 0;
3592 IADDR UNUSED pc = abuf->addr;
3593 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3597 SI opval = FLD (f_indir_pc__dword);
3598 SET_H_SR (FLD (f_operand2), opval);
3599 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3604 CPU (h_xbit) = opval;
3605 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3609 SET_H_INSN_PREFIXED_P (opval);
3610 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3619 CASE (sem, INSN_MOVE_C_SPRV32_P3) : /* move ${const32},${Pd} */
3621 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3622 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3623 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3624 int UNUSED written = 0;
3625 IADDR UNUSED pc = abuf->addr;
3626 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3630 SI opval = FLD (f_indir_pc__dword);
3631 SET_H_SR (FLD (f_operand2), opval);
3632 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3637 CPU (h_xbit) = opval;
3638 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3642 SET_H_INSN_PREFIXED_P (opval);
3643 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3652 CASE (sem, INSN_MOVE_C_SPRV32_P5) : /* move ${const32},${Pd} */
3654 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3655 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3656 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3657 int UNUSED written = 0;
3658 IADDR UNUSED pc = abuf->addr;
3659 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3663 SI opval = FLD (f_indir_pc__dword);
3664 SET_H_SR (FLD (f_operand2), opval);
3665 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3670 CPU (h_xbit) = opval;
3671 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3675 SET_H_INSN_PREFIXED_P (opval);
3676 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3685 CASE (sem, INSN_MOVE_C_SPRV32_P6) : /* move ${const32},${Pd} */
3687 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3688 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3689 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3690 int UNUSED written = 0;
3691 IADDR UNUSED pc = abuf->addr;
3692 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3696 SI opval = FLD (f_indir_pc__dword);
3697 SET_H_SR (FLD (f_operand2), opval);
3698 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3703 CPU (h_xbit) = opval;
3704 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3708 SET_H_INSN_PREFIXED_P (opval);
3709 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3718 CASE (sem, INSN_MOVE_C_SPRV32_P7) : /* move ${const32},${Pd} */
3720 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3721 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3722 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3723 int UNUSED written = 0;
3724 IADDR UNUSED pc = abuf->addr;
3725 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3729 SI opval = FLD (f_indir_pc__dword);
3730 SET_H_SR (FLD (f_operand2), opval);
3731 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3736 CPU (h_xbit) = opval;
3737 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3741 SET_H_INSN_PREFIXED_P (opval);
3742 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3751 CASE (sem, INSN_MOVE_C_SPRV32_P9) : /* move ${const32},${Pd} */
3753 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3754 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3755 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3756 int UNUSED written = 0;
3757 IADDR UNUSED pc = abuf->addr;
3758 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3762 SI opval = FLD (f_indir_pc__dword);
3763 SET_H_SR (FLD (f_operand2), opval);
3764 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3769 CPU (h_xbit) = opval;
3770 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3774 SET_H_INSN_PREFIXED_P (opval);
3775 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3784 CASE (sem, INSN_MOVE_C_SPRV32_P10) : /* move ${const32},${Pd} */
3786 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3787 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3788 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3789 int UNUSED written = 0;
3790 IADDR UNUSED pc = abuf->addr;
3791 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3795 SI opval = FLD (f_indir_pc__dword);
3796 SET_H_SR (FLD (f_operand2), opval);
3797 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3802 CPU (h_xbit) = opval;
3803 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3807 SET_H_INSN_PREFIXED_P (opval);
3808 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3817 CASE (sem, INSN_MOVE_C_SPRV32_P11) : /* move ${const32},${Pd} */
3819 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3820 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3821 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3822 int UNUSED written = 0;
3823 IADDR UNUSED pc = abuf->addr;
3824 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3828 SI opval = FLD (f_indir_pc__dword);
3829 SET_H_SR (FLD (f_operand2), opval);
3830 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3835 CPU (h_xbit) = opval;
3836 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3840 SET_H_INSN_PREFIXED_P (opval);
3841 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3850 CASE (sem, INSN_MOVE_C_SPRV32_P12) : /* move ${const32},${Pd} */
3852 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3853 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3854 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3855 int UNUSED written = 0;
3856 IADDR UNUSED pc = abuf->addr;
3857 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3861 SI opval = FLD (f_indir_pc__dword);
3862 SET_H_SR (FLD (f_operand2), opval);
3863 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3868 CPU (h_xbit) = opval;
3869 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3873 SET_H_INSN_PREFIXED_P (opval);
3874 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3883 CASE (sem, INSN_MOVE_C_SPRV32_P13) : /* move ${const32},${Pd} */
3885 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3886 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3887 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3888 int UNUSED written = 0;
3889 IADDR UNUSED pc = abuf->addr;
3890 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3894 SI opval = FLD (f_indir_pc__dword);
3895 SET_H_SR (FLD (f_operand2), opval);
3896 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3901 CPU (h_xbit) = opval;
3902 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3906 SET_H_INSN_PREFIXED_P (opval);
3907 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3916 CASE (sem, INSN_MOVE_C_SPRV32_P14) : /* move ${const32},${Pd} */
3918 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3919 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3920 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3921 int UNUSED written = 0;
3922 IADDR UNUSED pc = abuf->addr;
3923 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3927 SI opval = FLD (f_indir_pc__dword);
3928 SET_H_SR (FLD (f_operand2), opval);
3929 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3934 CPU (h_xbit) = opval;
3935 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3939 SET_H_INSN_PREFIXED_P (opval);
3940 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3949 CASE (sem, INSN_MOVE_C_SPRV32_P15) : /* move ${const32},${Pd} */
3951 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3952 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3953 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3954 int UNUSED written = 0;
3955 IADDR UNUSED pc = abuf->addr;
3956 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3960 SI opval = FLD (f_indir_pc__dword);
3961 SET_H_SR (FLD (f_operand2), opval);
3962 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3967 CPU (h_xbit) = opval;
3968 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3972 SET_H_INSN_PREFIXED_P (opval);
3973 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3982 CASE (sem, INSN_MOVE_SPR_MV32) : /* move ${Ps},[${Rd-sfield}${inc}] */
3984 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3985 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3986 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3987 int UNUSED written = 0;
3988 IADDR UNUSED pc = abuf->addr;
3989 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3993 tmp_rno = FLD (f_operand2);
3994 if (EQSI (tmp_rno, 2)) {
3998 tmp_postinc = FLD (f_memmode);
3999 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4000 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4001 if (EQBI (CPU (h_pbit), 0)) {
4004 SI opval = GET_H_SR (FLD (f_operand2));
4005 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4006 written |= (1 << 13);
4007 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4010 BI opval = CPU (h_pbit);
4011 CPU (h_cbit) = opval;
4012 written |= (1 << 10);
4013 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4019 CPU (h_cbit) = opval;
4020 written |= (1 << 10);
4021 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4026 SI opval = GET_H_SR (FLD (f_operand2));
4027 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4028 written |= (1 << 13);
4029 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4032 if (NEBI (tmp_postinc, 0)) {
4034 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4035 tmp_addr = ADDSI (tmp_addr, 4);
4038 SI opval = tmp_addr;
4039 SET_H_GR (FLD (f_operand1), opval);
4040 written |= (1 << 9);
4041 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4047 else if (EQSI (tmp_rno, 3)) {
4051 tmp_postinc = FLD (f_memmode);
4052 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4053 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4054 if (EQBI (CPU (h_pbit), 0)) {
4057 QI opval = GET_H_SR (FLD (f_operand2));
4058 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4059 written |= (1 << 12);
4060 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4063 BI opval = CPU (h_pbit);
4064 CPU (h_cbit) = opval;
4065 written |= (1 << 10);
4066 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4072 CPU (h_cbit) = opval;
4073 written |= (1 << 10);
4074 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4079 QI opval = GET_H_SR (FLD (f_operand2));
4080 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4081 written |= (1 << 12);
4082 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4085 if (NEBI (tmp_postinc, 0)) {
4087 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4088 tmp_addr = ADDSI (tmp_addr, 1);
4091 SI opval = tmp_addr;
4092 SET_H_GR (FLD (f_operand1), opval);
4093 written |= (1 << 9);
4094 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4100 else if (EQSI (tmp_rno, 5)) {
4104 tmp_postinc = FLD (f_memmode);
4105 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4106 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4107 if (EQBI (CPU (h_pbit), 0)) {
4110 SI opval = GET_H_SR (FLD (f_operand2));
4111 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4112 written |= (1 << 13);
4113 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4116 BI opval = CPU (h_pbit);
4117 CPU (h_cbit) = opval;
4118 written |= (1 << 10);
4119 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4125 CPU (h_cbit) = opval;
4126 written |= (1 << 10);
4127 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4132 SI opval = GET_H_SR (FLD (f_operand2));
4133 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4134 written |= (1 << 13);
4135 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4138 if (NEBI (tmp_postinc, 0)) {
4140 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4141 tmp_addr = ADDSI (tmp_addr, 4);
4144 SI opval = tmp_addr;
4145 SET_H_GR (FLD (f_operand1), opval);
4146 written |= (1 << 9);
4147 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4153 else if (EQSI (tmp_rno, 6)) {
4157 tmp_postinc = FLD (f_memmode);
4158 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4159 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4160 if (EQBI (CPU (h_pbit), 0)) {
4163 SI opval = GET_H_SR (FLD (f_operand2));
4164 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4165 written |= (1 << 13);
4166 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4169 BI opval = CPU (h_pbit);
4170 CPU (h_cbit) = opval;
4171 written |= (1 << 10);
4172 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4178 CPU (h_cbit) = opval;
4179 written |= (1 << 10);
4180 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4185 SI opval = GET_H_SR (FLD (f_operand2));
4186 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4187 written |= (1 << 13);
4188 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4191 if (NEBI (tmp_postinc, 0)) {
4193 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4194 tmp_addr = ADDSI (tmp_addr, 4);
4197 SI opval = tmp_addr;
4198 SET_H_GR (FLD (f_operand1), opval);
4199 written |= (1 << 9);
4200 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4206 else if (EQSI (tmp_rno, 7)) {
4210 tmp_postinc = FLD (f_memmode);
4211 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4212 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4213 if (EQBI (CPU (h_pbit), 0)) {
4216 SI opval = GET_H_SR (FLD (f_operand2));
4217 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4218 written |= (1 << 13);
4219 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4222 BI opval = CPU (h_pbit);
4223 CPU (h_cbit) = opval;
4224 written |= (1 << 10);
4225 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4231 CPU (h_cbit) = opval;
4232 written |= (1 << 10);
4233 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4238 SI opval = GET_H_SR (FLD (f_operand2));
4239 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4240 written |= (1 << 13);
4241 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4244 if (NEBI (tmp_postinc, 0)) {
4246 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4247 tmp_addr = ADDSI (tmp_addr, 4);
4250 SI opval = tmp_addr;
4251 SET_H_GR (FLD (f_operand1), opval);
4252 written |= (1 << 9);
4253 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4259 else if (EQSI (tmp_rno, 9)) {
4263 tmp_postinc = FLD (f_memmode);
4264 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4265 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4266 if (EQBI (CPU (h_pbit), 0)) {
4269 SI opval = GET_H_SR (FLD (f_operand2));
4270 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4271 written |= (1 << 13);
4272 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4275 BI opval = CPU (h_pbit);
4276 CPU (h_cbit) = opval;
4277 written |= (1 << 10);
4278 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4284 CPU (h_cbit) = opval;
4285 written |= (1 << 10);
4286 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4291 SI opval = GET_H_SR (FLD (f_operand2));
4292 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4293 written |= (1 << 13);
4294 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4297 if (NEBI (tmp_postinc, 0)) {
4299 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4300 tmp_addr = ADDSI (tmp_addr, 4);
4303 SI opval = tmp_addr;
4304 SET_H_GR (FLD (f_operand1), opval);
4305 written |= (1 << 9);
4306 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4312 else if (EQSI (tmp_rno, 10)) {
4316 tmp_postinc = FLD (f_memmode);
4317 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4318 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4319 if (EQBI (CPU (h_pbit), 0)) {
4322 SI opval = GET_H_SR (FLD (f_operand2));
4323 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4324 written |= (1 << 13);
4325 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4328 BI opval = CPU (h_pbit);
4329 CPU (h_cbit) = opval;
4330 written |= (1 << 10);
4331 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4337 CPU (h_cbit) = opval;
4338 written |= (1 << 10);
4339 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4344 SI opval = GET_H_SR (FLD (f_operand2));
4345 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4346 written |= (1 << 13);
4347 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4350 if (NEBI (tmp_postinc, 0)) {
4352 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4353 tmp_addr = ADDSI (tmp_addr, 4);
4356 SI opval = tmp_addr;
4357 SET_H_GR (FLD (f_operand1), opval);
4358 written |= (1 << 9);
4359 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4365 else if (EQSI (tmp_rno, 11)) {
4369 tmp_postinc = FLD (f_memmode);
4370 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4371 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4372 if (EQBI (CPU (h_pbit), 0)) {
4375 SI opval = GET_H_SR (FLD (f_operand2));
4376 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4377 written |= (1 << 13);
4378 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4381 BI opval = CPU (h_pbit);
4382 CPU (h_cbit) = opval;
4383 written |= (1 << 10);
4384 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4390 CPU (h_cbit) = opval;
4391 written |= (1 << 10);
4392 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4397 SI opval = GET_H_SR (FLD (f_operand2));
4398 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4399 written |= (1 << 13);
4400 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4403 if (NEBI (tmp_postinc, 0)) {
4405 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4406 tmp_addr = ADDSI (tmp_addr, 4);
4409 SI opval = tmp_addr;
4410 SET_H_GR (FLD (f_operand1), opval);
4411 written |= (1 << 9);
4412 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4418 else if (EQSI (tmp_rno, 12)) {
4422 tmp_postinc = FLD (f_memmode);
4423 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4424 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4425 if (EQBI (CPU (h_pbit), 0)) {
4428 SI opval = GET_H_SR (FLD (f_operand2));
4429 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4430 written |= (1 << 13);
4431 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4434 BI opval = CPU (h_pbit);
4435 CPU (h_cbit) = opval;
4436 written |= (1 << 10);
4437 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4443 CPU (h_cbit) = opval;
4444 written |= (1 << 10);
4445 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4450 SI opval = GET_H_SR (FLD (f_operand2));
4451 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4452 written |= (1 << 13);
4453 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4456 if (NEBI (tmp_postinc, 0)) {
4458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4459 tmp_addr = ADDSI (tmp_addr, 4);
4462 SI opval = tmp_addr;
4463 SET_H_GR (FLD (f_operand1), opval);
4464 written |= (1 << 9);
4465 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4471 else if (EQSI (tmp_rno, 13)) {
4475 tmp_postinc = FLD (f_memmode);
4476 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4477 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4478 if (EQBI (CPU (h_pbit), 0)) {
4481 SI opval = GET_H_SR (FLD (f_operand2));
4482 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4483 written |= (1 << 13);
4484 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4487 BI opval = CPU (h_pbit);
4488 CPU (h_cbit) = opval;
4489 written |= (1 << 10);
4490 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4496 CPU (h_cbit) = opval;
4497 written |= (1 << 10);
4498 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4503 SI opval = GET_H_SR (FLD (f_operand2));
4504 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4505 written |= (1 << 13);
4506 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4509 if (NEBI (tmp_postinc, 0)) {
4511 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4512 tmp_addr = ADDSI (tmp_addr, 4);
4515 SI opval = tmp_addr;
4516 SET_H_GR (FLD (f_operand1), opval);
4517 written |= (1 << 9);
4518 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4524 else if (EQSI (tmp_rno, 14)) {
4528 tmp_postinc = FLD (f_memmode);
4529 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4530 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4531 if (EQBI (CPU (h_pbit), 0)) {
4534 SI opval = GET_H_SR (FLD (f_operand2));
4535 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4536 written |= (1 << 13);
4537 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4540 BI opval = CPU (h_pbit);
4541 CPU (h_cbit) = opval;
4542 written |= (1 << 10);
4543 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4549 CPU (h_cbit) = opval;
4550 written |= (1 << 10);
4551 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4556 SI opval = GET_H_SR (FLD (f_operand2));
4557 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4558 written |= (1 << 13);
4559 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4562 if (NEBI (tmp_postinc, 0)) {
4564 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4565 tmp_addr = ADDSI (tmp_addr, 4);
4568 SI opval = tmp_addr;
4569 SET_H_GR (FLD (f_operand1), opval);
4570 written |= (1 << 9);
4571 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4577 else if (EQSI (tmp_rno, 15)) {
4581 tmp_postinc = FLD (f_memmode);
4582 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4583 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4584 if (EQBI (CPU (h_pbit), 0)) {
4587 SI opval = GET_H_SR (FLD (f_operand2));
4588 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4589 written |= (1 << 13);
4590 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4593 BI opval = CPU (h_pbit);
4594 CPU (h_cbit) = opval;
4595 written |= (1 << 10);
4596 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4602 CPU (h_cbit) = opval;
4603 written |= (1 << 10);
4604 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4609 SI opval = GET_H_SR (FLD (f_operand2));
4610 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4611 written |= (1 << 13);
4612 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4615 if (NEBI (tmp_postinc, 0)) {
4617 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4618 tmp_addr = ADDSI (tmp_addr, 4);
4621 SI opval = tmp_addr;
4622 SET_H_GR (FLD (f_operand1), opval);
4623 written |= (1 << 9);
4624 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4630 else if (EQSI (tmp_rno, 0)) {
4634 tmp_postinc = FLD (f_memmode);
4635 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4636 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4637 if (EQBI (CPU (h_pbit), 0)) {
4640 QI opval = GET_H_SR (FLD (f_operand2));
4641 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4642 written |= (1 << 12);
4643 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4646 BI opval = CPU (h_pbit);
4647 CPU (h_cbit) = opval;
4648 written |= (1 << 10);
4649 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4655 CPU (h_cbit) = opval;
4656 written |= (1 << 10);
4657 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4662 QI opval = GET_H_SR (FLD (f_operand2));
4663 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4664 written |= (1 << 12);
4665 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4668 if (NEBI (tmp_postinc, 0)) {
4670 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4671 tmp_addr = ADDSI (tmp_addr, 1);
4674 SI opval = tmp_addr;
4675 SET_H_GR (FLD (f_operand1), opval);
4676 written |= (1 << 9);
4677 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4683 else if (EQSI (tmp_rno, 1)) {
4687 tmp_postinc = FLD (f_memmode);
4688 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4689 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4690 if (EQBI (CPU (h_pbit), 0)) {
4693 QI opval = GET_H_SR (FLD (f_operand2));
4694 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4695 written |= (1 << 12);
4696 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4699 BI opval = CPU (h_pbit);
4700 CPU (h_cbit) = opval;
4701 written |= (1 << 10);
4702 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4708 CPU (h_cbit) = opval;
4709 written |= (1 << 10);
4710 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4715 QI opval = GET_H_SR (FLD (f_operand2));
4716 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4717 written |= (1 << 12);
4718 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4721 if (NEBI (tmp_postinc, 0)) {
4723 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4724 tmp_addr = ADDSI (tmp_addr, 1);
4727 SI opval = tmp_addr;
4728 SET_H_GR (FLD (f_operand1), opval);
4729 written |= (1 << 9);
4730 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4736 else if (EQSI (tmp_rno, 4)) {
4740 tmp_postinc = FLD (f_memmode);
4741 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4742 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4743 if (EQBI (CPU (h_pbit), 0)) {
4746 HI opval = GET_H_SR (FLD (f_operand2));
4747 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4748 written |= (1 << 11);
4749 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4752 BI opval = CPU (h_pbit);
4753 CPU (h_cbit) = opval;
4754 written |= (1 << 10);
4755 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4761 CPU (h_cbit) = opval;
4762 written |= (1 << 10);
4763 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4768 HI opval = GET_H_SR (FLD (f_operand2));
4769 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4770 written |= (1 << 11);
4771 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4774 if (NEBI (tmp_postinc, 0)) {
4776 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4777 tmp_addr = ADDSI (tmp_addr, 2);
4780 SI opval = tmp_addr;
4781 SET_H_GR (FLD (f_operand1), opval);
4782 written |= (1 << 9);
4783 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4789 else if (EQSI (tmp_rno, 8)) {
4793 tmp_postinc = FLD (f_memmode);
4794 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4795 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4796 if (EQBI (CPU (h_pbit), 0)) {
4799 SI opval = GET_H_SR (FLD (f_operand2));
4800 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4801 written |= (1 << 13);
4802 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4805 BI opval = CPU (h_pbit);
4806 CPU (h_cbit) = opval;
4807 written |= (1 << 10);
4808 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4814 CPU (h_cbit) = opval;
4815 written |= (1 << 10);
4816 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4821 SI opval = GET_H_SR (FLD (f_operand2));
4822 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4823 written |= (1 << 13);
4824 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4827 if (NEBI (tmp_postinc, 0)) {
4829 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4830 tmp_addr = ADDSI (tmp_addr, 4);
4833 SI opval = tmp_addr;
4834 SET_H_GR (FLD (f_operand1), opval);
4835 written |= (1 << 9);
4836 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4843 cgen_rtx_error (current_cpu, "write from unimplemented special register");
4848 CPU (h_xbit) = opval;
4849 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4853 SET_H_INSN_PREFIXED_P (opval);
4854 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4859 abuf->written = written;
4864 CASE (sem, INSN_MOVE_SS_R) : /* move ${Ss},${Rd-sfield} */
4866 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4867 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4868 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4869 int UNUSED written = 0;
4870 IADDR UNUSED pc = abuf->addr;
4871 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4875 SI opval = GET_H_SUPR (FLD (f_operand2));
4876 SET_H_GR (FLD (f_operand1), opval);
4877 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4882 CPU (h_xbit) = opval;
4883 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4887 SET_H_INSN_PREFIXED_P (opval);
4888 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4897 CASE (sem, INSN_MOVE_R_SS) : /* move ${Rs},${Sd} */
4899 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4900 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4901 #define FLD(f) abuf->fields.sfmt_mcp.f
4902 int UNUSED written = 0;
4903 IADDR UNUSED pc = abuf->addr;
4904 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4908 SI opval = GET_H_GR (FLD (f_operand1));
4909 SET_H_SUPR (FLD (f_operand2), opval);
4910 TRACE_RESULT (current_cpu, abuf, "supr", 'x', opval);
4915 CPU (h_xbit) = opval;
4916 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4920 SET_H_INSN_PREFIXED_P (opval);
4921 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4930 CASE (sem, INSN_MOVEM_R_M_V32) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4932 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4933 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4934 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
4935 int UNUSED written = 0;
4936 IADDR UNUSED pc = abuf->addr;
4937 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4942 tmp_postinc = FLD (f_memmode);
4945 tmp_dummy = GET_H_GR (FLD (f_operand2));
4947 tmp_addr = GET_H_GR (FLD (f_operand1));
4949 if (GESI (FLD (f_operand2), 0)) {
4952 tmp_tmp = GET_H_GR (((UINT) 0));
4955 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4956 written |= (1 << 21);
4957 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4959 tmp_addr = ADDSI (tmp_addr, 4);
4962 if (GESI (FLD (f_operand2), 1)) {
4965 tmp_tmp = GET_H_GR (((UINT) 1));
4968 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4969 written |= (1 << 21);
4970 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4972 tmp_addr = ADDSI (tmp_addr, 4);
4975 if (GESI (FLD (f_operand2), 2)) {
4978 tmp_tmp = GET_H_GR (((UINT) 2));
4981 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4982 written |= (1 << 21);
4983 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4985 tmp_addr = ADDSI (tmp_addr, 4);
4988 if (GESI (FLD (f_operand2), 3)) {
4991 tmp_tmp = GET_H_GR (((UINT) 3));
4994 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4995 written |= (1 << 21);
4996 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4998 tmp_addr = ADDSI (tmp_addr, 4);
5001 if (GESI (FLD (f_operand2), 4)) {
5004 tmp_tmp = GET_H_GR (((UINT) 4));
5007 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5008 written |= (1 << 21);
5009 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5011 tmp_addr = ADDSI (tmp_addr, 4);
5014 if (GESI (FLD (f_operand2), 5)) {
5017 tmp_tmp = GET_H_GR (((UINT) 5));
5020 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5021 written |= (1 << 21);
5022 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5024 tmp_addr = ADDSI (tmp_addr, 4);
5027 if (GESI (FLD (f_operand2), 6)) {
5030 tmp_tmp = GET_H_GR (((UINT) 6));
5033 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5034 written |= (1 << 21);
5035 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5037 tmp_addr = ADDSI (tmp_addr, 4);
5040 if (GESI (FLD (f_operand2), 7)) {
5043 tmp_tmp = GET_H_GR (((UINT) 7));
5046 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5047 written |= (1 << 21);
5048 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5050 tmp_addr = ADDSI (tmp_addr, 4);
5053 if (GESI (FLD (f_operand2), 8)) {
5056 tmp_tmp = GET_H_GR (((UINT) 8));
5059 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5060 written |= (1 << 21);
5061 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5063 tmp_addr = ADDSI (tmp_addr, 4);
5066 if (GESI (FLD (f_operand2), 9)) {
5069 tmp_tmp = GET_H_GR (((UINT) 9));
5072 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5073 written |= (1 << 21);
5074 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5076 tmp_addr = ADDSI (tmp_addr, 4);
5079 if (GESI (FLD (f_operand2), 10)) {
5082 tmp_tmp = GET_H_GR (((UINT) 10));
5085 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5086 written |= (1 << 21);
5087 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5089 tmp_addr = ADDSI (tmp_addr, 4);
5092 if (GESI (FLD (f_operand2), 11)) {
5095 tmp_tmp = GET_H_GR (((UINT) 11));
5098 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5099 written |= (1 << 21);
5100 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5102 tmp_addr = ADDSI (tmp_addr, 4);
5105 if (GESI (FLD (f_operand2), 12)) {
5108 tmp_tmp = GET_H_GR (((UINT) 12));
5111 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5112 written |= (1 << 21);
5113 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5115 tmp_addr = ADDSI (tmp_addr, 4);
5118 if (GESI (FLD (f_operand2), 13)) {
5121 tmp_tmp = GET_H_GR (((UINT) 13));
5124 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5125 written |= (1 << 21);
5126 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5128 tmp_addr = ADDSI (tmp_addr, 4);
5131 if (GESI (FLD (f_operand2), 14)) {
5134 tmp_tmp = GET_H_GR (((UINT) 14));
5137 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5138 written |= (1 << 21);
5139 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5141 tmp_addr = ADDSI (tmp_addr, 4);
5144 if (GESI (FLD (f_operand2), 15)) {
5147 tmp_tmp = GET_H_GR (((UINT) 15));
5150 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5151 written |= (1 << 21);
5152 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5154 tmp_addr = ADDSI (tmp_addr, 4);
5158 if (NEBI (tmp_postinc, 0)) {
5160 SI opval = tmp_addr;
5161 SET_H_GR (FLD (f_operand1), opval);
5162 written |= (1 << 20);
5163 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5169 CPU (h_xbit) = opval;
5170 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5174 SET_H_INSN_PREFIXED_P (opval);
5175 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5180 abuf->written = written;
5185 CASE (sem, INSN_MOVEM_M_R_V32) : /* movem [${Rs}${inc}],${Rd} */
5187 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5188 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5189 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5190 int UNUSED written = 0;
5191 IADDR UNUSED pc = abuf->addr;
5192 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5197 tmp_postinc = FLD (f_memmode);
5198 tmp_addr = GET_H_GR (FLD (f_operand1));
5201 tmp_dummy = GET_H_GR (FLD (f_operand2));
5204 if (GESI (FLD (f_operand2), 0)) {
5207 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5210 SET_H_GR (((UINT) 0), opval);
5211 written |= (1 << 6);
5212 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5214 tmp_addr = ADDSI (tmp_addr, 4);
5217 if (GESI (FLD (f_operand2), 1)) {
5220 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5223 SET_H_GR (((UINT) 1), opval);
5224 written |= (1 << 7);
5225 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5227 tmp_addr = ADDSI (tmp_addr, 4);
5230 if (GESI (FLD (f_operand2), 2)) {
5233 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5236 SET_H_GR (((UINT) 2), opval);
5237 written |= (1 << 14);
5238 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5240 tmp_addr = ADDSI (tmp_addr, 4);
5243 if (GESI (FLD (f_operand2), 3)) {
5246 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5249 SET_H_GR (((UINT) 3), opval);
5250 written |= (1 << 15);
5251 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5253 tmp_addr = ADDSI (tmp_addr, 4);
5256 if (GESI (FLD (f_operand2), 4)) {
5259 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5262 SET_H_GR (((UINT) 4), opval);
5263 written |= (1 << 16);
5264 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5266 tmp_addr = ADDSI (tmp_addr, 4);
5269 if (GESI (FLD (f_operand2), 5)) {
5272 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5275 SET_H_GR (((UINT) 5), opval);
5276 written |= (1 << 17);
5277 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5279 tmp_addr = ADDSI (tmp_addr, 4);
5282 if (GESI (FLD (f_operand2), 6)) {
5285 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5288 SET_H_GR (((UINT) 6), opval);
5289 written |= (1 << 18);
5290 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5292 tmp_addr = ADDSI (tmp_addr, 4);
5295 if (GESI (FLD (f_operand2), 7)) {
5298 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5301 SET_H_GR (((UINT) 7), opval);
5302 written |= (1 << 19);
5303 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5305 tmp_addr = ADDSI (tmp_addr, 4);
5308 if (GESI (FLD (f_operand2), 8)) {
5311 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5314 SET_H_GR (((UINT) 8), opval);
5315 written |= (1 << 20);
5316 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5318 tmp_addr = ADDSI (tmp_addr, 4);
5321 if (GESI (FLD (f_operand2), 9)) {
5324 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5327 SET_H_GR (((UINT) 9), opval);
5328 written |= (1 << 21);
5329 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5331 tmp_addr = ADDSI (tmp_addr, 4);
5334 if (GESI (FLD (f_operand2), 10)) {
5337 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5340 SET_H_GR (((UINT) 10), opval);
5341 written |= (1 << 8);
5342 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5344 tmp_addr = ADDSI (tmp_addr, 4);
5347 if (GESI (FLD (f_operand2), 11)) {
5350 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5353 SET_H_GR (((UINT) 11), opval);
5354 written |= (1 << 9);
5355 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5357 tmp_addr = ADDSI (tmp_addr, 4);
5360 if (GESI (FLD (f_operand2), 12)) {
5363 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5366 SET_H_GR (((UINT) 12), opval);
5367 written |= (1 << 10);
5368 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5370 tmp_addr = ADDSI (tmp_addr, 4);
5373 if (GESI (FLD (f_operand2), 13)) {
5376 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5379 SET_H_GR (((UINT) 13), opval);
5380 written |= (1 << 11);
5381 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5383 tmp_addr = ADDSI (tmp_addr, 4);
5386 if (GESI (FLD (f_operand2), 14)) {
5389 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5392 SET_H_GR (((UINT) 14), opval);
5393 written |= (1 << 12);
5394 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5396 tmp_addr = ADDSI (tmp_addr, 4);
5399 if (GESI (FLD (f_operand2), 15)) {
5402 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5405 SET_H_GR (((UINT) 15), opval);
5406 written |= (1 << 13);
5407 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5409 tmp_addr = ADDSI (tmp_addr, 4);
5413 if (NEBI (tmp_postinc, 0)) {
5415 SI opval = tmp_addr;
5416 SET_H_GR (FLD (f_operand1), opval);
5417 written |= (1 << 5);
5418 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5424 CPU (h_xbit) = opval;
5425 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5429 SET_H_INSN_PREFIXED_P (opval);
5430 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5435 abuf->written = written;
5440 CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
5442 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5443 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5444 #define FLD(f) abuf->fields.sfmt_addc_m.f
5445 int UNUSED written = 0;
5446 IADDR UNUSED pc = abuf->addr;
5447 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5454 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5455 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5456 tmp_carry = CPU (h_cbit);
5457 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5460 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5462 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5463 SET_H_GR (FLD (f_operand2), opval);
5464 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5469 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))));
5470 CPU (h_cbit) = opval;
5471 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5474 BI opval = LTQI (tmp_newval, 0);
5475 CPU (h_nbit) = opval;
5476 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5479 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5480 CPU (h_zbit) = opval;
5481 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5484 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)));
5485 CPU (h_vbit) = opval;
5486 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5491 CPU (h_xbit) = opval;
5492 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5496 SET_H_INSN_PREFIXED_P (opval);
5497 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5507 CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
5509 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5510 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5511 #define FLD(f) abuf->fields.sfmt_addc_m.f
5512 int UNUSED written = 0;
5513 IADDR UNUSED pc = abuf->addr;
5514 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5521 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5522 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5523 tmp_carry = CPU (h_cbit);
5524 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5527 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5529 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5530 SET_H_GR (FLD (f_operand2), opval);
5531 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5536 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))));
5537 CPU (h_cbit) = opval;
5538 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5541 BI opval = LTHI (tmp_newval, 0);
5542 CPU (h_nbit) = opval;
5543 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5546 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5547 CPU (h_zbit) = opval;
5548 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5551 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)));
5552 CPU (h_vbit) = opval;
5553 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5558 CPU (h_xbit) = opval;
5559 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5563 SET_H_INSN_PREFIXED_P (opval);
5564 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5574 CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
5576 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5577 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5578 #define FLD(f) abuf->fields.sfmt_addc_m.f
5579 int UNUSED written = 0;
5580 IADDR UNUSED pc = abuf->addr;
5581 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5588 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5589 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5590 tmp_carry = CPU (h_cbit);
5591 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5593 SI opval = tmp_newval;
5594 SET_H_GR (FLD (f_operand2), opval);
5595 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5599 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))));
5600 CPU (h_cbit) = opval;
5601 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5604 BI opval = LTSI (tmp_newval, 0);
5605 CPU (h_nbit) = opval;
5606 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5609 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5610 CPU (h_zbit) = opval;
5611 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5614 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)));
5615 CPU (h_vbit) = opval;
5616 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5621 CPU (h_xbit) = opval;
5622 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5626 SET_H_INSN_PREFIXED_P (opval);
5627 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5637 CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
5639 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5640 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5641 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5642 int UNUSED written = 0;
5643 IADDR UNUSED pc = abuf->addr;
5644 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5651 tmp_tmpops = ({ SI tmp_addr;
5654 tmp_postinc = FLD (f_memmode);
5655 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5656 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
5657 ; if (NEBI (tmp_postinc, 0)) {
5659 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5660 tmp_addr = ADDSI (tmp_addr, 1);
5663 SI opval = tmp_addr;
5664 SET_H_GR (FLD (f_operand1), opval);
5665 written |= (1 << 12);
5666 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5671 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5672 tmp_carry = CPU (h_cbit);
5673 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5676 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5678 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5679 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5680 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5685 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))));
5686 CPU (h_cbit) = opval;
5687 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5690 BI opval = LTQI (tmp_newval, 0);
5691 CPU (h_nbit) = opval;
5692 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5695 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5696 CPU (h_zbit) = opval;
5697 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5700 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)));
5701 CPU (h_vbit) = opval;
5702 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5707 CPU (h_xbit) = opval;
5708 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5712 SET_H_INSN_PREFIXED_P (opval);
5713 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5719 abuf->written = written;
5724 CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
5726 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5727 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5728 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5729 int UNUSED written = 0;
5730 IADDR UNUSED pc = abuf->addr;
5731 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5738 tmp_tmpops = ({ SI tmp_addr;
5741 tmp_postinc = FLD (f_memmode);
5742 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5743 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
5744 ; if (NEBI (tmp_postinc, 0)) {
5746 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5747 tmp_addr = ADDSI (tmp_addr, 2);
5750 SI opval = tmp_addr;
5751 SET_H_GR (FLD (f_operand1), opval);
5752 written |= (1 << 12);
5753 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5758 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5759 tmp_carry = CPU (h_cbit);
5760 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5763 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5765 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5766 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5767 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5772 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))));
5773 CPU (h_cbit) = opval;
5774 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5777 BI opval = LTHI (tmp_newval, 0);
5778 CPU (h_nbit) = opval;
5779 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5782 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5783 CPU (h_zbit) = opval;
5784 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5787 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)));
5788 CPU (h_vbit) = opval;
5789 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5794 CPU (h_xbit) = opval;
5795 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5799 SET_H_INSN_PREFIXED_P (opval);
5800 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5806 abuf->written = written;
5811 CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
5813 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5814 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5815 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5816 int UNUSED written = 0;
5817 IADDR UNUSED pc = abuf->addr;
5818 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5825 tmp_tmpops = ({ SI tmp_addr;
5828 tmp_postinc = FLD (f_memmode);
5829 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5830 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
5831 ; if (NEBI (tmp_postinc, 0)) {
5833 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5834 tmp_addr = ADDSI (tmp_addr, 4);
5837 SI opval = tmp_addr;
5838 SET_H_GR (FLD (f_operand1), opval);
5839 written |= (1 << 11);
5840 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5845 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5846 tmp_carry = CPU (h_cbit);
5847 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5849 SI opval = tmp_newval;
5850 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5851 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5855 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))));
5856 CPU (h_cbit) = opval;
5857 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5860 BI opval = LTSI (tmp_newval, 0);
5861 CPU (h_nbit) = opval;
5862 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5865 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5866 CPU (h_zbit) = opval;
5867 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5870 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)));
5871 CPU (h_vbit) = opval;
5872 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5877 CPU (h_xbit) = opval;
5878 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5882 SET_H_INSN_PREFIXED_P (opval);
5883 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5889 abuf->written = written;
5894 CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
5896 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5897 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5898 #define FLD(f) abuf->fields.sfmt_addcbr.f
5899 int UNUSED written = 0;
5900 IADDR UNUSED pc = abuf->addr;
5901 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5908 tmp_tmpops = FLD (f_indir_pc__byte);
5909 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5910 tmp_carry = CPU (h_cbit);
5911 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5914 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5916 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5917 SET_H_GR (FLD (f_operand2), opval);
5918 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5923 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))));
5924 CPU (h_cbit) = opval;
5925 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5928 BI opval = LTQI (tmp_newval, 0);
5929 CPU (h_nbit) = opval;
5930 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5933 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5934 CPU (h_zbit) = opval;
5935 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5938 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)));
5939 CPU (h_vbit) = opval;
5940 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5945 CPU (h_xbit) = opval;
5946 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5950 SET_H_INSN_PREFIXED_P (opval);
5951 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5961 CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
5963 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5964 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5965 #define FLD(f) abuf->fields.sfmt_addcwr.f
5966 int UNUSED written = 0;
5967 IADDR UNUSED pc = abuf->addr;
5968 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5975 tmp_tmpops = FLD (f_indir_pc__word);
5976 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5977 tmp_carry = CPU (h_cbit);
5978 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5981 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5983 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5984 SET_H_GR (FLD (f_operand2), opval);
5985 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5990 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))));
5991 CPU (h_cbit) = opval;
5992 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5995 BI opval = LTHI (tmp_newval, 0);
5996 CPU (h_nbit) = opval;
5997 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6000 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6001 CPU (h_zbit) = opval;
6002 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6005 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)));
6006 CPU (h_vbit) = opval;
6007 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6012 CPU (h_xbit) = opval;
6013 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6017 SET_H_INSN_PREFIXED_P (opval);
6018 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6028 CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
6030 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6031 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6032 #define FLD(f) abuf->fields.sfmt_addcdr.f
6033 int UNUSED written = 0;
6034 IADDR UNUSED pc = abuf->addr;
6035 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
6042 tmp_tmpops = FLD (f_indir_pc__dword);
6043 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6044 tmp_carry = CPU (h_cbit);
6045 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6047 SI opval = tmp_newval;
6048 SET_H_GR (FLD (f_operand2), opval);
6049 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6053 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))));
6054 CPU (h_cbit) = opval;
6055 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6058 BI opval = LTSI (tmp_newval, 0);
6059 CPU (h_nbit) = opval;
6060 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6063 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6064 CPU (h_zbit) = opval;
6065 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6068 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)));
6069 CPU (h_vbit) = opval;
6070 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6075 CPU (h_xbit) = opval;
6076 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6080 SET_H_INSN_PREFIXED_P (opval);
6081 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6091 CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
6093 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6094 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6095 #define FLD(f) abuf->fields.sfmt_addc_m.f
6096 int UNUSED written = 0;
6097 IADDR UNUSED pc = abuf->addr;
6098 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6105 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6106 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6107 tmp_carry = CPU (h_cbit);
6108 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6110 SI opval = tmp_newval;
6111 SET_H_GR (FLD (f_operand2), opval);
6112 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6116 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))));
6117 CPU (h_cbit) = opval;
6118 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6121 BI opval = LTSI (tmp_newval, 0);
6122 CPU (h_nbit) = opval;
6123 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6126 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6127 CPU (h_zbit) = opval;
6128 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6131 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)));
6132 CPU (h_vbit) = opval;
6133 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6138 CPU (h_xbit) = opval;
6139 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6143 SET_H_INSN_PREFIXED_P (opval);
6144 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6154 CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
6156 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6157 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6158 #define FLD(f) abuf->fields.sfmt_addc_m.f
6159 int UNUSED written = 0;
6160 IADDR UNUSED pc = abuf->addr;
6161 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6168 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6169 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6170 tmp_carry = CPU (h_cbit);
6171 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6173 SI opval = tmp_newval;
6174 SET_H_GR (FLD (f_operand2), opval);
6175 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6179 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))));
6180 CPU (h_cbit) = opval;
6181 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6184 BI opval = LTSI (tmp_newval, 0);
6185 CPU (h_nbit) = opval;
6186 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6189 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6190 CPU (h_zbit) = opval;
6191 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6194 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)));
6195 CPU (h_vbit) = opval;
6196 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6201 CPU (h_xbit) = opval;
6202 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6206 SET_H_INSN_PREFIXED_P (opval);
6207 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6217 CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
6219 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6220 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6221 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6222 int UNUSED written = 0;
6223 IADDR UNUSED pc = abuf->addr;
6224 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6231 tmp_tmpops = EXTQISI (({ SI tmp_addr;
6234 tmp_postinc = FLD (f_memmode);
6235 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6236 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6237 ; if (NEBI (tmp_postinc, 0)) {
6239 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6240 tmp_addr = ADDSI (tmp_addr, 1);
6243 SI opval = tmp_addr;
6244 SET_H_GR (FLD (f_operand1), opval);
6245 written |= (1 << 11);
6246 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6251 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6252 tmp_carry = CPU (h_cbit);
6253 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6255 SI opval = tmp_newval;
6256 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6257 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6261 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))));
6262 CPU (h_cbit) = opval;
6263 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6266 BI opval = LTSI (tmp_newval, 0);
6267 CPU (h_nbit) = opval;
6268 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6271 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6272 CPU (h_zbit) = opval;
6273 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6276 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)));
6277 CPU (h_vbit) = opval;
6278 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6283 CPU (h_xbit) = opval;
6284 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6288 SET_H_INSN_PREFIXED_P (opval);
6289 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6295 abuf->written = written;
6300 CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
6302 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6303 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6304 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6305 int UNUSED written = 0;
6306 IADDR UNUSED pc = abuf->addr;
6307 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6314 tmp_tmpops = EXTHISI (({ SI tmp_addr;
6317 tmp_postinc = FLD (f_memmode);
6318 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6319 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6320 ; if (NEBI (tmp_postinc, 0)) {
6322 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6323 tmp_addr = ADDSI (tmp_addr, 2);
6326 SI opval = tmp_addr;
6327 SET_H_GR (FLD (f_operand1), opval);
6328 written |= (1 << 11);
6329 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6334 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6335 tmp_carry = CPU (h_cbit);
6336 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6338 SI opval = tmp_newval;
6339 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6340 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6344 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))));
6345 CPU (h_cbit) = opval;
6346 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6349 BI opval = LTSI (tmp_newval, 0);
6350 CPU (h_nbit) = opval;
6351 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6354 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6355 CPU (h_zbit) = opval;
6356 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6359 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)));
6360 CPU (h_vbit) = opval;
6361 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6366 CPU (h_xbit) = opval;
6367 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6371 SET_H_INSN_PREFIXED_P (opval);
6372 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6378 abuf->written = written;
6383 CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
6385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6387 #define FLD(f) abuf->fields.sfmt_addcbr.f
6388 int UNUSED written = 0;
6389 IADDR UNUSED pc = abuf->addr;
6390 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6397 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6398 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6399 tmp_carry = CPU (h_cbit);
6400 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6402 SI opval = tmp_newval;
6403 SET_H_GR (FLD (f_operand2), opval);
6404 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6408 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))));
6409 CPU (h_cbit) = opval;
6410 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6413 BI opval = LTSI (tmp_newval, 0);
6414 CPU (h_nbit) = opval;
6415 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6418 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6419 CPU (h_zbit) = opval;
6420 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6423 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)));
6424 CPU (h_vbit) = opval;
6425 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6430 CPU (h_xbit) = opval;
6431 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6435 SET_H_INSN_PREFIXED_P (opval);
6436 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6446 CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
6448 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6449 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6450 #define FLD(f) abuf->fields.sfmt_addcwr.f
6451 int UNUSED written = 0;
6452 IADDR UNUSED pc = abuf->addr;
6453 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6460 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6461 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6462 tmp_carry = CPU (h_cbit);
6463 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6465 SI opval = tmp_newval;
6466 SET_H_GR (FLD (f_operand2), opval);
6467 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6471 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))));
6472 CPU (h_cbit) = opval;
6473 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6476 BI opval = LTSI (tmp_newval, 0);
6477 CPU (h_nbit) = opval;
6478 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6481 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6482 CPU (h_zbit) = opval;
6483 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6486 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)));
6487 CPU (h_vbit) = opval;
6488 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6493 CPU (h_xbit) = opval;
6494 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6498 SET_H_INSN_PREFIXED_P (opval);
6499 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6509 CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
6511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6513 #define FLD(f) abuf->fields.sfmt_addc_m.f
6514 int UNUSED written = 0;
6515 IADDR UNUSED pc = abuf->addr;
6516 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6523 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6524 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6525 tmp_carry = CPU (h_cbit);
6526 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6528 SI opval = tmp_newval;
6529 SET_H_GR (FLD (f_operand2), opval);
6530 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6534 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))));
6535 CPU (h_cbit) = opval;
6536 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6539 BI opval = LTSI (tmp_newval, 0);
6540 CPU (h_nbit) = opval;
6541 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6544 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6545 CPU (h_zbit) = opval;
6546 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6549 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)));
6550 CPU (h_vbit) = opval;
6551 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6556 CPU (h_xbit) = opval;
6557 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6561 SET_H_INSN_PREFIXED_P (opval);
6562 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6572 CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
6574 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6575 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6576 #define FLD(f) abuf->fields.sfmt_addc_m.f
6577 int UNUSED written = 0;
6578 IADDR UNUSED pc = abuf->addr;
6579 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6586 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6587 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6588 tmp_carry = CPU (h_cbit);
6589 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6591 SI opval = tmp_newval;
6592 SET_H_GR (FLD (f_operand2), opval);
6593 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6597 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))));
6598 CPU (h_cbit) = opval;
6599 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6602 BI opval = LTSI (tmp_newval, 0);
6603 CPU (h_nbit) = opval;
6604 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6607 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6608 CPU (h_zbit) = opval;
6609 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6612 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)));
6613 CPU (h_vbit) = opval;
6614 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6619 CPU (h_xbit) = opval;
6620 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6624 SET_H_INSN_PREFIXED_P (opval);
6625 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6635 CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
6637 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6638 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6639 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6640 int UNUSED written = 0;
6641 IADDR UNUSED pc = abuf->addr;
6642 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6649 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
6652 tmp_postinc = FLD (f_memmode);
6653 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6654 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6655 ; if (NEBI (tmp_postinc, 0)) {
6657 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6658 tmp_addr = ADDSI (tmp_addr, 1);
6661 SI opval = tmp_addr;
6662 SET_H_GR (FLD (f_operand1), opval);
6663 written |= (1 << 11);
6664 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6669 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6670 tmp_carry = CPU (h_cbit);
6671 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6673 SI opval = tmp_newval;
6674 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6675 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6679 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))));
6680 CPU (h_cbit) = opval;
6681 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6684 BI opval = LTSI (tmp_newval, 0);
6685 CPU (h_nbit) = opval;
6686 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6689 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6690 CPU (h_zbit) = opval;
6691 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6694 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)));
6695 CPU (h_vbit) = opval;
6696 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6701 CPU (h_xbit) = opval;
6702 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6706 SET_H_INSN_PREFIXED_P (opval);
6707 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6713 abuf->written = written;
6718 CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
6720 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6721 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6722 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6723 int UNUSED written = 0;
6724 IADDR UNUSED pc = abuf->addr;
6725 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6732 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
6735 tmp_postinc = FLD (f_memmode);
6736 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6737 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6738 ; if (NEBI (tmp_postinc, 0)) {
6740 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6741 tmp_addr = ADDSI (tmp_addr, 2);
6744 SI opval = tmp_addr;
6745 SET_H_GR (FLD (f_operand1), opval);
6746 written |= (1 << 11);
6747 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6752 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6753 tmp_carry = CPU (h_cbit);
6754 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6756 SI opval = tmp_newval;
6757 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6758 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6762 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))));
6763 CPU (h_cbit) = opval;
6764 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6767 BI opval = LTSI (tmp_newval, 0);
6768 CPU (h_nbit) = opval;
6769 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6772 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6773 CPU (h_zbit) = opval;
6774 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6777 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)));
6778 CPU (h_vbit) = opval;
6779 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6784 CPU (h_xbit) = opval;
6785 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6789 SET_H_INSN_PREFIXED_P (opval);
6790 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6796 abuf->written = written;
6801 CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
6803 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6804 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6805 #define FLD(f) abuf->fields.sfmt_addcbr.f
6806 int UNUSED written = 0;
6807 IADDR UNUSED pc = abuf->addr;
6808 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6815 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6816 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6817 tmp_carry = CPU (h_cbit);
6818 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6820 SI opval = tmp_newval;
6821 SET_H_GR (FLD (f_operand2), opval);
6822 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6826 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))));
6827 CPU (h_cbit) = opval;
6828 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6831 BI opval = LTSI (tmp_newval, 0);
6832 CPU (h_nbit) = opval;
6833 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6836 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6837 CPU (h_zbit) = opval;
6838 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6841 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)));
6842 CPU (h_vbit) = opval;
6843 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6848 CPU (h_xbit) = opval;
6849 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6853 SET_H_INSN_PREFIXED_P (opval);
6854 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6864 CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
6866 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6867 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6868 #define FLD(f) abuf->fields.sfmt_addcwr.f
6869 int UNUSED written = 0;
6870 IADDR UNUSED pc = abuf->addr;
6871 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6878 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6879 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6880 tmp_carry = CPU (h_cbit);
6881 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6883 SI opval = tmp_newval;
6884 SET_H_GR (FLD (f_operand2), opval);
6885 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6889 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))));
6890 CPU (h_cbit) = opval;
6891 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6894 BI opval = LTSI (tmp_newval, 0);
6895 CPU (h_nbit) = opval;
6896 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6899 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6900 CPU (h_zbit) = opval;
6901 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6904 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)));
6905 CPU (h_vbit) = opval;
6906 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6911 CPU (h_xbit) = opval;
6912 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6916 SET_H_INSN_PREFIXED_P (opval);
6917 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6927 CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
6929 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6930 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6931 #define FLD(f) abuf->fields.sfmt_addc_m.f
6932 int UNUSED written = 0;
6933 IADDR UNUSED pc = abuf->addr;
6934 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6941 tmp_tmpops = GET_H_GR (FLD (f_operand1));
6942 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6943 tmp_carry = CPU (h_cbit);
6944 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6947 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
6949 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
6950 SET_H_GR (FLD (f_operand2), opval);
6951 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6956 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))));
6957 CPU (h_cbit) = opval;
6958 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6961 BI opval = LTQI (tmp_newval, 0);
6962 CPU (h_nbit) = opval;
6963 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6966 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6967 CPU (h_zbit) = opval;
6968 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6971 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)));
6972 CPU (h_vbit) = opval;
6973 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6978 CPU (h_xbit) = opval;
6979 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6983 SET_H_INSN_PREFIXED_P (opval);
6984 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6994 CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
6996 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6997 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6998 #define FLD(f) abuf->fields.sfmt_addc_m.f
6999 int UNUSED written = 0;
7000 IADDR UNUSED pc = abuf->addr;
7001 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7008 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7009 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7010 tmp_carry = CPU (h_cbit);
7011 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7014 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7016 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7017 SET_H_GR (FLD (f_operand2), opval);
7018 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7023 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))));
7024 CPU (h_cbit) = opval;
7025 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7028 BI opval = LTHI (tmp_newval, 0);
7029 CPU (h_nbit) = opval;
7030 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7033 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7034 CPU (h_zbit) = opval;
7035 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7038 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)));
7039 CPU (h_vbit) = opval;
7040 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7045 CPU (h_xbit) = opval;
7046 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7050 SET_H_INSN_PREFIXED_P (opval);
7051 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7061 CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
7063 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7064 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7065 #define FLD(f) abuf->fields.sfmt_addc_m.f
7066 int UNUSED written = 0;
7067 IADDR UNUSED pc = abuf->addr;
7068 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7075 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7076 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7077 tmp_carry = CPU (h_cbit);
7078 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7080 SI opval = tmp_newval;
7081 SET_H_GR (FLD (f_operand2), opval);
7082 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7086 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))));
7087 CPU (h_cbit) = opval;
7088 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7091 BI opval = LTSI (tmp_newval, 0);
7092 CPU (h_nbit) = opval;
7093 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7096 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7097 CPU (h_zbit) = opval;
7098 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7101 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)));
7102 CPU (h_vbit) = opval;
7103 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7108 CPU (h_xbit) = opval;
7109 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7113 SET_H_INSN_PREFIXED_P (opval);
7114 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7124 CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
7126 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7127 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7128 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7129 int UNUSED written = 0;
7130 IADDR UNUSED pc = abuf->addr;
7131 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7138 tmp_tmpops = ({ SI tmp_addr;
7141 tmp_postinc = FLD (f_memmode);
7142 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7143 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7144 ; if (NEBI (tmp_postinc, 0)) {
7146 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7147 tmp_addr = ADDSI (tmp_addr, 1);
7150 SI opval = tmp_addr;
7151 SET_H_GR (FLD (f_operand1), opval);
7152 written |= (1 << 12);
7153 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7158 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7159 tmp_carry = CPU (h_cbit);
7160 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7163 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7165 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7166 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7167 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7172 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))));
7173 CPU (h_cbit) = opval;
7174 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7177 BI opval = LTQI (tmp_newval, 0);
7178 CPU (h_nbit) = opval;
7179 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7182 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7183 CPU (h_zbit) = opval;
7184 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7187 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)));
7188 CPU (h_vbit) = opval;
7189 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7194 CPU (h_xbit) = opval;
7195 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7199 SET_H_INSN_PREFIXED_P (opval);
7200 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7206 abuf->written = written;
7211 CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
7213 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7214 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7215 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7216 int UNUSED written = 0;
7217 IADDR UNUSED pc = abuf->addr;
7218 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7225 tmp_tmpops = ({ SI tmp_addr;
7228 tmp_postinc = FLD (f_memmode);
7229 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7230 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7231 ; if (NEBI (tmp_postinc, 0)) {
7233 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7234 tmp_addr = ADDSI (tmp_addr, 2);
7237 SI opval = tmp_addr;
7238 SET_H_GR (FLD (f_operand1), opval);
7239 written |= (1 << 12);
7240 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7245 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7246 tmp_carry = CPU (h_cbit);
7247 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7250 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7252 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7253 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7254 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7259 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))));
7260 CPU (h_cbit) = opval;
7261 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7264 BI opval = LTHI (tmp_newval, 0);
7265 CPU (h_nbit) = opval;
7266 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7269 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7270 CPU (h_zbit) = opval;
7271 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7274 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)));
7275 CPU (h_vbit) = opval;
7276 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7281 CPU (h_xbit) = opval;
7282 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7286 SET_H_INSN_PREFIXED_P (opval);
7287 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7293 abuf->written = written;
7298 CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
7300 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7301 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7302 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7303 int UNUSED written = 0;
7304 IADDR UNUSED pc = abuf->addr;
7305 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7312 tmp_tmpops = ({ SI tmp_addr;
7315 tmp_postinc = FLD (f_memmode);
7316 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7317 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
7318 ; if (NEBI (tmp_postinc, 0)) {
7320 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7321 tmp_addr = ADDSI (tmp_addr, 4);
7324 SI opval = tmp_addr;
7325 SET_H_GR (FLD (f_operand1), opval);
7326 written |= (1 << 11);
7327 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7332 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7333 tmp_carry = CPU (h_cbit);
7334 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7336 SI opval = tmp_newval;
7337 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7338 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7342 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))));
7343 CPU (h_cbit) = opval;
7344 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7347 BI opval = LTSI (tmp_newval, 0);
7348 CPU (h_nbit) = opval;
7349 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7352 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7353 CPU (h_zbit) = opval;
7354 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7357 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)));
7358 CPU (h_vbit) = opval;
7359 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7364 CPU (h_xbit) = opval;
7365 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7369 SET_H_INSN_PREFIXED_P (opval);
7370 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7376 abuf->written = written;
7381 CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
7383 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7384 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7385 #define FLD(f) abuf->fields.sfmt_addcbr.f
7386 int UNUSED written = 0;
7387 IADDR UNUSED pc = abuf->addr;
7388 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7395 tmp_tmpops = FLD (f_indir_pc__byte);
7396 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7397 tmp_carry = CPU (h_cbit);
7398 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7401 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7403 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7404 SET_H_GR (FLD (f_operand2), opval);
7405 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7410 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))));
7411 CPU (h_cbit) = opval;
7412 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7415 BI opval = LTQI (tmp_newval, 0);
7416 CPU (h_nbit) = opval;
7417 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7420 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7421 CPU (h_zbit) = opval;
7422 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7425 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)));
7426 CPU (h_vbit) = opval;
7427 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7432 CPU (h_xbit) = opval;
7433 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7437 SET_H_INSN_PREFIXED_P (opval);
7438 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7448 CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
7450 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7451 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7452 #define FLD(f) abuf->fields.sfmt_addcwr.f
7453 int UNUSED written = 0;
7454 IADDR UNUSED pc = abuf->addr;
7455 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7462 tmp_tmpops = FLD (f_indir_pc__word);
7463 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7464 tmp_carry = CPU (h_cbit);
7465 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7468 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7470 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7471 SET_H_GR (FLD (f_operand2), opval);
7472 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7477 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))));
7478 CPU (h_cbit) = opval;
7479 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7482 BI opval = LTHI (tmp_newval, 0);
7483 CPU (h_nbit) = opval;
7484 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7487 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7488 CPU (h_zbit) = opval;
7489 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7492 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)));
7493 CPU (h_vbit) = opval;
7494 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7499 CPU (h_xbit) = opval;
7500 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7504 SET_H_INSN_PREFIXED_P (opval);
7505 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7515 CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
7517 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7518 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7519 #define FLD(f) abuf->fields.sfmt_addcdr.f
7520 int UNUSED written = 0;
7521 IADDR UNUSED pc = abuf->addr;
7522 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
7529 tmp_tmpops = FLD (f_indir_pc__dword);
7530 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7531 tmp_carry = CPU (h_cbit);
7532 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7534 SI opval = tmp_newval;
7535 SET_H_GR (FLD (f_operand2), opval);
7536 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7540 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))));
7541 CPU (h_cbit) = opval;
7542 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7545 BI opval = LTSI (tmp_newval, 0);
7546 CPU (h_nbit) = opval;
7547 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7550 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7551 CPU (h_zbit) = opval;
7552 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7555 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)));
7556 CPU (h_vbit) = opval;
7557 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7562 CPU (h_xbit) = opval;
7563 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7567 SET_H_INSN_PREFIXED_P (opval);
7568 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7578 CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
7580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7581 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7582 #define FLD(f) abuf->fields.sfmt_addc_m.f
7583 int UNUSED written = 0;
7584 IADDR UNUSED pc = abuf->addr;
7585 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7592 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
7593 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7594 tmp_carry = CPU (h_cbit);
7595 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7597 SI opval = tmp_newval;
7598 SET_H_GR (FLD (f_operand2), opval);
7599 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7603 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))));
7604 CPU (h_cbit) = opval;
7605 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7608 BI opval = LTSI (tmp_newval, 0);
7609 CPU (h_nbit) = opval;
7610 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7613 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7614 CPU (h_zbit) = opval;
7615 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7618 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)));
7619 CPU (h_vbit) = opval;
7620 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7625 CPU (h_xbit) = opval;
7626 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7630 SET_H_INSN_PREFIXED_P (opval);
7631 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7641 CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
7643 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7644 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7645 #define FLD(f) abuf->fields.sfmt_addc_m.f
7646 int UNUSED written = 0;
7647 IADDR UNUSED pc = abuf->addr;
7648 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7655 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
7656 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7657 tmp_carry = CPU (h_cbit);
7658 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7660 SI opval = tmp_newval;
7661 SET_H_GR (FLD (f_operand2), opval);
7662 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7666 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))));
7667 CPU (h_cbit) = opval;
7668 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7671 BI opval = LTSI (tmp_newval, 0);
7672 CPU (h_nbit) = opval;
7673 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7676 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7677 CPU (h_zbit) = opval;
7678 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7681 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)));
7682 CPU (h_vbit) = opval;
7683 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7688 CPU (h_xbit) = opval;
7689 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7693 SET_H_INSN_PREFIXED_P (opval);
7694 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7704 CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
7706 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7707 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7708 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7709 int UNUSED written = 0;
7710 IADDR UNUSED pc = abuf->addr;
7711 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7718 tmp_tmpops = EXTQISI (({ SI tmp_addr;
7721 tmp_postinc = FLD (f_memmode);
7722 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7723 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7724 ; if (NEBI (tmp_postinc, 0)) {
7726 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7727 tmp_addr = ADDSI (tmp_addr, 1);
7730 SI opval = tmp_addr;
7731 SET_H_GR (FLD (f_operand1), opval);
7732 written |= (1 << 11);
7733 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7738 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7739 tmp_carry = CPU (h_cbit);
7740 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7742 SI opval = tmp_newval;
7743 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7744 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7748 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))));
7749 CPU (h_cbit) = opval;
7750 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7753 BI opval = LTSI (tmp_newval, 0);
7754 CPU (h_nbit) = opval;
7755 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7758 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7759 CPU (h_zbit) = opval;
7760 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7763 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)));
7764 CPU (h_vbit) = opval;
7765 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7770 CPU (h_xbit) = opval;
7771 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7775 SET_H_INSN_PREFIXED_P (opval);
7776 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7782 abuf->written = written;
7787 CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
7789 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7790 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7791 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7792 int UNUSED written = 0;
7793 IADDR UNUSED pc = abuf->addr;
7794 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7801 tmp_tmpops = EXTHISI (({ SI tmp_addr;
7804 tmp_postinc = FLD (f_memmode);
7805 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7806 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7807 ; if (NEBI (tmp_postinc, 0)) {
7809 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7810 tmp_addr = ADDSI (tmp_addr, 2);
7813 SI opval = tmp_addr;
7814 SET_H_GR (FLD (f_operand1), opval);
7815 written |= (1 << 11);
7816 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7821 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7822 tmp_carry = CPU (h_cbit);
7823 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7825 SI opval = tmp_newval;
7826 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7827 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7831 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))));
7832 CPU (h_cbit) = opval;
7833 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7836 BI opval = LTSI (tmp_newval, 0);
7837 CPU (h_nbit) = opval;
7838 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7841 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7842 CPU (h_zbit) = opval;
7843 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7846 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)));
7847 CPU (h_vbit) = opval;
7848 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7853 CPU (h_xbit) = opval;
7854 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7858 SET_H_INSN_PREFIXED_P (opval);
7859 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7865 abuf->written = written;
7870 CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
7872 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7873 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7874 #define FLD(f) abuf->fields.sfmt_addcbr.f
7875 int UNUSED written = 0;
7876 IADDR UNUSED pc = abuf->addr;
7877 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7884 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
7885 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7886 tmp_carry = CPU (h_cbit);
7887 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7889 SI opval = tmp_newval;
7890 SET_H_GR (FLD (f_operand2), opval);
7891 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7895 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))));
7896 CPU (h_cbit) = opval;
7897 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7900 BI opval = LTSI (tmp_newval, 0);
7901 CPU (h_nbit) = opval;
7902 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7905 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7906 CPU (h_zbit) = opval;
7907 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7910 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)));
7911 CPU (h_vbit) = opval;
7912 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7917 CPU (h_xbit) = opval;
7918 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7922 SET_H_INSN_PREFIXED_P (opval);
7923 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7933 CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
7935 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7936 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7937 #define FLD(f) abuf->fields.sfmt_addcwr.f
7938 int UNUSED written = 0;
7939 IADDR UNUSED pc = abuf->addr;
7940 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7947 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
7948 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7949 tmp_carry = CPU (h_cbit);
7950 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7952 SI opval = tmp_newval;
7953 SET_H_GR (FLD (f_operand2), opval);
7954 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7958 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))));
7959 CPU (h_cbit) = opval;
7960 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7963 BI opval = LTSI (tmp_newval, 0);
7964 CPU (h_nbit) = opval;
7965 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7968 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7969 CPU (h_zbit) = opval;
7970 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7973 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)));
7974 CPU (h_vbit) = opval;
7975 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7980 CPU (h_xbit) = opval;
7981 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7985 SET_H_INSN_PREFIXED_P (opval);
7986 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7996 CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
7998 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7999 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8000 #define FLD(f) abuf->fields.sfmt_addc_m.f
8001 int UNUSED written = 0;
8002 IADDR UNUSED pc = abuf->addr;
8003 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8010 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
8011 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8012 tmp_carry = CPU (h_cbit);
8013 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8015 SI opval = tmp_newval;
8016 SET_H_GR (FLD (f_operand2), opval);
8017 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8021 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))));
8022 CPU (h_cbit) = opval;
8023 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8026 BI opval = LTSI (tmp_newval, 0);
8027 CPU (h_nbit) = opval;
8028 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8031 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8032 CPU (h_zbit) = opval;
8033 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8036 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)));
8037 CPU (h_vbit) = opval;
8038 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8043 CPU (h_xbit) = opval;
8044 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8048 SET_H_INSN_PREFIXED_P (opval);
8049 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8059 CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
8061 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8062 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8063 #define FLD(f) abuf->fields.sfmt_addc_m.f
8064 int UNUSED written = 0;
8065 IADDR UNUSED pc = abuf->addr;
8066 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8073 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
8074 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8075 tmp_carry = CPU (h_cbit);
8076 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8078 SI opval = tmp_newval;
8079 SET_H_GR (FLD (f_operand2), opval);
8080 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8084 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))));
8085 CPU (h_cbit) = opval;
8086 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8089 BI opval = LTSI (tmp_newval, 0);
8090 CPU (h_nbit) = opval;
8091 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8094 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8095 CPU (h_zbit) = opval;
8096 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8099 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)));
8100 CPU (h_vbit) = opval;
8101 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8106 CPU (h_xbit) = opval;
8107 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8111 SET_H_INSN_PREFIXED_P (opval);
8112 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8122 CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
8124 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8125 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8126 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8127 int UNUSED written = 0;
8128 IADDR UNUSED pc = abuf->addr;
8129 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8136 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
8139 tmp_postinc = FLD (f_memmode);
8140 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8141 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8142 ; if (NEBI (tmp_postinc, 0)) {
8144 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8145 tmp_addr = ADDSI (tmp_addr, 1);
8148 SI opval = tmp_addr;
8149 SET_H_GR (FLD (f_operand1), opval);
8150 written |= (1 << 11);
8151 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8156 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8157 tmp_carry = CPU (h_cbit);
8158 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8160 SI opval = tmp_newval;
8161 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8162 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8166 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))));
8167 CPU (h_cbit) = opval;
8168 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8171 BI opval = LTSI (tmp_newval, 0);
8172 CPU (h_nbit) = opval;
8173 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8176 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8177 CPU (h_zbit) = opval;
8178 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8181 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)));
8182 CPU (h_vbit) = opval;
8183 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8188 CPU (h_xbit) = opval;
8189 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8193 SET_H_INSN_PREFIXED_P (opval);
8194 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8200 abuf->written = written;
8205 CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
8207 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8208 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8209 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8210 int UNUSED written = 0;
8211 IADDR UNUSED pc = abuf->addr;
8212 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8219 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
8222 tmp_postinc = FLD (f_memmode);
8223 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8224 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8225 ; if (NEBI (tmp_postinc, 0)) {
8227 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8228 tmp_addr = ADDSI (tmp_addr, 2);
8231 SI opval = tmp_addr;
8232 SET_H_GR (FLD (f_operand1), opval);
8233 written |= (1 << 11);
8234 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8239 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8240 tmp_carry = CPU (h_cbit);
8241 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8243 SI opval = tmp_newval;
8244 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8245 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8249 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))));
8250 CPU (h_cbit) = opval;
8251 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8254 BI opval = LTSI (tmp_newval, 0);
8255 CPU (h_nbit) = opval;
8256 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8259 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8260 CPU (h_zbit) = opval;
8261 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8264 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)));
8265 CPU (h_vbit) = opval;
8266 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8271 CPU (h_xbit) = opval;
8272 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8276 SET_H_INSN_PREFIXED_P (opval);
8277 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8283 abuf->written = written;
8288 CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
8290 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8291 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8292 #define FLD(f) abuf->fields.sfmt_addcbr.f
8293 int UNUSED written = 0;
8294 IADDR UNUSED pc = abuf->addr;
8295 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8302 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
8303 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8304 tmp_carry = CPU (h_cbit);
8305 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8307 SI opval = tmp_newval;
8308 SET_H_GR (FLD (f_operand2), opval);
8309 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8313 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))));
8314 CPU (h_cbit) = opval;
8315 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8318 BI opval = LTSI (tmp_newval, 0);
8319 CPU (h_nbit) = opval;
8320 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8323 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8324 CPU (h_zbit) = opval;
8325 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8328 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)));
8329 CPU (h_vbit) = opval;
8330 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8335 CPU (h_xbit) = opval;
8336 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8340 SET_H_INSN_PREFIXED_P (opval);
8341 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8351 CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
8353 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8354 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8355 #define FLD(f) abuf->fields.sfmt_addcwr.f
8356 int UNUSED written = 0;
8357 IADDR UNUSED pc = abuf->addr;
8358 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8365 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
8366 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8367 tmp_carry = CPU (h_cbit);
8368 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8370 SI opval = tmp_newval;
8371 SET_H_GR (FLD (f_operand2), opval);
8372 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8376 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))));
8377 CPU (h_cbit) = opval;
8378 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8381 BI opval = LTSI (tmp_newval, 0);
8382 CPU (h_nbit) = opval;
8383 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8386 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8387 CPU (h_zbit) = opval;
8388 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8391 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)));
8392 CPU (h_vbit) = opval;
8393 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8398 CPU (h_xbit) = opval;
8399 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8403 SET_H_INSN_PREFIXED_P (opval);
8404 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8414 CASE (sem, INSN_ADDC_R) : /* addc $Rs,$Rd */
8416 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8417 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8418 #define FLD(f) abuf->fields.sfmt_addc_m.f
8419 int UNUSED written = 0;
8420 IADDR UNUSED pc = abuf->addr;
8421 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8430 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8431 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8432 tmp_carry = CPU (h_cbit);
8433 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8435 SI opval = tmp_newval;
8436 SET_H_GR (FLD (f_operand2), opval);
8437 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8441 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))));
8442 CPU (h_cbit) = opval;
8443 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8446 BI opval = LTSI (tmp_newval, 0);
8447 CPU (h_nbit) = opval;
8448 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8451 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8452 CPU (h_zbit) = opval;
8453 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8456 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)));
8457 CPU (h_vbit) = opval;
8458 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8463 CPU (h_xbit) = opval;
8464 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8468 SET_H_INSN_PREFIXED_P (opval);
8469 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8480 CASE (sem, INSN_ADDC_M) : /* addc [${Rs}${inc}],${Rd} */
8482 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8483 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8484 #define FLD(f) abuf->fields.sfmt_addc_m.f
8485 int UNUSED written = 0;
8486 IADDR UNUSED pc = abuf->addr;
8487 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8496 tmp_tmpops = ({ SI tmp_addr;
8499 tmp_postinc = FLD (f_memmode);
8500 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8501 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
8502 ; if (NEBI (tmp_postinc, 0)) {
8504 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8505 tmp_addr = ADDSI (tmp_addr, 4);
8508 SI opval = tmp_addr;
8509 SET_H_GR (FLD (f_operand1), opval);
8510 written |= (1 << 10);
8511 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8516 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8517 tmp_carry = CPU (h_cbit);
8518 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8520 SI opval = tmp_newval;
8521 SET_H_GR (FLD (f_operand2), opval);
8522 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8526 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))));
8527 CPU (h_cbit) = opval;
8528 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8531 BI opval = LTSI (tmp_newval, 0);
8532 CPU (h_nbit) = opval;
8533 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8536 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8537 CPU (h_zbit) = opval;
8538 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8541 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)));
8542 CPU (h_vbit) = opval;
8543 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8548 CPU (h_xbit) = opval;
8549 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8553 SET_H_INSN_PREFIXED_P (opval);
8554 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8561 abuf->written = written;
8566 CASE (sem, INSN_ADDC_C) : /* addc ${const32},${Rd} */
8568 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8569 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8570 #define FLD(f) abuf->fields.sfmt_addcdr.f
8571 int UNUSED written = 0;
8572 IADDR UNUSED pc = abuf->addr;
8573 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
8582 tmp_tmpops = FLD (f_indir_pc__dword);
8583 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8584 tmp_carry = CPU (h_cbit);
8585 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8587 SI opval = tmp_newval;
8588 SET_H_GR (FLD (f_operand2), opval);
8589 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8593 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))));
8594 CPU (h_cbit) = opval;
8595 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8598 BI opval = LTSI (tmp_newval, 0);
8599 CPU (h_nbit) = opval;
8600 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8603 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8604 CPU (h_zbit) = opval;
8605 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8608 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)));
8609 CPU (h_vbit) = opval;
8610 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8615 CPU (h_xbit) = opval;
8616 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8620 SET_H_INSN_PREFIXED_P (opval);
8621 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8632 CASE (sem, INSN_LAPC_D) : /* lapc.d ${const32-pcrel},${Rd} */
8634 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8635 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8636 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8637 int UNUSED written = 0;
8638 IADDR UNUSED pc = abuf->addr;
8639 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
8643 SI opval = FLD (i_const32_pcrel);
8644 SET_H_GR (FLD (f_operand2), opval);
8645 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8650 CPU (h_xbit) = opval;
8651 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8655 SET_H_INSN_PREFIXED_P (opval);
8656 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8665 CASE (sem, INSN_LAPCQ) : /* lapcq ${qo},${Rd} */
8667 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8668 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8669 #define FLD(f) abuf->fields.sfmt_lapcq.f
8670 int UNUSED written = 0;
8671 IADDR UNUSED pc = abuf->addr;
8672 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8676 SI opval = FLD (i_qo);
8677 SET_H_GR (FLD (f_operand2), opval);
8678 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8683 CPU (h_xbit) = opval;
8684 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8688 SET_H_INSN_PREFIXED_P (opval);
8689 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8698 CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8700 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8701 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8702 #define FLD(f) abuf->fields.sfmt_addc_m.f
8703 int UNUSED written = 0;
8704 IADDR UNUSED pc = abuf->addr;
8705 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8709 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
8710 SET_H_GR (FLD (f_operand1), opval);
8711 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8716 CPU (h_xbit) = opval;
8717 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8721 SET_H_INSN_PREFIXED_P (opval);
8722 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8731 CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8733 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8734 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8735 #define FLD(f) abuf->fields.sfmt_addc_m.f
8736 int UNUSED written = 0;
8737 IADDR UNUSED pc = abuf->addr;
8738 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8742 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
8743 SET_H_GR (FLD (f_operand1), opval);
8744 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8749 CPU (h_xbit) = opval;
8750 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8754 SET_H_INSN_PREFIXED_P (opval);
8755 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8764 CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8766 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8767 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8768 #define FLD(f) abuf->fields.sfmt_addc_m.f
8769 int UNUSED written = 0;
8770 IADDR UNUSED pc = abuf->addr;
8771 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8775 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
8776 SET_H_GR (FLD (f_operand1), opval);
8777 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8782 CPU (h_xbit) = opval;
8783 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8787 SET_H_INSN_PREFIXED_P (opval);
8788 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8797 CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
8799 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8800 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8801 #define FLD(f) abuf->fields.sfmt_addc_m.f
8802 int UNUSED written = 0;
8803 IADDR UNUSED pc = abuf->addr;
8804 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8811 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8813 tmp_carry = CPU (h_cbit);
8814 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8817 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
8819 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
8820 SET_H_GR (FLD (f_operand2), opval);
8821 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8826 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))));
8827 CPU (h_cbit) = opval;
8828 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8831 BI opval = LTQI (tmp_newval, 0);
8832 CPU (h_nbit) = opval;
8833 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8836 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8837 CPU (h_zbit) = opval;
8838 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8841 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)));
8842 CPU (h_vbit) = opval;
8843 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8848 CPU (h_xbit) = opval;
8849 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8853 SET_H_INSN_PREFIXED_P (opval);
8854 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8864 CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
8866 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8867 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8868 #define FLD(f) abuf->fields.sfmt_addc_m.f
8869 int UNUSED written = 0;
8870 IADDR UNUSED pc = abuf->addr;
8871 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8878 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8880 tmp_carry = CPU (h_cbit);
8881 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8884 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
8886 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
8887 SET_H_GR (FLD (f_operand2), opval);
8888 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8893 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))));
8894 CPU (h_cbit) = opval;
8895 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8898 BI opval = LTHI (tmp_newval, 0);
8899 CPU (h_nbit) = opval;
8900 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8903 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8904 CPU (h_zbit) = opval;
8905 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8908 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)));
8909 CPU (h_vbit) = opval;
8910 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8915 CPU (h_xbit) = opval;
8916 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8920 SET_H_INSN_PREFIXED_P (opval);
8921 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8931 CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
8933 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8934 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8935 #define FLD(f) abuf->fields.sfmt_addc_m.f
8936 int UNUSED written = 0;
8937 IADDR UNUSED pc = abuf->addr;
8938 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8945 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8947 tmp_carry = CPU (h_cbit);
8948 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8950 SI opval = tmp_newval;
8951 SET_H_GR (FLD (f_operand2), opval);
8952 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8956 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))));
8957 CPU (h_cbit) = opval;
8958 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8961 BI opval = LTSI (tmp_newval, 0);
8962 CPU (h_nbit) = opval;
8963 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8966 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8967 CPU (h_zbit) = opval;
8968 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8971 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)));
8972 CPU (h_vbit) = opval;
8973 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8978 CPU (h_xbit) = opval;
8979 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8983 SET_H_INSN_PREFIXED_P (opval);
8984 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8994 CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
8996 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8997 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8998 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
8999 int UNUSED written = 0;
9000 IADDR UNUSED pc = abuf->addr;
9001 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9005 tmp_tmpd = ({ SI tmp_addr;
9008 tmp_postinc = FLD (f_memmode);
9009 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9010 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
9011 ; if (NEBI (tmp_postinc, 0)) {
9013 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9014 tmp_addr = ADDSI (tmp_addr, 1);
9017 SI opval = tmp_addr;
9018 SET_H_GR (FLD (f_operand1), opval);
9019 written |= (1 << 8);
9020 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9031 tmp_tmpopd = tmp_tmpd;
9032 tmp_carry = CPU (h_cbit);
9033 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9037 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))));
9038 CPU (h_cbit) = opval;
9039 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9042 BI opval = LTQI (tmp_newval, 0);
9043 CPU (h_nbit) = opval;
9044 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9047 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9048 CPU (h_zbit) = opval;
9049 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9052 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)));
9053 CPU (h_vbit) = opval;
9054 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9059 CPU (h_xbit) = opval;
9060 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9064 SET_H_INSN_PREFIXED_P (opval);
9065 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9072 abuf->written = written;
9077 CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
9079 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9080 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9081 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9082 int UNUSED written = 0;
9083 IADDR UNUSED pc = abuf->addr;
9084 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9088 tmp_tmpd = ({ SI tmp_addr;
9091 tmp_postinc = FLD (f_memmode);
9092 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9093 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
9094 ; if (NEBI (tmp_postinc, 0)) {
9096 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9097 tmp_addr = ADDSI (tmp_addr, 2);
9100 SI opval = tmp_addr;
9101 SET_H_GR (FLD (f_operand1), opval);
9102 written |= (1 << 8);
9103 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9114 tmp_tmpopd = tmp_tmpd;
9115 tmp_carry = CPU (h_cbit);
9116 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9120 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))));
9121 CPU (h_cbit) = opval;
9122 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9125 BI opval = LTHI (tmp_newval, 0);
9126 CPU (h_nbit) = opval;
9127 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9130 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9131 CPU (h_zbit) = opval;
9132 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9135 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)));
9136 CPU (h_vbit) = opval;
9137 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9142 CPU (h_xbit) = opval;
9143 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9147 SET_H_INSN_PREFIXED_P (opval);
9148 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9155 abuf->written = written;
9160 CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
9162 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9163 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9164 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9165 int UNUSED written = 0;
9166 IADDR UNUSED pc = abuf->addr;
9167 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9171 tmp_tmpd = ({ SI tmp_addr;
9174 tmp_postinc = FLD (f_memmode);
9175 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9176 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
9177 ; if (NEBI (tmp_postinc, 0)) {
9179 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9180 tmp_addr = ADDSI (tmp_addr, 4);
9183 SI opval = tmp_addr;
9184 SET_H_GR (FLD (f_operand1), opval);
9185 written |= (1 << 8);
9186 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9197 tmp_tmpopd = tmp_tmpd;
9198 tmp_carry = CPU (h_cbit);
9199 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9203 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))));
9204 CPU (h_cbit) = opval;
9205 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9208 BI opval = LTSI (tmp_newval, 0);
9209 CPU (h_nbit) = opval;
9210 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9213 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9214 CPU (h_zbit) = opval;
9215 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9218 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)));
9219 CPU (h_vbit) = opval;
9220 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9225 CPU (h_xbit) = opval;
9226 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9230 SET_H_INSN_PREFIXED_P (opval);
9231 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9238 abuf->written = written;
9243 CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9245 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9246 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9247 #define FLD(f) abuf->fields.sfmt_addc_m.f
9248 int UNUSED written = 0;
9249 IADDR UNUSED pc = abuf->addr;
9250 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9254 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9258 tmp_postinc = FLD (f_memmode);
9259 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9260 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9261 if (EQBI (CPU (h_pbit), 0)) {
9264 QI opval = tmp_tmpd;
9265 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9266 written |= (1 << 10);
9267 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9270 BI opval = CPU (h_pbit);
9271 CPU (h_cbit) = opval;
9272 written |= (1 << 9);
9273 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9279 CPU (h_cbit) = opval;
9280 written |= (1 << 9);
9281 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9286 QI opval = tmp_tmpd;
9287 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9288 written |= (1 << 10);
9289 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9292 if (NEBI (tmp_postinc, 0)) {
9294 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9295 tmp_addr = ADDSI (tmp_addr, 1);
9298 SI opval = tmp_addr;
9299 SET_H_GR (FLD (f_operand1), opval);
9300 written |= (1 << 8);
9301 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9309 CPU (h_xbit) = opval;
9310 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9314 SET_H_INSN_PREFIXED_P (opval);
9315 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9320 abuf->written = written;
9325 CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9327 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9328 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9329 #define FLD(f) abuf->fields.sfmt_addc_m.f
9330 int UNUSED written = 0;
9331 IADDR UNUSED pc = abuf->addr;
9332 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9336 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9340 tmp_postinc = FLD (f_memmode);
9341 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9342 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9343 if (EQBI (CPU (h_pbit), 0)) {
9346 HI opval = tmp_tmpd;
9347 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9348 written |= (1 << 10);
9349 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9352 BI opval = CPU (h_pbit);
9353 CPU (h_cbit) = opval;
9354 written |= (1 << 9);
9355 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9361 CPU (h_cbit) = opval;
9362 written |= (1 << 9);
9363 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9368 HI opval = tmp_tmpd;
9369 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9370 written |= (1 << 10);
9371 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9374 if (NEBI (tmp_postinc, 0)) {
9376 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9377 tmp_addr = ADDSI (tmp_addr, 2);
9380 SI opval = tmp_addr;
9381 SET_H_GR (FLD (f_operand1), opval);
9382 written |= (1 << 8);
9383 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9391 CPU (h_xbit) = opval;
9392 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9396 SET_H_INSN_PREFIXED_P (opval);
9397 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9402 abuf->written = written;
9407 CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9409 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9410 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9411 #define FLD(f) abuf->fields.sfmt_addc_m.f
9412 int UNUSED written = 0;
9413 IADDR UNUSED pc = abuf->addr;
9414 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9418 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9422 tmp_postinc = FLD (f_memmode);
9423 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9424 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9425 if (EQBI (CPU (h_pbit), 0)) {
9428 SI opval = tmp_tmpd;
9429 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9430 written |= (1 << 10);
9431 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9434 BI opval = CPU (h_pbit);
9435 CPU (h_cbit) = opval;
9436 written |= (1 << 9);
9437 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9443 CPU (h_cbit) = opval;
9444 written |= (1 << 9);
9445 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9450 SI opval = tmp_tmpd;
9451 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9452 written |= (1 << 10);
9453 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9456 if (NEBI (tmp_postinc, 0)) {
9458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9459 tmp_addr = ADDSI (tmp_addr, 4);
9462 SI opval = tmp_addr;
9463 SET_H_GR (FLD (f_operand1), opval);
9464 written |= (1 << 8);
9465 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9473 CPU (h_xbit) = opval;
9474 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9478 SET_H_INSN_PREFIXED_P (opval);
9479 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9484 abuf->written = written;
9489 CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
9491 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9492 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9493 #define FLD(f) abuf->fields.sfmt_muls_b.f
9494 int UNUSED written = 0;
9495 IADDR UNUSED pc = abuf->addr;
9496 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9502 tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9503 tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9504 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9506 SI opval = TRUNCDISI (tmp_tmpr);
9507 SET_H_GR (FLD (f_operand2), opval);
9508 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9511 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9512 SET_H_SR (((UINT) 7), opval);
9513 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9517 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9518 CPU (h_cbit) = opval;
9519 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9522 BI opval = LTDI (tmp_tmpr, 0);
9523 CPU (h_nbit) = opval;
9524 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9527 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9528 CPU (h_zbit) = opval;
9529 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9532 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9533 CPU (h_vbit) = opval;
9534 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9539 CPU (h_xbit) = opval;
9540 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9544 SET_H_INSN_PREFIXED_P (opval);
9545 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9555 CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
9557 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9558 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9559 #define FLD(f) abuf->fields.sfmt_muls_b.f
9560 int UNUSED written = 0;
9561 IADDR UNUSED pc = abuf->addr;
9562 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9568 tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9569 tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9570 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9572 SI opval = TRUNCDISI (tmp_tmpr);
9573 SET_H_GR (FLD (f_operand2), opval);
9574 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9577 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9578 SET_H_SR (((UINT) 7), opval);
9579 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9583 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9584 CPU (h_cbit) = opval;
9585 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9588 BI opval = LTDI (tmp_tmpr, 0);
9589 CPU (h_nbit) = opval;
9590 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9593 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9594 CPU (h_zbit) = opval;
9595 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9598 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9599 CPU (h_vbit) = opval;
9600 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9605 CPU (h_xbit) = opval;
9606 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9610 SET_H_INSN_PREFIXED_P (opval);
9611 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9621 CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
9623 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9624 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9625 #define FLD(f) abuf->fields.sfmt_muls_b.f
9626 int UNUSED written = 0;
9627 IADDR UNUSED pc = abuf->addr;
9628 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9634 tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9635 tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9636 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9638 SI opval = TRUNCDISI (tmp_tmpr);
9639 SET_H_GR (FLD (f_operand2), opval);
9640 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9643 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9644 SET_H_SR (((UINT) 7), opval);
9645 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9649 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9650 CPU (h_cbit) = opval;
9651 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9654 BI opval = LTDI (tmp_tmpr, 0);
9655 CPU (h_nbit) = opval;
9656 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9659 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9660 CPU (h_zbit) = opval;
9661 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9664 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9665 CPU (h_vbit) = opval;
9666 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9671 CPU (h_xbit) = opval;
9672 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9676 SET_H_INSN_PREFIXED_P (opval);
9677 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9687 CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
9689 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9690 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9691 #define FLD(f) abuf->fields.sfmt_muls_b.f
9692 int UNUSED written = 0;
9693 IADDR UNUSED pc = abuf->addr;
9694 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9700 tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9701 tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9702 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9704 SI opval = TRUNCDISI (tmp_tmpr);
9705 SET_H_GR (FLD (f_operand2), opval);
9706 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9709 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9710 SET_H_SR (((UINT) 7), opval);
9711 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9715 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9716 CPU (h_cbit) = opval;
9717 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9720 BI opval = LTDI (tmp_tmpr, 0);
9721 CPU (h_nbit) = opval;
9722 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9725 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9726 CPU (h_zbit) = opval;
9727 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9730 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9731 CPU (h_vbit) = opval;
9732 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9737 CPU (h_xbit) = opval;
9738 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9742 SET_H_INSN_PREFIXED_P (opval);
9743 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9753 CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
9755 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9756 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9757 #define FLD(f) abuf->fields.sfmt_muls_b.f
9758 int UNUSED written = 0;
9759 IADDR UNUSED pc = abuf->addr;
9760 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9766 tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9767 tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9768 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9770 SI opval = TRUNCDISI (tmp_tmpr);
9771 SET_H_GR (FLD (f_operand2), opval);
9772 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9775 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9776 SET_H_SR (((UINT) 7), opval);
9777 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9781 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9782 CPU (h_cbit) = opval;
9783 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9786 BI opval = LTDI (tmp_tmpr, 0);
9787 CPU (h_nbit) = opval;
9788 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9791 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9792 CPU (h_zbit) = opval;
9793 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9796 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9797 CPU (h_vbit) = opval;
9798 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9803 CPU (h_xbit) = opval;
9804 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9808 SET_H_INSN_PREFIXED_P (opval);
9809 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9819 CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
9821 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9822 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9823 #define FLD(f) abuf->fields.sfmt_muls_b.f
9824 int UNUSED written = 0;
9825 IADDR UNUSED pc = abuf->addr;
9826 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9832 tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9833 tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9834 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9836 SI opval = TRUNCDISI (tmp_tmpr);
9837 SET_H_GR (FLD (f_operand2), opval);
9838 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9841 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9842 SET_H_SR (((UINT) 7), opval);
9843 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9847 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9848 CPU (h_cbit) = opval;
9849 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9852 BI opval = LTDI (tmp_tmpr, 0);
9853 CPU (h_nbit) = opval;
9854 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9857 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9858 CPU (h_zbit) = opval;
9859 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9862 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9863 CPU (h_vbit) = opval;
9864 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9869 CPU (h_xbit) = opval;
9870 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9874 SET_H_INSN_PREFIXED_P (opval);
9875 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9885 CASE (sem, INSN_MCP) : /* mcp $Ps,$Rd */
9887 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9888 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9889 #define FLD(f) abuf->fields.sfmt_mcp.f
9890 int UNUSED written = 0;
9891 IADDR UNUSED pc = abuf->addr;
9892 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9902 tmp_tmpops = GET_H_SR (FLD (f_operand2));
9903 tmp_tmpopd = GET_H_GR (FLD (f_operand1));
9904 tmp_carry = CPU (h_rbit);
9905 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9907 SI opval = tmp_newval;
9908 SET_H_GR (FLD (f_operand1), opval);
9909 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9913 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))));
9914 CPU (h_rbit) = opval;
9915 TRACE_RESULT (current_cpu, abuf, "rbit", 'x', opval);
9918 BI opval = LTSI (tmp_newval, 0);
9919 CPU (h_nbit) = opval;
9920 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9923 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9924 CPU (h_zbit) = opval;
9925 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9928 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)));
9929 CPU (h_vbit) = opval;
9930 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9935 CPU (h_xbit) = opval;
9936 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9940 SET_H_INSN_PREFIXED_P (opval);
9941 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9952 CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
9954 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9955 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9956 #define FLD(f) abuf->fields.sfmt_muls_b.f
9957 int UNUSED written = 0;
9958 IADDR UNUSED pc = abuf->addr;
9959 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9965 tmp_tmps = GET_H_GR (FLD (f_operand1));
9966 tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
9967 tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
9969 SI opval = tmp_tmpd;
9970 SET_H_GR (FLD (f_operand2), opval);
9971 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9975 BI opval = LTSI (tmp_tmpd, 0);
9976 CPU (h_nbit) = opval;
9977 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9980 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9981 CPU (h_zbit) = opval;
9982 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9984 SET_H_CBIT_MOVE (0);
9985 SET_H_VBIT_MOVE (0);
9989 CPU (h_xbit) = opval;
9990 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9994 SET_H_INSN_PREFIXED_P (opval);
9995 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10005 CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
10007 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10008 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10009 #define FLD(f) abuf->fields.sfmt_muls_b.f
10010 int UNUSED written = 0;
10011 IADDR UNUSED pc = abuf->addr;
10012 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10016 tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
10018 SI opval = tmp_tmpd;
10019 SET_H_GR (FLD (f_operand2), opval);
10020 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10024 BI opval = LTSI (tmp_tmpd, 0);
10025 CPU (h_nbit) = opval;
10026 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10029 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10030 CPU (h_zbit) = opval;
10031 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10033 SET_H_CBIT_MOVE (0);
10034 SET_H_VBIT_MOVE (0);
10038 CPU (h_xbit) = opval;
10039 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10043 SET_H_INSN_PREFIXED_P (opval);
10044 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10054 CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
10056 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10057 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10058 #define FLD(f) abuf->fields.sfmt_addc_m.f
10059 int UNUSED written = 0;
10060 IADDR UNUSED pc = abuf->addr;
10061 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10065 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10068 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10070 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10071 SET_H_GR (FLD (f_operand2), opval);
10072 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10077 BI opval = LTQI (tmp_tmpd, 0);
10078 CPU (h_nbit) = opval;
10079 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10082 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10083 CPU (h_zbit) = opval;
10084 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10086 SET_H_CBIT_MOVE (0);
10087 SET_H_VBIT_MOVE (0);
10091 CPU (h_xbit) = opval;
10092 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10096 SET_H_INSN_PREFIXED_P (opval);
10097 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10107 CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
10109 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10110 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10111 #define FLD(f) abuf->fields.sfmt_addc_m.f
10112 int UNUSED written = 0;
10113 IADDR UNUSED pc = abuf->addr;
10114 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10118 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10121 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10123 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10124 SET_H_GR (FLD (f_operand2), opval);
10125 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10130 BI opval = LTHI (tmp_tmpd, 0);
10131 CPU (h_nbit) = opval;
10132 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10135 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10136 CPU (h_zbit) = opval;
10137 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10139 SET_H_CBIT_MOVE (0);
10140 SET_H_VBIT_MOVE (0);
10144 CPU (h_xbit) = opval;
10145 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10149 SET_H_INSN_PREFIXED_P (opval);
10150 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10160 CASE (sem, INSN_AND_D_R) : /* and.d $Rs,$Rd */
10162 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10163 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10164 #define FLD(f) abuf->fields.sfmt_addc_m.f
10165 int UNUSED written = 0;
10166 IADDR UNUSED pc = abuf->addr;
10167 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10171 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10173 SI opval = tmp_tmpd;
10174 SET_H_GR (FLD (f_operand2), opval);
10175 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10179 BI opval = LTSI (tmp_tmpd, 0);
10180 CPU (h_nbit) = opval;
10181 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10184 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10185 CPU (h_zbit) = opval;
10186 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10188 SET_H_CBIT_MOVE (0);
10189 SET_H_VBIT_MOVE (0);
10193 CPU (h_xbit) = opval;
10194 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10198 SET_H_INSN_PREFIXED_P (opval);
10199 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10209 CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
10211 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10212 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10213 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10214 int UNUSED written = 0;
10215 IADDR UNUSED pc = abuf->addr;
10216 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10220 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10223 tmp_postinc = FLD (f_memmode);
10224 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10225 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10226 ; if (NEBI (tmp_postinc, 0)) {
10228 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10229 tmp_addr = ADDSI (tmp_addr, 1);
10232 SI opval = tmp_addr;
10233 SET_H_GR (FLD (f_operand1), opval);
10234 written |= (1 << 11);
10235 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10239 ; tmp_tmp_mem; }));
10242 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10244 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10245 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10246 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10251 BI opval = LTQI (tmp_tmpd, 0);
10252 CPU (h_nbit) = opval;
10253 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10256 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10257 CPU (h_zbit) = opval;
10258 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10260 SET_H_CBIT_MOVE (0);
10261 SET_H_VBIT_MOVE (0);
10265 CPU (h_xbit) = opval;
10266 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10270 SET_H_INSN_PREFIXED_P (opval);
10271 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10277 abuf->written = written;
10282 CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
10284 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10285 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10286 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10287 int UNUSED written = 0;
10288 IADDR UNUSED pc = abuf->addr;
10289 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10293 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10296 tmp_postinc = FLD (f_memmode);
10297 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10298 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10299 ; if (NEBI (tmp_postinc, 0)) {
10301 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10302 tmp_addr = ADDSI (tmp_addr, 2);
10305 SI opval = tmp_addr;
10306 SET_H_GR (FLD (f_operand1), opval);
10307 written |= (1 << 11);
10308 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10312 ; tmp_tmp_mem; }));
10315 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10317 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10318 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10319 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10324 BI opval = LTHI (tmp_tmpd, 0);
10325 CPU (h_nbit) = opval;
10326 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10329 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10330 CPU (h_zbit) = opval;
10331 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10333 SET_H_CBIT_MOVE (0);
10334 SET_H_VBIT_MOVE (0);
10338 CPU (h_xbit) = opval;
10339 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10343 SET_H_INSN_PREFIXED_P (opval);
10344 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10350 abuf->written = written;
10355 CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
10357 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10358 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10359 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10360 int UNUSED written = 0;
10361 IADDR UNUSED pc = abuf->addr;
10362 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10366 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10369 tmp_postinc = FLD (f_memmode);
10370 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10371 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10372 ; if (NEBI (tmp_postinc, 0)) {
10374 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10375 tmp_addr = ADDSI (tmp_addr, 4);
10378 SI opval = tmp_addr;
10379 SET_H_GR (FLD (f_operand1), opval);
10380 written |= (1 << 10);
10381 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10385 ; tmp_tmp_mem; }));
10387 SI opval = tmp_tmpd;
10388 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10389 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10393 BI opval = LTSI (tmp_tmpd, 0);
10394 CPU (h_nbit) = opval;
10395 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10398 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10399 CPU (h_zbit) = opval;
10400 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10402 SET_H_CBIT_MOVE (0);
10403 SET_H_VBIT_MOVE (0);
10407 CPU (h_xbit) = opval;
10408 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10412 SET_H_INSN_PREFIXED_P (opval);
10413 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10419 abuf->written = written;
10424 CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
10426 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10427 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10428 #define FLD(f) abuf->fields.sfmt_addcbr.f
10429 int UNUSED written = 0;
10430 IADDR UNUSED pc = abuf->addr;
10431 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10435 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10438 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10440 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10441 SET_H_GR (FLD (f_operand2), opval);
10442 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10447 BI opval = LTQI (tmp_tmpd, 0);
10448 CPU (h_nbit) = opval;
10449 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10452 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10453 CPU (h_zbit) = opval;
10454 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10456 SET_H_CBIT_MOVE (0);
10457 SET_H_VBIT_MOVE (0);
10461 CPU (h_xbit) = opval;
10462 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10466 SET_H_INSN_PREFIXED_P (opval);
10467 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10477 CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
10479 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10480 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10481 #define FLD(f) abuf->fields.sfmt_addcwr.f
10482 int UNUSED written = 0;
10483 IADDR UNUSED pc = abuf->addr;
10484 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10488 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10491 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10493 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10494 SET_H_GR (FLD (f_operand2), opval);
10495 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10500 BI opval = LTHI (tmp_tmpd, 0);
10501 CPU (h_nbit) = opval;
10502 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10505 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10506 CPU (h_zbit) = opval;
10507 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10509 SET_H_CBIT_MOVE (0);
10510 SET_H_VBIT_MOVE (0);
10514 CPU (h_xbit) = opval;
10515 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10519 SET_H_INSN_PREFIXED_P (opval);
10520 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10530 CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
10532 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10533 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10534 #define FLD(f) abuf->fields.sfmt_addcdr.f
10535 int UNUSED written = 0;
10536 IADDR UNUSED pc = abuf->addr;
10537 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10541 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10543 SI opval = tmp_tmpd;
10544 SET_H_GR (FLD (f_operand2), opval);
10545 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10549 BI opval = LTSI (tmp_tmpd, 0);
10550 CPU (h_nbit) = opval;
10551 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10554 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10555 CPU (h_zbit) = opval;
10556 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10558 SET_H_CBIT_MOVE (0);
10559 SET_H_VBIT_MOVE (0);
10563 CPU (h_xbit) = opval;
10564 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10568 SET_H_INSN_PREFIXED_P (opval);
10569 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10579 CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
10581 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10582 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10583 #define FLD(f) abuf->fields.sfmt_andq.f
10584 int UNUSED written = 0;
10585 IADDR UNUSED pc = abuf->addr;
10586 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10590 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10592 SI opval = tmp_tmpd;
10593 SET_H_GR (FLD (f_operand2), opval);
10594 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10598 BI opval = LTSI (tmp_tmpd, 0);
10599 CPU (h_nbit) = opval;
10600 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10603 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10604 CPU (h_zbit) = opval;
10605 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10607 SET_H_CBIT_MOVE (0);
10608 SET_H_VBIT_MOVE (0);
10612 CPU (h_xbit) = opval;
10613 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10617 SET_H_INSN_PREFIXED_P (opval);
10618 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10628 CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
10630 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10632 #define FLD(f) abuf->fields.sfmt_addc_m.f
10633 int UNUSED written = 0;
10634 IADDR UNUSED pc = abuf->addr;
10635 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10639 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10642 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10644 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10645 SET_H_GR (FLD (f_operand2), opval);
10646 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10651 BI opval = LTQI (tmp_tmpd, 0);
10652 CPU (h_nbit) = opval;
10653 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10656 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10657 CPU (h_zbit) = opval;
10658 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10660 SET_H_CBIT_MOVE (0);
10661 SET_H_VBIT_MOVE (0);
10665 CPU (h_xbit) = opval;
10666 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10670 SET_H_INSN_PREFIXED_P (opval);
10671 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10681 CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
10683 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10684 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10685 #define FLD(f) abuf->fields.sfmt_addc_m.f
10686 int UNUSED written = 0;
10687 IADDR UNUSED pc = abuf->addr;
10688 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10692 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10695 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10697 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10698 SET_H_GR (FLD (f_operand2), opval);
10699 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10704 BI opval = LTHI (tmp_tmpd, 0);
10705 CPU (h_nbit) = opval;
10706 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10709 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10710 CPU (h_zbit) = opval;
10711 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10713 SET_H_CBIT_MOVE (0);
10714 SET_H_VBIT_MOVE (0);
10718 CPU (h_xbit) = opval;
10719 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10723 SET_H_INSN_PREFIXED_P (opval);
10724 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10734 CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
10736 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10737 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10738 #define FLD(f) abuf->fields.sfmt_addc_m.f
10739 int UNUSED written = 0;
10740 IADDR UNUSED pc = abuf->addr;
10741 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10745 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10747 SI opval = tmp_tmpd;
10748 SET_H_GR (FLD (f_operand2), opval);
10749 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10753 BI opval = LTSI (tmp_tmpd, 0);
10754 CPU (h_nbit) = opval;
10755 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10758 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10759 CPU (h_zbit) = opval;
10760 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10762 SET_H_CBIT_MOVE (0);
10763 SET_H_VBIT_MOVE (0);
10767 CPU (h_xbit) = opval;
10768 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10772 SET_H_INSN_PREFIXED_P (opval);
10773 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10783 CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
10785 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10786 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10787 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10788 int UNUSED written = 0;
10789 IADDR UNUSED pc = abuf->addr;
10790 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10794 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10797 tmp_postinc = FLD (f_memmode);
10798 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10799 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10800 ; if (NEBI (tmp_postinc, 0)) {
10802 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10803 tmp_addr = ADDSI (tmp_addr, 1);
10806 SI opval = tmp_addr;
10807 SET_H_GR (FLD (f_operand1), opval);
10808 written |= (1 << 11);
10809 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10813 ; tmp_tmp_mem; }));
10816 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10818 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10819 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10820 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10825 BI opval = LTQI (tmp_tmpd, 0);
10826 CPU (h_nbit) = opval;
10827 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10830 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10831 CPU (h_zbit) = opval;
10832 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10834 SET_H_CBIT_MOVE (0);
10835 SET_H_VBIT_MOVE (0);
10839 CPU (h_xbit) = opval;
10840 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10844 SET_H_INSN_PREFIXED_P (opval);
10845 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10851 abuf->written = written;
10856 CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
10858 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10859 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10860 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10861 int UNUSED written = 0;
10862 IADDR UNUSED pc = abuf->addr;
10863 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10867 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10870 tmp_postinc = FLD (f_memmode);
10871 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10872 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10873 ; if (NEBI (tmp_postinc, 0)) {
10875 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10876 tmp_addr = ADDSI (tmp_addr, 2);
10879 SI opval = tmp_addr;
10880 SET_H_GR (FLD (f_operand1), opval);
10881 written |= (1 << 11);
10882 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10886 ; tmp_tmp_mem; }));
10889 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10891 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10892 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10893 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10898 BI opval = LTHI (tmp_tmpd, 0);
10899 CPU (h_nbit) = opval;
10900 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10903 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10904 CPU (h_zbit) = opval;
10905 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10907 SET_H_CBIT_MOVE (0);
10908 SET_H_VBIT_MOVE (0);
10912 CPU (h_xbit) = opval;
10913 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10917 SET_H_INSN_PREFIXED_P (opval);
10918 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10924 abuf->written = written;
10929 CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
10931 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10932 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10933 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10934 int UNUSED written = 0;
10935 IADDR UNUSED pc = abuf->addr;
10936 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10940 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10943 tmp_postinc = FLD (f_memmode);
10944 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10945 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10946 ; if (NEBI (tmp_postinc, 0)) {
10948 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10949 tmp_addr = ADDSI (tmp_addr, 4);
10952 SI opval = tmp_addr;
10953 SET_H_GR (FLD (f_operand1), opval);
10954 written |= (1 << 10);
10955 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10959 ; tmp_tmp_mem; }));
10961 SI opval = tmp_tmpd;
10962 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10963 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10967 BI opval = LTSI (tmp_tmpd, 0);
10968 CPU (h_nbit) = opval;
10969 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10972 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10973 CPU (h_zbit) = opval;
10974 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10976 SET_H_CBIT_MOVE (0);
10977 SET_H_VBIT_MOVE (0);
10981 CPU (h_xbit) = opval;
10982 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10986 SET_H_INSN_PREFIXED_P (opval);
10987 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10993 abuf->written = written;
10998 CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
11000 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11001 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11002 #define FLD(f) abuf->fields.sfmt_addcbr.f
11003 int UNUSED written = 0;
11004 IADDR UNUSED pc = abuf->addr;
11005 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11009 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
11012 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11014 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11015 SET_H_GR (FLD (f_operand2), opval);
11016 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11021 BI opval = LTQI (tmp_tmpd, 0);
11022 CPU (h_nbit) = opval;
11023 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11026 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11027 CPU (h_zbit) = opval;
11028 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11030 SET_H_CBIT_MOVE (0);
11031 SET_H_VBIT_MOVE (0);
11035 CPU (h_xbit) = opval;
11036 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11040 SET_H_INSN_PREFIXED_P (opval);
11041 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11051 CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
11053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11055 #define FLD(f) abuf->fields.sfmt_addcwr.f
11056 int UNUSED written = 0;
11057 IADDR UNUSED pc = abuf->addr;
11058 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11062 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
11065 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11067 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11068 SET_H_GR (FLD (f_operand2), opval);
11069 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11074 BI opval = LTHI (tmp_tmpd, 0);
11075 CPU (h_nbit) = opval;
11076 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11079 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11080 CPU (h_zbit) = opval;
11081 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11083 SET_H_CBIT_MOVE (0);
11084 SET_H_VBIT_MOVE (0);
11088 CPU (h_xbit) = opval;
11089 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11093 SET_H_INSN_PREFIXED_P (opval);
11094 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11104 CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
11106 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11107 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11108 #define FLD(f) abuf->fields.sfmt_addcdr.f
11109 int UNUSED written = 0;
11110 IADDR UNUSED pc = abuf->addr;
11111 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
11115 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
11117 SI opval = tmp_tmpd;
11118 SET_H_GR (FLD (f_operand2), opval);
11119 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11123 BI opval = LTSI (tmp_tmpd, 0);
11124 CPU (h_nbit) = opval;
11125 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11128 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11129 CPU (h_zbit) = opval;
11130 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11132 SET_H_CBIT_MOVE (0);
11133 SET_H_VBIT_MOVE (0);
11137 CPU (h_xbit) = opval;
11138 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11142 SET_H_INSN_PREFIXED_P (opval);
11143 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11153 CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
11155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11157 #define FLD(f) abuf->fields.sfmt_andq.f
11158 int UNUSED written = 0;
11159 IADDR UNUSED pc = abuf->addr;
11160 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11164 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
11166 SI opval = tmp_tmpd;
11167 SET_H_GR (FLD (f_operand2), opval);
11168 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11172 BI opval = LTSI (tmp_tmpd, 0);
11173 CPU (h_nbit) = opval;
11174 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11177 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11178 CPU (h_zbit) = opval;
11179 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11181 SET_H_CBIT_MOVE (0);
11182 SET_H_VBIT_MOVE (0);
11186 CPU (h_xbit) = opval;
11187 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11191 SET_H_INSN_PREFIXED_P (opval);
11192 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11202 CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
11204 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11205 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11206 #define FLD(f) abuf->fields.sfmt_muls_b.f
11207 int UNUSED written = 0;
11208 IADDR UNUSED pc = abuf->addr;
11209 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11213 tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
11215 SI opval = tmp_tmpd;
11216 SET_H_GR (FLD (f_operand2), opval);
11217 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11221 BI opval = LTSI (tmp_tmpd, 0);
11222 CPU (h_nbit) = opval;
11223 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11226 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11227 CPU (h_zbit) = opval;
11228 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11230 SET_H_CBIT_MOVE (0);
11231 SET_H_VBIT_MOVE (0);
11235 CPU (h_xbit) = opval;
11236 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11240 SET_H_INSN_PREFIXED_P (opval);
11241 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11251 CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
11253 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11254 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11255 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11256 int UNUSED written = 0;
11257 IADDR UNUSED pc = abuf->addr;
11258 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11263 tmp_tmps = GET_H_GR (FLD (f_operand1));
11264 tmp_tmpd = ({ SI tmp_tmpcode;
11267 tmp_tmpcode = FLD (f_operand2);
11268 ; tmp_tmpval = tmp_tmps;
11269 ; if (EQSI (tmp_tmpcode, 0)) {
11270 tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
11272 else if (EQSI (tmp_tmpcode, 1)) {
11273 tmp_tmpres = ({ SI tmp_tmpr;
11274 tmp_tmpr = tmp_tmpval;
11275 ; 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)))))))); });
11277 else if (EQSI (tmp_tmpcode, 2)) {
11278 tmp_tmpres = ({ SI tmp_tmpb;
11279 tmp_tmpb = tmp_tmpval;
11280 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11282 else if (EQSI (tmp_tmpcode, 3)) {
11283 tmp_tmpres = ({ SI tmp_tmpr;
11284 tmp_tmpr = ({ SI tmp_tmpb;
11285 tmp_tmpb = tmp_tmpval;
11286 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11287 ; 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)))))))); });
11289 else if (EQSI (tmp_tmpcode, 4)) {
11290 tmp_tmpres = ({ SI tmp_tmpb;
11291 tmp_tmpb = tmp_tmpval;
11292 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11294 else if (EQSI (tmp_tmpcode, 5)) {
11295 tmp_tmpres = ({ SI tmp_tmpr;
11296 tmp_tmpr = ({ SI tmp_tmpb;
11297 tmp_tmpb = tmp_tmpval;
11298 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11299 ; 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)))))))); });
11301 else if (EQSI (tmp_tmpcode, 6)) {
11302 tmp_tmpres = ({ SI tmp_tmpb;
11303 tmp_tmpb = ({ SI tmp_tmpb;
11304 tmp_tmpb = tmp_tmpval;
11305 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11306 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11308 else if (EQSI (tmp_tmpcode, 7)) {
11309 tmp_tmpres = ({ SI tmp_tmpr;
11310 tmp_tmpr = ({ SI tmp_tmpb;
11311 tmp_tmpb = ({ SI tmp_tmpb;
11312 tmp_tmpb = tmp_tmpval;
11313 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11314 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11315 ; 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)))))))); });
11317 else if (EQSI (tmp_tmpcode, 8)) {
11318 tmp_tmpres = INVSI (tmp_tmpval);
11320 else if (EQSI (tmp_tmpcode, 9)) {
11321 tmp_tmpres = ({ SI tmp_tmpr;
11322 tmp_tmpr = INVSI (tmp_tmpval);
11323 ; 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)))))))); });
11325 else if (EQSI (tmp_tmpcode, 10)) {
11326 tmp_tmpres = ({ SI tmp_tmpb;
11327 tmp_tmpb = INVSI (tmp_tmpval);
11328 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11330 else if (EQSI (tmp_tmpcode, 11)) {
11331 tmp_tmpres = ({ SI tmp_tmpr;
11332 tmp_tmpr = ({ SI tmp_tmpb;
11333 tmp_tmpb = INVSI (tmp_tmpval);
11334 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11335 ; 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)))))))); });
11337 else if (EQSI (tmp_tmpcode, 12)) {
11338 tmp_tmpres = ({ SI tmp_tmpb;
11339 tmp_tmpb = INVSI (tmp_tmpval);
11340 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11342 else if (EQSI (tmp_tmpcode, 13)) {
11343 tmp_tmpres = ({ SI tmp_tmpr;
11344 tmp_tmpr = ({ SI tmp_tmpb;
11345 tmp_tmpb = INVSI (tmp_tmpval);
11346 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11347 ; 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)))))))); });
11349 else if (EQSI (tmp_tmpcode, 14)) {
11350 tmp_tmpres = ({ SI tmp_tmpb;
11351 tmp_tmpb = ({ SI tmp_tmpb;
11352 tmp_tmpb = INVSI (tmp_tmpval);
11353 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11354 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11356 else if (EQSI (tmp_tmpcode, 15)) {
11357 tmp_tmpres = ({ SI tmp_tmpr;
11358 tmp_tmpr = ({ SI tmp_tmpb;
11359 tmp_tmpb = ({ SI tmp_tmpb;
11360 tmp_tmpb = INVSI (tmp_tmpval);
11361 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11362 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11363 ; 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)))))))); });
11367 SI opval = tmp_tmpd;
11368 SET_H_GR (FLD (f_operand1), opval);
11369 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11373 BI opval = LTSI (tmp_tmpd, 0);
11374 CPU (h_nbit) = opval;
11375 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11378 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11379 CPU (h_zbit) = opval;
11380 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11382 SET_H_CBIT_MOVE (0);
11383 SET_H_VBIT_MOVE (0);
11387 CPU (h_xbit) = opval;
11388 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11392 SET_H_INSN_PREFIXED_P (opval);
11393 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11403 CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
11405 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11406 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11407 #define FLD(f) abuf->fields.sfmt_addc_m.f
11408 int UNUSED written = 0;
11409 IADDR UNUSED pc = abuf->addr;
11410 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11416 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11417 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11418 tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11421 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11423 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11424 SET_H_GR (FLD (f_operand2), opval);
11425 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11430 BI opval = LTQI (tmp_tmpd, 0);
11431 CPU (h_nbit) = opval;
11432 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11435 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11436 CPU (h_zbit) = opval;
11437 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11439 SET_H_CBIT_MOVE (0);
11440 SET_H_VBIT_MOVE (0);
11444 CPU (h_xbit) = opval;
11445 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11449 SET_H_INSN_PREFIXED_P (opval);
11450 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11460 CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
11462 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11463 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11464 #define FLD(f) abuf->fields.sfmt_addc_m.f
11465 int UNUSED written = 0;
11466 IADDR UNUSED pc = abuf->addr;
11467 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11473 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11474 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11475 tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11478 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11480 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11481 SET_H_GR (FLD (f_operand2), opval);
11482 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11487 BI opval = LTHI (tmp_tmpd, 0);
11488 CPU (h_nbit) = opval;
11489 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11492 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11493 CPU (h_zbit) = opval;
11494 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11496 SET_H_CBIT_MOVE (0);
11497 SET_H_VBIT_MOVE (0);
11501 CPU (h_xbit) = opval;
11502 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11506 SET_H_INSN_PREFIXED_P (opval);
11507 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11517 CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
11519 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11520 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11521 #define FLD(f) abuf->fields.sfmt_addc_m.f
11522 int UNUSED written = 0;
11523 IADDR UNUSED pc = abuf->addr;
11524 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11530 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11531 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11532 tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11534 SI opval = tmp_tmpd;
11535 SET_H_GR (FLD (f_operand2), opval);
11536 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11540 BI opval = LTSI (tmp_tmpd, 0);
11541 CPU (h_nbit) = opval;
11542 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11545 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11546 CPU (h_zbit) = opval;
11547 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11549 SET_H_CBIT_MOVE (0);
11550 SET_H_VBIT_MOVE (0);
11554 CPU (h_xbit) = opval;
11555 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11559 SET_H_INSN_PREFIXED_P (opval);
11560 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11570 CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
11572 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11573 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11574 #define FLD(f) abuf->fields.sfmt_asrq.f
11575 int UNUSED written = 0;
11576 IADDR UNUSED pc = abuf->addr;
11577 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11581 tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11583 SI opval = tmp_tmpd;
11584 SET_H_GR (FLD (f_operand2), opval);
11585 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11589 BI opval = LTSI (tmp_tmpd, 0);
11590 CPU (h_nbit) = opval;
11591 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11594 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11595 CPU (h_zbit) = opval;
11596 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11598 SET_H_CBIT_MOVE (0);
11599 SET_H_VBIT_MOVE (0);
11603 CPU (h_xbit) = opval;
11604 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11608 SET_H_INSN_PREFIXED_P (opval);
11609 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11619 CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
11621 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11622 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11623 #define FLD(f) abuf->fields.sfmt_addc_m.f
11624 int UNUSED written = 0;
11625 IADDR UNUSED pc = abuf->addr;
11626 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11631 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11632 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11635 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11637 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11638 SET_H_GR (FLD (f_operand2), opval);
11639 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11644 BI opval = LTQI (tmp_tmpd, 0);
11645 CPU (h_nbit) = opval;
11646 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11649 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11650 CPU (h_zbit) = opval;
11651 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11653 SET_H_CBIT_MOVE (0);
11654 SET_H_VBIT_MOVE (0);
11658 CPU (h_xbit) = opval;
11659 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11663 SET_H_INSN_PREFIXED_P (opval);
11664 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11674 CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $Rs,$Rd */
11676 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11677 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11678 #define FLD(f) abuf->fields.sfmt_addc_m.f
11679 int UNUSED written = 0;
11680 IADDR UNUSED pc = abuf->addr;
11681 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11686 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11687 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11690 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11692 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11693 SET_H_GR (FLD (f_operand2), opval);
11694 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11699 BI opval = LTHI (tmp_tmpd, 0);
11700 CPU (h_nbit) = opval;
11701 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11704 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11705 CPU (h_zbit) = opval;
11706 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11708 SET_H_CBIT_MOVE (0);
11709 SET_H_VBIT_MOVE (0);
11713 CPU (h_xbit) = opval;
11714 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11718 SET_H_INSN_PREFIXED_P (opval);
11719 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11729 CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
11731 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11732 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11733 #define FLD(f) abuf->fields.sfmt_addc_m.f
11734 int UNUSED written = 0;
11735 IADDR UNUSED pc = abuf->addr;
11736 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11741 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11742 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11744 SI opval = tmp_tmpd;
11745 SET_H_GR (FLD (f_operand2), opval);
11746 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11750 BI opval = LTSI (tmp_tmpd, 0);
11751 CPU (h_nbit) = opval;
11752 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11755 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11756 CPU (h_zbit) = opval;
11757 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11759 SET_H_CBIT_MOVE (0);
11760 SET_H_VBIT_MOVE (0);
11764 CPU (h_xbit) = opval;
11765 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11769 SET_H_INSN_PREFIXED_P (opval);
11770 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11780 CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
11782 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11783 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11784 #define FLD(f) abuf->fields.sfmt_asrq.f
11785 int UNUSED written = 0;
11786 IADDR UNUSED pc = abuf->addr;
11787 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11791 tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11793 SI opval = tmp_tmpd;
11794 SET_H_GR (FLD (f_operand2), opval);
11795 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11799 BI opval = LTSI (tmp_tmpd, 0);
11800 CPU (h_nbit) = opval;
11801 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11804 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11805 CPU (h_zbit) = opval;
11806 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11808 SET_H_CBIT_MOVE (0);
11809 SET_H_VBIT_MOVE (0);
11813 CPU (h_xbit) = opval;
11814 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11818 SET_H_INSN_PREFIXED_P (opval);
11819 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11829 CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
11831 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11832 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11833 #define FLD(f) abuf->fields.sfmt_addc_m.f
11834 int UNUSED written = 0;
11835 IADDR UNUSED pc = abuf->addr;
11836 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11841 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11842 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11845 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11847 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11848 SET_H_GR (FLD (f_operand2), opval);
11849 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11854 BI opval = LTQI (tmp_tmpd, 0);
11855 CPU (h_nbit) = opval;
11856 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11859 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11860 CPU (h_zbit) = opval;
11861 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11863 SET_H_CBIT_MOVE (0);
11864 SET_H_VBIT_MOVE (0);
11868 CPU (h_xbit) = opval;
11869 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11873 SET_H_INSN_PREFIXED_P (opval);
11874 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11884 CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
11886 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11887 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11888 #define FLD(f) abuf->fields.sfmt_addc_m.f
11889 int UNUSED written = 0;
11890 IADDR UNUSED pc = abuf->addr;
11891 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11896 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11897 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11900 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11902 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11903 SET_H_GR (FLD (f_operand2), opval);
11904 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11909 BI opval = LTHI (tmp_tmpd, 0);
11910 CPU (h_nbit) = opval;
11911 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11914 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11915 CPU (h_zbit) = opval;
11916 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11918 SET_H_CBIT_MOVE (0);
11919 SET_H_VBIT_MOVE (0);
11923 CPU (h_xbit) = opval;
11924 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11928 SET_H_INSN_PREFIXED_P (opval);
11929 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11939 CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
11941 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11942 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11943 #define FLD(f) abuf->fields.sfmt_addc_m.f
11944 int UNUSED written = 0;
11945 IADDR UNUSED pc = abuf->addr;
11946 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11951 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11952 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11954 SI opval = tmp_tmpd;
11955 SET_H_GR (FLD (f_operand2), opval);
11956 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11960 BI opval = LTSI (tmp_tmpd, 0);
11961 CPU (h_nbit) = opval;
11962 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11965 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11966 CPU (h_zbit) = opval;
11967 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11969 SET_H_CBIT_MOVE (0);
11970 SET_H_VBIT_MOVE (0);
11974 CPU (h_xbit) = opval;
11975 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11979 SET_H_INSN_PREFIXED_P (opval);
11980 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11990 CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
11992 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11993 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11994 #define FLD(f) abuf->fields.sfmt_asrq.f
11995 int UNUSED written = 0;
11996 IADDR UNUSED pc = abuf->addr;
11997 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12001 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
12003 SI opval = tmp_tmpd;
12004 SET_H_GR (FLD (f_operand2), opval);
12005 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12009 BI opval = LTSI (tmp_tmpd, 0);
12010 CPU (h_nbit) = opval;
12011 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12014 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12015 CPU (h_zbit) = opval;
12016 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12018 SET_H_CBIT_MOVE (0);
12019 SET_H_VBIT_MOVE (0);
12023 CPU (h_xbit) = opval;
12024 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12028 SET_H_INSN_PREFIXED_P (opval);
12029 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12039 CASE (sem, INSN_BTST) : /* $Rs,$Rd */
12041 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12042 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12043 #define FLD(f) abuf->fields.sfmt_muls_b.f
12044 int UNUSED written = 0;
12045 IADDR UNUSED pc = abuf->addr;
12046 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12051 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
12054 BI opval = LTSI (tmp_tmpd, 0);
12055 CPU (h_nbit) = opval;
12056 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12059 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12060 CPU (h_zbit) = opval;
12061 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12063 SET_H_CBIT_MOVE (0);
12064 SET_H_VBIT_MOVE (0);
12068 CPU (h_xbit) = opval;
12069 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12073 SET_H_INSN_PREFIXED_P (opval);
12074 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12084 CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
12086 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12087 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12088 #define FLD(f) abuf->fields.sfmt_asrq.f
12089 int UNUSED written = 0;
12090 IADDR UNUSED pc = abuf->addr;
12091 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12095 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
12098 BI opval = LTSI (tmp_tmpd, 0);
12099 CPU (h_nbit) = opval;
12100 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12103 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12104 CPU (h_zbit) = opval;
12105 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12107 SET_H_CBIT_MOVE (0);
12108 SET_H_VBIT_MOVE (0);
12112 CPU (h_xbit) = opval;
12113 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12117 SET_H_INSN_PREFIXED_P (opval);
12118 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12128 CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
12130 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12131 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12132 #define FLD(f) abuf->fields.sfmt_setf.f
12133 int UNUSED written = 0;
12134 IADDR UNUSED pc = abuf->addr;
12135 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12139 tmp_tmp = FLD (f_dstsrc);
12140 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
12143 CPU (h_cbit) = opval;
12144 written |= (1 << 1);
12145 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
12148 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
12151 CPU (h_vbit) = opval;
12152 written |= (1 << 7);
12153 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
12156 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
12159 CPU (h_zbit) = opval;
12160 written |= (1 << 9);
12161 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12164 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
12167 CPU (h_nbit) = opval;
12168 written |= (1 << 3);
12169 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12172 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12175 CPU (h_xbit) = opval;
12176 written |= (1 << 8);
12177 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12180 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12183 SET_H_IBIT (opval);
12184 written |= (1 << 2);
12185 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12188 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12191 SET_H_UBIT (opval);
12192 written |= (1 << 6);
12193 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12196 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12199 CPU (h_pbit) = opval;
12200 written |= (1 << 4);
12201 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12206 SET_H_INSN_PREFIXED_P (opval);
12207 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12209 if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12212 CPU (h_xbit) = opval;
12213 written |= (1 << 8);
12214 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12219 abuf->written = written;
12224 CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
12226 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12227 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12228 #define FLD(f) abuf->fields.sfmt_setf.f
12229 int UNUSED written = 0;
12230 IADDR UNUSED pc = abuf->addr;
12231 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12235 tmp_tmp = FLD (f_dstsrc);
12236 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
12239 CPU (h_cbit) = opval;
12240 written |= (1 << 1);
12241 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
12244 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
12247 CPU (h_vbit) = opval;
12248 written |= (1 << 7);
12249 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
12252 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
12255 CPU (h_zbit) = opval;
12256 written |= (1 << 9);
12257 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12260 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
12263 CPU (h_nbit) = opval;
12264 written |= (1 << 3);
12265 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12268 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12271 CPU (h_xbit) = opval;
12272 written |= (1 << 8);
12273 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12276 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12279 SET_H_IBIT (opval);
12280 written |= (1 << 2);
12281 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12284 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12287 SET_H_UBIT (opval);
12288 written |= (1 << 6);
12289 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12292 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12295 CPU (h_pbit) = opval;
12296 written |= (1 << 4);
12297 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12303 CPU (h_xbit) = opval;
12304 written |= (1 << 8);
12305 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12309 SET_H_INSN_PREFIXED_P (opval);
12310 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12315 abuf->written = written;
12320 CASE (sem, INSN_RFE) : /* rfe */
12322 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12323 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12324 #define FLD(f) abuf->fields.sfmt_rfe.f
12325 int UNUSED written = 0;
12326 IADDR UNUSED pc = abuf->addr;
12327 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12335 tmp_oldccs = GET_H_SR (((UINT) 13));
12336 tmp_keepmask = 0xc0000000;
12337 tmp_samebits = ANDSI (tmp_oldccs, tmp_keepmask);
12338 tmp_shiftbits = ANDSI (SRLSI (ANDSI (tmp_oldccs, 1073609728), 10), INVSI (tmp_keepmask));
12339 tmp_p1 = NESI (0, ANDSI (tmp_oldccs, 131072));
12341 SI opval = ORSI (ORSI (tmp_samebits, tmp_shiftbits), ((ANDBI (CPU (h_rbit), NOTBI (tmp_p1))) ? (0) : (128)));
12342 SET_H_SR (((UINT) 13), opval);
12343 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12351 CASE (sem, INSN_SFE) : /* sfe */
12353 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12354 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12355 #define FLD(f) abuf->fields.sfmt_rfe.f
12356 int UNUSED written = 0;
12357 IADDR UNUSED pc = abuf->addr;
12358 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12363 tmp_savemask = 0xc0000000;
12364 tmp_oldccs = GET_H_SR (((UINT) 13));
12366 SI opval = ORSI (ANDSI (tmp_savemask, tmp_oldccs), ANDSI (INVSI (tmp_savemask), SLLSI (tmp_oldccs, 10)));
12367 SET_H_SR (((UINT) 13), opval);
12368 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12376 CASE (sem, INSN_RFG) : /* rfg */
12378 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12379 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12380 #define FLD(f) abuf->fields.sfmt_empty.f
12381 int UNUSED written = 0;
12382 IADDR UNUSED pc = abuf->addr;
12383 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12385 crisv32f_rfg_handler (current_cpu, pc);
12391 CASE (sem, INSN_RFN) : /* rfn */
12393 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12394 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12395 #define FLD(f) abuf->fields.sfmt_rfe.f
12396 int UNUSED written = 0;
12397 IADDR UNUSED pc = abuf->addr;
12398 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12407 tmp_oldccs = GET_H_SR (((UINT) 13));
12408 tmp_keepmask = 0xc0000000;
12409 tmp_samebits = ANDSI (tmp_oldccs, tmp_keepmask);
12410 tmp_shiftbits = ANDSI (SRLSI (ANDSI (tmp_oldccs, 1073609728), 10), INVSI (tmp_keepmask));
12411 tmp_p1 = NESI (0, ANDSI (tmp_oldccs, 131072));
12413 SI opval = ORSI (ORSI (tmp_samebits, tmp_shiftbits), ((ANDBI (CPU (h_rbit), NOTBI (tmp_p1))) ? (0) : (128)));
12414 SET_H_SR (((UINT) 13), opval);
12415 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12420 SET_H_MBIT (opval);
12421 TRACE_RESULT (current_cpu, abuf, "mbit", 'x', opval);
12429 CASE (sem, INSN_HALT) : /* halt */
12431 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12432 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12433 #define FLD(f) abuf->fields.sfmt_empty.f
12434 int UNUSED written = 0;
12435 IADDR UNUSED pc = abuf->addr;
12437 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12440 USI opval = crisv32f_halt_handler (current_cpu, pc);
12441 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12442 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12445 SEM_BRANCH_FINI (vpc);
12450 CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
12452 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12453 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12454 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12455 int UNUSED written = 0;
12456 IADDR UNUSED pc = abuf->addr;
12458 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12462 tmp_truthval = ({ SI tmp_tmpcond;
12464 tmp_tmpcond = FLD (f_operand2);
12465 ; if (EQSI (tmp_tmpcond, 0)) {
12466 tmp_condres = NOTBI (CPU (h_cbit));
12468 else if (EQSI (tmp_tmpcond, 1)) {
12469 tmp_condres = CPU (h_cbit);
12471 else if (EQSI (tmp_tmpcond, 2)) {
12472 tmp_condres = NOTBI (CPU (h_zbit));
12474 else if (EQSI (tmp_tmpcond, 3)) {
12475 tmp_condres = CPU (h_zbit);
12477 else if (EQSI (tmp_tmpcond, 4)) {
12478 tmp_condres = NOTBI (CPU (h_vbit));
12480 else if (EQSI (tmp_tmpcond, 5)) {
12481 tmp_condres = CPU (h_vbit);
12483 else if (EQSI (tmp_tmpcond, 6)) {
12484 tmp_condres = NOTBI (CPU (h_nbit));
12486 else if (EQSI (tmp_tmpcond, 7)) {
12487 tmp_condres = CPU (h_nbit);
12489 else if (EQSI (tmp_tmpcond, 8)) {
12490 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12492 else if (EQSI (tmp_tmpcond, 9)) {
12493 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12495 else if (EQSI (tmp_tmpcond, 10)) {
12496 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12498 else if (EQSI (tmp_tmpcond, 11)) {
12499 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12501 else if (EQSI (tmp_tmpcond, 12)) {
12502 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12504 else if (EQSI (tmp_tmpcond, 13)) {
12505 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12507 else if (EQSI (tmp_tmpcond, 14)) {
12510 else if (EQSI (tmp_tmpcond, 15)) {
12511 tmp_condres = CPU (h_pbit);
12514 crisv32f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
12518 CPU (h_xbit) = opval;
12519 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12523 SET_H_INSN_PREFIXED_P (opval);
12524 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12527 if (tmp_truthval) {
12530 USI opval = FLD (i_o_pcrel);
12531 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12532 written |= (1 << 8);
12533 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12539 abuf->written = written;
12540 SEM_BRANCH_FINI (vpc);
12545 CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
12547 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12548 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12549 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12550 int UNUSED written = 0;
12551 IADDR UNUSED pc = abuf->addr;
12553 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12559 CPU (h_xbit) = opval;
12560 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12564 SET_H_INSN_PREFIXED_P (opval);
12565 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12570 USI opval = FLD (i_o_pcrel);
12571 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12572 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12577 SEM_BRANCH_FINI (vpc);
12582 CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
12584 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12585 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12586 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12587 int UNUSED written = 0;
12588 IADDR UNUSED pc = abuf->addr;
12590 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12594 tmp_truthval = ({ SI tmp_tmpcond;
12596 tmp_tmpcond = FLD (f_operand2);
12597 ; if (EQSI (tmp_tmpcond, 0)) {
12598 tmp_condres = NOTBI (CPU (h_cbit));
12600 else if (EQSI (tmp_tmpcond, 1)) {
12601 tmp_condres = CPU (h_cbit);
12603 else if (EQSI (tmp_tmpcond, 2)) {
12604 tmp_condres = NOTBI (CPU (h_zbit));
12606 else if (EQSI (tmp_tmpcond, 3)) {
12607 tmp_condres = CPU (h_zbit);
12609 else if (EQSI (tmp_tmpcond, 4)) {
12610 tmp_condres = NOTBI (CPU (h_vbit));
12612 else if (EQSI (tmp_tmpcond, 5)) {
12613 tmp_condres = CPU (h_vbit);
12615 else if (EQSI (tmp_tmpcond, 6)) {
12616 tmp_condres = NOTBI (CPU (h_nbit));
12618 else if (EQSI (tmp_tmpcond, 7)) {
12619 tmp_condres = CPU (h_nbit);
12621 else if (EQSI (tmp_tmpcond, 8)) {
12622 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12624 else if (EQSI (tmp_tmpcond, 9)) {
12625 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12627 else if (EQSI (tmp_tmpcond, 10)) {
12628 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12630 else if (EQSI (tmp_tmpcond, 11)) {
12631 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12633 else if (EQSI (tmp_tmpcond, 12)) {
12634 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12636 else if (EQSI (tmp_tmpcond, 13)) {
12637 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12639 else if (EQSI (tmp_tmpcond, 14)) {
12642 else if (EQSI (tmp_tmpcond, 15)) {
12643 tmp_condres = CPU (h_pbit);
12646 crisv32f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
12650 CPU (h_xbit) = opval;
12651 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12655 SET_H_INSN_PREFIXED_P (opval);
12656 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12659 if (tmp_truthval) {
12662 USI opval = FLD (i_o_word_pcrel);
12663 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12664 written |= (1 << 8);
12665 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12671 abuf->written = written;
12672 SEM_BRANCH_FINI (vpc);
12677 CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
12679 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12680 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12681 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12682 int UNUSED written = 0;
12683 IADDR UNUSED pc = abuf->addr;
12685 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12691 CPU (h_xbit) = opval;
12692 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12696 SET_H_INSN_PREFIXED_P (opval);
12697 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12702 USI opval = FLD (i_o_word_pcrel);
12703 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12704 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12709 SEM_BRANCH_FINI (vpc);
12714 CASE (sem, INSN_JAS_R) : /* jas ${Rs},${Pd} */
12716 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12717 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12718 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12719 int UNUSED written = 0;
12720 IADDR UNUSED pc = abuf->addr;
12722 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12728 CPU (h_xbit) = opval;
12729 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12733 SET_H_INSN_PREFIXED_P (opval);
12734 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12737 if (ANDIF (EQSI (FLD (f_operand1), 1), EQSI (FLD (f_operand2), 11))) {
12738 cris_flush_simulator_decode_cache (current_cpu, pc);
12743 SI opval = ADDSI (pc, 4);
12744 SET_H_SR (FLD (f_operand2), opval);
12745 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12748 USI opval = GET_H_GR (FLD (f_operand1));
12749 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12750 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12756 SEM_BRANCH_FINI (vpc);
12761 CASE (sem, INSN_JAS_C) : /* jas ${const32},${Pd} */
12763 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12764 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12765 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12766 int UNUSED written = 0;
12767 IADDR UNUSED pc = abuf->addr;
12769 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12775 CPU (h_xbit) = opval;
12776 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12780 SET_H_INSN_PREFIXED_P (opval);
12781 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12787 SI opval = ADDSI (pc, 8);
12788 SET_H_SR (FLD (f_operand2), opval);
12789 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12792 USI opval = FLD (f_indir_pc__dword);
12793 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12794 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12800 SEM_BRANCH_FINI (vpc);
12805 CASE (sem, INSN_JUMP_P) : /* jump ${Ps} */
12807 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12808 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12809 #define FLD(f) abuf->fields.sfmt_mcp.f
12810 int UNUSED written = 0;
12811 IADDR UNUSED pc = abuf->addr;
12813 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12819 CPU (h_xbit) = opval;
12820 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12824 SET_H_INSN_PREFIXED_P (opval);
12825 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12830 USI opval = GET_H_SR (FLD (f_operand2));
12831 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12832 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12837 SEM_BRANCH_FINI (vpc);
12842 CASE (sem, INSN_BAS_C) : /* bas ${const32},${Pd} */
12844 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12845 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12846 #define FLD(f) abuf->fields.sfmt_bas_c.f
12847 int UNUSED written = 0;
12848 IADDR UNUSED pc = abuf->addr;
12850 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12856 CPU (h_xbit) = opval;
12857 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12861 SET_H_INSN_PREFIXED_P (opval);
12862 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12868 SI opval = ADDSI (pc, 8);
12869 SET_H_SR (FLD (f_operand2), opval);
12870 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12873 USI opval = FLD (i_const32_pcrel);
12874 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12875 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12881 SEM_BRANCH_FINI (vpc);
12886 CASE (sem, INSN_JASC_R) : /* jasc ${Rs},${Pd} */
12888 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12890 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12891 int UNUSED written = 0;
12892 IADDR UNUSED pc = abuf->addr;
12894 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12900 CPU (h_xbit) = opval;
12901 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12905 SET_H_INSN_PREFIXED_P (opval);
12906 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12912 SI opval = ADDSI (pc, 8);
12913 SET_H_SR (FLD (f_operand2), opval);
12914 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12917 USI opval = GET_H_GR (FLD (f_operand1));
12918 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12919 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12925 SEM_BRANCH_FINI (vpc);
12930 CASE (sem, INSN_JASC_C) : /* jasc ${const32},${Pd} */
12932 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12933 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12934 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12935 int UNUSED written = 0;
12936 IADDR UNUSED pc = abuf->addr;
12938 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12944 CPU (h_xbit) = opval;
12945 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12949 SET_H_INSN_PREFIXED_P (opval);
12950 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12956 SI opval = ADDSI (pc, 12);
12957 SET_H_SR (FLD (f_operand2), opval);
12958 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12961 USI opval = FLD (f_indir_pc__dword);
12962 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12963 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12969 SEM_BRANCH_FINI (vpc);
12974 CASE (sem, INSN_BASC_C) : /* basc ${const32},${Pd} */
12976 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12977 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12978 #define FLD(f) abuf->fields.sfmt_bas_c.f
12979 int UNUSED written = 0;
12980 IADDR UNUSED pc = abuf->addr;
12982 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12988 CPU (h_xbit) = opval;
12989 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12993 SET_H_INSN_PREFIXED_P (opval);
12994 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13000 SI opval = ADDSI (pc, 12);
13001 SET_H_SR (FLD (f_operand2), opval);
13002 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
13005 USI opval = FLD (i_const32_pcrel);
13006 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13007 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13013 SEM_BRANCH_FINI (vpc);
13018 CASE (sem, INSN_BREAK) : /* break $n */
13020 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13021 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13022 #define FLD(f) abuf->fields.sfmt_break.f
13023 int UNUSED written = 0;
13024 IADDR UNUSED pc = abuf->addr;
13026 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13032 CPU (h_xbit) = opval;
13033 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13037 SET_H_INSN_PREFIXED_P (opval);
13038 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13042 USI opval = crisv32f_break_handler (current_cpu, FLD (f_u4), pc);
13043 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13044 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13048 SEM_BRANCH_FINI (vpc);
13053 CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
13055 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13056 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13057 #define FLD(f) abuf->fields.sfmt_muls_b.f
13058 int UNUSED written = 0;
13059 IADDR UNUSED pc = abuf->addr;
13060 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13066 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
13067 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13068 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13070 SI opval = tmp_newval;
13071 SET_H_GR (FLD (f_operand2), opval);
13072 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13076 BI opval = LTSI (tmp_newval, 0);
13077 CPU (h_nbit) = opval;
13078 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13081 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13082 CPU (h_zbit) = opval;
13083 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13085 SET_H_CBIT_MOVE (0);
13086 SET_H_VBIT_MOVE (0);
13090 CPU (h_xbit) = opval;
13091 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13095 SET_H_INSN_PREFIXED_P (opval);
13096 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13106 CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
13108 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13109 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13110 #define FLD(f) abuf->fields.sfmt_muls_b.f
13111 int UNUSED written = 0;
13112 IADDR UNUSED pc = abuf->addr;
13113 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13119 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
13120 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13121 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13123 SI opval = tmp_newval;
13124 SET_H_GR (FLD (f_operand2), opval);
13125 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13129 BI opval = LTSI (tmp_newval, 0);
13130 CPU (h_nbit) = opval;
13131 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13134 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13135 CPU (h_zbit) = opval;
13136 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13138 SET_H_CBIT_MOVE (0);
13139 SET_H_VBIT_MOVE (0);
13143 CPU (h_xbit) = opval;
13144 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13148 SET_H_INSN_PREFIXED_P (opval);
13149 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13159 CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
13161 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13162 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13163 #define FLD(f) abuf->fields.sfmt_muls_b.f
13164 int UNUSED written = 0;
13165 IADDR UNUSED pc = abuf->addr;
13166 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13172 tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
13173 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13174 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13176 SI opval = tmp_newval;
13177 SET_H_GR (FLD (f_operand2), opval);
13178 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13182 BI opval = LTSI (tmp_newval, 0);
13183 CPU (h_nbit) = opval;
13184 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13187 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13188 CPU (h_zbit) = opval;
13189 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13191 SET_H_CBIT_MOVE (0);
13192 SET_H_VBIT_MOVE (0);
13196 CPU (h_xbit) = opval;
13197 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13201 SET_H_INSN_PREFIXED_P (opval);
13202 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13212 CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
13214 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13215 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13216 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13217 int UNUSED written = 0;
13218 IADDR UNUSED pc = abuf->addr;
13219 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13225 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
13226 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13227 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13229 SI opval = tmp_newval;
13230 SET_H_GR (FLD (f_operand2), opval);
13231 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13235 BI opval = LTSI (tmp_newval, 0);
13236 CPU (h_nbit) = opval;
13237 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13240 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13241 CPU (h_zbit) = opval;
13242 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13244 SET_H_CBIT_MOVE (0);
13245 SET_H_VBIT_MOVE (0);
13249 CPU (h_xbit) = opval;
13250 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13254 SET_H_INSN_PREFIXED_P (opval);
13255 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13265 CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
13267 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13268 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13269 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13270 int UNUSED written = 0;
13271 IADDR UNUSED pc = abuf->addr;
13272 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13278 tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
13279 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13280 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13282 SI opval = tmp_newval;
13283 SET_H_GR (FLD (f_operand2), opval);
13284 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13288 BI opval = LTSI (tmp_newval, 0);
13289 CPU (h_nbit) = opval;
13290 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13293 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13294 CPU (h_zbit) = opval;
13295 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13297 SET_H_CBIT_MOVE (0);
13298 SET_H_VBIT_MOVE (0);
13302 CPU (h_xbit) = opval;
13303 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13307 SET_H_INSN_PREFIXED_P (opval);
13308 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13318 CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
13320 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13321 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13322 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13323 int UNUSED written = 0;
13324 IADDR UNUSED pc = abuf->addr;
13325 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13331 tmp_tmpops = FLD (f_indir_pc__dword);
13332 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13333 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13335 SI opval = tmp_newval;
13336 SET_H_GR (FLD (f_operand2), opval);
13337 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13341 BI opval = LTSI (tmp_newval, 0);
13342 CPU (h_nbit) = opval;
13343 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13346 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13347 CPU (h_zbit) = opval;
13348 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13350 SET_H_CBIT_MOVE (0);
13351 SET_H_VBIT_MOVE (0);
13355 CPU (h_xbit) = opval;
13356 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13360 SET_H_INSN_PREFIXED_P (opval);
13361 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13371 CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
13373 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13374 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13375 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13376 int UNUSED written = 0;
13377 IADDR UNUSED pc = abuf->addr;
13378 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13382 tmp_truthval = ({ SI tmp_tmpcond;
13384 tmp_tmpcond = FLD (f_operand2);
13385 ; if (EQSI (tmp_tmpcond, 0)) {
13386 tmp_condres = NOTBI (CPU (h_cbit));
13388 else if (EQSI (tmp_tmpcond, 1)) {
13389 tmp_condres = CPU (h_cbit);
13391 else if (EQSI (tmp_tmpcond, 2)) {
13392 tmp_condres = NOTBI (CPU (h_zbit));
13394 else if (EQSI (tmp_tmpcond, 3)) {
13395 tmp_condres = CPU (h_zbit);
13397 else if (EQSI (tmp_tmpcond, 4)) {
13398 tmp_condres = NOTBI (CPU (h_vbit));
13400 else if (EQSI (tmp_tmpcond, 5)) {
13401 tmp_condres = CPU (h_vbit);
13403 else if (EQSI (tmp_tmpcond, 6)) {
13404 tmp_condres = NOTBI (CPU (h_nbit));
13406 else if (EQSI (tmp_tmpcond, 7)) {
13407 tmp_condres = CPU (h_nbit);
13409 else if (EQSI (tmp_tmpcond, 8)) {
13410 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
13412 else if (EQSI (tmp_tmpcond, 9)) {
13413 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
13415 else if (EQSI (tmp_tmpcond, 10)) {
13416 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
13418 else if (EQSI (tmp_tmpcond, 11)) {
13419 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
13421 else if (EQSI (tmp_tmpcond, 12)) {
13422 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
13424 else if (EQSI (tmp_tmpcond, 13)) {
13425 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
13427 else if (EQSI (tmp_tmpcond, 14)) {
13430 else if (EQSI (tmp_tmpcond, 15)) {
13431 tmp_condres = CPU (h_pbit);
13435 SI opval = ZEXTBISI (tmp_truthval);
13436 SET_H_GR (FLD (f_operand1), opval);
13437 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13442 CPU (h_xbit) = opval;
13443 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13447 SET_H_INSN_PREFIXED_P (opval);
13448 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13457 CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
13459 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13460 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13461 #define FLD(f) abuf->fields.sfmt_muls_b.f
13462 int UNUSED written = 0;
13463 IADDR UNUSED pc = abuf->addr;
13464 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13469 tmp_tmp = GET_H_GR (FLD (f_operand1));
13472 if (GESI (tmp_tmp, 0)) {
13474 tmp_tmp = SLLSI (tmp_tmp, 1);
13475 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13478 if (GESI (tmp_tmp, 0)) {
13480 tmp_tmp = SLLSI (tmp_tmp, 1);
13481 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13484 if (GESI (tmp_tmp, 0)) {
13486 tmp_tmp = SLLSI (tmp_tmp, 1);
13487 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13490 if (GESI (tmp_tmp, 0)) {
13492 tmp_tmp = SLLSI (tmp_tmp, 1);
13493 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13496 if (GESI (tmp_tmp, 0)) {
13498 tmp_tmp = SLLSI (tmp_tmp, 1);
13499 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13502 if (GESI (tmp_tmp, 0)) {
13504 tmp_tmp = SLLSI (tmp_tmp, 1);
13505 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13508 if (GESI (tmp_tmp, 0)) {
13510 tmp_tmp = SLLSI (tmp_tmp, 1);
13511 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13514 if (GESI (tmp_tmp, 0)) {
13516 tmp_tmp = SLLSI (tmp_tmp, 1);
13517 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13520 if (GESI (tmp_tmp, 0)) {
13522 tmp_tmp = SLLSI (tmp_tmp, 1);
13523 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13526 if (GESI (tmp_tmp, 0)) {
13528 tmp_tmp = SLLSI (tmp_tmp, 1);
13529 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13532 if (GESI (tmp_tmp, 0)) {
13534 tmp_tmp = SLLSI (tmp_tmp, 1);
13535 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13538 if (GESI (tmp_tmp, 0)) {
13540 tmp_tmp = SLLSI (tmp_tmp, 1);
13541 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13544 if (GESI (tmp_tmp, 0)) {
13546 tmp_tmp = SLLSI (tmp_tmp, 1);
13547 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13550 if (GESI (tmp_tmp, 0)) {
13552 tmp_tmp = SLLSI (tmp_tmp, 1);
13553 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13556 if (GESI (tmp_tmp, 0)) {
13558 tmp_tmp = SLLSI (tmp_tmp, 1);
13559 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13562 if (GESI (tmp_tmp, 0)) {
13564 tmp_tmp = SLLSI (tmp_tmp, 1);
13565 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13568 if (GESI (tmp_tmp, 0)) {
13570 tmp_tmp = SLLSI (tmp_tmp, 1);
13571 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13574 if (GESI (tmp_tmp, 0)) {
13576 tmp_tmp = SLLSI (tmp_tmp, 1);
13577 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13580 if (GESI (tmp_tmp, 0)) {
13582 tmp_tmp = SLLSI (tmp_tmp, 1);
13583 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13586 if (GESI (tmp_tmp, 0)) {
13588 tmp_tmp = SLLSI (tmp_tmp, 1);
13589 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13592 if (GESI (tmp_tmp, 0)) {
13594 tmp_tmp = SLLSI (tmp_tmp, 1);
13595 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13598 if (GESI (tmp_tmp, 0)) {
13600 tmp_tmp = SLLSI (tmp_tmp, 1);
13601 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13604 if (GESI (tmp_tmp, 0)) {
13606 tmp_tmp = SLLSI (tmp_tmp, 1);
13607 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13610 if (GESI (tmp_tmp, 0)) {
13612 tmp_tmp = SLLSI (tmp_tmp, 1);
13613 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13616 if (GESI (tmp_tmp, 0)) {
13618 tmp_tmp = SLLSI (tmp_tmp, 1);
13619 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13622 if (GESI (tmp_tmp, 0)) {
13624 tmp_tmp = SLLSI (tmp_tmp, 1);
13625 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13628 if (GESI (tmp_tmp, 0)) {
13630 tmp_tmp = SLLSI (tmp_tmp, 1);
13631 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13634 if (GESI (tmp_tmp, 0)) {
13636 tmp_tmp = SLLSI (tmp_tmp, 1);
13637 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13640 if (GESI (tmp_tmp, 0)) {
13642 tmp_tmp = SLLSI (tmp_tmp, 1);
13643 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13646 if (GESI (tmp_tmp, 0)) {
13648 tmp_tmp = SLLSI (tmp_tmp, 1);
13649 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13652 if (GESI (tmp_tmp, 0)) {
13654 tmp_tmp = SLLSI (tmp_tmp, 1);
13655 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13658 if (GESI (tmp_tmp, 0)) {
13660 tmp_tmp = SLLSI (tmp_tmp, 1);
13661 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13666 SI opval = tmp_tmpd;
13667 SET_H_GR (FLD (f_operand2), opval);
13668 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13672 BI opval = LTSI (tmp_tmpd, 0);
13673 CPU (h_nbit) = opval;
13674 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13677 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13678 CPU (h_zbit) = opval;
13679 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13681 SET_H_CBIT_MOVE (0);
13682 SET_H_VBIT_MOVE (0);
13686 CPU (h_xbit) = opval;
13687 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13691 SET_H_INSN_PREFIXED_P (opval);
13692 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13702 CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
13704 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13705 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13706 #define FLD(f) abuf->fields.sfmt_addoq.f
13707 int UNUSED written = 0;
13708 IADDR UNUSED pc = abuf->addr;
13709 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13713 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
13714 SET_H_PREFIXREG_V32 (opval);
13715 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13719 SET_H_INSN_PREFIXED_P (opval);
13720 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13728 CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13730 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13731 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13732 #define FLD(f) abuf->fields.sfmt_addc_m.f
13733 int UNUSED written = 0;
13734 IADDR UNUSED pc = abuf->addr;
13735 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13739 tmp_tmps = ({ SI tmp_addr;
13742 tmp_postinc = FLD (f_memmode);
13743 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13744 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13745 ; if (NEBI (tmp_postinc, 0)) {
13747 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13748 tmp_addr = ADDSI (tmp_addr, 1);
13751 SI opval = tmp_addr;
13752 SET_H_GR (FLD (f_operand1), opval);
13753 written |= (1 << 6);
13754 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13760 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
13761 SET_H_PREFIXREG_V32 (opval);
13762 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13766 SET_H_INSN_PREFIXED_P (opval);
13767 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13771 abuf->written = written;
13776 CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13778 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13779 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13780 #define FLD(f) abuf->fields.sfmt_addc_m.f
13781 int UNUSED written = 0;
13782 IADDR UNUSED pc = abuf->addr;
13783 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13787 tmp_tmps = ({ SI tmp_addr;
13790 tmp_postinc = FLD (f_memmode);
13791 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13792 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
13793 ; if (NEBI (tmp_postinc, 0)) {
13795 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13796 tmp_addr = ADDSI (tmp_addr, 2);
13799 SI opval = tmp_addr;
13800 SET_H_GR (FLD (f_operand1), opval);
13801 written |= (1 << 6);
13802 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13808 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
13809 SET_H_PREFIXREG_V32 (opval);
13810 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13814 SET_H_INSN_PREFIXED_P (opval);
13815 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13819 abuf->written = written;
13824 CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13826 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13827 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13828 #define FLD(f) abuf->fields.sfmt_addc_m.f
13829 int UNUSED written = 0;
13830 IADDR UNUSED pc = abuf->addr;
13831 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13835 tmp_tmps = ({ SI tmp_addr;
13838 tmp_postinc = FLD (f_memmode);
13839 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13840 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13841 ; if (NEBI (tmp_postinc, 0)) {
13843 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13844 tmp_addr = ADDSI (tmp_addr, 4);
13847 SI opval = tmp_addr;
13848 SET_H_GR (FLD (f_operand1), opval);
13849 written |= (1 << 6);
13850 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13856 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
13857 SET_H_PREFIXREG_V32 (opval);
13858 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13862 SET_H_INSN_PREFIXED_P (opval);
13863 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13867 abuf->written = written;
13872 CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
13874 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13875 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13876 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13877 int UNUSED written = 0;
13878 IADDR UNUSED pc = abuf->addr;
13879 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13883 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
13884 SET_H_PREFIXREG_V32 (opval);
13885 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13889 SET_H_INSN_PREFIXED_P (opval);
13890 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13898 CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
13900 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13901 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13902 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13903 int UNUSED written = 0;
13904 IADDR UNUSED pc = abuf->addr;
13905 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13909 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
13910 SET_H_PREFIXREG_V32 (opval);
13911 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13915 SET_H_INSN_PREFIXED_P (opval);
13916 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13924 CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
13926 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13927 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13928 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13929 int UNUSED written = 0;
13930 IADDR UNUSED pc = abuf->addr;
13931 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13935 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
13936 SET_H_PREFIXREG_V32 (opval);
13937 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13941 SET_H_INSN_PREFIXED_P (opval);
13942 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13950 CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13952 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13953 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13954 #define FLD(f) abuf->fields.sfmt_muls_b.f
13955 int UNUSED written = 0;
13956 IADDR UNUSED pc = abuf->addr;
13957 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13961 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13962 SET_H_PREFIXREG_V32 (opval);
13963 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13967 SET_H_INSN_PREFIXED_P (opval);
13968 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13976 CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13978 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13979 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13980 #define FLD(f) abuf->fields.sfmt_muls_b.f
13981 int UNUSED written = 0;
13982 IADDR UNUSED pc = abuf->addr;
13983 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13987 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13988 SET_H_PREFIXREG_V32 (opval);
13989 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13993 SET_H_INSN_PREFIXED_P (opval);
13994 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14002 CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14004 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14005 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14006 #define FLD(f) abuf->fields.sfmt_muls_b.f
14007 int UNUSED written = 0;
14008 IADDR UNUSED pc = abuf->addr;
14009 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14013 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
14014 SET_H_PREFIXREG_V32 (opval);
14015 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14019 SET_H_INSN_PREFIXED_P (opval);
14020 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14028 CASE (sem, INSN_FIDXI) : /* fidxi [$Rs] */
14030 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14031 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14032 #define FLD(f) abuf->fields.sfmt_mcp.f
14033 int UNUSED written = 0;
14034 IADDR UNUSED pc = abuf->addr;
14036 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14039 USI opval = crisv32f_fidxi_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14040 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14041 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14044 SEM_BRANCH_FINI (vpc);
14049 CASE (sem, INSN_FTAGI) : /* fidxi [$Rs] */
14051 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14052 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14053 #define FLD(f) abuf->fields.sfmt_mcp.f
14054 int UNUSED written = 0;
14055 IADDR UNUSED pc = abuf->addr;
14057 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14060 USI opval = crisv32f_ftagi_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14061 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14062 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14065 SEM_BRANCH_FINI (vpc);
14070 CASE (sem, INSN_FIDXD) : /* fidxd [$Rs] */
14072 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14073 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14074 #define FLD(f) abuf->fields.sfmt_mcp.f
14075 int UNUSED written = 0;
14076 IADDR UNUSED pc = abuf->addr;
14078 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14081 USI opval = crisv32f_fidxd_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14082 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14083 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14086 SEM_BRANCH_FINI (vpc);
14091 CASE (sem, INSN_FTAGD) : /* ftagd [$Rs] */
14093 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14094 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14095 #define FLD(f) abuf->fields.sfmt_mcp.f
14096 int UNUSED written = 0;
14097 IADDR UNUSED pc = abuf->addr;
14099 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14102 USI opval = crisv32f_ftagd_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14103 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14104 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14107 SEM_BRANCH_FINI (vpc);
14114 ENDSWITCH (sem) /* End of semantic switch. */
14116 /* At this point `vpc' contains the next insn to execute. */
14119 #undef DEFINE_SWITCH
14120 #endif /* DEFINE_SWITCH */