1 /* Simulator instruction semantics for crisv10f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2005 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 /* The labels have the case they have because the enum of insn types
27 is all uppercase and in the non-stdc case the insn symbol is built
28 into the enum name. */
34 { CRISV10F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
35 { CRISV10F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
36 { CRISV10F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
37 { CRISV10F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
38 { CRISV10F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
39 { CRISV10F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
40 { CRISV10F_INSN_NOP, && case_sem_INSN_NOP },
41 { CRISV10F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
42 { CRISV10F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
43 { CRISV10F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
44 { CRISV10F_INSN_MOVEPCR, && case_sem_INSN_MOVEPCR },
45 { CRISV10F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
46 { CRISV10F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
47 { CRISV10F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
48 { CRISV10F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
49 { CRISV10F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
50 { CRISV10F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
51 { CRISV10F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
52 { CRISV10F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
53 { CRISV10F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
54 { CRISV10F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
55 { CRISV10F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
56 { CRISV10F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
57 { CRISV10F_INSN_ADDQ, && case_sem_INSN_ADDQ },
58 { CRISV10F_INSN_SUBQ, && case_sem_INSN_SUBQ },
59 { CRISV10F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
60 { CRISV10F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
61 { CRISV10F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
62 { CRISV10F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
63 { CRISV10F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
64 { CRISV10F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
65 { CRISV10F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
66 { CRISV10F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
67 { CRISV10F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
68 { CRISV10F_INSN_CMPQ, && case_sem_INSN_CMPQ },
69 { CRISV10F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
70 { CRISV10F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
71 { CRISV10F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
72 { CRISV10F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
73 { CRISV10F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
74 { CRISV10F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
75 { CRISV10F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
76 { CRISV10F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
77 { CRISV10F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
78 { CRISV10F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
79 { CRISV10F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
80 { CRISV10F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
81 { CRISV10F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
82 { CRISV10F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
83 { CRISV10F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
84 { CRISV10F_INSN_MOVE_R_SPRV10, && case_sem_INSN_MOVE_R_SPRV10 },
85 { CRISV10F_INSN_MOVE_SPR_RV10, && case_sem_INSN_MOVE_SPR_RV10 },
86 { CRISV10F_INSN_RET_TYPE, && case_sem_INSN_RET_TYPE },
87 { CRISV10F_INSN_MOVE_M_SPRV10, && case_sem_INSN_MOVE_M_SPRV10 },
88 { CRISV10F_INSN_MOVE_C_SPRV10_P5, && case_sem_INSN_MOVE_C_SPRV10_P5 },
89 { CRISV10F_INSN_MOVE_C_SPRV10_P9, && case_sem_INSN_MOVE_C_SPRV10_P9 },
90 { CRISV10F_INSN_MOVE_C_SPRV10_P10, && case_sem_INSN_MOVE_C_SPRV10_P10 },
91 { CRISV10F_INSN_MOVE_C_SPRV10_P11, && case_sem_INSN_MOVE_C_SPRV10_P11 },
92 { CRISV10F_INSN_MOVE_C_SPRV10_P12, && case_sem_INSN_MOVE_C_SPRV10_P12 },
93 { CRISV10F_INSN_MOVE_C_SPRV10_P13, && case_sem_INSN_MOVE_C_SPRV10_P13 },
94 { CRISV10F_INSN_MOVE_C_SPRV10_P7, && case_sem_INSN_MOVE_C_SPRV10_P7 },
95 { CRISV10F_INSN_MOVE_C_SPRV10_P14, && case_sem_INSN_MOVE_C_SPRV10_P14 },
96 { CRISV10F_INSN_MOVE_C_SPRV10_P15, && case_sem_INSN_MOVE_C_SPRV10_P15 },
97 { CRISV10F_INSN_MOVE_SPR_MV10, && case_sem_INSN_MOVE_SPR_MV10 },
98 { CRISV10F_INSN_SBFS, && case_sem_INSN_SBFS },
99 { CRISV10F_INSN_MOVEM_R_M, && case_sem_INSN_MOVEM_R_M },
100 { CRISV10F_INSN_MOVEM_M_R, && case_sem_INSN_MOVEM_M_R },
101 { CRISV10F_INSN_MOVEM_M_PC, && case_sem_INSN_MOVEM_M_PC },
102 { CRISV10F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
103 { CRISV10F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
104 { CRISV10F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
105 { CRISV10F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
106 { CRISV10F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
107 { CRISV10F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
108 { CRISV10F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
109 { CRISV10F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
110 { CRISV10F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
111 { CRISV10F_INSN_ADDCPC, && case_sem_INSN_ADDCPC },
112 { CRISV10F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
113 { CRISV10F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
114 { CRISV10F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
115 { CRISV10F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
116 { CRISV10F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
117 { CRISV10F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
118 { CRISV10F_INSN_ADDSPCPC, && case_sem_INSN_ADDSPCPC },
119 { CRISV10F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
120 { CRISV10F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
121 { CRISV10F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
122 { CRISV10F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
123 { CRISV10F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
124 { CRISV10F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
125 { CRISV10F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
126 { CRISV10F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
127 { CRISV10F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
128 { CRISV10F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
129 { CRISV10F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
130 { CRISV10F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
131 { CRISV10F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
132 { CRISV10F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
133 { CRISV10F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
134 { CRISV10F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
135 { CRISV10F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
136 { CRISV10F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
137 { CRISV10F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
138 { CRISV10F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
139 { CRISV10F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
140 { CRISV10F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
141 { CRISV10F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
142 { CRISV10F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
143 { CRISV10F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
144 { CRISV10F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
145 { CRISV10F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
146 { CRISV10F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
147 { CRISV10F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
148 { CRISV10F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
149 { CRISV10F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
150 { CRISV10F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
151 { CRISV10F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
152 { CRISV10F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
153 { CRISV10F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
154 { CRISV10F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
155 { CRISV10F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
156 { CRISV10F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
157 { CRISV10F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
158 { CRISV10F_INSN_MULS_B, && case_sem_INSN_MULS_B },
159 { CRISV10F_INSN_MULS_W, && case_sem_INSN_MULS_W },
160 { CRISV10F_INSN_MULS_D, && case_sem_INSN_MULS_D },
161 { CRISV10F_INSN_MULU_B, && case_sem_INSN_MULU_B },
162 { CRISV10F_INSN_MULU_W, && case_sem_INSN_MULU_W },
163 { CRISV10F_INSN_MULU_D, && case_sem_INSN_MULU_D },
164 { CRISV10F_INSN_MSTEP, && case_sem_INSN_MSTEP },
165 { CRISV10F_INSN_DSTEP, && case_sem_INSN_DSTEP },
166 { CRISV10F_INSN_ABS, && case_sem_INSN_ABS },
167 { CRISV10F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
168 { CRISV10F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
169 { CRISV10F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
170 { CRISV10F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
171 { CRISV10F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
172 { CRISV10F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
173 { CRISV10F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
174 { CRISV10F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
175 { CRISV10F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
176 { CRISV10F_INSN_ANDQ, && case_sem_INSN_ANDQ },
177 { CRISV10F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
178 { CRISV10F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
179 { CRISV10F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
180 { CRISV10F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
181 { CRISV10F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
182 { CRISV10F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
183 { CRISV10F_INSN_ORCBR, && case_sem_INSN_ORCBR },
184 { CRISV10F_INSN_ORCWR, && case_sem_INSN_ORCWR },
185 { CRISV10F_INSN_ORCDR, && case_sem_INSN_ORCDR },
186 { CRISV10F_INSN_ORQ, && case_sem_INSN_ORQ },
187 { CRISV10F_INSN_XOR, && case_sem_INSN_XOR },
188 { CRISV10F_INSN_SWAP, && case_sem_INSN_SWAP },
189 { CRISV10F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
190 { CRISV10F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
191 { CRISV10F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
192 { CRISV10F_INSN_ASRQ, && case_sem_INSN_ASRQ },
193 { CRISV10F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
194 { CRISV10F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
195 { CRISV10F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
196 { CRISV10F_INSN_LSRQ, && case_sem_INSN_LSRQ },
197 { CRISV10F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
198 { CRISV10F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
199 { CRISV10F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
200 { CRISV10F_INSN_LSLQ, && case_sem_INSN_LSLQ },
201 { CRISV10F_INSN_BTST, && case_sem_INSN_BTST },
202 { CRISV10F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
203 { CRISV10F_INSN_SETF, && case_sem_INSN_SETF },
204 { CRISV10F_INSN_CLEARF, && case_sem_INSN_CLEARF },
205 { CRISV10F_INSN_BCC_B, && case_sem_INSN_BCC_B },
206 { CRISV10F_INSN_BA_B, && case_sem_INSN_BA_B },
207 { CRISV10F_INSN_BCC_W, && case_sem_INSN_BCC_W },
208 { CRISV10F_INSN_BA_W, && case_sem_INSN_BA_W },
209 { CRISV10F_INSN_JUMP_R, && case_sem_INSN_JUMP_R },
210 { CRISV10F_INSN_JUMP_M, && case_sem_INSN_JUMP_M },
211 { CRISV10F_INSN_JUMP_C, && case_sem_INSN_JUMP_C },
212 { CRISV10F_INSN_BREAK, && case_sem_INSN_BREAK },
213 { CRISV10F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
214 { CRISV10F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
215 { CRISV10F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
216 { CRISV10F_INSN_BOUND_M_B_M, && case_sem_INSN_BOUND_M_B_M },
217 { CRISV10F_INSN_BOUND_M_W_M, && case_sem_INSN_BOUND_M_W_M },
218 { CRISV10F_INSN_BOUND_M_D_M, && case_sem_INSN_BOUND_M_D_M },
219 { CRISV10F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
220 { CRISV10F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
221 { CRISV10F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
222 { CRISV10F_INSN_SCC, && case_sem_INSN_SCC },
223 { CRISV10F_INSN_LZ, && case_sem_INSN_LZ },
224 { CRISV10F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
225 { CRISV10F_INSN_BDAPQPC, && case_sem_INSN_BDAPQPC },
226 { CRISV10F_INSN_BDAP_32_PC, && case_sem_INSN_BDAP_32_PC },
227 { CRISV10F_INSN_MOVE_M_PCPLUS_P0, && case_sem_INSN_MOVE_M_PCPLUS_P0 },
228 { CRISV10F_INSN_MOVE_M_SPPLUS_P8, && case_sem_INSN_MOVE_M_SPPLUS_P8 },
229 { CRISV10F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
230 { CRISV10F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
231 { CRISV10F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
232 { CRISV10F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
233 { CRISV10F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
234 { CRISV10F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
235 { CRISV10F_INSN_DIP_M, && case_sem_INSN_DIP_M },
236 { CRISV10F_INSN_DIP_C, && case_sem_INSN_DIP_C },
237 { CRISV10F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
238 { CRISV10F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
239 { CRISV10F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
240 { CRISV10F_INSN_BIAP_PC_B_R, && case_sem_INSN_BIAP_PC_B_R },
241 { CRISV10F_INSN_BIAP_PC_W_R, && case_sem_INSN_BIAP_PC_W_R },
242 { CRISV10F_INSN_BIAP_PC_D_R, && case_sem_INSN_BIAP_PC_D_R },
247 for (i = 0; labels[i].label != 0; ++i)
250 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
252 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
257 #endif /* DEFINE_LABELS */
261 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
262 off frills like tracing and profiling. */
263 /* FIXME: A better way would be to have TRACE_RESULT check for something
264 that can cause it to be optimized out. Another way would be to emit
265 special handlers into the instruction "stream". */
269 #define TRACE_RESULT(cpu, abuf, name, type, val)
273 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
274 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
276 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
283 /* Branch to next handler without going around main loop. */
284 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
285 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
287 #else /* ! WITH_SCACHE_PBB */
289 #define NEXT(vpc) BREAK (sem)
292 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
294 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
297 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
300 #endif /* ! WITH_SCACHE_PBB */
304 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
306 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
307 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
308 #define FLD(f) abuf->fields.fmt_empty.f
309 int UNUSED written = 0;
310 IADDR UNUSED pc = abuf->addr;
311 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
314 /* Update the recorded pc in the cpu state struct.
315 Only necessary for WITH_SCACHE case, but to avoid the
316 conditional compilation .... */
318 /* Virtual insns have zero size. Overwrite vpc with address of next insn
319 using the default-insn-bitsize spec. When executing insns in parallel
320 we may want to queue the fault and continue execution. */
321 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
322 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
329 CASE (sem, INSN_X_AFTER) : /* --after-- */
331 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
332 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
333 #define FLD(f) abuf->fields.fmt_empty.f
334 int UNUSED written = 0;
335 IADDR UNUSED pc = abuf->addr;
336 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
339 #if WITH_SCACHE_PBB_CRISV10F
340 crisv10f_pbb_after (current_cpu, sem_arg);
348 CASE (sem, INSN_X_BEFORE) : /* --before-- */
350 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
351 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
352 #define FLD(f) abuf->fields.fmt_empty.f
353 int UNUSED written = 0;
354 IADDR UNUSED pc = abuf->addr;
355 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
358 #if WITH_SCACHE_PBB_CRISV10F
359 crisv10f_pbb_before (current_cpu, sem_arg);
367 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
369 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
370 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
371 #define FLD(f) abuf->fields.fmt_empty.f
372 int UNUSED written = 0;
373 IADDR UNUSED pc = abuf->addr;
374 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
377 #if WITH_SCACHE_PBB_CRISV10F
379 vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
380 pbb_br_type, pbb_br_npc);
383 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
384 vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
385 CPU_PBB_BR_TYPE (current_cpu),
386 CPU_PBB_BR_NPC (current_cpu));
395 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
397 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
398 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
399 #define FLD(f) abuf->fields.fmt_empty.f
400 int UNUSED written = 0;
401 IADDR UNUSED pc = abuf->addr;
402 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
405 #if WITH_SCACHE_PBB_CRISV10F
406 vpc = crisv10f_pbb_chain (current_cpu, sem_arg);
417 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
419 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
420 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
421 #define FLD(f) abuf->fields.fmt_empty.f
422 int UNUSED written = 0;
423 IADDR UNUSED pc = abuf->addr;
424 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
427 #if WITH_SCACHE_PBB_CRISV10F
428 #if defined DEFINE_SWITCH || defined FAST_P
429 /* In the switch case FAST_P is a constant, allowing several optimizations
430 in any called inline functions. */
431 vpc = crisv10f_pbb_begin (current_cpu, FAST_P);
433 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
434 vpc = crisv10f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
436 vpc = crisv10f_pbb_begin (current_cpu, 0);
446 CASE (sem, INSN_NOP) : /* nop */
448 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
449 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
450 #define FLD(f) abuf->fields.fmt_empty.f
451 int UNUSED written = 0;
452 IADDR UNUSED pc = abuf->addr;
453 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
458 CPU (h_xbit) = opval;
459 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
463 SET_H_INSN_PREFIXED_P (opval);
464 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
472 CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
474 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
475 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
476 #define FLD(f) abuf->fields.sfmt_add_b_r.f
477 int UNUSED written = 0;
478 IADDR UNUSED pc = abuf->addr;
479 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
483 tmp_newval = GET_H_GR (FLD (f_operand1));
486 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
488 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
489 SET_H_GR (FLD (f_operand2), opval);
490 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
495 BI opval = LTQI (tmp_newval, 0);
496 CPU (h_nbit) = opval;
497 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
500 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
501 CPU (h_zbit) = opval;
502 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
509 CPU (h_xbit) = opval;
510 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
514 SET_H_INSN_PREFIXED_P (opval);
515 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
525 CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
527 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
528 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
529 #define FLD(f) abuf->fields.sfmt_add_b_r.f
530 int UNUSED written = 0;
531 IADDR UNUSED pc = abuf->addr;
532 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
536 tmp_newval = GET_H_GR (FLD (f_operand1));
539 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
541 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
542 SET_H_GR (FLD (f_operand2), opval);
543 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
548 BI opval = LTHI (tmp_newval, 0);
549 CPU (h_nbit) = opval;
550 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
553 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
554 CPU (h_zbit) = opval;
555 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
562 CPU (h_xbit) = opval;
563 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
567 SET_H_INSN_PREFIXED_P (opval);
568 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
578 CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
581 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
582 #define FLD(f) abuf->fields.sfmt_add_b_r.f
583 int UNUSED written = 0;
584 IADDR UNUSED pc = abuf->addr;
585 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
589 tmp_newval = GET_H_GR (FLD (f_operand1));
591 SI opval = tmp_newval;
592 SET_H_GR (FLD (f_operand2), opval);
593 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
597 BI opval = LTSI (tmp_newval, 0);
598 CPU (h_nbit) = opval;
599 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
602 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
603 CPU (h_zbit) = opval;
604 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
611 CPU (h_xbit) = opval;
612 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
616 SET_H_INSN_PREFIXED_P (opval);
617 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
627 CASE (sem, INSN_MOVEPCR) : /* move.d PC,${Rd} */
629 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
630 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
631 #define FLD(f) abuf->fields.sfmt_moveq.f
632 int UNUSED written = 0;
633 IADDR UNUSED pc = abuf->addr;
635 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
639 tmp_pcval = ADDSI (pc, 2);
641 SI opval = tmp_pcval;
642 SET_H_GR (FLD (f_operand2), opval);
643 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
647 BI opval = LTSI (tmp_pcval, 0);
648 CPU (h_nbit) = opval;
649 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
652 BI opval = ANDIF (EQSI (tmp_pcval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
653 CPU (h_zbit) = opval;
654 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
661 CPU (h_xbit) = opval;
662 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
666 SET_H_INSN_PREFIXED_P (opval);
667 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
673 SEM_BRANCH_FINI (vpc);
678 CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
680 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
681 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
682 #define FLD(f) abuf->fields.sfmt_moveq.f
683 int UNUSED written = 0;
684 IADDR UNUSED pc = abuf->addr;
685 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
689 tmp_newval = FLD (f_s6);
691 SI opval = tmp_newval;
692 SET_H_GR (FLD (f_operand2), opval);
693 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
696 SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
697 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
703 CPU (h_xbit) = opval;
704 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
708 SET_H_INSN_PREFIXED_P (opval);
709 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
719 CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
721 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
722 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
723 #define FLD(f) abuf->fields.sfmt_muls_b.f
724 int UNUSED written = 0;
725 IADDR UNUSED pc = abuf->addr;
726 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
730 tmp_newval = GET_H_GR (FLD (f_operand1));
732 SI opval = EXTQISI (tmp_newval);
733 SET_H_GR (FLD (f_operand2), opval);
734 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
738 BI opval = LTSI (tmp_newval, 0);
739 CPU (h_nbit) = opval;
740 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
743 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
744 CPU (h_zbit) = opval;
745 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
752 CPU (h_xbit) = opval;
753 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
757 SET_H_INSN_PREFIXED_P (opval);
758 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
768 CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
770 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
771 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
772 #define FLD(f) abuf->fields.sfmt_muls_b.f
773 int UNUSED written = 0;
774 IADDR UNUSED pc = abuf->addr;
775 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
779 tmp_newval = GET_H_GR (FLD (f_operand1));
781 SI opval = EXTHISI (tmp_newval);
782 SET_H_GR (FLD (f_operand2), opval);
783 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
787 BI opval = LTSI (tmp_newval, 0);
788 CPU (h_nbit) = opval;
789 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
792 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
793 CPU (h_zbit) = opval;
794 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
801 CPU (h_xbit) = opval;
802 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
806 SET_H_INSN_PREFIXED_P (opval);
807 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
817 CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
819 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
820 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
821 #define FLD(f) abuf->fields.sfmt_muls_b.f
822 int UNUSED written = 0;
823 IADDR UNUSED pc = abuf->addr;
824 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
828 tmp_newval = GET_H_GR (FLD (f_operand1));
830 SI opval = ZEXTQISI (tmp_newval);
831 SET_H_GR (FLD (f_operand2), opval);
832 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
836 BI opval = LTSI (tmp_newval, 0);
837 CPU (h_nbit) = opval;
838 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
841 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
842 CPU (h_zbit) = opval;
843 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
850 CPU (h_xbit) = opval;
851 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
855 SET_H_INSN_PREFIXED_P (opval);
856 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
866 CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
868 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
869 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
870 #define FLD(f) abuf->fields.sfmt_muls_b.f
871 int UNUSED written = 0;
872 IADDR UNUSED pc = abuf->addr;
873 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
877 tmp_newval = GET_H_GR (FLD (f_operand1));
879 SI opval = ZEXTHISI (tmp_newval);
880 SET_H_GR (FLD (f_operand2), opval);
881 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
885 BI opval = LTSI (tmp_newval, 0);
886 CPU (h_nbit) = opval;
887 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
890 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
891 CPU (h_zbit) = opval;
892 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
899 CPU (h_xbit) = opval;
900 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
904 SET_H_INSN_PREFIXED_P (opval);
905 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
915 CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
917 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
918 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
919 #define FLD(f) abuf->fields.sfmt_addcbr.f
920 int UNUSED written = 0;
921 IADDR UNUSED pc = abuf->addr;
922 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
926 tmp_newval = FLD (f_indir_pc__byte);
929 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
931 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
932 SET_H_GR (FLD (f_operand2), opval);
933 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
938 BI opval = LTQI (tmp_newval, 0);
939 CPU (h_nbit) = opval;
940 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
943 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
944 CPU (h_zbit) = opval;
945 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
952 CPU (h_xbit) = opval;
953 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
957 SET_H_INSN_PREFIXED_P (opval);
958 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
968 CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
970 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
971 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
972 #define FLD(f) abuf->fields.sfmt_addcwr.f
973 int UNUSED written = 0;
974 IADDR UNUSED pc = abuf->addr;
975 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
979 tmp_newval = FLD (f_indir_pc__word);
982 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
984 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
985 SET_H_GR (FLD (f_operand2), opval);
986 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
991 BI opval = LTHI (tmp_newval, 0);
992 CPU (h_nbit) = opval;
993 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
996 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
997 CPU (h_zbit) = opval;
998 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1000 SET_H_CBIT_MOVE (0);
1001 SET_H_VBIT_MOVE (0);
1005 CPU (h_xbit) = opval;
1006 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1010 SET_H_INSN_PREFIXED_P (opval);
1011 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1021 CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
1023 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1024 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1025 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1026 int UNUSED written = 0;
1027 IADDR UNUSED pc = abuf->addr;
1028 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1032 tmp_newval = FLD (f_indir_pc__dword);
1034 SI opval = tmp_newval;
1035 SET_H_GR (FLD (f_operand2), opval);
1036 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1040 BI opval = LTSI (tmp_newval, 0);
1041 CPU (h_nbit) = opval;
1042 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1045 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1046 CPU (h_zbit) = opval;
1047 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1049 SET_H_CBIT_MOVE (0);
1050 SET_H_VBIT_MOVE (0);
1054 CPU (h_xbit) = opval;
1055 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1059 SET_H_INSN_PREFIXED_P (opval);
1060 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1070 CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
1072 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1073 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1074 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1075 int UNUSED written = 0;
1076 IADDR UNUSED pc = abuf->addr;
1077 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1081 tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1083 SI opval = tmp_newval;
1084 SET_H_GR (FLD (f_operand2), opval);
1085 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1089 BI opval = LTSI (tmp_newval, 0);
1090 CPU (h_nbit) = opval;
1091 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1094 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1095 CPU (h_zbit) = opval;
1096 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1098 SET_H_CBIT_MOVE (0);
1099 SET_H_VBIT_MOVE (0);
1103 CPU (h_xbit) = opval;
1104 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1108 SET_H_INSN_PREFIXED_P (opval);
1109 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1119 CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
1121 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1122 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1123 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1124 int UNUSED written = 0;
1125 IADDR UNUSED pc = abuf->addr;
1126 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1130 tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1132 SI opval = tmp_newval;
1133 SET_H_GR (FLD (f_operand2), opval);
1134 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1138 BI opval = LTSI (tmp_newval, 0);
1139 CPU (h_nbit) = opval;
1140 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1143 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1144 CPU (h_zbit) = opval;
1145 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1147 SET_H_CBIT_MOVE (0);
1148 SET_H_VBIT_MOVE (0);
1152 CPU (h_xbit) = opval;
1153 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1157 SET_H_INSN_PREFIXED_P (opval);
1158 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1168 CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
1170 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1171 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1172 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1173 int UNUSED written = 0;
1174 IADDR UNUSED pc = abuf->addr;
1175 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1179 tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1181 SI opval = tmp_newval;
1182 SET_H_GR (FLD (f_operand2), opval);
1183 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1187 BI opval = LTSI (tmp_newval, 0);
1188 CPU (h_nbit) = opval;
1189 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1192 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1193 CPU (h_zbit) = opval;
1194 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1196 SET_H_CBIT_MOVE (0);
1197 SET_H_VBIT_MOVE (0);
1201 CPU (h_xbit) = opval;
1202 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1206 SET_H_INSN_PREFIXED_P (opval);
1207 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1217 CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
1219 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1220 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1221 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1222 int UNUSED written = 0;
1223 IADDR UNUSED pc = abuf->addr;
1224 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1228 tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1230 SI opval = tmp_newval;
1231 SET_H_GR (FLD (f_operand2), opval);
1232 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1236 BI opval = LTSI (tmp_newval, 0);
1237 CPU (h_nbit) = opval;
1238 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1241 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1242 CPU (h_zbit) = opval;
1243 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1245 SET_H_CBIT_MOVE (0);
1246 SET_H_VBIT_MOVE (0);
1250 CPU (h_xbit) = opval;
1251 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1255 SET_H_INSN_PREFIXED_P (opval);
1256 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1266 CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
1268 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1269 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1270 #define FLD(f) abuf->fields.sfmt_addq.f
1271 int UNUSED written = 0;
1272 IADDR UNUSED pc = abuf->addr;
1273 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1280 tmp_tmpops = FLD (f_u6);
1281 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1282 tmp_carry = CPU (h_cbit);
1283 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1285 SI opval = tmp_newval;
1286 SET_H_GR (FLD (f_operand2), opval);
1287 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1291 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))));
1292 CPU (h_cbit) = opval;
1293 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1296 BI opval = LTSI (tmp_newval, 0);
1297 CPU (h_nbit) = opval;
1298 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1301 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1302 CPU (h_zbit) = opval;
1303 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1306 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)));
1307 CPU (h_vbit) = opval;
1308 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1313 CPU (h_xbit) = opval;
1314 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1318 SET_H_INSN_PREFIXED_P (opval);
1319 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1329 CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
1331 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1332 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1333 #define FLD(f) abuf->fields.sfmt_addq.f
1334 int UNUSED written = 0;
1335 IADDR UNUSED pc = abuf->addr;
1336 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1343 tmp_tmpops = FLD (f_u6);
1344 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1345 tmp_carry = CPU (h_cbit);
1346 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1348 SI opval = tmp_newval;
1349 SET_H_GR (FLD (f_operand2), opval);
1350 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1354 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))));
1355 CPU (h_cbit) = opval;
1356 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1359 BI opval = LTSI (tmp_newval, 0);
1360 CPU (h_nbit) = opval;
1361 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1364 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1365 CPU (h_zbit) = opval;
1366 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1369 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)));
1370 CPU (h_vbit) = opval;
1371 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1376 CPU (h_xbit) = opval;
1377 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1381 SET_H_INSN_PREFIXED_P (opval);
1382 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1392 CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
1394 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1395 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1396 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1397 int UNUSED written = 0;
1398 IADDR UNUSED pc = abuf->addr;
1399 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1406 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1407 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1408 tmp_carry = CPU (h_cbit);
1409 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1413 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))));
1414 CPU (h_cbit) = opval;
1415 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1418 BI opval = LTQI (tmp_newval, 0);
1419 CPU (h_nbit) = opval;
1420 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1423 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1424 CPU (h_zbit) = opval;
1425 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1428 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)));
1429 CPU (h_vbit) = opval;
1430 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1435 CPU (h_xbit) = opval;
1436 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1440 SET_H_INSN_PREFIXED_P (opval);
1441 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1451 CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
1453 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1454 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1455 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1456 int UNUSED written = 0;
1457 IADDR UNUSED pc = abuf->addr;
1458 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1465 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1466 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1467 tmp_carry = CPU (h_cbit);
1468 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1472 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))));
1473 CPU (h_cbit) = opval;
1474 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1477 BI opval = LTHI (tmp_newval, 0);
1478 CPU (h_nbit) = opval;
1479 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1482 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1483 CPU (h_zbit) = opval;
1484 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1487 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)));
1488 CPU (h_vbit) = opval;
1489 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1494 CPU (h_xbit) = opval;
1495 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1499 SET_H_INSN_PREFIXED_P (opval);
1500 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1510 CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
1512 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1513 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1514 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1515 int UNUSED written = 0;
1516 IADDR UNUSED pc = abuf->addr;
1517 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1524 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1525 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1526 tmp_carry = CPU (h_cbit);
1527 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1531 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))));
1532 CPU (h_cbit) = opval;
1533 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1536 BI opval = LTSI (tmp_newval, 0);
1537 CPU (h_nbit) = opval;
1538 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1541 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1542 CPU (h_zbit) = opval;
1543 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1546 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)));
1547 CPU (h_vbit) = opval;
1548 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1553 CPU (h_xbit) = opval;
1554 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1558 SET_H_INSN_PREFIXED_P (opval);
1559 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1569 CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1571 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1572 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1573 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1574 int UNUSED written = 0;
1575 IADDR UNUSED pc = abuf->addr;
1576 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1583 tmp_tmpops = ({ SI tmp_addr;
1586 tmp_postinc = FLD (f_memmode);
1587 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1588 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1589 ; if (NEBI (tmp_postinc, 0)) {
1591 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1592 tmp_addr = ADDSI (tmp_addr, 1);
1595 SI opval = tmp_addr;
1596 SET_H_GR (FLD (f_operand1), opval);
1597 written |= (1 << 9);
1598 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1603 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1604 tmp_carry = CPU (h_cbit);
1605 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1609 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))));
1610 CPU (h_cbit) = opval;
1611 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1614 BI opval = LTQI (tmp_newval, 0);
1615 CPU (h_nbit) = opval;
1616 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1619 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1620 CPU (h_zbit) = opval;
1621 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1624 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)));
1625 CPU (h_vbit) = opval;
1626 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1631 CPU (h_xbit) = opval;
1632 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1636 SET_H_INSN_PREFIXED_P (opval);
1637 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1643 abuf->written = written;
1648 CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1650 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1651 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1652 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1653 int UNUSED written = 0;
1654 IADDR UNUSED pc = abuf->addr;
1655 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1662 tmp_tmpops = ({ SI tmp_addr;
1665 tmp_postinc = FLD (f_memmode);
1666 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1667 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
1668 ; if (NEBI (tmp_postinc, 0)) {
1670 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1671 tmp_addr = ADDSI (tmp_addr, 2);
1674 SI opval = tmp_addr;
1675 SET_H_GR (FLD (f_operand1), opval);
1676 written |= (1 << 9);
1677 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1682 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1683 tmp_carry = CPU (h_cbit);
1684 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1688 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))));
1689 CPU (h_cbit) = opval;
1690 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1693 BI opval = LTHI (tmp_newval, 0);
1694 CPU (h_nbit) = opval;
1695 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1698 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1699 CPU (h_zbit) = opval;
1700 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1703 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)));
1704 CPU (h_vbit) = opval;
1705 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1710 CPU (h_xbit) = opval;
1711 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1715 SET_H_INSN_PREFIXED_P (opval);
1716 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1722 abuf->written = written;
1727 CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1729 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1730 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1731 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1732 int UNUSED written = 0;
1733 IADDR UNUSED pc = abuf->addr;
1734 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1741 tmp_tmpops = ({ SI tmp_addr;
1744 tmp_postinc = FLD (f_memmode);
1745 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1746 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
1747 ; if (NEBI (tmp_postinc, 0)) {
1749 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1750 tmp_addr = ADDSI (tmp_addr, 4);
1753 SI opval = tmp_addr;
1754 SET_H_GR (FLD (f_operand1), opval);
1755 written |= (1 << 9);
1756 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1761 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1762 tmp_carry = CPU (h_cbit);
1763 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1767 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))));
1768 CPU (h_cbit) = opval;
1769 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1772 BI opval = LTSI (tmp_newval, 0);
1773 CPU (h_nbit) = opval;
1774 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1777 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1778 CPU (h_zbit) = opval;
1779 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1782 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)));
1783 CPU (h_vbit) = opval;
1784 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1789 CPU (h_xbit) = opval;
1790 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1794 SET_H_INSN_PREFIXED_P (opval);
1795 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1801 abuf->written = written;
1806 CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
1808 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1809 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1810 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1811 int UNUSED written = 0;
1812 IADDR UNUSED pc = abuf->addr;
1813 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1820 tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
1821 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1822 tmp_carry = CPU (h_cbit);
1823 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1827 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))));
1828 CPU (h_cbit) = opval;
1829 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1832 BI opval = LTQI (tmp_newval, 0);
1833 CPU (h_nbit) = opval;
1834 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1837 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1838 CPU (h_zbit) = opval;
1839 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1842 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)));
1843 CPU (h_vbit) = opval;
1844 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1849 CPU (h_xbit) = opval;
1850 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1854 SET_H_INSN_PREFIXED_P (opval);
1855 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1865 CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
1867 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1868 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1869 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1870 int UNUSED written = 0;
1871 IADDR UNUSED pc = abuf->addr;
1872 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1879 tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
1880 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1881 tmp_carry = CPU (h_cbit);
1882 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1886 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))));
1887 CPU (h_cbit) = opval;
1888 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1891 BI opval = LTHI (tmp_newval, 0);
1892 CPU (h_nbit) = opval;
1893 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1896 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1897 CPU (h_zbit) = opval;
1898 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1901 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)));
1902 CPU (h_vbit) = opval;
1903 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1908 CPU (h_xbit) = opval;
1909 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1913 SET_H_INSN_PREFIXED_P (opval);
1914 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1924 CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
1926 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1927 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1928 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1929 int UNUSED written = 0;
1930 IADDR UNUSED pc = abuf->addr;
1931 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1938 tmp_tmpops = FLD (f_indir_pc__dword);
1939 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1940 tmp_carry = CPU (h_cbit);
1941 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1945 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))));
1946 CPU (h_cbit) = opval;
1947 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1950 BI opval = LTSI (tmp_newval, 0);
1951 CPU (h_nbit) = opval;
1952 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1955 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1956 CPU (h_zbit) = opval;
1957 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1960 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)));
1961 CPU (h_vbit) = opval;
1962 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1967 CPU (h_xbit) = opval;
1968 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1972 SET_H_INSN_PREFIXED_P (opval);
1973 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1983 CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
1985 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1986 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1987 #define FLD(f) abuf->fields.sfmt_andq.f
1988 int UNUSED written = 0;
1989 IADDR UNUSED pc = abuf->addr;
1990 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1997 tmp_tmpops = FLD (f_s6);
1998 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1999 tmp_carry = CPU (h_cbit);
2000 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2004 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))));
2005 CPU (h_cbit) = opval;
2006 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2009 BI opval = LTSI (tmp_newval, 0);
2010 CPU (h_nbit) = opval;
2011 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2014 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2015 CPU (h_zbit) = opval;
2016 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2019 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)));
2020 CPU (h_vbit) = opval;
2021 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2026 CPU (h_xbit) = opval;
2027 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2031 SET_H_INSN_PREFIXED_P (opval);
2032 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2042 CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
2044 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2045 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2046 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2047 int UNUSED written = 0;
2048 IADDR UNUSED pc = abuf->addr;
2049 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2056 tmp_tmpops = EXTQISI (({ SI tmp_addr;
2059 tmp_postinc = FLD (f_memmode);
2060 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2061 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2062 ; if (NEBI (tmp_postinc, 0)) {
2064 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2065 tmp_addr = ADDSI (tmp_addr, 1);
2068 SI opval = tmp_addr;
2069 SET_H_GR (FLD (f_operand1), opval);
2070 written |= (1 << 9);
2071 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2076 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2077 tmp_carry = CPU (h_cbit);
2078 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2082 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))));
2083 CPU (h_cbit) = opval;
2084 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2087 BI opval = LTSI (tmp_newval, 0);
2088 CPU (h_nbit) = opval;
2089 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2092 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2093 CPU (h_zbit) = opval;
2094 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2097 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)));
2098 CPU (h_vbit) = opval;
2099 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2104 CPU (h_xbit) = opval;
2105 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2109 SET_H_INSN_PREFIXED_P (opval);
2110 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2116 abuf->written = written;
2121 CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
2123 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2124 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2125 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2126 int UNUSED written = 0;
2127 IADDR UNUSED pc = abuf->addr;
2128 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2135 tmp_tmpops = EXTHISI (({ SI tmp_addr;
2138 tmp_postinc = FLD (f_memmode);
2139 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2140 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2141 ; if (NEBI (tmp_postinc, 0)) {
2143 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2144 tmp_addr = ADDSI (tmp_addr, 2);
2147 SI opval = tmp_addr;
2148 SET_H_GR (FLD (f_operand1), opval);
2149 written |= (1 << 9);
2150 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2155 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2156 tmp_carry = CPU (h_cbit);
2157 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2161 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))));
2162 CPU (h_cbit) = opval;
2163 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2166 BI opval = LTSI (tmp_newval, 0);
2167 CPU (h_nbit) = opval;
2168 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2171 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2172 CPU (h_zbit) = opval;
2173 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2176 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)));
2177 CPU (h_vbit) = opval;
2178 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2183 CPU (h_xbit) = opval;
2184 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2188 SET_H_INSN_PREFIXED_P (opval);
2189 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2195 abuf->written = written;
2200 CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
2202 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2203 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2204 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2205 int UNUSED written = 0;
2206 IADDR UNUSED pc = abuf->addr;
2207 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2214 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2215 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2216 tmp_carry = CPU (h_cbit);
2217 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2221 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))));
2222 CPU (h_cbit) = opval;
2223 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2226 BI opval = LTSI (tmp_newval, 0);
2227 CPU (h_nbit) = opval;
2228 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2231 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2232 CPU (h_zbit) = opval;
2233 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2236 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)));
2237 CPU (h_vbit) = opval;
2238 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2243 CPU (h_xbit) = opval;
2244 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2248 SET_H_INSN_PREFIXED_P (opval);
2249 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2259 CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
2261 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2262 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2263 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2264 int UNUSED written = 0;
2265 IADDR UNUSED pc = abuf->addr;
2266 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2273 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2274 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2275 tmp_carry = CPU (h_cbit);
2276 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2280 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))));
2281 CPU (h_cbit) = opval;
2282 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2285 BI opval = LTSI (tmp_newval, 0);
2286 CPU (h_nbit) = opval;
2287 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2290 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2291 CPU (h_zbit) = opval;
2292 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2295 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)));
2296 CPU (h_vbit) = opval;
2297 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2302 CPU (h_xbit) = opval;
2303 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2307 SET_H_INSN_PREFIXED_P (opval);
2308 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2318 CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2320 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2321 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2322 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2323 int UNUSED written = 0;
2324 IADDR UNUSED pc = abuf->addr;
2325 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2332 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
2335 tmp_postinc = FLD (f_memmode);
2336 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2337 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2338 ; if (NEBI (tmp_postinc, 0)) {
2340 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2341 tmp_addr = ADDSI (tmp_addr, 1);
2344 SI opval = tmp_addr;
2345 SET_H_GR (FLD (f_operand1), opval);
2346 written |= (1 << 9);
2347 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2352 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2353 tmp_carry = CPU (h_cbit);
2354 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2358 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))));
2359 CPU (h_cbit) = opval;
2360 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2363 BI opval = LTSI (tmp_newval, 0);
2364 CPU (h_nbit) = opval;
2365 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2368 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2369 CPU (h_zbit) = opval;
2370 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2373 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)));
2374 CPU (h_vbit) = opval;
2375 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2380 CPU (h_xbit) = opval;
2381 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2385 SET_H_INSN_PREFIXED_P (opval);
2386 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2392 abuf->written = written;
2397 CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2399 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2400 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2401 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2402 int UNUSED written = 0;
2403 IADDR UNUSED pc = abuf->addr;
2404 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2411 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
2414 tmp_postinc = FLD (f_memmode);
2415 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2416 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2417 ; if (NEBI (tmp_postinc, 0)) {
2419 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2420 tmp_addr = ADDSI (tmp_addr, 2);
2423 SI opval = tmp_addr;
2424 SET_H_GR (FLD (f_operand1), opval);
2425 written |= (1 << 9);
2426 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2431 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2432 tmp_carry = CPU (h_cbit);
2433 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2437 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))));
2438 CPU (h_cbit) = opval;
2439 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2442 BI opval = LTSI (tmp_newval, 0);
2443 CPU (h_nbit) = opval;
2444 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2447 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2448 CPU (h_zbit) = opval;
2449 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2452 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)));
2453 CPU (h_vbit) = opval;
2454 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2459 CPU (h_xbit) = opval;
2460 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2464 SET_H_INSN_PREFIXED_P (opval);
2465 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2471 abuf->written = written;
2476 CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
2478 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2479 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2480 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2481 int UNUSED written = 0;
2482 IADDR UNUSED pc = abuf->addr;
2483 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2490 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2491 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2492 tmp_carry = CPU (h_cbit);
2493 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2497 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))));
2498 CPU (h_cbit) = opval;
2499 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2502 BI opval = LTSI (tmp_newval, 0);
2503 CPU (h_nbit) = opval;
2504 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2507 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2508 CPU (h_zbit) = opval;
2509 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2512 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)));
2513 CPU (h_vbit) = opval;
2514 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2519 CPU (h_xbit) = opval;
2520 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2524 SET_H_INSN_PREFIXED_P (opval);
2525 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2535 CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
2537 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2538 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2539 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2540 int UNUSED written = 0;
2541 IADDR UNUSED pc = abuf->addr;
2542 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2549 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2550 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2551 tmp_carry = CPU (h_cbit);
2552 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2556 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))));
2557 CPU (h_cbit) = opval;
2558 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2561 BI opval = LTSI (tmp_newval, 0);
2562 CPU (h_nbit) = opval;
2563 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2566 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2567 CPU (h_zbit) = opval;
2568 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2571 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)));
2572 CPU (h_vbit) = opval;
2573 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2578 CPU (h_xbit) = opval;
2579 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2583 SET_H_INSN_PREFIXED_P (opval);
2584 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2594 CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
2596 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2597 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2598 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2599 int UNUSED written = 0;
2600 IADDR UNUSED pc = abuf->addr;
2601 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2605 tmp_tmp = ({ SI tmp_addr;
2608 tmp_postinc = FLD (f_memmode);
2609 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2610 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2611 ; if (NEBI (tmp_postinc, 0)) {
2613 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2614 tmp_addr = ADDSI (tmp_addr, 1);
2617 SI opval = tmp_addr;
2618 SET_H_GR (FLD (f_operand1), opval);
2619 written |= (1 << 10);
2620 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2627 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2629 SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
2630 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2631 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2636 BI opval = LTQI (tmp_tmp, 0);
2637 CPU (h_nbit) = opval;
2638 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2641 BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2642 CPU (h_zbit) = opval;
2643 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2645 SET_H_CBIT_MOVE (0);
2646 SET_H_VBIT_MOVE (0);
2650 CPU (h_xbit) = opval;
2651 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2655 SET_H_INSN_PREFIXED_P (opval);
2656 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2662 abuf->written = written;
2667 CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
2669 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2670 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2671 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2672 int UNUSED written = 0;
2673 IADDR UNUSED pc = abuf->addr;
2674 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2678 tmp_tmp = ({ SI tmp_addr;
2681 tmp_postinc = FLD (f_memmode);
2682 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2683 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2684 ; if (NEBI (tmp_postinc, 0)) {
2686 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2687 tmp_addr = ADDSI (tmp_addr, 2);
2690 SI opval = tmp_addr;
2691 SET_H_GR (FLD (f_operand1), opval);
2692 written |= (1 << 10);
2693 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2700 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2702 SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
2703 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2704 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2709 BI opval = LTHI (tmp_tmp, 0);
2710 CPU (h_nbit) = opval;
2711 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2714 BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2715 CPU (h_zbit) = opval;
2716 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2718 SET_H_CBIT_MOVE (0);
2719 SET_H_VBIT_MOVE (0);
2723 CPU (h_xbit) = opval;
2724 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2728 SET_H_INSN_PREFIXED_P (opval);
2729 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2735 abuf->written = written;
2740 CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
2742 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2743 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2744 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2745 int UNUSED written = 0;
2746 IADDR UNUSED pc = abuf->addr;
2747 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2751 tmp_tmp = ({ SI tmp_addr;
2754 tmp_postinc = FLD (f_memmode);
2755 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2756 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
2757 ; if (NEBI (tmp_postinc, 0)) {
2759 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2760 tmp_addr = ADDSI (tmp_addr, 4);
2763 SI opval = tmp_addr;
2764 SET_H_GR (FLD (f_operand1), opval);
2765 written |= (1 << 9);
2766 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2773 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2774 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2778 BI opval = LTSI (tmp_tmp, 0);
2779 CPU (h_nbit) = opval;
2780 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2783 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2784 CPU (h_zbit) = opval;
2785 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2787 SET_H_CBIT_MOVE (0);
2788 SET_H_VBIT_MOVE (0);
2792 CPU (h_xbit) = opval;
2793 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2797 SET_H_INSN_PREFIXED_P (opval);
2798 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2804 abuf->written = written;
2809 CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
2811 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2812 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2813 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2814 int UNUSED written = 0;
2815 IADDR UNUSED pc = abuf->addr;
2816 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2820 tmp_tmp = EXTQISI (({ SI tmp_addr;
2823 tmp_postinc = FLD (f_memmode);
2824 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2825 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2826 ; if (NEBI (tmp_postinc, 0)) {
2828 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2829 tmp_addr = ADDSI (tmp_addr, 1);
2832 SI opval = tmp_addr;
2833 SET_H_GR (FLD (f_operand1), opval);
2834 written |= (1 << 8);
2835 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2840 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2843 SET_H_GR (FLD (f_operand1), opval);
2844 written |= (1 << 8);
2845 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2850 SET_H_GR (FLD (f_operand2), opval);
2851 written |= (1 << 7);
2852 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2857 BI opval = LTSI (tmp_tmp, 0);
2858 CPU (h_nbit) = opval;
2859 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2862 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2863 CPU (h_zbit) = opval;
2864 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2866 SET_H_CBIT_MOVE (0);
2867 SET_H_VBIT_MOVE (0);
2871 CPU (h_xbit) = opval;
2872 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2876 SET_H_INSN_PREFIXED_P (opval);
2877 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2883 abuf->written = written;
2888 CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
2890 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2891 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2892 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2893 int UNUSED written = 0;
2894 IADDR UNUSED pc = abuf->addr;
2895 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2899 tmp_tmp = EXTHISI (({ SI tmp_addr;
2902 tmp_postinc = FLD (f_memmode);
2903 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2904 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2905 ; if (NEBI (tmp_postinc, 0)) {
2907 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2908 tmp_addr = ADDSI (tmp_addr, 2);
2911 SI opval = tmp_addr;
2912 SET_H_GR (FLD (f_operand1), opval);
2913 written |= (1 << 8);
2914 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2919 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2922 SET_H_GR (FLD (f_operand1), opval);
2923 written |= (1 << 8);
2924 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2929 SET_H_GR (FLD (f_operand2), opval);
2930 written |= (1 << 7);
2931 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2936 BI opval = LTSI (tmp_tmp, 0);
2937 CPU (h_nbit) = opval;
2938 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2941 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2942 CPU (h_zbit) = opval;
2943 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2945 SET_H_CBIT_MOVE (0);
2946 SET_H_VBIT_MOVE (0);
2950 CPU (h_xbit) = opval;
2951 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2955 SET_H_INSN_PREFIXED_P (opval);
2956 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2962 abuf->written = written;
2967 CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
2969 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2970 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2971 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2972 int UNUSED written = 0;
2973 IADDR UNUSED pc = abuf->addr;
2974 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2978 tmp_tmp = ZEXTQISI (({ SI tmp_addr;
2981 tmp_postinc = FLD (f_memmode);
2982 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2983 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2984 ; if (NEBI (tmp_postinc, 0)) {
2986 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2987 tmp_addr = ADDSI (tmp_addr, 1);
2990 SI opval = tmp_addr;
2991 SET_H_GR (FLD (f_operand1), opval);
2992 written |= (1 << 8);
2993 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2998 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3001 SET_H_GR (FLD (f_operand1), opval);
3002 written |= (1 << 8);
3003 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3008 SET_H_GR (FLD (f_operand2), opval);
3009 written |= (1 << 7);
3010 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3015 BI opval = LTSI (tmp_tmp, 0);
3016 CPU (h_nbit) = opval;
3017 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3020 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3021 CPU (h_zbit) = opval;
3022 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3024 SET_H_CBIT_MOVE (0);
3025 SET_H_VBIT_MOVE (0);
3029 CPU (h_xbit) = opval;
3030 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3034 SET_H_INSN_PREFIXED_P (opval);
3035 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3041 abuf->written = written;
3046 CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
3048 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3049 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3050 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
3051 int UNUSED written = 0;
3052 IADDR UNUSED pc = abuf->addr;
3053 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3057 tmp_tmp = ZEXTHISI (({ SI tmp_addr;
3060 tmp_postinc = FLD (f_memmode);
3061 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3062 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
3063 ; if (NEBI (tmp_postinc, 0)) {
3065 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3066 tmp_addr = ADDSI (tmp_addr, 2);
3069 SI opval = tmp_addr;
3070 SET_H_GR (FLD (f_operand1), opval);
3071 written |= (1 << 8);
3072 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3077 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3080 SET_H_GR (FLD (f_operand1), opval);
3081 written |= (1 << 8);
3082 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3087 SET_H_GR (FLD (f_operand2), opval);
3088 written |= (1 << 7);
3089 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3094 BI opval = LTSI (tmp_tmp, 0);
3095 CPU (h_nbit) = opval;
3096 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3099 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3100 CPU (h_zbit) = opval;
3101 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3103 SET_H_CBIT_MOVE (0);
3104 SET_H_VBIT_MOVE (0);
3108 CPU (h_xbit) = opval;
3109 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3113 SET_H_INSN_PREFIXED_P (opval);
3114 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3120 abuf->written = written;
3125 CASE (sem, INSN_MOVE_R_SPRV10) : /* move ${Rs},${Pd} */
3127 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3128 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3129 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3130 int UNUSED written = 0;
3131 IADDR UNUSED pc = abuf->addr;
3132 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3137 tmp_tmp = GET_H_GR (FLD (f_operand1));
3138 tmp_rno = FLD (f_operand2);
3139 if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
3140 cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
3145 SET_H_SR (FLD (f_operand2), opval);
3146 written |= (1 << 2);
3147 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3153 CPU (h_xbit) = opval;
3154 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3158 SET_H_INSN_PREFIXED_P (opval);
3159 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3164 abuf->written = written;
3169 CASE (sem, INSN_MOVE_SPR_RV10) : /* move ${Ps},${Rd-sfield} */
3171 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3172 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3173 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3174 int UNUSED written = 0;
3175 IADDR UNUSED pc = abuf->addr;
3176 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3182 tmp_prno = FLD (f_operand2);
3183 tmp_newval = GET_H_SR (FLD (f_operand2));
3184 if (EQSI (tmp_prno, 5)) {
3187 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3189 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3190 SET_H_GR (FLD (f_operand1), opval);
3191 written |= (1 << 4);
3192 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3196 else if (EQSI (tmp_prno, 9)) {
3198 SI opval = tmp_newval;
3199 SET_H_GR (FLD (f_operand1), opval);
3200 written |= (1 << 4);
3201 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3204 else if (EQSI (tmp_prno, 10)) {
3206 SI opval = tmp_newval;
3207 SET_H_GR (FLD (f_operand1), opval);
3208 written |= (1 << 4);
3209 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3212 else if (EQSI (tmp_prno, 11)) {
3214 SI opval = tmp_newval;
3215 SET_H_GR (FLD (f_operand1), opval);
3216 written |= (1 << 4);
3217 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3220 else if (EQSI (tmp_prno, 12)) {
3222 SI opval = tmp_newval;
3223 SET_H_GR (FLD (f_operand1), opval);
3224 written |= (1 << 4);
3225 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3228 else if (EQSI (tmp_prno, 13)) {
3230 SI opval = tmp_newval;
3231 SET_H_GR (FLD (f_operand1), opval);
3232 written |= (1 << 4);
3233 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3236 else if (EQSI (tmp_prno, 0)) {
3239 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3241 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3242 SET_H_GR (FLD (f_operand1), opval);
3243 written |= (1 << 4);
3244 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3248 else if (EQSI (tmp_prno, 1)) {
3251 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3253 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3254 SET_H_GR (FLD (f_operand1), opval);
3255 written |= (1 << 4);
3256 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3260 else if (EQSI (tmp_prno, 4)) {
3263 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3265 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3266 SET_H_GR (FLD (f_operand1), opval);
3267 written |= (1 << 4);
3268 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3272 else if (EQSI (tmp_prno, 8)) {
3274 SI opval = tmp_newval;
3275 SET_H_GR (FLD (f_operand1), opval);
3276 written |= (1 << 4);
3277 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3280 else if (EQSI (tmp_prno, 7)) {
3282 SI opval = tmp_newval;
3283 SET_H_GR (FLD (f_operand1), opval);
3284 written |= (1 << 4);
3285 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3288 else if (EQSI (tmp_prno, 14)) {
3290 SI opval = tmp_newval;
3291 SET_H_GR (FLD (f_operand1), opval);
3292 written |= (1 << 4);
3293 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3296 else if (EQSI (tmp_prno, 15)) {
3298 SI opval = tmp_newval;
3299 SET_H_GR (FLD (f_operand1), opval);
3300 written |= (1 << 4);
3301 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3305 cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
3310 CPU (h_xbit) = opval;
3311 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3315 SET_H_INSN_PREFIXED_P (opval);
3316 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3321 abuf->written = written;
3326 CASE (sem, INSN_RET_TYPE) : /* ret/reti/retb */
3328 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3329 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3330 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3331 int UNUSED written = 0;
3332 IADDR UNUSED pc = abuf->addr;
3334 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3338 tmp_retaddr = GET_H_SR (FLD (f_operand2));
3342 CPU (h_xbit) = opval;
3343 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3347 SET_H_INSN_PREFIXED_P (opval);
3348 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3353 USI opval = tmp_retaddr;
3354 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3355 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3360 SEM_BRANCH_FINI (vpc);
3365 CASE (sem, INSN_MOVE_M_SPRV10) : /* move [${Rs}${inc}],${Pd} */
3367 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3368 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3369 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3370 int UNUSED written = 0;
3371 IADDR UNUSED pc = abuf->addr;
3372 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3377 tmp_rno = FLD (f_operand2);
3378 if (EQSI (tmp_rno, 5)) {
3379 tmp_newval = EXTHISI (({ SI tmp_addr;
3382 tmp_postinc = FLD (f_memmode);
3383 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3384 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
3385 ; if (NEBI (tmp_postinc, 0)) {
3387 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3388 tmp_addr = ADDSI (tmp_addr, 2);
3391 SI opval = tmp_addr;
3392 SET_H_GR (FLD (f_operand1), opval);
3393 written |= (1 << 8);
3394 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3400 else if (EQSI (tmp_rno, 9)) {
3401 tmp_newval = ({ SI tmp_addr;
3404 tmp_postinc = FLD (f_memmode);
3405 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3406 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3407 ; if (NEBI (tmp_postinc, 0)) {
3409 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3410 tmp_addr = ADDSI (tmp_addr, 4);
3413 SI opval = tmp_addr;
3414 SET_H_GR (FLD (f_operand1), opval);
3415 written |= (1 << 8);
3416 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3422 else if (EQSI (tmp_rno, 10)) {
3423 tmp_newval = ({ SI tmp_addr;
3426 tmp_postinc = FLD (f_memmode);
3427 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3428 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3429 ; if (NEBI (tmp_postinc, 0)) {
3431 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3432 tmp_addr = ADDSI (tmp_addr, 4);
3435 SI opval = tmp_addr;
3436 SET_H_GR (FLD (f_operand1), opval);
3437 written |= (1 << 8);
3438 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3444 else if (EQSI (tmp_rno, 11)) {
3445 tmp_newval = ({ SI tmp_addr;
3448 tmp_postinc = FLD (f_memmode);
3449 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3450 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3451 ; if (NEBI (tmp_postinc, 0)) {
3453 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3454 tmp_addr = ADDSI (tmp_addr, 4);
3457 SI opval = tmp_addr;
3458 SET_H_GR (FLD (f_operand1), opval);
3459 written |= (1 << 8);
3460 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3466 else if (EQSI (tmp_rno, 12)) {
3467 tmp_newval = ({ SI tmp_addr;
3470 tmp_postinc = FLD (f_memmode);
3471 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3472 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3473 ; if (NEBI (tmp_postinc, 0)) {
3475 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3476 tmp_addr = ADDSI (tmp_addr, 4);
3479 SI opval = tmp_addr;
3480 SET_H_GR (FLD (f_operand1), opval);
3481 written |= (1 << 8);
3482 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3488 else if (EQSI (tmp_rno, 13)) {
3489 tmp_newval = ({ SI tmp_addr;
3492 tmp_postinc = FLD (f_memmode);
3493 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3494 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3495 ; if (NEBI (tmp_postinc, 0)) {
3497 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3498 tmp_addr = ADDSI (tmp_addr, 4);
3501 SI opval = tmp_addr;
3502 SET_H_GR (FLD (f_operand1), opval);
3503 written |= (1 << 8);
3504 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3510 else if (EQSI (tmp_rno, 7)) {
3511 tmp_newval = ({ SI tmp_addr;
3514 tmp_postinc = FLD (f_memmode);
3515 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3516 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3517 ; if (NEBI (tmp_postinc, 0)) {
3519 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3520 tmp_addr = ADDSI (tmp_addr, 4);
3523 SI opval = tmp_addr;
3524 SET_H_GR (FLD (f_operand1), opval);
3525 written |= (1 << 8);
3526 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3532 else if (EQSI (tmp_rno, 14)) {
3533 tmp_newval = ({ SI tmp_addr;
3536 tmp_postinc = FLD (f_memmode);
3537 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3538 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3539 ; if (NEBI (tmp_postinc, 0)) {
3541 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3542 tmp_addr = ADDSI (tmp_addr, 4);
3545 SI opval = tmp_addr;
3546 SET_H_GR (FLD (f_operand1), opval);
3547 written |= (1 << 8);
3548 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3554 else if (EQSI (tmp_rno, 15)) {
3555 tmp_newval = ({ SI tmp_addr;
3558 tmp_postinc = FLD (f_memmode);
3559 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3560 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3561 ; if (NEBI (tmp_postinc, 0)) {
3563 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3564 tmp_addr = ADDSI (tmp_addr, 4);
3567 SI opval = tmp_addr;
3568 SET_H_GR (FLD (f_operand1), opval);
3569 written |= (1 << 8);
3570 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3577 cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
3580 SI opval = tmp_newval;
3581 SET_H_SR (FLD (f_operand2), opval);
3582 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3587 CPU (h_xbit) = opval;
3588 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3592 SET_H_INSN_PREFIXED_P (opval);
3593 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3598 abuf->written = written;
3603 CASE (sem, INSN_MOVE_C_SPRV10_P5) : /* move ${sconst16},${Pd} */
3605 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3606 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3607 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p5.f
3608 int UNUSED written = 0;
3609 IADDR UNUSED pc = abuf->addr;
3610 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3614 SI opval = FLD (f_indir_pc__word);
3615 SET_H_SR (FLD (f_operand2), opval);
3616 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3621 CPU (h_xbit) = opval;
3622 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3626 SET_H_INSN_PREFIXED_P (opval);
3627 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3636 CASE (sem, INSN_MOVE_C_SPRV10_P9) : /* move ${const32},${Pd} */
3638 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3639 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3640 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3641 int UNUSED written = 0;
3642 IADDR UNUSED pc = abuf->addr;
3643 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3647 SI opval = FLD (f_indir_pc__dword);
3648 SET_H_SR (FLD (f_operand2), opval);
3649 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3654 CPU (h_xbit) = opval;
3655 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3659 SET_H_INSN_PREFIXED_P (opval);
3660 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3669 CASE (sem, INSN_MOVE_C_SPRV10_P10) : /* move ${const32},${Pd} */
3671 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3672 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3673 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3674 int UNUSED written = 0;
3675 IADDR UNUSED pc = abuf->addr;
3676 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3680 SI opval = FLD (f_indir_pc__dword);
3681 SET_H_SR (FLD (f_operand2), opval);
3682 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3687 CPU (h_xbit) = opval;
3688 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3692 SET_H_INSN_PREFIXED_P (opval);
3693 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3702 CASE (sem, INSN_MOVE_C_SPRV10_P11) : /* move ${const32},${Pd} */
3704 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3705 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3706 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3707 int UNUSED written = 0;
3708 IADDR UNUSED pc = abuf->addr;
3709 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3713 SI opval = FLD (f_indir_pc__dword);
3714 SET_H_SR (FLD (f_operand2), opval);
3715 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3720 CPU (h_xbit) = opval;
3721 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3725 SET_H_INSN_PREFIXED_P (opval);
3726 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3735 CASE (sem, INSN_MOVE_C_SPRV10_P12) : /* move ${const32},${Pd} */
3737 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3738 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3739 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3740 int UNUSED written = 0;
3741 IADDR UNUSED pc = abuf->addr;
3742 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3746 SI opval = FLD (f_indir_pc__dword);
3747 SET_H_SR (FLD (f_operand2), opval);
3748 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3753 CPU (h_xbit) = opval;
3754 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3758 SET_H_INSN_PREFIXED_P (opval);
3759 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3768 CASE (sem, INSN_MOVE_C_SPRV10_P13) : /* move ${const32},${Pd} */
3770 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3771 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3772 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3773 int UNUSED written = 0;
3774 IADDR UNUSED pc = abuf->addr;
3775 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3779 SI opval = FLD (f_indir_pc__dword);
3780 SET_H_SR (FLD (f_operand2), opval);
3781 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3786 CPU (h_xbit) = opval;
3787 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3791 SET_H_INSN_PREFIXED_P (opval);
3792 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3801 CASE (sem, INSN_MOVE_C_SPRV10_P7) : /* move ${const32},${Pd} */
3803 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3804 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3805 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3806 int UNUSED written = 0;
3807 IADDR UNUSED pc = abuf->addr;
3808 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3812 SI opval = FLD (f_indir_pc__dword);
3813 SET_H_SR (FLD (f_operand2), opval);
3814 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3819 CPU (h_xbit) = opval;
3820 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3824 SET_H_INSN_PREFIXED_P (opval);
3825 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3834 CASE (sem, INSN_MOVE_C_SPRV10_P14) : /* move ${const32},${Pd} */
3836 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3837 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3838 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3839 int UNUSED written = 0;
3840 IADDR UNUSED pc = abuf->addr;
3841 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3845 SI opval = FLD (f_indir_pc__dword);
3846 SET_H_SR (FLD (f_operand2), opval);
3847 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3852 CPU (h_xbit) = opval;
3853 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3857 SET_H_INSN_PREFIXED_P (opval);
3858 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3867 CASE (sem, INSN_MOVE_C_SPRV10_P15) : /* move ${const32},${Pd} */
3869 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3870 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3871 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3872 int UNUSED written = 0;
3873 IADDR UNUSED pc = abuf->addr;
3874 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3878 SI opval = FLD (f_indir_pc__dword);
3879 SET_H_SR (FLD (f_operand2), opval);
3880 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3885 CPU (h_xbit) = opval;
3886 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3890 SET_H_INSN_PREFIXED_P (opval);
3891 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3900 CASE (sem, INSN_MOVE_SPR_MV10) : /* move ${Ps},[${Rd-sfield}${inc}] */
3902 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3903 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3904 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
3905 int UNUSED written = 0;
3906 IADDR UNUSED pc = abuf->addr;
3907 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3911 tmp_rno = FLD (f_operand2);
3912 if (EQSI (tmp_rno, 5)) {
3916 tmp_postinc = FLD (f_memmode);
3917 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3918 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
3919 if (EQBI (CPU (h_pbit), 0)) {
3922 HI opval = GET_H_SR (FLD (f_operand2));
3923 SETMEMHI (current_cpu, pc, tmp_addr, opval);
3924 written |= (1 << 11);
3925 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3928 BI opval = CPU (h_pbit);
3929 CPU (h_cbit) = opval;
3930 written |= (1 << 10);
3931 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3937 CPU (h_cbit) = opval;
3938 written |= (1 << 10);
3939 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3944 HI opval = GET_H_SR (FLD (f_operand2));
3945 SETMEMHI (current_cpu, pc, tmp_addr, opval);
3946 written |= (1 << 11);
3947 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3950 if (NEBI (tmp_postinc, 0)) {
3952 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3953 tmp_addr = ADDSI (tmp_addr, 2);
3956 SI opval = tmp_addr;
3957 SET_H_GR (FLD (f_operand1), opval);
3958 written |= (1 << 9);
3959 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3965 else if (EQSI (tmp_rno, 9)) {
3969 tmp_postinc = FLD (f_memmode);
3970 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3971 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
3972 if (EQBI (CPU (h_pbit), 0)) {
3975 SI opval = GET_H_SR (FLD (f_operand2));
3976 SETMEMSI (current_cpu, pc, tmp_addr, opval);
3977 written |= (1 << 13);
3978 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3981 BI opval = CPU (h_pbit);
3982 CPU (h_cbit) = opval;
3983 written |= (1 << 10);
3984 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3990 CPU (h_cbit) = opval;
3991 written |= (1 << 10);
3992 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3997 SI opval = GET_H_SR (FLD (f_operand2));
3998 SETMEMSI (current_cpu, pc, tmp_addr, opval);
3999 written |= (1 << 13);
4000 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4003 if (NEBI (tmp_postinc, 0)) {
4005 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4006 tmp_addr = ADDSI (tmp_addr, 4);
4009 SI opval = tmp_addr;
4010 SET_H_GR (FLD (f_operand1), opval);
4011 written |= (1 << 9);
4012 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4018 else if (EQSI (tmp_rno, 10)) {
4022 tmp_postinc = FLD (f_memmode);
4023 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4024 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4025 if (EQBI (CPU (h_pbit), 0)) {
4028 SI opval = GET_H_SR (FLD (f_operand2));
4029 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4030 written |= (1 << 13);
4031 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4034 BI opval = CPU (h_pbit);
4035 CPU (h_cbit) = opval;
4036 written |= (1 << 10);
4037 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4043 CPU (h_cbit) = opval;
4044 written |= (1 << 10);
4045 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4050 SI opval = GET_H_SR (FLD (f_operand2));
4051 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4052 written |= (1 << 13);
4053 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4056 if (NEBI (tmp_postinc, 0)) {
4058 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4059 tmp_addr = ADDSI (tmp_addr, 4);
4062 SI opval = tmp_addr;
4063 SET_H_GR (FLD (f_operand1), opval);
4064 written |= (1 << 9);
4065 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4071 else if (EQSI (tmp_rno, 11)) {
4075 tmp_postinc = FLD (f_memmode);
4076 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4077 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4078 if (EQBI (CPU (h_pbit), 0)) {
4081 SI opval = GET_H_SR (FLD (f_operand2));
4082 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4083 written |= (1 << 13);
4084 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4087 BI opval = CPU (h_pbit);
4088 CPU (h_cbit) = opval;
4089 written |= (1 << 10);
4090 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4096 CPU (h_cbit) = opval;
4097 written |= (1 << 10);
4098 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4103 SI opval = GET_H_SR (FLD (f_operand2));
4104 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4105 written |= (1 << 13);
4106 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4109 if (NEBI (tmp_postinc, 0)) {
4111 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4112 tmp_addr = ADDSI (tmp_addr, 4);
4115 SI opval = tmp_addr;
4116 SET_H_GR (FLD (f_operand1), opval);
4117 written |= (1 << 9);
4118 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4124 else if (EQSI (tmp_rno, 12)) {
4128 tmp_postinc = FLD (f_memmode);
4129 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4130 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4131 if (EQBI (CPU (h_pbit), 0)) {
4134 SI opval = GET_H_SR (FLD (f_operand2));
4135 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4136 written |= (1 << 13);
4137 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4140 BI opval = CPU (h_pbit);
4141 CPU (h_cbit) = opval;
4142 written |= (1 << 10);
4143 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4149 CPU (h_cbit) = opval;
4150 written |= (1 << 10);
4151 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4156 SI opval = GET_H_SR (FLD (f_operand2));
4157 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4158 written |= (1 << 13);
4159 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4162 if (NEBI (tmp_postinc, 0)) {
4164 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4165 tmp_addr = ADDSI (tmp_addr, 4);
4168 SI opval = tmp_addr;
4169 SET_H_GR (FLD (f_operand1), opval);
4170 written |= (1 << 9);
4171 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4177 else if (EQSI (tmp_rno, 13)) {
4181 tmp_postinc = FLD (f_memmode);
4182 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4183 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4184 if (EQBI (CPU (h_pbit), 0)) {
4187 SI opval = GET_H_SR (FLD (f_operand2));
4188 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4189 written |= (1 << 13);
4190 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4193 BI opval = CPU (h_pbit);
4194 CPU (h_cbit) = opval;
4195 written |= (1 << 10);
4196 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4202 CPU (h_cbit) = opval;
4203 written |= (1 << 10);
4204 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4209 SI opval = GET_H_SR (FLD (f_operand2));
4210 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4211 written |= (1 << 13);
4212 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4215 if (NEBI (tmp_postinc, 0)) {
4217 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4218 tmp_addr = ADDSI (tmp_addr, 4);
4221 SI opval = tmp_addr;
4222 SET_H_GR (FLD (f_operand1), opval);
4223 written |= (1 << 9);
4224 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4230 else if (EQSI (tmp_rno, 0)) {
4234 tmp_postinc = FLD (f_memmode);
4235 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4236 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4237 if (EQBI (CPU (h_pbit), 0)) {
4240 QI opval = GET_H_SR (FLD (f_operand2));
4241 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4242 written |= (1 << 12);
4243 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4246 BI opval = CPU (h_pbit);
4247 CPU (h_cbit) = opval;
4248 written |= (1 << 10);
4249 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4255 CPU (h_cbit) = opval;
4256 written |= (1 << 10);
4257 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4262 QI opval = GET_H_SR (FLD (f_operand2));
4263 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4264 written |= (1 << 12);
4265 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4268 if (NEBI (tmp_postinc, 0)) {
4270 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4271 tmp_addr = ADDSI (tmp_addr, 1);
4274 SI opval = tmp_addr;
4275 SET_H_GR (FLD (f_operand1), opval);
4276 written |= (1 << 9);
4277 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4283 else if (EQSI (tmp_rno, 1)) {
4287 tmp_postinc = FLD (f_memmode);
4288 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4289 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4290 if (EQBI (CPU (h_pbit), 0)) {
4293 QI opval = GET_H_SR (FLD (f_operand2));
4294 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4295 written |= (1 << 12);
4296 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4299 BI opval = CPU (h_pbit);
4300 CPU (h_cbit) = opval;
4301 written |= (1 << 10);
4302 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4308 CPU (h_cbit) = opval;
4309 written |= (1 << 10);
4310 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4315 QI opval = GET_H_SR (FLD (f_operand2));
4316 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4317 written |= (1 << 12);
4318 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4321 if (NEBI (tmp_postinc, 0)) {
4323 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4324 tmp_addr = ADDSI (tmp_addr, 1);
4327 SI opval = tmp_addr;
4328 SET_H_GR (FLD (f_operand1), opval);
4329 written |= (1 << 9);
4330 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4336 else if (EQSI (tmp_rno, 4)) {
4340 tmp_postinc = FLD (f_memmode);
4341 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4342 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4343 if (EQBI (CPU (h_pbit), 0)) {
4346 HI opval = GET_H_SR (FLD (f_operand2));
4347 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4348 written |= (1 << 11);
4349 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4352 BI opval = CPU (h_pbit);
4353 CPU (h_cbit) = opval;
4354 written |= (1 << 10);
4355 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4361 CPU (h_cbit) = opval;
4362 written |= (1 << 10);
4363 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4368 HI opval = GET_H_SR (FLD (f_operand2));
4369 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4370 written |= (1 << 11);
4371 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4374 if (NEBI (tmp_postinc, 0)) {
4376 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4377 tmp_addr = ADDSI (tmp_addr, 2);
4380 SI opval = tmp_addr;
4381 SET_H_GR (FLD (f_operand1), opval);
4382 written |= (1 << 9);
4383 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4389 else if (EQSI (tmp_rno, 8)) {
4393 tmp_postinc = FLD (f_memmode);
4394 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4395 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4396 if (EQBI (CPU (h_pbit), 0)) {
4399 SI opval = GET_H_SR (FLD (f_operand2));
4400 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4401 written |= (1 << 13);
4402 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4405 BI opval = CPU (h_pbit);
4406 CPU (h_cbit) = opval;
4407 written |= (1 << 10);
4408 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4414 CPU (h_cbit) = opval;
4415 written |= (1 << 10);
4416 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4421 SI opval = GET_H_SR (FLD (f_operand2));
4422 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4423 written |= (1 << 13);
4424 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4427 if (NEBI (tmp_postinc, 0)) {
4429 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4430 tmp_addr = ADDSI (tmp_addr, 4);
4433 SI opval = tmp_addr;
4434 SET_H_GR (FLD (f_operand1), opval);
4435 written |= (1 << 9);
4436 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4442 else if (EQSI (tmp_rno, 7)) {
4446 tmp_postinc = FLD (f_memmode);
4447 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4448 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4449 if (EQBI (CPU (h_pbit), 0)) {
4452 SI opval = GET_H_SR (FLD (f_operand2));
4453 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4454 written |= (1 << 13);
4455 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4458 BI opval = CPU (h_pbit);
4459 CPU (h_cbit) = opval;
4460 written |= (1 << 10);
4461 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4467 CPU (h_cbit) = opval;
4468 written |= (1 << 10);
4469 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4474 SI opval = GET_H_SR (FLD (f_operand2));
4475 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4476 written |= (1 << 13);
4477 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4480 if (NEBI (tmp_postinc, 0)) {
4482 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4483 tmp_addr = ADDSI (tmp_addr, 4);
4486 SI opval = tmp_addr;
4487 SET_H_GR (FLD (f_operand1), opval);
4488 written |= (1 << 9);
4489 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4495 else if (EQSI (tmp_rno, 14)) {
4499 tmp_postinc = FLD (f_memmode);
4500 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4501 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4502 if (EQBI (CPU (h_pbit), 0)) {
4505 SI opval = GET_H_SR (FLD (f_operand2));
4506 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4507 written |= (1 << 13);
4508 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4511 BI opval = CPU (h_pbit);
4512 CPU (h_cbit) = opval;
4513 written |= (1 << 10);
4514 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4520 CPU (h_cbit) = opval;
4521 written |= (1 << 10);
4522 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4527 SI opval = GET_H_SR (FLD (f_operand2));
4528 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4529 written |= (1 << 13);
4530 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4533 if (NEBI (tmp_postinc, 0)) {
4535 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4536 tmp_addr = ADDSI (tmp_addr, 4);
4539 SI opval = tmp_addr;
4540 SET_H_GR (FLD (f_operand1), opval);
4541 written |= (1 << 9);
4542 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4548 else if (EQSI (tmp_rno, 15)) {
4552 tmp_postinc = FLD (f_memmode);
4553 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4554 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4555 if (EQBI (CPU (h_pbit), 0)) {
4558 SI opval = GET_H_SR (FLD (f_operand2));
4559 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4560 written |= (1 << 13);
4561 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4564 BI opval = CPU (h_pbit);
4565 CPU (h_cbit) = opval;
4566 written |= (1 << 10);
4567 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4573 CPU (h_cbit) = opval;
4574 written |= (1 << 10);
4575 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4580 SI opval = GET_H_SR (FLD (f_operand2));
4581 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4582 written |= (1 << 13);
4583 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4586 if (NEBI (tmp_postinc, 0)) {
4588 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4589 tmp_addr = ADDSI (tmp_addr, 4);
4592 SI opval = tmp_addr;
4593 SET_H_GR (FLD (f_operand1), opval);
4594 written |= (1 << 9);
4595 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4602 cgen_rtx_error (current_cpu, "write from unimplemented special register");
4607 CPU (h_xbit) = opval;
4608 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4612 SET_H_INSN_PREFIXED_P (opval);
4613 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4618 abuf->written = written;
4623 CASE (sem, INSN_SBFS) : /* sbfs [${Rd-sfield}${inc}] */
4625 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4626 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4627 #define FLD(f) abuf->fields.fmt_empty.f
4628 int UNUSED written = 0;
4629 IADDR UNUSED pc = abuf->addr;
4630 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4632 cgen_rtx_error (current_cpu, "SBFS isn't implemented");
4638 CASE (sem, INSN_MOVEM_R_M) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4640 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4641 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4642 #define FLD(f) abuf->fields.sfmt_movem_r_m.f
4643 int UNUSED written = 0;
4644 IADDR UNUSED pc = abuf->addr;
4645 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4650 tmp_postinc = FLD (f_memmode);
4653 tmp_dummy = GET_H_GR (FLD (f_operand2));
4655 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4657 if (GESI (FLD (f_operand2), 15)) {
4660 tmp_tmp = GET_H_GR (((UINT) 15));
4663 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4664 written |= (1 << 23);
4665 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4667 tmp_addr = ADDSI (tmp_addr, 4);
4670 if (GESI (FLD (f_operand2), 14)) {
4673 tmp_tmp = GET_H_GR (((UINT) 14));
4676 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4677 written |= (1 << 23);
4678 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4680 tmp_addr = ADDSI (tmp_addr, 4);
4683 if (GESI (FLD (f_operand2), 13)) {
4686 tmp_tmp = GET_H_GR (((UINT) 13));
4689 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4690 written |= (1 << 23);
4691 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4693 tmp_addr = ADDSI (tmp_addr, 4);
4696 if (GESI (FLD (f_operand2), 12)) {
4699 tmp_tmp = GET_H_GR (((UINT) 12));
4702 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4703 written |= (1 << 23);
4704 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4706 tmp_addr = ADDSI (tmp_addr, 4);
4709 if (GESI (FLD (f_operand2), 11)) {
4712 tmp_tmp = GET_H_GR (((UINT) 11));
4715 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4716 written |= (1 << 23);
4717 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4719 tmp_addr = ADDSI (tmp_addr, 4);
4722 if (GESI (FLD (f_operand2), 10)) {
4725 tmp_tmp = GET_H_GR (((UINT) 10));
4728 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4729 written |= (1 << 23);
4730 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4732 tmp_addr = ADDSI (tmp_addr, 4);
4735 if (GESI (FLD (f_operand2), 9)) {
4738 tmp_tmp = GET_H_GR (((UINT) 9));
4741 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4742 written |= (1 << 23);
4743 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4745 tmp_addr = ADDSI (tmp_addr, 4);
4748 if (GESI (FLD (f_operand2), 8)) {
4751 tmp_tmp = GET_H_GR (((UINT) 8));
4754 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4755 written |= (1 << 23);
4756 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4758 tmp_addr = ADDSI (tmp_addr, 4);
4761 if (GESI (FLD (f_operand2), 7)) {
4764 tmp_tmp = GET_H_GR (((UINT) 7));
4767 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4768 written |= (1 << 23);
4769 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4771 tmp_addr = ADDSI (tmp_addr, 4);
4774 if (GESI (FLD (f_operand2), 6)) {
4777 tmp_tmp = GET_H_GR (((UINT) 6));
4780 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4781 written |= (1 << 23);
4782 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4784 tmp_addr = ADDSI (tmp_addr, 4);
4787 if (GESI (FLD (f_operand2), 5)) {
4790 tmp_tmp = GET_H_GR (((UINT) 5));
4793 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4794 written |= (1 << 23);
4795 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4797 tmp_addr = ADDSI (tmp_addr, 4);
4800 if (GESI (FLD (f_operand2), 4)) {
4803 tmp_tmp = GET_H_GR (((UINT) 4));
4806 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4807 written |= (1 << 23);
4808 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4810 tmp_addr = ADDSI (tmp_addr, 4);
4813 if (GESI (FLD (f_operand2), 3)) {
4816 tmp_tmp = GET_H_GR (((UINT) 3));
4819 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4820 written |= (1 << 23);
4821 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4823 tmp_addr = ADDSI (tmp_addr, 4);
4826 if (GESI (FLD (f_operand2), 2)) {
4829 tmp_tmp = GET_H_GR (((UINT) 2));
4832 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4833 written |= (1 << 23);
4834 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4836 tmp_addr = ADDSI (tmp_addr, 4);
4839 if (GESI (FLD (f_operand2), 1)) {
4842 tmp_tmp = GET_H_GR (((UINT) 1));
4845 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4846 written |= (1 << 23);
4847 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4849 tmp_addr = ADDSI (tmp_addr, 4);
4852 if (GESI (FLD (f_operand2), 0)) {
4855 tmp_tmp = GET_H_GR (((UINT) 0));
4858 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4859 written |= (1 << 23);
4860 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4862 tmp_addr = ADDSI (tmp_addr, 4);
4866 if (NEBI (tmp_postinc, 0)) {
4868 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
4869 SET_H_GR (FLD (f_operand1), opval);
4870 written |= (1 << 22);
4871 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4877 CPU (h_xbit) = opval;
4878 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4882 SET_H_INSN_PREFIXED_P (opval);
4883 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4888 abuf->written = written;
4893 CASE (sem, INSN_MOVEM_M_R) : /* movem [${Rs}${inc}],${Rd} */
4895 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4896 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4897 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
4898 int UNUSED written = 0;
4899 IADDR UNUSED pc = abuf->addr;
4900 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4905 tmp_postinc = FLD (f_memmode);
4906 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4909 tmp_dummy = GET_H_GR (FLD (f_operand2));
4912 if (GESI (FLD (f_operand2), 14)) {
4915 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4918 SET_H_GR (((UINT) 14), opval);
4919 written |= (1 << 14);
4920 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4922 tmp_addr = ADDSI (tmp_addr, 4);
4925 if (GESI (FLD (f_operand2), 13)) {
4928 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4931 SET_H_GR (((UINT) 13), opval);
4932 written |= (1 << 13);
4933 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4935 tmp_addr = ADDSI (tmp_addr, 4);
4938 if (GESI (FLD (f_operand2), 12)) {
4941 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4944 SET_H_GR (((UINT) 12), opval);
4945 written |= (1 << 12);
4946 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4948 tmp_addr = ADDSI (tmp_addr, 4);
4951 if (GESI (FLD (f_operand2), 11)) {
4954 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4957 SET_H_GR (((UINT) 11), opval);
4958 written |= (1 << 11);
4959 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4961 tmp_addr = ADDSI (tmp_addr, 4);
4964 if (GESI (FLD (f_operand2), 10)) {
4967 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4970 SET_H_GR (((UINT) 10), opval);
4971 written |= (1 << 10);
4972 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4974 tmp_addr = ADDSI (tmp_addr, 4);
4977 if (GESI (FLD (f_operand2), 9)) {
4980 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4983 SET_H_GR (((UINT) 9), opval);
4984 written |= (1 << 22);
4985 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4987 tmp_addr = ADDSI (tmp_addr, 4);
4990 if (GESI (FLD (f_operand2), 8)) {
4993 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4996 SET_H_GR (((UINT) 8), opval);
4997 written |= (1 << 21);
4998 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5000 tmp_addr = ADDSI (tmp_addr, 4);
5003 if (GESI (FLD (f_operand2), 7)) {
5006 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5009 SET_H_GR (((UINT) 7), opval);
5010 written |= (1 << 20);
5011 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5013 tmp_addr = ADDSI (tmp_addr, 4);
5016 if (GESI (FLD (f_operand2), 6)) {
5019 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5022 SET_H_GR (((UINT) 6), opval);
5023 written |= (1 << 19);
5024 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5026 tmp_addr = ADDSI (tmp_addr, 4);
5029 if (GESI (FLD (f_operand2), 5)) {
5032 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5035 SET_H_GR (((UINT) 5), opval);
5036 written |= (1 << 18);
5037 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5039 tmp_addr = ADDSI (tmp_addr, 4);
5042 if (GESI (FLD (f_operand2), 4)) {
5045 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5048 SET_H_GR (((UINT) 4), opval);
5049 written |= (1 << 17);
5050 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5052 tmp_addr = ADDSI (tmp_addr, 4);
5055 if (GESI (FLD (f_operand2), 3)) {
5058 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5061 SET_H_GR (((UINT) 3), opval);
5062 written |= (1 << 16);
5063 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5065 tmp_addr = ADDSI (tmp_addr, 4);
5068 if (GESI (FLD (f_operand2), 2)) {
5071 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5074 SET_H_GR (((UINT) 2), opval);
5075 written |= (1 << 15);
5076 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5078 tmp_addr = ADDSI (tmp_addr, 4);
5081 if (GESI (FLD (f_operand2), 1)) {
5084 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5087 SET_H_GR (((UINT) 1), opval);
5088 written |= (1 << 9);
5089 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5091 tmp_addr = ADDSI (tmp_addr, 4);
5094 if (GESI (FLD (f_operand2), 0)) {
5097 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5100 SET_H_GR (((UINT) 0), opval);
5101 written |= (1 << 8);
5102 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5104 tmp_addr = ADDSI (tmp_addr, 4);
5108 if (NEBI (tmp_postinc, 0)) {
5110 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
5111 SET_H_GR (FLD (f_operand1), opval);
5112 written |= (1 << 7);
5113 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5119 CPU (h_xbit) = opval;
5120 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5124 SET_H_INSN_PREFIXED_P (opval);
5125 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5130 abuf->written = written;
5135 CASE (sem, INSN_MOVEM_M_PC) : /* movem [${Rs}${inc}],${Rd} */
5137 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5138 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5139 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
5140 int UNUSED written = 0;
5141 IADDR UNUSED pc = abuf->addr;
5143 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5148 tmp_postinc = FLD (f_memmode);
5149 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5152 USI opval = GETMEMSI (current_cpu, pc, tmp_addr);
5153 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
5154 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
5156 tmp_addr = ADDSI (tmp_addr, 4);
5159 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5162 SET_H_GR (((UINT) 14), opval);
5163 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5165 tmp_addr = ADDSI (tmp_addr, 4);
5169 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5172 SET_H_GR (((UINT) 13), opval);
5173 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5175 tmp_addr = ADDSI (tmp_addr, 4);
5179 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5182 SET_H_GR (((UINT) 12), opval);
5183 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5185 tmp_addr = ADDSI (tmp_addr, 4);
5189 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5192 SET_H_GR (((UINT) 11), opval);
5193 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5195 tmp_addr = ADDSI (tmp_addr, 4);
5199 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5202 SET_H_GR (((UINT) 10), opval);
5203 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5205 tmp_addr = ADDSI (tmp_addr, 4);
5209 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5212 SET_H_GR (((UINT) 9), opval);
5213 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5215 tmp_addr = ADDSI (tmp_addr, 4);
5219 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5222 SET_H_GR (((UINT) 8), opval);
5223 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5225 tmp_addr = ADDSI (tmp_addr, 4);
5229 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5232 SET_H_GR (((UINT) 7), opval);
5233 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5235 tmp_addr = ADDSI (tmp_addr, 4);
5239 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5242 SET_H_GR (((UINT) 6), opval);
5243 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5245 tmp_addr = ADDSI (tmp_addr, 4);
5249 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5252 SET_H_GR (((UINT) 5), opval);
5253 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5255 tmp_addr = ADDSI (tmp_addr, 4);
5259 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5262 SET_H_GR (((UINT) 4), opval);
5263 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5265 tmp_addr = ADDSI (tmp_addr, 4);
5269 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5272 SET_H_GR (((UINT) 3), opval);
5273 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5275 tmp_addr = ADDSI (tmp_addr, 4);
5279 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5282 SET_H_GR (((UINT) 2), opval);
5283 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5285 tmp_addr = ADDSI (tmp_addr, 4);
5289 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5292 SET_H_GR (((UINT) 1), opval);
5293 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5295 tmp_addr = ADDSI (tmp_addr, 4);
5299 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5302 SET_H_GR (((UINT) 0), opval);
5303 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5305 tmp_addr = ADDSI (tmp_addr, 4);
5308 if (NEBI (tmp_postinc, 0)) {
5310 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
5311 SET_H_GR (FLD (f_operand1), opval);
5312 written |= (1 << 5);
5313 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5319 CPU (h_xbit) = opval;
5320 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5324 SET_H_INSN_PREFIXED_P (opval);
5325 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5330 abuf->written = written;
5331 SEM_BRANCH_FINI (vpc);
5336 CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
5338 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5339 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5340 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5341 int UNUSED written = 0;
5342 IADDR UNUSED pc = abuf->addr;
5343 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5350 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5351 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5352 tmp_carry = CPU (h_cbit);
5353 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5356 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5358 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5359 SET_H_GR (FLD (f_operand2), opval);
5360 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5365 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))));
5366 CPU (h_cbit) = opval;
5367 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5370 BI opval = LTQI (tmp_newval, 0);
5371 CPU (h_nbit) = opval;
5372 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5375 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5376 CPU (h_zbit) = opval;
5377 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5380 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)));
5381 CPU (h_vbit) = opval;
5382 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5387 CPU (h_xbit) = opval;
5388 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5392 SET_H_INSN_PREFIXED_P (opval);
5393 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5403 CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
5405 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5406 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5407 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5408 int UNUSED written = 0;
5409 IADDR UNUSED pc = abuf->addr;
5410 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5417 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5418 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5419 tmp_carry = CPU (h_cbit);
5420 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5423 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5425 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5426 SET_H_GR (FLD (f_operand2), opval);
5427 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5432 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))));
5433 CPU (h_cbit) = opval;
5434 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5437 BI opval = LTHI (tmp_newval, 0);
5438 CPU (h_nbit) = opval;
5439 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5442 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5443 CPU (h_zbit) = opval;
5444 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5447 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)));
5448 CPU (h_vbit) = opval;
5449 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5454 CPU (h_xbit) = opval;
5455 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5459 SET_H_INSN_PREFIXED_P (opval);
5460 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5470 CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
5472 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5473 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5474 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5475 int UNUSED written = 0;
5476 IADDR UNUSED pc = abuf->addr;
5477 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5484 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5485 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5486 tmp_carry = CPU (h_cbit);
5487 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5489 SI opval = tmp_newval;
5490 SET_H_GR (FLD (f_operand2), opval);
5491 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5495 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))));
5496 CPU (h_cbit) = opval;
5497 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5500 BI opval = LTSI (tmp_newval, 0);
5501 CPU (h_nbit) = opval;
5502 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5505 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5506 CPU (h_zbit) = opval;
5507 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5510 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)));
5511 CPU (h_vbit) = opval;
5512 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5517 CPU (h_xbit) = opval;
5518 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5522 SET_H_INSN_PREFIXED_P (opval);
5523 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5533 CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
5535 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5536 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5537 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5538 int UNUSED written = 0;
5539 IADDR UNUSED pc = abuf->addr;
5540 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5547 tmp_tmpops = ({ SI tmp_addr;
5550 tmp_postinc = FLD (f_memmode);
5551 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5552 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
5553 ; if (NEBI (tmp_postinc, 0)) {
5555 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5556 tmp_addr = ADDSI (tmp_addr, 1);
5559 SI opval = tmp_addr;
5560 SET_H_GR (FLD (f_operand1), opval);
5561 written |= (1 << 12);
5562 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5567 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5568 tmp_carry = CPU (h_cbit);
5569 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5572 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5574 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5575 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5576 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5581 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))));
5582 CPU (h_cbit) = opval;
5583 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5586 BI opval = LTQI (tmp_newval, 0);
5587 CPU (h_nbit) = opval;
5588 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5591 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5592 CPU (h_zbit) = opval;
5593 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5596 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)));
5597 CPU (h_vbit) = opval;
5598 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5603 CPU (h_xbit) = opval;
5604 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5608 SET_H_INSN_PREFIXED_P (opval);
5609 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5615 abuf->written = written;
5620 CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
5622 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5623 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5624 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5625 int UNUSED written = 0;
5626 IADDR UNUSED pc = abuf->addr;
5627 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5634 tmp_tmpops = ({ SI tmp_addr;
5637 tmp_postinc = FLD (f_memmode);
5638 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5639 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
5640 ; if (NEBI (tmp_postinc, 0)) {
5642 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5643 tmp_addr = ADDSI (tmp_addr, 2);
5646 SI opval = tmp_addr;
5647 SET_H_GR (FLD (f_operand1), opval);
5648 written |= (1 << 12);
5649 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5654 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5655 tmp_carry = CPU (h_cbit);
5656 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5659 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5661 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5662 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5663 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5668 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))));
5669 CPU (h_cbit) = opval;
5670 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5673 BI opval = LTHI (tmp_newval, 0);
5674 CPU (h_nbit) = opval;
5675 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5678 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5679 CPU (h_zbit) = opval;
5680 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5683 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)));
5684 CPU (h_vbit) = opval;
5685 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5690 CPU (h_xbit) = opval;
5691 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5695 SET_H_INSN_PREFIXED_P (opval);
5696 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5702 abuf->written = written;
5707 CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
5709 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5710 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5711 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5712 int UNUSED written = 0;
5713 IADDR UNUSED pc = abuf->addr;
5714 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5721 tmp_tmpops = ({ SI tmp_addr;
5724 tmp_postinc = FLD (f_memmode);
5725 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5726 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
5727 ; if (NEBI (tmp_postinc, 0)) {
5729 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5730 tmp_addr = ADDSI (tmp_addr, 4);
5733 SI opval = tmp_addr;
5734 SET_H_GR (FLD (f_operand1), opval);
5735 written |= (1 << 11);
5736 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5741 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5742 tmp_carry = CPU (h_cbit);
5743 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5745 SI opval = tmp_newval;
5746 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5747 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5751 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))));
5752 CPU (h_cbit) = opval;
5753 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5756 BI opval = LTSI (tmp_newval, 0);
5757 CPU (h_nbit) = opval;
5758 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5761 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5762 CPU (h_zbit) = opval;
5763 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5766 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)));
5767 CPU (h_vbit) = opval;
5768 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5773 CPU (h_xbit) = opval;
5774 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5778 SET_H_INSN_PREFIXED_P (opval);
5779 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5785 abuf->written = written;
5790 CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
5792 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5793 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5794 #define FLD(f) abuf->fields.sfmt_addcbr.f
5795 int UNUSED written = 0;
5796 IADDR UNUSED pc = abuf->addr;
5797 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5804 tmp_tmpops = FLD (f_indir_pc__byte);
5805 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5806 tmp_carry = CPU (h_cbit);
5807 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5810 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5812 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5813 SET_H_GR (FLD (f_operand2), opval);
5814 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5819 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))));
5820 CPU (h_cbit) = opval;
5821 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5824 BI opval = LTQI (tmp_newval, 0);
5825 CPU (h_nbit) = opval;
5826 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5829 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5830 CPU (h_zbit) = opval;
5831 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5834 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)));
5835 CPU (h_vbit) = opval;
5836 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5841 CPU (h_xbit) = opval;
5842 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5846 SET_H_INSN_PREFIXED_P (opval);
5847 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5857 CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
5859 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5860 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5861 #define FLD(f) abuf->fields.sfmt_addcwr.f
5862 int UNUSED written = 0;
5863 IADDR UNUSED pc = abuf->addr;
5864 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5871 tmp_tmpops = FLD (f_indir_pc__word);
5872 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5873 tmp_carry = CPU (h_cbit);
5874 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5877 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5879 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5880 SET_H_GR (FLD (f_operand2), opval);
5881 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5886 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))));
5887 CPU (h_cbit) = opval;
5888 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5891 BI opval = LTHI (tmp_newval, 0);
5892 CPU (h_nbit) = opval;
5893 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5896 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5897 CPU (h_zbit) = opval;
5898 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5901 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)));
5902 CPU (h_vbit) = opval;
5903 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5908 CPU (h_xbit) = opval;
5909 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5913 SET_H_INSN_PREFIXED_P (opval);
5914 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5924 CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
5926 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5927 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5928 #define FLD(f) abuf->fields.sfmt_addcdr.f
5929 int UNUSED written = 0;
5930 IADDR UNUSED pc = abuf->addr;
5931 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
5938 tmp_tmpops = FLD (f_indir_pc__dword);
5939 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5940 tmp_carry = CPU (h_cbit);
5941 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5943 SI opval = tmp_newval;
5944 SET_H_GR (FLD (f_operand2), opval);
5945 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5949 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))));
5950 CPU (h_cbit) = opval;
5951 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5954 BI opval = LTSI (tmp_newval, 0);
5955 CPU (h_nbit) = opval;
5956 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5959 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5960 CPU (h_zbit) = opval;
5961 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5964 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)));
5965 CPU (h_vbit) = opval;
5966 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5971 CPU (h_xbit) = opval;
5972 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5976 SET_H_INSN_PREFIXED_P (opval);
5977 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5987 CASE (sem, INSN_ADDCPC) : /* add.d ${sconst32},PC */
5989 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5990 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5991 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
5992 int UNUSED written = 0;
5993 IADDR UNUSED pc = abuf->addr;
5995 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
6001 tmp_offs = FLD (f_indir_pc__dword);
6002 tmp_oldpc = ADDSI (pc, 6);
6003 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
6005 USI opval = tmp_newpc;
6006 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
6007 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6011 BI opval = ORIF (ANDIF (LTSI (tmp_offs, 0), LTSI (tmp_oldpc, 0)), ORIF (ANDIF (LTSI (tmp_oldpc, 0), GESI (tmp_newpc, 0)), ANDIF (LTSI (tmp_offs, 0), GESI (tmp_newpc, 0))));
6012 CPU (h_cbit) = opval;
6013 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6016 BI opval = LTSI (tmp_newpc, 0);
6017 CPU (h_nbit) = opval;
6018 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6021 BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6022 CPU (h_zbit) = opval;
6023 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6026 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_offs, 0), LTSI (tmp_oldpc, 0)), GESI (tmp_newpc, 0)), ANDIF (ANDIF (GESI (tmp_offs, 0), GESI (tmp_oldpc, 0)), LTSI (tmp_newpc, 0)));
6027 CPU (h_vbit) = opval;
6028 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6033 CPU (h_xbit) = opval;
6034 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6038 SET_H_INSN_PREFIXED_P (opval);
6039 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6045 SEM_BRANCH_FINI (vpc);
6050 CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
6052 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6053 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6054 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6055 int UNUSED written = 0;
6056 IADDR UNUSED pc = abuf->addr;
6057 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6064 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6065 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6066 tmp_carry = CPU (h_cbit);
6067 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6069 SI opval = tmp_newval;
6070 SET_H_GR (FLD (f_operand2), opval);
6071 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6075 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))));
6076 CPU (h_cbit) = opval;
6077 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6080 BI opval = LTSI (tmp_newval, 0);
6081 CPU (h_nbit) = opval;
6082 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6085 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6086 CPU (h_zbit) = opval;
6087 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6090 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)));
6091 CPU (h_vbit) = opval;
6092 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6097 CPU (h_xbit) = opval;
6098 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6102 SET_H_INSN_PREFIXED_P (opval);
6103 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6113 CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
6115 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6116 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6117 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6118 int UNUSED written = 0;
6119 IADDR UNUSED pc = abuf->addr;
6120 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6127 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6128 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6129 tmp_carry = CPU (h_cbit);
6130 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6132 SI opval = tmp_newval;
6133 SET_H_GR (FLD (f_operand2), opval);
6134 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6138 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))));
6139 CPU (h_cbit) = opval;
6140 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6143 BI opval = LTSI (tmp_newval, 0);
6144 CPU (h_nbit) = opval;
6145 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6148 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6149 CPU (h_zbit) = opval;
6150 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6153 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)));
6154 CPU (h_vbit) = opval;
6155 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6160 CPU (h_xbit) = opval;
6161 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6165 SET_H_INSN_PREFIXED_P (opval);
6166 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6176 CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
6178 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6179 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6180 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6181 int UNUSED written = 0;
6182 IADDR UNUSED pc = abuf->addr;
6183 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6190 tmp_tmpops = EXTQISI (({ SI tmp_addr;
6193 tmp_postinc = FLD (f_memmode);
6194 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6195 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6196 ; if (NEBI (tmp_postinc, 0)) {
6198 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6199 tmp_addr = ADDSI (tmp_addr, 1);
6202 SI opval = tmp_addr;
6203 SET_H_GR (FLD (f_operand1), opval);
6204 written |= (1 << 11);
6205 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6210 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6211 tmp_carry = CPU (h_cbit);
6212 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6214 SI opval = tmp_newval;
6215 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6216 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6220 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))));
6221 CPU (h_cbit) = opval;
6222 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6225 BI opval = LTSI (tmp_newval, 0);
6226 CPU (h_nbit) = opval;
6227 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6230 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6231 CPU (h_zbit) = opval;
6232 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6235 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)));
6236 CPU (h_vbit) = opval;
6237 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6242 CPU (h_xbit) = opval;
6243 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6247 SET_H_INSN_PREFIXED_P (opval);
6248 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6254 abuf->written = written;
6259 CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
6261 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6262 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6263 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6264 int UNUSED written = 0;
6265 IADDR UNUSED pc = abuf->addr;
6266 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6273 tmp_tmpops = EXTHISI (({ SI tmp_addr;
6276 tmp_postinc = FLD (f_memmode);
6277 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6278 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6279 ; if (NEBI (tmp_postinc, 0)) {
6281 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6282 tmp_addr = ADDSI (tmp_addr, 2);
6285 SI opval = tmp_addr;
6286 SET_H_GR (FLD (f_operand1), opval);
6287 written |= (1 << 11);
6288 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6293 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6294 tmp_carry = CPU (h_cbit);
6295 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6297 SI opval = tmp_newval;
6298 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6299 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6303 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))));
6304 CPU (h_cbit) = opval;
6305 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6308 BI opval = LTSI (tmp_newval, 0);
6309 CPU (h_nbit) = opval;
6310 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6313 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6314 CPU (h_zbit) = opval;
6315 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6318 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)));
6319 CPU (h_vbit) = opval;
6320 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6325 CPU (h_xbit) = opval;
6326 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6330 SET_H_INSN_PREFIXED_P (opval);
6331 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6337 abuf->written = written;
6342 CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
6344 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6345 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6346 #define FLD(f) abuf->fields.sfmt_addcbr.f
6347 int UNUSED written = 0;
6348 IADDR UNUSED pc = abuf->addr;
6349 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6356 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6357 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6358 tmp_carry = CPU (h_cbit);
6359 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6361 SI opval = tmp_newval;
6362 SET_H_GR (FLD (f_operand2), opval);
6363 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6367 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))));
6368 CPU (h_cbit) = opval;
6369 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6372 BI opval = LTSI (tmp_newval, 0);
6373 CPU (h_nbit) = opval;
6374 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6377 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6378 CPU (h_zbit) = opval;
6379 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6382 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)));
6383 CPU (h_vbit) = opval;
6384 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6389 CPU (h_xbit) = opval;
6390 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6394 SET_H_INSN_PREFIXED_P (opval);
6395 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6405 CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
6407 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6408 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6409 #define FLD(f) abuf->fields.sfmt_addcwr.f
6410 int UNUSED written = 0;
6411 IADDR UNUSED pc = abuf->addr;
6412 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6419 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6420 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6421 tmp_carry = CPU (h_cbit);
6422 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6424 SI opval = tmp_newval;
6425 SET_H_GR (FLD (f_operand2), opval);
6426 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6430 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))));
6431 CPU (h_cbit) = opval;
6432 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6435 BI opval = LTSI (tmp_newval, 0);
6436 CPU (h_nbit) = opval;
6437 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6440 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6441 CPU (h_zbit) = opval;
6442 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6445 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)));
6446 CPU (h_vbit) = opval;
6447 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6452 CPU (h_xbit) = opval;
6453 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6457 SET_H_INSN_PREFIXED_P (opval);
6458 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6468 CASE (sem, INSN_ADDSPCPC) : /* adds.w [PC],PC */
6470 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6471 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6472 #define FLD(f) abuf->fields.fmt_empty.f
6473 int UNUSED written = 0;
6474 IADDR UNUSED pc = abuf->addr;
6476 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6482 if (NOTBI (GET_H_INSN_PREFIXED_P ())) {
6483 cgen_rtx_error (current_cpu, "Unexpected adds.w [PC],PC without prefix");
6485 tmp_offs = GETMEMHI (current_cpu, pc, CPU (h_prefixreg_pre_v32));
6486 tmp_oldpc = ADDSI (pc, 2);
6487 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
6489 USI opval = tmp_newpc;
6490 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
6491 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6495 BI opval = ORIF (ANDIF (LTSI (EXTHISI (tmp_offs), 0), LTSI (tmp_oldpc, 0)), ORIF (ANDIF (LTSI (tmp_oldpc, 0), GESI (tmp_newpc, 0)), ANDIF (LTSI (EXTHISI (tmp_offs), 0), GESI (tmp_newpc, 0))));
6496 CPU (h_cbit) = opval;
6497 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6500 BI opval = LTSI (tmp_newpc, 0);
6501 CPU (h_nbit) = opval;
6502 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6505 BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6506 CPU (h_zbit) = opval;
6507 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6510 BI opval = ORIF (ANDIF (ANDIF (LTSI (EXTHISI (tmp_offs), 0), LTSI (tmp_oldpc, 0)), GESI (tmp_newpc, 0)), ANDIF (ANDIF (GESI (EXTHISI (tmp_offs), 0), GESI (tmp_oldpc, 0)), LTSI (tmp_newpc, 0)));
6511 CPU (h_vbit) = opval;
6512 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6517 CPU (h_xbit) = opval;
6518 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6522 SET_H_INSN_PREFIXED_P (opval);
6523 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6529 SEM_BRANCH_FINI (vpc);
6534 CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
6536 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6537 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6538 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6539 int UNUSED written = 0;
6540 IADDR UNUSED pc = abuf->addr;
6541 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6548 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6549 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6550 tmp_carry = CPU (h_cbit);
6551 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6553 SI opval = tmp_newval;
6554 SET_H_GR (FLD (f_operand2), opval);
6555 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6559 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))));
6560 CPU (h_cbit) = opval;
6561 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6564 BI opval = LTSI (tmp_newval, 0);
6565 CPU (h_nbit) = opval;
6566 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6569 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6570 CPU (h_zbit) = opval;
6571 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6574 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)));
6575 CPU (h_vbit) = opval;
6576 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6581 CPU (h_xbit) = opval;
6582 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6586 SET_H_INSN_PREFIXED_P (opval);
6587 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6597 CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
6599 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6600 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6601 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6602 int UNUSED written = 0;
6603 IADDR UNUSED pc = abuf->addr;
6604 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6611 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6612 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6613 tmp_carry = CPU (h_cbit);
6614 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6616 SI opval = tmp_newval;
6617 SET_H_GR (FLD (f_operand2), opval);
6618 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6622 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))));
6623 CPU (h_cbit) = opval;
6624 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6627 BI opval = LTSI (tmp_newval, 0);
6628 CPU (h_nbit) = opval;
6629 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6632 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6633 CPU (h_zbit) = opval;
6634 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6637 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)));
6638 CPU (h_vbit) = opval;
6639 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6644 CPU (h_xbit) = opval;
6645 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6649 SET_H_INSN_PREFIXED_P (opval);
6650 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6660 CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
6662 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6663 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6664 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6665 int UNUSED written = 0;
6666 IADDR UNUSED pc = abuf->addr;
6667 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6674 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
6677 tmp_postinc = FLD (f_memmode);
6678 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6679 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6680 ; if (NEBI (tmp_postinc, 0)) {
6682 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6683 tmp_addr = ADDSI (tmp_addr, 1);
6686 SI opval = tmp_addr;
6687 SET_H_GR (FLD (f_operand1), opval);
6688 written |= (1 << 11);
6689 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6694 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6695 tmp_carry = CPU (h_cbit);
6696 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6698 SI opval = tmp_newval;
6699 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6700 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6704 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))));
6705 CPU (h_cbit) = opval;
6706 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6709 BI opval = LTSI (tmp_newval, 0);
6710 CPU (h_nbit) = opval;
6711 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6714 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6715 CPU (h_zbit) = opval;
6716 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6719 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)));
6720 CPU (h_vbit) = opval;
6721 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6726 CPU (h_xbit) = opval;
6727 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6731 SET_H_INSN_PREFIXED_P (opval);
6732 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6738 abuf->written = written;
6743 CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
6745 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6746 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6747 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6748 int UNUSED written = 0;
6749 IADDR UNUSED pc = abuf->addr;
6750 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6757 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
6760 tmp_postinc = FLD (f_memmode);
6761 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6762 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6763 ; if (NEBI (tmp_postinc, 0)) {
6765 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6766 tmp_addr = ADDSI (tmp_addr, 2);
6769 SI opval = tmp_addr;
6770 SET_H_GR (FLD (f_operand1), opval);
6771 written |= (1 << 11);
6772 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6777 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6778 tmp_carry = CPU (h_cbit);
6779 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6781 SI opval = tmp_newval;
6782 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6783 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6787 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))));
6788 CPU (h_cbit) = opval;
6789 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6792 BI opval = LTSI (tmp_newval, 0);
6793 CPU (h_nbit) = opval;
6794 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6797 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6798 CPU (h_zbit) = opval;
6799 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6802 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)));
6803 CPU (h_vbit) = opval;
6804 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6809 CPU (h_xbit) = opval;
6810 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6814 SET_H_INSN_PREFIXED_P (opval);
6815 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6821 abuf->written = written;
6826 CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
6828 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6829 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6830 #define FLD(f) abuf->fields.sfmt_addcbr.f
6831 int UNUSED written = 0;
6832 IADDR UNUSED pc = abuf->addr;
6833 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6840 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6841 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6842 tmp_carry = CPU (h_cbit);
6843 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6845 SI opval = tmp_newval;
6846 SET_H_GR (FLD (f_operand2), opval);
6847 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6851 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))));
6852 CPU (h_cbit) = opval;
6853 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6856 BI opval = LTSI (tmp_newval, 0);
6857 CPU (h_nbit) = opval;
6858 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6861 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6862 CPU (h_zbit) = opval;
6863 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6866 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)));
6867 CPU (h_vbit) = opval;
6868 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6873 CPU (h_xbit) = opval;
6874 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6878 SET_H_INSN_PREFIXED_P (opval);
6879 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6889 CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
6891 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6892 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6893 #define FLD(f) abuf->fields.sfmt_addcwr.f
6894 int UNUSED written = 0;
6895 IADDR UNUSED pc = abuf->addr;
6896 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6903 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6904 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6905 tmp_carry = CPU (h_cbit);
6906 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6908 SI opval = tmp_newval;
6909 SET_H_GR (FLD (f_operand2), opval);
6910 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6914 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))));
6915 CPU (h_cbit) = opval;
6916 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6919 BI opval = LTSI (tmp_newval, 0);
6920 CPU (h_nbit) = opval;
6921 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6924 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6925 CPU (h_zbit) = opval;
6926 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6929 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)));
6930 CPU (h_vbit) = opval;
6931 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6936 CPU (h_xbit) = opval;
6937 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6941 SET_H_INSN_PREFIXED_P (opval);
6942 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6952 CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
6954 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6955 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6956 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6957 int UNUSED written = 0;
6958 IADDR UNUSED pc = abuf->addr;
6959 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6966 tmp_tmpops = GET_H_GR (FLD (f_operand1));
6967 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6968 tmp_carry = CPU (h_cbit);
6969 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6972 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
6974 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
6975 SET_H_GR (FLD (f_operand2), opval);
6976 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6981 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))));
6982 CPU (h_cbit) = opval;
6983 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6986 BI opval = LTQI (tmp_newval, 0);
6987 CPU (h_nbit) = opval;
6988 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6991 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6992 CPU (h_zbit) = opval;
6993 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6996 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)));
6997 CPU (h_vbit) = opval;
6998 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7003 CPU (h_xbit) = opval;
7004 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7008 SET_H_INSN_PREFIXED_P (opval);
7009 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7019 CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
7021 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7022 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7023 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7024 int UNUSED written = 0;
7025 IADDR UNUSED pc = abuf->addr;
7026 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7033 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7034 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7035 tmp_carry = CPU (h_cbit);
7036 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7039 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7041 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7042 SET_H_GR (FLD (f_operand2), opval);
7043 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7048 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))));
7049 CPU (h_cbit) = opval;
7050 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7053 BI opval = LTHI (tmp_newval, 0);
7054 CPU (h_nbit) = opval;
7055 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7058 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7059 CPU (h_zbit) = opval;
7060 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7063 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)));
7064 CPU (h_vbit) = opval;
7065 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7070 CPU (h_xbit) = opval;
7071 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7075 SET_H_INSN_PREFIXED_P (opval);
7076 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7086 CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
7088 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7089 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7090 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7091 int UNUSED written = 0;
7092 IADDR UNUSED pc = abuf->addr;
7093 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7100 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7101 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7102 tmp_carry = CPU (h_cbit);
7103 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7105 SI opval = tmp_newval;
7106 SET_H_GR (FLD (f_operand2), opval);
7107 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7111 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))));
7112 CPU (h_cbit) = opval;
7113 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7116 BI opval = LTSI (tmp_newval, 0);
7117 CPU (h_nbit) = opval;
7118 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7121 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7122 CPU (h_zbit) = opval;
7123 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7126 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)));
7127 CPU (h_vbit) = opval;
7128 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7133 CPU (h_xbit) = opval;
7134 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7138 SET_H_INSN_PREFIXED_P (opval);
7139 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7149 CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
7151 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7152 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7153 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7154 int UNUSED written = 0;
7155 IADDR UNUSED pc = abuf->addr;
7156 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7163 tmp_tmpops = ({ SI tmp_addr;
7166 tmp_postinc = FLD (f_memmode);
7167 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7168 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7169 ; if (NEBI (tmp_postinc, 0)) {
7171 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7172 tmp_addr = ADDSI (tmp_addr, 1);
7175 SI opval = tmp_addr;
7176 SET_H_GR (FLD (f_operand1), opval);
7177 written |= (1 << 12);
7178 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7183 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7184 tmp_carry = CPU (h_cbit);
7185 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7188 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7190 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7191 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7192 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7197 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))));
7198 CPU (h_cbit) = opval;
7199 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7202 BI opval = LTQI (tmp_newval, 0);
7203 CPU (h_nbit) = opval;
7204 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7207 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7208 CPU (h_zbit) = opval;
7209 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7212 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)));
7213 CPU (h_vbit) = opval;
7214 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7219 CPU (h_xbit) = opval;
7220 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7224 SET_H_INSN_PREFIXED_P (opval);
7225 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7231 abuf->written = written;
7236 CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
7238 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7239 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7240 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7241 int UNUSED written = 0;
7242 IADDR UNUSED pc = abuf->addr;
7243 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7250 tmp_tmpops = ({ SI tmp_addr;
7253 tmp_postinc = FLD (f_memmode);
7254 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7255 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7256 ; if (NEBI (tmp_postinc, 0)) {
7258 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7259 tmp_addr = ADDSI (tmp_addr, 2);
7262 SI opval = tmp_addr;
7263 SET_H_GR (FLD (f_operand1), opval);
7264 written |= (1 << 12);
7265 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7270 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7271 tmp_carry = CPU (h_cbit);
7272 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7275 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7277 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7278 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7279 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7284 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))));
7285 CPU (h_cbit) = opval;
7286 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7289 BI opval = LTHI (tmp_newval, 0);
7290 CPU (h_nbit) = opval;
7291 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7294 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7295 CPU (h_zbit) = opval;
7296 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7299 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)));
7300 CPU (h_vbit) = opval;
7301 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7306 CPU (h_xbit) = opval;
7307 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7311 SET_H_INSN_PREFIXED_P (opval);
7312 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7318 abuf->written = written;
7323 CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
7325 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7326 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7327 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7328 int UNUSED written = 0;
7329 IADDR UNUSED pc = abuf->addr;
7330 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7337 tmp_tmpops = ({ SI tmp_addr;
7340 tmp_postinc = FLD (f_memmode);
7341 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7342 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
7343 ; if (NEBI (tmp_postinc, 0)) {
7345 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7346 tmp_addr = ADDSI (tmp_addr, 4);
7349 SI opval = tmp_addr;
7350 SET_H_GR (FLD (f_operand1), opval);
7351 written |= (1 << 11);
7352 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7357 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7358 tmp_carry = CPU (h_cbit);
7359 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7361 SI opval = tmp_newval;
7362 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7363 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7367 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))));
7368 CPU (h_cbit) = opval;
7369 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7372 BI opval = LTSI (tmp_newval, 0);
7373 CPU (h_nbit) = opval;
7374 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7377 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7378 CPU (h_zbit) = opval;
7379 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7382 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)));
7383 CPU (h_vbit) = opval;
7384 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7389 CPU (h_xbit) = opval;
7390 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7394 SET_H_INSN_PREFIXED_P (opval);
7395 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7401 abuf->written = written;
7406 CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
7408 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7409 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7410 #define FLD(f) abuf->fields.sfmt_addcbr.f
7411 int UNUSED written = 0;
7412 IADDR UNUSED pc = abuf->addr;
7413 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7420 tmp_tmpops = FLD (f_indir_pc__byte);
7421 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7422 tmp_carry = CPU (h_cbit);
7423 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7426 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7428 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7429 SET_H_GR (FLD (f_operand2), opval);
7430 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7435 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))));
7436 CPU (h_cbit) = opval;
7437 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7440 BI opval = LTQI (tmp_newval, 0);
7441 CPU (h_nbit) = opval;
7442 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7445 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7446 CPU (h_zbit) = opval;
7447 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7450 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)));
7451 CPU (h_vbit) = opval;
7452 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7457 CPU (h_xbit) = opval;
7458 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7462 SET_H_INSN_PREFIXED_P (opval);
7463 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7473 CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
7475 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7476 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7477 #define FLD(f) abuf->fields.sfmt_addcwr.f
7478 int UNUSED written = 0;
7479 IADDR UNUSED pc = abuf->addr;
7480 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7487 tmp_tmpops = FLD (f_indir_pc__word);
7488 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7489 tmp_carry = CPU (h_cbit);
7490 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7493 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7495 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7496 SET_H_GR (FLD (f_operand2), opval);
7497 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7502 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))));
7503 CPU (h_cbit) = opval;
7504 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7507 BI opval = LTHI (tmp_newval, 0);
7508 CPU (h_nbit) = opval;
7509 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7512 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7513 CPU (h_zbit) = opval;
7514 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7517 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)));
7518 CPU (h_vbit) = opval;
7519 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7524 CPU (h_xbit) = opval;
7525 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7529 SET_H_INSN_PREFIXED_P (opval);
7530 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7540 CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
7542 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7543 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7544 #define FLD(f) abuf->fields.sfmt_addcdr.f
7545 int UNUSED written = 0;
7546 IADDR UNUSED pc = abuf->addr;
7547 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
7554 tmp_tmpops = FLD (f_indir_pc__dword);
7555 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7556 tmp_carry = CPU (h_cbit);
7557 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7559 SI opval = tmp_newval;
7560 SET_H_GR (FLD (f_operand2), opval);
7561 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7565 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))));
7566 CPU (h_cbit) = opval;
7567 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7570 BI opval = LTSI (tmp_newval, 0);
7571 CPU (h_nbit) = opval;
7572 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7575 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7576 CPU (h_zbit) = opval;
7577 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7580 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)));
7581 CPU (h_vbit) = opval;
7582 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7587 CPU (h_xbit) = opval;
7588 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7592 SET_H_INSN_PREFIXED_P (opval);
7593 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7603 CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
7605 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7606 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7607 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7608 int UNUSED written = 0;
7609 IADDR UNUSED pc = abuf->addr;
7610 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7617 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
7618 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7619 tmp_carry = CPU (h_cbit);
7620 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7622 SI opval = tmp_newval;
7623 SET_H_GR (FLD (f_operand2), opval);
7624 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7628 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))));
7629 CPU (h_cbit) = opval;
7630 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7633 BI opval = LTSI (tmp_newval, 0);
7634 CPU (h_nbit) = opval;
7635 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7638 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7639 CPU (h_zbit) = opval;
7640 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7643 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)));
7644 CPU (h_vbit) = opval;
7645 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7650 CPU (h_xbit) = opval;
7651 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7655 SET_H_INSN_PREFIXED_P (opval);
7656 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7666 CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
7668 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7669 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7670 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7671 int UNUSED written = 0;
7672 IADDR UNUSED pc = abuf->addr;
7673 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7680 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
7681 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7682 tmp_carry = CPU (h_cbit);
7683 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7685 SI opval = tmp_newval;
7686 SET_H_GR (FLD (f_operand2), opval);
7687 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7691 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))));
7692 CPU (h_cbit) = opval;
7693 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7696 BI opval = LTSI (tmp_newval, 0);
7697 CPU (h_nbit) = opval;
7698 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7701 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7702 CPU (h_zbit) = opval;
7703 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7706 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)));
7707 CPU (h_vbit) = opval;
7708 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7713 CPU (h_xbit) = opval;
7714 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7718 SET_H_INSN_PREFIXED_P (opval);
7719 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7729 CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
7731 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7732 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7733 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7734 int UNUSED written = 0;
7735 IADDR UNUSED pc = abuf->addr;
7736 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7743 tmp_tmpops = EXTQISI (({ SI tmp_addr;
7746 tmp_postinc = FLD (f_memmode);
7747 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7748 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7749 ; if (NEBI (tmp_postinc, 0)) {
7751 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7752 tmp_addr = ADDSI (tmp_addr, 1);
7755 SI opval = tmp_addr;
7756 SET_H_GR (FLD (f_operand1), opval);
7757 written |= (1 << 11);
7758 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7763 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7764 tmp_carry = CPU (h_cbit);
7765 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7767 SI opval = tmp_newval;
7768 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7769 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7773 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))));
7774 CPU (h_cbit) = opval;
7775 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7778 BI opval = LTSI (tmp_newval, 0);
7779 CPU (h_nbit) = opval;
7780 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7783 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7784 CPU (h_zbit) = opval;
7785 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7788 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)));
7789 CPU (h_vbit) = opval;
7790 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7795 CPU (h_xbit) = opval;
7796 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7800 SET_H_INSN_PREFIXED_P (opval);
7801 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7807 abuf->written = written;
7812 CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
7814 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7815 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7816 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7817 int UNUSED written = 0;
7818 IADDR UNUSED pc = abuf->addr;
7819 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7826 tmp_tmpops = EXTHISI (({ SI tmp_addr;
7829 tmp_postinc = FLD (f_memmode);
7830 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7831 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7832 ; if (NEBI (tmp_postinc, 0)) {
7834 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7835 tmp_addr = ADDSI (tmp_addr, 2);
7838 SI opval = tmp_addr;
7839 SET_H_GR (FLD (f_operand1), opval);
7840 written |= (1 << 11);
7841 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7846 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7847 tmp_carry = CPU (h_cbit);
7848 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7850 SI opval = tmp_newval;
7851 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7852 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7856 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))));
7857 CPU (h_cbit) = opval;
7858 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7861 BI opval = LTSI (tmp_newval, 0);
7862 CPU (h_nbit) = opval;
7863 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7866 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7867 CPU (h_zbit) = opval;
7868 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7871 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)));
7872 CPU (h_vbit) = opval;
7873 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7878 CPU (h_xbit) = opval;
7879 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7883 SET_H_INSN_PREFIXED_P (opval);
7884 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7890 abuf->written = written;
7895 CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
7897 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7898 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7899 #define FLD(f) abuf->fields.sfmt_addcbr.f
7900 int UNUSED written = 0;
7901 IADDR UNUSED pc = abuf->addr;
7902 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7909 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
7910 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7911 tmp_carry = CPU (h_cbit);
7912 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7914 SI opval = tmp_newval;
7915 SET_H_GR (FLD (f_operand2), opval);
7916 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7920 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))));
7921 CPU (h_cbit) = opval;
7922 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7925 BI opval = LTSI (tmp_newval, 0);
7926 CPU (h_nbit) = opval;
7927 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7930 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7931 CPU (h_zbit) = opval;
7932 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7935 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)));
7936 CPU (h_vbit) = opval;
7937 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7942 CPU (h_xbit) = opval;
7943 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7947 SET_H_INSN_PREFIXED_P (opval);
7948 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7958 CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
7960 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7961 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7962 #define FLD(f) abuf->fields.sfmt_addcwr.f
7963 int UNUSED written = 0;
7964 IADDR UNUSED pc = abuf->addr;
7965 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7972 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
7973 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7974 tmp_carry = CPU (h_cbit);
7975 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7977 SI opval = tmp_newval;
7978 SET_H_GR (FLD (f_operand2), opval);
7979 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7983 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))));
7984 CPU (h_cbit) = opval;
7985 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7988 BI opval = LTSI (tmp_newval, 0);
7989 CPU (h_nbit) = opval;
7990 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7993 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7994 CPU (h_zbit) = opval;
7995 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7998 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)));
7999 CPU (h_vbit) = opval;
8000 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8005 CPU (h_xbit) = opval;
8006 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8010 SET_H_INSN_PREFIXED_P (opval);
8011 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8021 CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
8023 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8024 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8025 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8026 int UNUSED written = 0;
8027 IADDR UNUSED pc = abuf->addr;
8028 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8035 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
8036 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8037 tmp_carry = CPU (h_cbit);
8038 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8040 SI opval = tmp_newval;
8041 SET_H_GR (FLD (f_operand2), opval);
8042 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8046 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))));
8047 CPU (h_cbit) = opval;
8048 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8051 BI opval = LTSI (tmp_newval, 0);
8052 CPU (h_nbit) = opval;
8053 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8056 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8057 CPU (h_zbit) = opval;
8058 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8061 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)));
8062 CPU (h_vbit) = opval;
8063 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8068 CPU (h_xbit) = opval;
8069 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8073 SET_H_INSN_PREFIXED_P (opval);
8074 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8084 CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
8086 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8087 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8088 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8089 int UNUSED written = 0;
8090 IADDR UNUSED pc = abuf->addr;
8091 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8098 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
8099 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8100 tmp_carry = CPU (h_cbit);
8101 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8103 SI opval = tmp_newval;
8104 SET_H_GR (FLD (f_operand2), opval);
8105 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8109 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))));
8110 CPU (h_cbit) = opval;
8111 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8114 BI opval = LTSI (tmp_newval, 0);
8115 CPU (h_nbit) = opval;
8116 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8119 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8120 CPU (h_zbit) = opval;
8121 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8124 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)));
8125 CPU (h_vbit) = opval;
8126 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8131 CPU (h_xbit) = opval;
8132 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8136 SET_H_INSN_PREFIXED_P (opval);
8137 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8147 CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
8149 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8150 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8151 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8152 int UNUSED written = 0;
8153 IADDR UNUSED pc = abuf->addr;
8154 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8161 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
8164 tmp_postinc = FLD (f_memmode);
8165 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8166 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8167 ; if (NEBI (tmp_postinc, 0)) {
8169 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8170 tmp_addr = ADDSI (tmp_addr, 1);
8173 SI opval = tmp_addr;
8174 SET_H_GR (FLD (f_operand1), opval);
8175 written |= (1 << 11);
8176 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8181 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8182 tmp_carry = CPU (h_cbit);
8183 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8185 SI opval = tmp_newval;
8186 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8187 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8191 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))));
8192 CPU (h_cbit) = opval;
8193 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8196 BI opval = LTSI (tmp_newval, 0);
8197 CPU (h_nbit) = opval;
8198 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8201 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8202 CPU (h_zbit) = opval;
8203 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8206 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)));
8207 CPU (h_vbit) = opval;
8208 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8213 CPU (h_xbit) = opval;
8214 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8218 SET_H_INSN_PREFIXED_P (opval);
8219 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8225 abuf->written = written;
8230 CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
8232 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8233 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8234 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8235 int UNUSED written = 0;
8236 IADDR UNUSED pc = abuf->addr;
8237 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8244 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
8247 tmp_postinc = FLD (f_memmode);
8248 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8249 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8250 ; if (NEBI (tmp_postinc, 0)) {
8252 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8253 tmp_addr = ADDSI (tmp_addr, 2);
8256 SI opval = tmp_addr;
8257 SET_H_GR (FLD (f_operand1), opval);
8258 written |= (1 << 11);
8259 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8264 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8265 tmp_carry = CPU (h_cbit);
8266 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8268 SI opval = tmp_newval;
8269 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8270 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8274 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))));
8275 CPU (h_cbit) = opval;
8276 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8279 BI opval = LTSI (tmp_newval, 0);
8280 CPU (h_nbit) = opval;
8281 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8284 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8285 CPU (h_zbit) = opval;
8286 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8289 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)));
8290 CPU (h_vbit) = opval;
8291 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8296 CPU (h_xbit) = opval;
8297 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8301 SET_H_INSN_PREFIXED_P (opval);
8302 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8308 abuf->written = written;
8313 CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
8315 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8316 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8317 #define FLD(f) abuf->fields.sfmt_addcbr.f
8318 int UNUSED written = 0;
8319 IADDR UNUSED pc = abuf->addr;
8320 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8327 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
8328 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8329 tmp_carry = CPU (h_cbit);
8330 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8332 SI opval = tmp_newval;
8333 SET_H_GR (FLD (f_operand2), opval);
8334 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8338 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))));
8339 CPU (h_cbit) = opval;
8340 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8343 BI opval = LTSI (tmp_newval, 0);
8344 CPU (h_nbit) = opval;
8345 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8348 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8349 CPU (h_zbit) = opval;
8350 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8353 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)));
8354 CPU (h_vbit) = opval;
8355 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8360 CPU (h_xbit) = opval;
8361 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8365 SET_H_INSN_PREFIXED_P (opval);
8366 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8376 CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
8378 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8379 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8380 #define FLD(f) abuf->fields.sfmt_addcwr.f
8381 int UNUSED written = 0;
8382 IADDR UNUSED pc = abuf->addr;
8383 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8390 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
8391 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8392 tmp_carry = CPU (h_cbit);
8393 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8395 SI opval = tmp_newval;
8396 SET_H_GR (FLD (f_operand2), opval);
8397 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8401 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))));
8402 CPU (h_cbit) = opval;
8403 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8406 BI opval = LTSI (tmp_newval, 0);
8407 CPU (h_nbit) = opval;
8408 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8411 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8412 CPU (h_zbit) = opval;
8413 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8416 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)));
8417 CPU (h_vbit) = opval;
8418 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8423 CPU (h_xbit) = opval;
8424 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8428 SET_H_INSN_PREFIXED_P (opval);
8429 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8439 CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8441 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8442 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8443 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8444 int UNUSED written = 0;
8445 IADDR UNUSED pc = abuf->addr;
8446 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8450 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
8451 SET_H_GR (FLD (f_operand1), opval);
8452 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8457 CPU (h_xbit) = opval;
8458 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8462 SET_H_INSN_PREFIXED_P (opval);
8463 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8472 CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8474 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8475 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8476 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8477 int UNUSED written = 0;
8478 IADDR UNUSED pc = abuf->addr;
8479 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8483 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
8484 SET_H_GR (FLD (f_operand1), opval);
8485 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8490 CPU (h_xbit) = opval;
8491 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8495 SET_H_INSN_PREFIXED_P (opval);
8496 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8505 CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8507 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8508 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8509 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8510 int UNUSED written = 0;
8511 IADDR UNUSED pc = abuf->addr;
8512 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8516 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
8517 SET_H_GR (FLD (f_operand1), opval);
8518 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8523 CPU (h_xbit) = opval;
8524 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8528 SET_H_INSN_PREFIXED_P (opval);
8529 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8538 CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
8540 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8541 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8542 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8543 int UNUSED written = 0;
8544 IADDR UNUSED pc = abuf->addr;
8545 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8552 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8554 tmp_carry = CPU (h_cbit);
8555 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8558 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
8560 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
8561 SET_H_GR (FLD (f_operand2), opval);
8562 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8567 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))));
8568 CPU (h_cbit) = opval;
8569 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8572 BI opval = LTQI (tmp_newval, 0);
8573 CPU (h_nbit) = opval;
8574 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8577 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8578 CPU (h_zbit) = opval;
8579 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8582 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)));
8583 CPU (h_vbit) = opval;
8584 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8589 CPU (h_xbit) = opval;
8590 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8594 SET_H_INSN_PREFIXED_P (opval);
8595 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8605 CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
8607 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8608 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8609 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8610 int UNUSED written = 0;
8611 IADDR UNUSED pc = abuf->addr;
8612 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8619 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8621 tmp_carry = CPU (h_cbit);
8622 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8625 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
8627 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
8628 SET_H_GR (FLD (f_operand2), opval);
8629 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8634 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))));
8635 CPU (h_cbit) = opval;
8636 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8639 BI opval = LTHI (tmp_newval, 0);
8640 CPU (h_nbit) = opval;
8641 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8644 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8645 CPU (h_zbit) = opval;
8646 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8649 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)));
8650 CPU (h_vbit) = opval;
8651 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8656 CPU (h_xbit) = opval;
8657 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8661 SET_H_INSN_PREFIXED_P (opval);
8662 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8672 CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
8674 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8675 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8676 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8677 int UNUSED written = 0;
8678 IADDR UNUSED pc = abuf->addr;
8679 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8686 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8688 tmp_carry = CPU (h_cbit);
8689 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8691 SI opval = tmp_newval;
8692 SET_H_GR (FLD (f_operand2), opval);
8693 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8697 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))));
8698 CPU (h_cbit) = opval;
8699 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8702 BI opval = LTSI (tmp_newval, 0);
8703 CPU (h_nbit) = opval;
8704 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8707 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8708 CPU (h_zbit) = opval;
8709 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8712 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)));
8713 CPU (h_vbit) = opval;
8714 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8719 CPU (h_xbit) = opval;
8720 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8724 SET_H_INSN_PREFIXED_P (opval);
8725 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8735 CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
8737 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8738 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8739 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8740 int UNUSED written = 0;
8741 IADDR UNUSED pc = abuf->addr;
8742 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8746 tmp_tmpd = ({ SI tmp_addr;
8749 tmp_postinc = FLD (f_memmode);
8750 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8751 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8752 ; if (NEBI (tmp_postinc, 0)) {
8754 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8755 tmp_addr = ADDSI (tmp_addr, 1);
8758 SI opval = tmp_addr;
8759 SET_H_GR (FLD (f_operand1), opval);
8760 written |= (1 << 8);
8761 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8772 tmp_tmpopd = tmp_tmpd;
8773 tmp_carry = CPU (h_cbit);
8774 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8778 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))));
8779 CPU (h_cbit) = opval;
8780 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8783 BI opval = LTQI (tmp_newval, 0);
8784 CPU (h_nbit) = opval;
8785 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8788 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8789 CPU (h_zbit) = opval;
8790 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8793 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)));
8794 CPU (h_vbit) = opval;
8795 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8800 CPU (h_xbit) = opval;
8801 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8805 SET_H_INSN_PREFIXED_P (opval);
8806 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8813 abuf->written = written;
8818 CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
8820 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8821 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8822 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8823 int UNUSED written = 0;
8824 IADDR UNUSED pc = abuf->addr;
8825 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8829 tmp_tmpd = ({ SI tmp_addr;
8832 tmp_postinc = FLD (f_memmode);
8833 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8834 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8835 ; if (NEBI (tmp_postinc, 0)) {
8837 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8838 tmp_addr = ADDSI (tmp_addr, 2);
8841 SI opval = tmp_addr;
8842 SET_H_GR (FLD (f_operand1), opval);
8843 written |= (1 << 8);
8844 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8855 tmp_tmpopd = tmp_tmpd;
8856 tmp_carry = CPU (h_cbit);
8857 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8861 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))));
8862 CPU (h_cbit) = opval;
8863 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8866 BI opval = LTHI (tmp_newval, 0);
8867 CPU (h_nbit) = opval;
8868 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8871 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8872 CPU (h_zbit) = opval;
8873 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8876 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)));
8877 CPU (h_vbit) = opval;
8878 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8883 CPU (h_xbit) = opval;
8884 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8888 SET_H_INSN_PREFIXED_P (opval);
8889 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8896 abuf->written = written;
8901 CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
8903 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8904 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8905 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8906 int UNUSED written = 0;
8907 IADDR UNUSED pc = abuf->addr;
8908 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8912 tmp_tmpd = ({ SI tmp_addr;
8915 tmp_postinc = FLD (f_memmode);
8916 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8917 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
8918 ; if (NEBI (tmp_postinc, 0)) {
8920 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8921 tmp_addr = ADDSI (tmp_addr, 4);
8924 SI opval = tmp_addr;
8925 SET_H_GR (FLD (f_operand1), opval);
8926 written |= (1 << 8);
8927 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8938 tmp_tmpopd = tmp_tmpd;
8939 tmp_carry = CPU (h_cbit);
8940 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8944 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))));
8945 CPU (h_cbit) = opval;
8946 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8949 BI opval = LTSI (tmp_newval, 0);
8950 CPU (h_nbit) = opval;
8951 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8954 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8955 CPU (h_zbit) = opval;
8956 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8959 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)));
8960 CPU (h_vbit) = opval;
8961 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8966 CPU (h_xbit) = opval;
8967 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8971 SET_H_INSN_PREFIXED_P (opval);
8972 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8979 abuf->written = written;
8984 CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
8986 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8987 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8988 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8989 int UNUSED written = 0;
8990 IADDR UNUSED pc = abuf->addr;
8991 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8995 tmp_tmpd = GET_H_GR (FLD (f_operand2));
8999 tmp_postinc = FLD (f_memmode);
9000 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9001 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9002 if (EQBI (CPU (h_pbit), 0)) {
9005 QI opval = tmp_tmpd;
9006 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9007 written |= (1 << 10);
9008 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9011 BI opval = CPU (h_pbit);
9012 CPU (h_cbit) = opval;
9013 written |= (1 << 9);
9014 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9020 CPU (h_cbit) = opval;
9021 written |= (1 << 9);
9022 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9027 QI opval = tmp_tmpd;
9028 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9029 written |= (1 << 10);
9030 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9033 if (NEBI (tmp_postinc, 0)) {
9035 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9036 tmp_addr = ADDSI (tmp_addr, 1);
9039 SI opval = tmp_addr;
9040 SET_H_GR (FLD (f_operand1), opval);
9041 written |= (1 << 8);
9042 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9050 CPU (h_xbit) = opval;
9051 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9055 SET_H_INSN_PREFIXED_P (opval);
9056 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9061 abuf->written = written;
9066 CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9068 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9069 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9070 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9071 int UNUSED written = 0;
9072 IADDR UNUSED pc = abuf->addr;
9073 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9077 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9081 tmp_postinc = FLD (f_memmode);
9082 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9083 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9084 if (EQBI (CPU (h_pbit), 0)) {
9087 HI opval = tmp_tmpd;
9088 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9089 written |= (1 << 10);
9090 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9093 BI opval = CPU (h_pbit);
9094 CPU (h_cbit) = opval;
9095 written |= (1 << 9);
9096 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9102 CPU (h_cbit) = opval;
9103 written |= (1 << 9);
9104 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9109 HI opval = tmp_tmpd;
9110 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9111 written |= (1 << 10);
9112 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9115 if (NEBI (tmp_postinc, 0)) {
9117 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9118 tmp_addr = ADDSI (tmp_addr, 2);
9121 SI opval = tmp_addr;
9122 SET_H_GR (FLD (f_operand1), opval);
9123 written |= (1 << 8);
9124 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9132 CPU (h_xbit) = opval;
9133 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9137 SET_H_INSN_PREFIXED_P (opval);
9138 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9143 abuf->written = written;
9148 CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9150 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9151 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9152 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9153 int UNUSED written = 0;
9154 IADDR UNUSED pc = abuf->addr;
9155 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9159 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9163 tmp_postinc = FLD (f_memmode);
9164 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9165 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9166 if (EQBI (CPU (h_pbit), 0)) {
9169 SI opval = tmp_tmpd;
9170 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9171 written |= (1 << 10);
9172 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9175 BI opval = CPU (h_pbit);
9176 CPU (h_cbit) = opval;
9177 written |= (1 << 9);
9178 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9184 CPU (h_cbit) = opval;
9185 written |= (1 << 9);
9186 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9191 SI opval = tmp_tmpd;
9192 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9193 written |= (1 << 10);
9194 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9197 if (NEBI (tmp_postinc, 0)) {
9199 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9200 tmp_addr = ADDSI (tmp_addr, 4);
9203 SI opval = tmp_addr;
9204 SET_H_GR (FLD (f_operand1), opval);
9205 written |= (1 << 8);
9206 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9214 CPU (h_xbit) = opval;
9215 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9219 SET_H_INSN_PREFIXED_P (opval);
9220 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9225 abuf->written = written;
9230 CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
9232 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9233 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9234 #define FLD(f) abuf->fields.sfmt_muls_b.f
9235 int UNUSED written = 0;
9236 IADDR UNUSED pc = abuf->addr;
9237 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9243 tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9244 tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9245 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9247 SI opval = TRUNCDISI (tmp_tmpr);
9248 SET_H_GR (FLD (f_operand2), opval);
9249 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9252 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9253 SET_H_SR (((UINT) 7), opval);
9254 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9258 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9259 CPU (h_cbit) = opval;
9260 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9263 BI opval = LTDI (tmp_tmpr, 0);
9264 CPU (h_nbit) = opval;
9265 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9268 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9269 CPU (h_zbit) = opval;
9270 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9273 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9274 CPU (h_vbit) = opval;
9275 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9280 CPU (h_xbit) = opval;
9281 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9285 SET_H_INSN_PREFIXED_P (opval);
9286 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9296 CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
9298 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9299 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9300 #define FLD(f) abuf->fields.sfmt_muls_b.f
9301 int UNUSED written = 0;
9302 IADDR UNUSED pc = abuf->addr;
9303 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9309 tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9310 tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9311 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9313 SI opval = TRUNCDISI (tmp_tmpr);
9314 SET_H_GR (FLD (f_operand2), opval);
9315 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9318 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9319 SET_H_SR (((UINT) 7), opval);
9320 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9324 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9325 CPU (h_cbit) = opval;
9326 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9329 BI opval = LTDI (tmp_tmpr, 0);
9330 CPU (h_nbit) = opval;
9331 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9334 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9335 CPU (h_zbit) = opval;
9336 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9339 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9340 CPU (h_vbit) = opval;
9341 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9346 CPU (h_xbit) = opval;
9347 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9351 SET_H_INSN_PREFIXED_P (opval);
9352 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9362 CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
9364 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9365 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9366 #define FLD(f) abuf->fields.sfmt_muls_b.f
9367 int UNUSED written = 0;
9368 IADDR UNUSED pc = abuf->addr;
9369 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9375 tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9376 tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9377 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9379 SI opval = TRUNCDISI (tmp_tmpr);
9380 SET_H_GR (FLD (f_operand2), opval);
9381 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9384 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9385 SET_H_SR (((UINT) 7), opval);
9386 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9390 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9391 CPU (h_cbit) = opval;
9392 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9395 BI opval = LTDI (tmp_tmpr, 0);
9396 CPU (h_nbit) = opval;
9397 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9400 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9401 CPU (h_zbit) = opval;
9402 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9405 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9406 CPU (h_vbit) = opval;
9407 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9412 CPU (h_xbit) = opval;
9413 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9417 SET_H_INSN_PREFIXED_P (opval);
9418 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9428 CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
9430 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9431 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9432 #define FLD(f) abuf->fields.sfmt_muls_b.f
9433 int UNUSED written = 0;
9434 IADDR UNUSED pc = abuf->addr;
9435 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9441 tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9442 tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9443 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9445 SI opval = TRUNCDISI (tmp_tmpr);
9446 SET_H_GR (FLD (f_operand2), opval);
9447 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9450 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9451 SET_H_SR (((UINT) 7), opval);
9452 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9456 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9457 CPU (h_cbit) = opval;
9458 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9461 BI opval = LTDI (tmp_tmpr, 0);
9462 CPU (h_nbit) = opval;
9463 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9466 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9467 CPU (h_zbit) = opval;
9468 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9471 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9472 CPU (h_vbit) = opval;
9473 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9478 CPU (h_xbit) = opval;
9479 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9483 SET_H_INSN_PREFIXED_P (opval);
9484 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9494 CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
9496 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9497 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9498 #define FLD(f) abuf->fields.sfmt_muls_b.f
9499 int UNUSED written = 0;
9500 IADDR UNUSED pc = abuf->addr;
9501 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9507 tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9508 tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9509 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9511 SI opval = TRUNCDISI (tmp_tmpr);
9512 SET_H_GR (FLD (f_operand2), opval);
9513 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9516 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9517 SET_H_SR (((UINT) 7), opval);
9518 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9522 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9523 CPU (h_cbit) = opval;
9524 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9527 BI opval = LTDI (tmp_tmpr, 0);
9528 CPU (h_nbit) = opval;
9529 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9532 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9533 CPU (h_zbit) = opval;
9534 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9537 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9538 CPU (h_vbit) = opval;
9539 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9544 CPU (h_xbit) = opval;
9545 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9549 SET_H_INSN_PREFIXED_P (opval);
9550 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9560 CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
9562 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9563 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9564 #define FLD(f) abuf->fields.sfmt_muls_b.f
9565 int UNUSED written = 0;
9566 IADDR UNUSED pc = abuf->addr;
9567 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9573 tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9574 tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9575 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9577 SI opval = TRUNCDISI (tmp_tmpr);
9578 SET_H_GR (FLD (f_operand2), opval);
9579 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9582 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9583 SET_H_SR (((UINT) 7), opval);
9584 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9588 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9589 CPU (h_cbit) = opval;
9590 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9593 BI opval = LTDI (tmp_tmpr, 0);
9594 CPU (h_nbit) = opval;
9595 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9598 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9599 CPU (h_zbit) = opval;
9600 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9603 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9604 CPU (h_vbit) = opval;
9605 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9610 CPU (h_xbit) = opval;
9611 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9615 SET_H_INSN_PREFIXED_P (opval);
9616 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9626 CASE (sem, INSN_MSTEP) : /* mstep $Rs,$Rd */
9628 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9629 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9630 #define FLD(f) abuf->fields.sfmt_muls_b.f
9631 int UNUSED written = 0;
9632 IADDR UNUSED pc = abuf->addr;
9633 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9638 tmp_tmps = GET_H_GR (FLD (f_operand1));
9639 tmp_tmpd = ADDSI (SLLSI (GET_H_GR (FLD (f_operand2)), 1), ((CPU (h_nbit)) ? (tmp_tmps) : (0)));
9641 SI opval = tmp_tmpd;
9642 SET_H_GR (FLD (f_operand2), opval);
9643 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9647 BI opval = LTSI (tmp_tmpd, 0);
9648 CPU (h_nbit) = opval;
9649 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9652 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9653 CPU (h_zbit) = opval;
9654 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9656 SET_H_CBIT_MOVE (0);
9657 SET_H_VBIT_MOVE (0);
9661 CPU (h_xbit) = opval;
9662 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9666 SET_H_INSN_PREFIXED_P (opval);
9667 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9677 CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
9679 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9680 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9681 #define FLD(f) abuf->fields.sfmt_muls_b.f
9682 int UNUSED written = 0;
9683 IADDR UNUSED pc = abuf->addr;
9684 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9690 tmp_tmps = GET_H_GR (FLD (f_operand1));
9691 tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
9692 tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
9694 SI opval = tmp_tmpd;
9695 SET_H_GR (FLD (f_operand2), opval);
9696 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9700 BI opval = LTSI (tmp_tmpd, 0);
9701 CPU (h_nbit) = opval;
9702 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9705 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9706 CPU (h_zbit) = opval;
9707 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9709 SET_H_CBIT_MOVE (0);
9710 SET_H_VBIT_MOVE (0);
9714 CPU (h_xbit) = opval;
9715 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9719 SET_H_INSN_PREFIXED_P (opval);
9720 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9730 CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
9732 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9733 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9734 #define FLD(f) abuf->fields.sfmt_muls_b.f
9735 int UNUSED written = 0;
9736 IADDR UNUSED pc = abuf->addr;
9737 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9741 tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
9743 SI opval = tmp_tmpd;
9744 SET_H_GR (FLD (f_operand2), opval);
9745 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9749 BI opval = LTSI (tmp_tmpd, 0);
9750 CPU (h_nbit) = opval;
9751 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9754 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9755 CPU (h_zbit) = opval;
9756 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9758 SET_H_CBIT_MOVE (0);
9759 SET_H_VBIT_MOVE (0);
9763 CPU (h_xbit) = opval;
9764 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9768 SET_H_INSN_PREFIXED_P (opval);
9769 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9779 CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
9781 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9782 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9783 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9784 int UNUSED written = 0;
9785 IADDR UNUSED pc = abuf->addr;
9786 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9790 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9793 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
9795 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
9796 SET_H_GR (FLD (f_operand2), opval);
9797 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9802 BI opval = LTQI (tmp_tmpd, 0);
9803 CPU (h_nbit) = opval;
9804 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9807 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9808 CPU (h_zbit) = opval;
9809 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9811 SET_H_CBIT_MOVE (0);
9812 SET_H_VBIT_MOVE (0);
9816 CPU (h_xbit) = opval;
9817 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9821 SET_H_INSN_PREFIXED_P (opval);
9822 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9832 CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
9834 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9835 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9836 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9837 int UNUSED written = 0;
9838 IADDR UNUSED pc = abuf->addr;
9839 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9843 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9846 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
9848 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
9849 SET_H_GR (FLD (f_operand2), opval);
9850 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9855 BI opval = LTHI (tmp_tmpd, 0);
9856 CPU (h_nbit) = opval;
9857 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9860 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9861 CPU (h_zbit) = opval;
9862 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9864 SET_H_CBIT_MOVE (0);
9865 SET_H_VBIT_MOVE (0);
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_AND_D_R) : /* and.d $Rs,$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_add_b_r.f
9890 int UNUSED written = 0;
9891 IADDR UNUSED pc = abuf->addr;
9892 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9896 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9898 SI opval = tmp_tmpd;
9899 SET_H_GR (FLD (f_operand2), opval);
9900 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9904 BI opval = LTSI (tmp_tmpd, 0);
9905 CPU (h_nbit) = opval;
9906 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9909 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9910 CPU (h_zbit) = opval;
9911 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9913 SET_H_CBIT_MOVE (0);
9914 SET_H_VBIT_MOVE (0);
9918 CPU (h_xbit) = opval;
9919 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9923 SET_H_INSN_PREFIXED_P (opval);
9924 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9934 CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
9936 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9937 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9938 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
9939 int UNUSED written = 0;
9940 IADDR UNUSED pc = abuf->addr;
9941 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9945 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
9948 tmp_postinc = FLD (f_memmode);
9949 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9950 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
9951 ; if (NEBI (tmp_postinc, 0)) {
9953 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9954 tmp_addr = ADDSI (tmp_addr, 1);
9957 SI opval = tmp_addr;
9958 SET_H_GR (FLD (f_operand1), opval);
9959 written |= (1 << 11);
9960 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9967 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
9969 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
9970 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
9971 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9976 BI opval = LTQI (tmp_tmpd, 0);
9977 CPU (h_nbit) = opval;
9978 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9981 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9982 CPU (h_zbit) = opval;
9983 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9985 SET_H_CBIT_MOVE (0);
9986 SET_H_VBIT_MOVE (0);
9990 CPU (h_xbit) = opval;
9991 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9995 SET_H_INSN_PREFIXED_P (opval);
9996 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10002 abuf->written = written;
10007 CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
10009 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10010 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10011 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10012 int UNUSED written = 0;
10013 IADDR UNUSED pc = abuf->addr;
10014 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10018 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10021 tmp_postinc = FLD (f_memmode);
10022 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10023 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10024 ; if (NEBI (tmp_postinc, 0)) {
10026 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10027 tmp_addr = ADDSI (tmp_addr, 2);
10030 SI opval = tmp_addr;
10031 SET_H_GR (FLD (f_operand1), opval);
10032 written |= (1 << 11);
10033 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10037 ; tmp_tmp_mem; }));
10040 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10042 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10043 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10044 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10049 BI opval = LTHI (tmp_tmpd, 0);
10050 CPU (h_nbit) = opval;
10051 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10054 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10055 CPU (h_zbit) = opval;
10056 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10058 SET_H_CBIT_MOVE (0);
10059 SET_H_VBIT_MOVE (0);
10063 CPU (h_xbit) = opval;
10064 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10068 SET_H_INSN_PREFIXED_P (opval);
10069 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10075 abuf->written = written;
10080 CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
10082 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10083 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10084 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10085 int UNUSED written = 0;
10086 IADDR UNUSED pc = abuf->addr;
10087 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10091 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10094 tmp_postinc = FLD (f_memmode);
10095 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10096 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10097 ; if (NEBI (tmp_postinc, 0)) {
10099 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10100 tmp_addr = ADDSI (tmp_addr, 4);
10103 SI opval = tmp_addr;
10104 SET_H_GR (FLD (f_operand1), opval);
10105 written |= (1 << 10);
10106 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10110 ; tmp_tmp_mem; }));
10112 SI opval = tmp_tmpd;
10113 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10114 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10118 BI opval = LTSI (tmp_tmpd, 0);
10119 CPU (h_nbit) = opval;
10120 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10123 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10124 CPU (h_zbit) = opval;
10125 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10127 SET_H_CBIT_MOVE (0);
10128 SET_H_VBIT_MOVE (0);
10132 CPU (h_xbit) = opval;
10133 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10137 SET_H_INSN_PREFIXED_P (opval);
10138 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10144 abuf->written = written;
10149 CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
10151 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10152 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10153 #define FLD(f) abuf->fields.sfmt_addcbr.f
10154 int UNUSED written = 0;
10155 IADDR UNUSED pc = abuf->addr;
10156 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10160 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10163 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10165 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10166 SET_H_GR (FLD (f_operand2), opval);
10167 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10172 BI opval = LTQI (tmp_tmpd, 0);
10173 CPU (h_nbit) = opval;
10174 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10177 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10178 CPU (h_zbit) = opval;
10179 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10181 SET_H_CBIT_MOVE (0);
10182 SET_H_VBIT_MOVE (0);
10186 CPU (h_xbit) = opval;
10187 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10191 SET_H_INSN_PREFIXED_P (opval);
10192 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10202 CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
10204 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10205 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10206 #define FLD(f) abuf->fields.sfmt_addcwr.f
10207 int UNUSED written = 0;
10208 IADDR UNUSED pc = abuf->addr;
10209 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10213 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10216 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10218 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10219 SET_H_GR (FLD (f_operand2), opval);
10220 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10225 BI opval = LTHI (tmp_tmpd, 0);
10226 CPU (h_nbit) = opval;
10227 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10230 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10231 CPU (h_zbit) = opval;
10232 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10234 SET_H_CBIT_MOVE (0);
10235 SET_H_VBIT_MOVE (0);
10239 CPU (h_xbit) = opval;
10240 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10244 SET_H_INSN_PREFIXED_P (opval);
10245 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10255 CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
10257 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10258 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10259 #define FLD(f) abuf->fields.sfmt_addcdr.f
10260 int UNUSED written = 0;
10261 IADDR UNUSED pc = abuf->addr;
10262 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10266 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10268 SI opval = tmp_tmpd;
10269 SET_H_GR (FLD (f_operand2), opval);
10270 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10274 BI opval = LTSI (tmp_tmpd, 0);
10275 CPU (h_nbit) = opval;
10276 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10279 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10280 CPU (h_zbit) = opval;
10281 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10283 SET_H_CBIT_MOVE (0);
10284 SET_H_VBIT_MOVE (0);
10288 CPU (h_xbit) = opval;
10289 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10293 SET_H_INSN_PREFIXED_P (opval);
10294 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10304 CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
10306 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10307 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10308 #define FLD(f) abuf->fields.sfmt_andq.f
10309 int UNUSED written = 0;
10310 IADDR UNUSED pc = abuf->addr;
10311 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10315 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10317 SI opval = tmp_tmpd;
10318 SET_H_GR (FLD (f_operand2), opval);
10319 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10323 BI opval = LTSI (tmp_tmpd, 0);
10324 CPU (h_nbit) = opval;
10325 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10328 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10329 CPU (h_zbit) = opval;
10330 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10332 SET_H_CBIT_MOVE (0);
10333 SET_H_VBIT_MOVE (0);
10337 CPU (h_xbit) = opval;
10338 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10342 SET_H_INSN_PREFIXED_P (opval);
10343 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10353 CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
10355 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10356 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10357 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10358 int UNUSED written = 0;
10359 IADDR UNUSED pc = abuf->addr;
10360 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10364 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10367 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10369 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10370 SET_H_GR (FLD (f_operand2), opval);
10371 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10376 BI opval = LTQI (tmp_tmpd, 0);
10377 CPU (h_nbit) = opval;
10378 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10381 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10382 CPU (h_zbit) = opval;
10383 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10385 SET_H_CBIT_MOVE (0);
10386 SET_H_VBIT_MOVE (0);
10390 CPU (h_xbit) = opval;
10391 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10395 SET_H_INSN_PREFIXED_P (opval);
10396 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10406 CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
10408 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10409 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10410 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10411 int UNUSED written = 0;
10412 IADDR UNUSED pc = abuf->addr;
10413 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10417 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10420 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10422 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10423 SET_H_GR (FLD (f_operand2), opval);
10424 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10429 BI opval = LTHI (tmp_tmpd, 0);
10430 CPU (h_nbit) = opval;
10431 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10434 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10435 CPU (h_zbit) = opval;
10436 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10438 SET_H_CBIT_MOVE (0);
10439 SET_H_VBIT_MOVE (0);
10443 CPU (h_xbit) = opval;
10444 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10448 SET_H_INSN_PREFIXED_P (opval);
10449 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10459 CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
10461 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10462 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10463 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10464 int UNUSED written = 0;
10465 IADDR UNUSED pc = abuf->addr;
10466 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10470 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10472 SI opval = tmp_tmpd;
10473 SET_H_GR (FLD (f_operand2), opval);
10474 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10478 BI opval = LTSI (tmp_tmpd, 0);
10479 CPU (h_nbit) = opval;
10480 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10483 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10484 CPU (h_zbit) = opval;
10485 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10487 SET_H_CBIT_MOVE (0);
10488 SET_H_VBIT_MOVE (0);
10492 CPU (h_xbit) = opval;
10493 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10497 SET_H_INSN_PREFIXED_P (opval);
10498 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10508 CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
10510 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10511 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10512 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10513 int UNUSED written = 0;
10514 IADDR UNUSED pc = abuf->addr;
10515 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10519 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10522 tmp_postinc = FLD (f_memmode);
10523 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10524 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10525 ; if (NEBI (tmp_postinc, 0)) {
10527 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10528 tmp_addr = ADDSI (tmp_addr, 1);
10531 SI opval = tmp_addr;
10532 SET_H_GR (FLD (f_operand1), opval);
10533 written |= (1 << 11);
10534 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10538 ; tmp_tmp_mem; }));
10541 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10543 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10544 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10545 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10550 BI opval = LTQI (tmp_tmpd, 0);
10551 CPU (h_nbit) = opval;
10552 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10555 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10556 CPU (h_zbit) = opval;
10557 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10559 SET_H_CBIT_MOVE (0);
10560 SET_H_VBIT_MOVE (0);
10564 CPU (h_xbit) = opval;
10565 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10569 SET_H_INSN_PREFIXED_P (opval);
10570 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10576 abuf->written = written;
10581 CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
10583 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10584 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10585 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10586 int UNUSED written = 0;
10587 IADDR UNUSED pc = abuf->addr;
10588 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10592 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10595 tmp_postinc = FLD (f_memmode);
10596 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10597 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10598 ; if (NEBI (tmp_postinc, 0)) {
10600 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10601 tmp_addr = ADDSI (tmp_addr, 2);
10604 SI opval = tmp_addr;
10605 SET_H_GR (FLD (f_operand1), opval);
10606 written |= (1 << 11);
10607 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10611 ; tmp_tmp_mem; }));
10614 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10616 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10617 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10618 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10623 BI opval = LTHI (tmp_tmpd, 0);
10624 CPU (h_nbit) = opval;
10625 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10628 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10629 CPU (h_zbit) = opval;
10630 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10632 SET_H_CBIT_MOVE (0);
10633 SET_H_VBIT_MOVE (0);
10637 CPU (h_xbit) = opval;
10638 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10642 SET_H_INSN_PREFIXED_P (opval);
10643 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10649 abuf->written = written;
10654 CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
10656 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10657 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10658 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10659 int UNUSED written = 0;
10660 IADDR UNUSED pc = abuf->addr;
10661 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10665 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10668 tmp_postinc = FLD (f_memmode);
10669 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10670 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10671 ; if (NEBI (tmp_postinc, 0)) {
10673 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10674 tmp_addr = ADDSI (tmp_addr, 4);
10677 SI opval = tmp_addr;
10678 SET_H_GR (FLD (f_operand1), opval);
10679 written |= (1 << 10);
10680 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10684 ; tmp_tmp_mem; }));
10686 SI opval = tmp_tmpd;
10687 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10688 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10692 BI opval = LTSI (tmp_tmpd, 0);
10693 CPU (h_nbit) = opval;
10694 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10697 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10698 CPU (h_zbit) = opval;
10699 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10701 SET_H_CBIT_MOVE (0);
10702 SET_H_VBIT_MOVE (0);
10706 CPU (h_xbit) = opval;
10707 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10711 SET_H_INSN_PREFIXED_P (opval);
10712 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10718 abuf->written = written;
10723 CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
10725 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10726 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10727 #define FLD(f) abuf->fields.sfmt_addcbr.f
10728 int UNUSED written = 0;
10729 IADDR UNUSED pc = abuf->addr;
10730 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10734 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10737 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10739 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10740 SET_H_GR (FLD (f_operand2), opval);
10741 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10746 BI opval = LTQI (tmp_tmpd, 0);
10747 CPU (h_nbit) = opval;
10748 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10751 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10752 CPU (h_zbit) = opval;
10753 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10755 SET_H_CBIT_MOVE (0);
10756 SET_H_VBIT_MOVE (0);
10760 CPU (h_xbit) = opval;
10761 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10765 SET_H_INSN_PREFIXED_P (opval);
10766 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10776 CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
10778 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10779 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10780 #define FLD(f) abuf->fields.sfmt_addcwr.f
10781 int UNUSED written = 0;
10782 IADDR UNUSED pc = abuf->addr;
10783 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10787 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10790 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10792 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10793 SET_H_GR (FLD (f_operand2), opval);
10794 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10799 BI opval = LTHI (tmp_tmpd, 0);
10800 CPU (h_nbit) = opval;
10801 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10804 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10805 CPU (h_zbit) = opval;
10806 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10808 SET_H_CBIT_MOVE (0);
10809 SET_H_VBIT_MOVE (0);
10813 CPU (h_xbit) = opval;
10814 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10818 SET_H_INSN_PREFIXED_P (opval);
10819 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10829 CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
10831 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10832 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10833 #define FLD(f) abuf->fields.sfmt_addcdr.f
10834 int UNUSED written = 0;
10835 IADDR UNUSED pc = abuf->addr;
10836 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10840 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10842 SI opval = tmp_tmpd;
10843 SET_H_GR (FLD (f_operand2), opval);
10844 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10848 BI opval = LTSI (tmp_tmpd, 0);
10849 CPU (h_nbit) = opval;
10850 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10853 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10854 CPU (h_zbit) = opval;
10855 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10857 SET_H_CBIT_MOVE (0);
10858 SET_H_VBIT_MOVE (0);
10862 CPU (h_xbit) = opval;
10863 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10867 SET_H_INSN_PREFIXED_P (opval);
10868 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10878 CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
10880 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10881 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10882 #define FLD(f) abuf->fields.sfmt_andq.f
10883 int UNUSED written = 0;
10884 IADDR UNUSED pc = abuf->addr;
10885 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10889 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10891 SI opval = tmp_tmpd;
10892 SET_H_GR (FLD (f_operand2), opval);
10893 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10897 BI opval = LTSI (tmp_tmpd, 0);
10898 CPU (h_nbit) = opval;
10899 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10902 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10903 CPU (h_zbit) = opval;
10904 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10906 SET_H_CBIT_MOVE (0);
10907 SET_H_VBIT_MOVE (0);
10911 CPU (h_xbit) = opval;
10912 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10916 SET_H_INSN_PREFIXED_P (opval);
10917 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10927 CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
10929 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10930 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10931 #define FLD(f) abuf->fields.sfmt_muls_b.f
10932 int UNUSED written = 0;
10933 IADDR UNUSED pc = abuf->addr;
10934 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10938 tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10940 SI opval = tmp_tmpd;
10941 SET_H_GR (FLD (f_operand2), opval);
10942 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10946 BI opval = LTSI (tmp_tmpd, 0);
10947 CPU (h_nbit) = opval;
10948 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10951 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10952 CPU (h_zbit) = opval;
10953 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10955 SET_H_CBIT_MOVE (0);
10956 SET_H_VBIT_MOVE (0);
10960 CPU (h_xbit) = opval;
10961 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10965 SET_H_INSN_PREFIXED_P (opval);
10966 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10976 CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
10978 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10979 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10980 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
10981 int UNUSED written = 0;
10982 IADDR UNUSED pc = abuf->addr;
10983 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10988 tmp_tmps = GET_H_GR (FLD (f_operand1));
10989 tmp_tmpd = ({ SI tmp_tmpcode;
10992 tmp_tmpcode = FLD (f_operand2);
10993 ; tmp_tmpval = tmp_tmps;
10994 ; if (EQSI (tmp_tmpcode, 0)) {
10995 tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
10997 else if (EQSI (tmp_tmpcode, 1)) {
10998 tmp_tmpres = ({ SI tmp_tmpr;
10999 tmp_tmpr = tmp_tmpval;
11000 ; 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)))))))); });
11002 else if (EQSI (tmp_tmpcode, 2)) {
11003 tmp_tmpres = ({ SI tmp_tmpb;
11004 tmp_tmpb = tmp_tmpval;
11005 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11007 else if (EQSI (tmp_tmpcode, 3)) {
11008 tmp_tmpres = ({ SI tmp_tmpr;
11009 tmp_tmpr = ({ SI tmp_tmpb;
11010 tmp_tmpb = tmp_tmpval;
11011 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11012 ; 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)))))))); });
11014 else if (EQSI (tmp_tmpcode, 4)) {
11015 tmp_tmpres = ({ SI tmp_tmpb;
11016 tmp_tmpb = tmp_tmpval;
11017 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11019 else if (EQSI (tmp_tmpcode, 5)) {
11020 tmp_tmpres = ({ SI tmp_tmpr;
11021 tmp_tmpr = ({ SI tmp_tmpb;
11022 tmp_tmpb = tmp_tmpval;
11023 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11024 ; 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)))))))); });
11026 else if (EQSI (tmp_tmpcode, 6)) {
11027 tmp_tmpres = ({ SI tmp_tmpb;
11028 tmp_tmpb = ({ SI tmp_tmpb;
11029 tmp_tmpb = tmp_tmpval;
11030 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11031 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11033 else if (EQSI (tmp_tmpcode, 7)) {
11034 tmp_tmpres = ({ SI tmp_tmpr;
11035 tmp_tmpr = ({ SI tmp_tmpb;
11036 tmp_tmpb = ({ SI tmp_tmpb;
11037 tmp_tmpb = tmp_tmpval;
11038 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11039 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11040 ; 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)))))))); });
11042 else if (EQSI (tmp_tmpcode, 8)) {
11043 tmp_tmpres = INVSI (tmp_tmpval);
11045 else if (EQSI (tmp_tmpcode, 9)) {
11046 tmp_tmpres = ({ SI tmp_tmpr;
11047 tmp_tmpr = INVSI (tmp_tmpval);
11048 ; 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)))))))); });
11050 else if (EQSI (tmp_tmpcode, 10)) {
11051 tmp_tmpres = ({ SI tmp_tmpb;
11052 tmp_tmpb = INVSI (tmp_tmpval);
11053 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11055 else if (EQSI (tmp_tmpcode, 11)) {
11056 tmp_tmpres = ({ SI tmp_tmpr;
11057 tmp_tmpr = ({ SI tmp_tmpb;
11058 tmp_tmpb = INVSI (tmp_tmpval);
11059 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11060 ; 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)))))))); });
11062 else if (EQSI (tmp_tmpcode, 12)) {
11063 tmp_tmpres = ({ SI tmp_tmpb;
11064 tmp_tmpb = INVSI (tmp_tmpval);
11065 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11067 else if (EQSI (tmp_tmpcode, 13)) {
11068 tmp_tmpres = ({ SI tmp_tmpr;
11069 tmp_tmpr = ({ SI tmp_tmpb;
11070 tmp_tmpb = INVSI (tmp_tmpval);
11071 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11072 ; 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)))))))); });
11074 else if (EQSI (tmp_tmpcode, 14)) {
11075 tmp_tmpres = ({ SI tmp_tmpb;
11076 tmp_tmpb = ({ SI tmp_tmpb;
11077 tmp_tmpb = INVSI (tmp_tmpval);
11078 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11079 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11081 else if (EQSI (tmp_tmpcode, 15)) {
11082 tmp_tmpres = ({ SI tmp_tmpr;
11083 tmp_tmpr = ({ SI tmp_tmpb;
11084 tmp_tmpb = ({ SI tmp_tmpb;
11085 tmp_tmpb = INVSI (tmp_tmpval);
11086 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11087 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11088 ; 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)))))))); });
11092 SI opval = tmp_tmpd;
11093 SET_H_GR (FLD (f_operand1), opval);
11094 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11098 BI opval = LTSI (tmp_tmpd, 0);
11099 CPU (h_nbit) = opval;
11100 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11103 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11104 CPU (h_zbit) = opval;
11105 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11107 SET_H_CBIT_MOVE (0);
11108 SET_H_VBIT_MOVE (0);
11112 CPU (h_xbit) = opval;
11113 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11117 SET_H_INSN_PREFIXED_P (opval);
11118 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11128 CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
11130 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11131 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11132 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11133 int UNUSED written = 0;
11134 IADDR UNUSED pc = abuf->addr;
11135 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11141 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11142 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11143 tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11146 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11148 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11149 SET_H_GR (FLD (f_operand2), opval);
11150 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11155 BI opval = LTQI (tmp_tmpd, 0);
11156 CPU (h_nbit) = opval;
11157 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11160 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11161 CPU (h_zbit) = opval;
11162 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11164 SET_H_CBIT_MOVE (0);
11165 SET_H_VBIT_MOVE (0);
11169 CPU (h_xbit) = opval;
11170 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11174 SET_H_INSN_PREFIXED_P (opval);
11175 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11185 CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
11187 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11188 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11189 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11190 int UNUSED written = 0;
11191 IADDR UNUSED pc = abuf->addr;
11192 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11198 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11199 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11200 tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11203 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11205 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11206 SET_H_GR (FLD (f_operand2), opval);
11207 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11212 BI opval = LTHI (tmp_tmpd, 0);
11213 CPU (h_nbit) = opval;
11214 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11217 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11218 CPU (h_zbit) = opval;
11219 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11221 SET_H_CBIT_MOVE (0);
11222 SET_H_VBIT_MOVE (0);
11226 CPU (h_xbit) = opval;
11227 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11231 SET_H_INSN_PREFIXED_P (opval);
11232 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11242 CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
11244 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11245 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11246 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11247 int UNUSED written = 0;
11248 IADDR UNUSED pc = abuf->addr;
11249 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11255 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11256 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11257 tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11259 SI opval = tmp_tmpd;
11260 SET_H_GR (FLD (f_operand2), opval);
11261 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11265 BI opval = LTSI (tmp_tmpd, 0);
11266 CPU (h_nbit) = opval;
11267 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11270 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11271 CPU (h_zbit) = opval;
11272 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11274 SET_H_CBIT_MOVE (0);
11275 SET_H_VBIT_MOVE (0);
11279 CPU (h_xbit) = opval;
11280 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11284 SET_H_INSN_PREFIXED_P (opval);
11285 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11295 CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
11297 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11298 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11299 #define FLD(f) abuf->fields.sfmt_asrq.f
11300 int UNUSED written = 0;
11301 IADDR UNUSED pc = abuf->addr;
11302 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11306 tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11308 SI opval = tmp_tmpd;
11309 SET_H_GR (FLD (f_operand2), opval);
11310 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11314 BI opval = LTSI (tmp_tmpd, 0);
11315 CPU (h_nbit) = opval;
11316 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11319 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11320 CPU (h_zbit) = opval;
11321 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11323 SET_H_CBIT_MOVE (0);
11324 SET_H_VBIT_MOVE (0);
11328 CPU (h_xbit) = opval;
11329 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11333 SET_H_INSN_PREFIXED_P (opval);
11334 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11344 CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
11346 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11347 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11348 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11349 int UNUSED written = 0;
11350 IADDR UNUSED pc = abuf->addr;
11351 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11356 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11357 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11360 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11362 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11363 SET_H_GR (FLD (f_operand2), opval);
11364 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11369 BI opval = LTQI (tmp_tmpd, 0);
11370 CPU (h_nbit) = opval;
11371 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11374 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11375 CPU (h_zbit) = opval;
11376 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11378 SET_H_CBIT_MOVE (0);
11379 SET_H_VBIT_MOVE (0);
11383 CPU (h_xbit) = opval;
11384 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11388 SET_H_INSN_PREFIXED_P (opval);
11389 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11399 CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $Rs,$Rd */
11401 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11402 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11403 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11404 int UNUSED written = 0;
11405 IADDR UNUSED pc = abuf->addr;
11406 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11411 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11412 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11415 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11417 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11418 SET_H_GR (FLD (f_operand2), opval);
11419 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11424 BI opval = LTHI (tmp_tmpd, 0);
11425 CPU (h_nbit) = opval;
11426 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11429 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11430 CPU (h_zbit) = opval;
11431 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11433 SET_H_CBIT_MOVE (0);
11434 SET_H_VBIT_MOVE (0);
11438 CPU (h_xbit) = opval;
11439 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11443 SET_H_INSN_PREFIXED_P (opval);
11444 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11454 CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
11456 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11457 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11458 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11459 int UNUSED written = 0;
11460 IADDR UNUSED pc = abuf->addr;
11461 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11466 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11467 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11469 SI opval = tmp_tmpd;
11470 SET_H_GR (FLD (f_operand2), opval);
11471 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11475 BI opval = LTSI (tmp_tmpd, 0);
11476 CPU (h_nbit) = opval;
11477 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11480 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11481 CPU (h_zbit) = opval;
11482 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11484 SET_H_CBIT_MOVE (0);
11485 SET_H_VBIT_MOVE (0);
11489 CPU (h_xbit) = opval;
11490 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11494 SET_H_INSN_PREFIXED_P (opval);
11495 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11505 CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
11507 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11508 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11509 #define FLD(f) abuf->fields.sfmt_asrq.f
11510 int UNUSED written = 0;
11511 IADDR UNUSED pc = abuf->addr;
11512 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11516 tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11518 SI opval = tmp_tmpd;
11519 SET_H_GR (FLD (f_operand2), opval);
11520 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11524 BI opval = LTSI (tmp_tmpd, 0);
11525 CPU (h_nbit) = opval;
11526 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11529 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11530 CPU (h_zbit) = opval;
11531 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11533 SET_H_CBIT_MOVE (0);
11534 SET_H_VBIT_MOVE (0);
11538 CPU (h_xbit) = opval;
11539 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11543 SET_H_INSN_PREFIXED_P (opval);
11544 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11554 CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
11556 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11557 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11558 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11559 int UNUSED written = 0;
11560 IADDR UNUSED pc = abuf->addr;
11561 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11566 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11567 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11570 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11572 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11573 SET_H_GR (FLD (f_operand2), opval);
11574 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11579 BI opval = LTQI (tmp_tmpd, 0);
11580 CPU (h_nbit) = opval;
11581 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11584 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11585 CPU (h_zbit) = opval;
11586 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11588 SET_H_CBIT_MOVE (0);
11589 SET_H_VBIT_MOVE (0);
11593 CPU (h_xbit) = opval;
11594 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11598 SET_H_INSN_PREFIXED_P (opval);
11599 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11609 CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
11611 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11612 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11613 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11614 int UNUSED written = 0;
11615 IADDR UNUSED pc = abuf->addr;
11616 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11621 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11622 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11625 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11627 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11628 SET_H_GR (FLD (f_operand2), opval);
11629 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11634 BI opval = LTHI (tmp_tmpd, 0);
11635 CPU (h_nbit) = opval;
11636 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11639 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11640 CPU (h_zbit) = opval;
11641 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11643 SET_H_CBIT_MOVE (0);
11644 SET_H_VBIT_MOVE (0);
11648 CPU (h_xbit) = opval;
11649 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11653 SET_H_INSN_PREFIXED_P (opval);
11654 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11664 CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
11666 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11667 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11668 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11669 int UNUSED written = 0;
11670 IADDR UNUSED pc = abuf->addr;
11671 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11676 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11677 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11679 SI opval = tmp_tmpd;
11680 SET_H_GR (FLD (f_operand2), opval);
11681 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11685 BI opval = LTSI (tmp_tmpd, 0);
11686 CPU (h_nbit) = opval;
11687 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11690 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11691 CPU (h_zbit) = opval;
11692 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11694 SET_H_CBIT_MOVE (0);
11695 SET_H_VBIT_MOVE (0);
11699 CPU (h_xbit) = opval;
11700 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11704 SET_H_INSN_PREFIXED_P (opval);
11705 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11715 CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
11717 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11718 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11719 #define FLD(f) abuf->fields.sfmt_asrq.f
11720 int UNUSED written = 0;
11721 IADDR UNUSED pc = abuf->addr;
11722 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11726 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11728 SI opval = tmp_tmpd;
11729 SET_H_GR (FLD (f_operand2), opval);
11730 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11734 BI opval = LTSI (tmp_tmpd, 0);
11735 CPU (h_nbit) = opval;
11736 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11739 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11740 CPU (h_zbit) = opval;
11741 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11743 SET_H_CBIT_MOVE (0);
11744 SET_H_VBIT_MOVE (0);
11748 CPU (h_xbit) = opval;
11749 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11753 SET_H_INSN_PREFIXED_P (opval);
11754 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11764 CASE (sem, INSN_BTST) : /* $Rs,$Rd */
11766 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11767 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11768 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11769 int UNUSED written = 0;
11770 IADDR UNUSED pc = abuf->addr;
11771 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11776 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
11779 BI opval = LTSI (tmp_tmpd, 0);
11780 CPU (h_nbit) = opval;
11781 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11784 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11785 CPU (h_zbit) = opval;
11786 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11788 SET_H_CBIT_MOVE (0);
11789 SET_H_VBIT_MOVE (0);
11793 CPU (h_xbit) = opval;
11794 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11798 SET_H_INSN_PREFIXED_P (opval);
11799 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11809 CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
11811 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11812 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11813 #define FLD(f) abuf->fields.sfmt_asrq.f
11814 int UNUSED written = 0;
11815 IADDR UNUSED pc = abuf->addr;
11816 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11820 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
11823 BI opval = LTSI (tmp_tmpd, 0);
11824 CPU (h_nbit) = opval;
11825 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11828 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11829 CPU (h_zbit) = opval;
11830 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11832 SET_H_CBIT_MOVE (0);
11833 SET_H_VBIT_MOVE (0);
11837 CPU (h_xbit) = opval;
11838 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11842 SET_H_INSN_PREFIXED_P (opval);
11843 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11853 CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
11855 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11856 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11857 #define FLD(f) abuf->fields.sfmt_setf.f
11858 int UNUSED written = 0;
11859 IADDR UNUSED pc = abuf->addr;
11860 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11864 tmp_tmp = FLD (f_dstsrc);
11865 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
11868 CPU (h_cbit) = opval;
11869 written |= (1 << 1);
11870 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
11873 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
11876 CPU (h_vbit) = opval;
11877 written |= (1 << 7);
11878 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
11881 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
11884 CPU (h_zbit) = opval;
11885 written |= (1 << 9);
11886 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11889 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
11892 CPU (h_nbit) = opval;
11893 written |= (1 << 3);
11894 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11897 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11900 CPU (h_xbit) = opval;
11901 written |= (1 << 8);
11902 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11905 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
11908 SET_H_IBIT (opval);
11909 written |= (1 << 2);
11910 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
11913 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
11916 SET_H_UBIT (opval);
11917 written |= (1 << 6);
11918 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
11921 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
11924 CPU (h_pbit) = opval;
11925 written |= (1 << 4);
11926 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
11931 SET_H_INSN_PREFIXED_P (opval);
11932 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11934 if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11937 CPU (h_xbit) = opval;
11938 written |= (1 << 8);
11939 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11944 abuf->written = written;
11949 CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
11951 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11952 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11953 #define FLD(f) abuf->fields.sfmt_setf.f
11954 int UNUSED written = 0;
11955 IADDR UNUSED pc = abuf->addr;
11956 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11960 tmp_tmp = FLD (f_dstsrc);
11961 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
11964 CPU (h_cbit) = opval;
11965 written |= (1 << 1);
11966 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
11969 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
11972 CPU (h_vbit) = opval;
11973 written |= (1 << 7);
11974 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
11977 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
11980 CPU (h_zbit) = opval;
11981 written |= (1 << 9);
11982 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11985 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
11988 CPU (h_nbit) = opval;
11989 written |= (1 << 3);
11990 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11993 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11996 CPU (h_xbit) = opval;
11997 written |= (1 << 8);
11998 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12001 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12004 SET_H_IBIT (opval);
12005 written |= (1 << 2);
12006 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12009 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12012 SET_H_UBIT (opval);
12013 written |= (1 << 6);
12014 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12017 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12020 CPU (h_pbit) = opval;
12021 written |= (1 << 4);
12022 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12028 CPU (h_xbit) = opval;
12029 written |= (1 << 8);
12030 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12034 SET_H_INSN_PREFIXED_P (opval);
12035 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12040 abuf->written = written;
12045 CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
12047 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12048 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12049 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12050 int UNUSED written = 0;
12051 IADDR UNUSED pc = abuf->addr;
12053 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12057 tmp_truthval = ({ SI tmp_tmpcond;
12059 tmp_tmpcond = FLD (f_operand2);
12060 ; if (EQSI (tmp_tmpcond, 0)) {
12061 tmp_condres = NOTBI (CPU (h_cbit));
12063 else if (EQSI (tmp_tmpcond, 1)) {
12064 tmp_condres = CPU (h_cbit);
12066 else if (EQSI (tmp_tmpcond, 2)) {
12067 tmp_condres = NOTBI (CPU (h_zbit));
12069 else if (EQSI (tmp_tmpcond, 3)) {
12070 tmp_condres = CPU (h_zbit);
12072 else if (EQSI (tmp_tmpcond, 4)) {
12073 tmp_condres = NOTBI (CPU (h_vbit));
12075 else if (EQSI (tmp_tmpcond, 5)) {
12076 tmp_condres = CPU (h_vbit);
12078 else if (EQSI (tmp_tmpcond, 6)) {
12079 tmp_condres = NOTBI (CPU (h_nbit));
12081 else if (EQSI (tmp_tmpcond, 7)) {
12082 tmp_condres = CPU (h_nbit);
12084 else if (EQSI (tmp_tmpcond, 8)) {
12085 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12087 else if (EQSI (tmp_tmpcond, 9)) {
12088 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12090 else if (EQSI (tmp_tmpcond, 10)) {
12091 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12093 else if (EQSI (tmp_tmpcond, 11)) {
12094 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12096 else if (EQSI (tmp_tmpcond, 12)) {
12097 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12099 else if (EQSI (tmp_tmpcond, 13)) {
12100 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12102 else if (EQSI (tmp_tmpcond, 14)) {
12105 else if (EQSI (tmp_tmpcond, 15)) {
12106 tmp_condres = CPU (h_pbit);
12109 crisv10f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
12113 CPU (h_xbit) = opval;
12114 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12118 SET_H_INSN_PREFIXED_P (opval);
12119 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12122 if (tmp_truthval) {
12125 USI opval = FLD (i_o_pcrel);
12126 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12127 written |= (1 << 8);
12128 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12134 abuf->written = written;
12135 SEM_BRANCH_FINI (vpc);
12140 CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
12142 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12143 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12144 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12145 int UNUSED written = 0;
12146 IADDR UNUSED pc = abuf->addr;
12148 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12154 CPU (h_xbit) = opval;
12155 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12159 SET_H_INSN_PREFIXED_P (opval);
12160 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12165 USI opval = FLD (i_o_pcrel);
12166 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12167 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12172 SEM_BRANCH_FINI (vpc);
12177 CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
12179 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12180 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12181 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12182 int UNUSED written = 0;
12183 IADDR UNUSED pc = abuf->addr;
12185 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12189 tmp_truthval = ({ SI tmp_tmpcond;
12191 tmp_tmpcond = FLD (f_operand2);
12192 ; if (EQSI (tmp_tmpcond, 0)) {
12193 tmp_condres = NOTBI (CPU (h_cbit));
12195 else if (EQSI (tmp_tmpcond, 1)) {
12196 tmp_condres = CPU (h_cbit);
12198 else if (EQSI (tmp_tmpcond, 2)) {
12199 tmp_condres = NOTBI (CPU (h_zbit));
12201 else if (EQSI (tmp_tmpcond, 3)) {
12202 tmp_condres = CPU (h_zbit);
12204 else if (EQSI (tmp_tmpcond, 4)) {
12205 tmp_condres = NOTBI (CPU (h_vbit));
12207 else if (EQSI (tmp_tmpcond, 5)) {
12208 tmp_condres = CPU (h_vbit);
12210 else if (EQSI (tmp_tmpcond, 6)) {
12211 tmp_condres = NOTBI (CPU (h_nbit));
12213 else if (EQSI (tmp_tmpcond, 7)) {
12214 tmp_condres = CPU (h_nbit);
12216 else if (EQSI (tmp_tmpcond, 8)) {
12217 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12219 else if (EQSI (tmp_tmpcond, 9)) {
12220 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12222 else if (EQSI (tmp_tmpcond, 10)) {
12223 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12225 else if (EQSI (tmp_tmpcond, 11)) {
12226 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12228 else if (EQSI (tmp_tmpcond, 12)) {
12229 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12231 else if (EQSI (tmp_tmpcond, 13)) {
12232 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12234 else if (EQSI (tmp_tmpcond, 14)) {
12237 else if (EQSI (tmp_tmpcond, 15)) {
12238 tmp_condres = CPU (h_pbit);
12241 crisv10f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
12245 CPU (h_xbit) = opval;
12246 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12250 SET_H_INSN_PREFIXED_P (opval);
12251 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12254 if (tmp_truthval) {
12257 USI opval = FLD (i_o_word_pcrel);
12258 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12259 written |= (1 << 8);
12260 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12266 abuf->written = written;
12267 SEM_BRANCH_FINI (vpc);
12272 CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
12274 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12275 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12276 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12277 int UNUSED written = 0;
12278 IADDR UNUSED pc = abuf->addr;
12280 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12286 CPU (h_xbit) = opval;
12287 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12291 SET_H_INSN_PREFIXED_P (opval);
12292 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12297 USI opval = FLD (i_o_word_pcrel);
12298 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12299 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12304 SEM_BRANCH_FINI (vpc);
12309 CASE (sem, INSN_JUMP_R) : /* jump/jsr/jir ${Rs} */
12311 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12312 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12313 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12314 int UNUSED written = 0;
12315 IADDR UNUSED pc = abuf->addr;
12317 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12321 SI opval = ADDSI (pc, 2);
12322 SET_H_SR (FLD (f_operand2), opval);
12323 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12326 USI opval = GET_H_GR (FLD (f_operand1));
12327 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12328 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12333 CPU (h_xbit) = opval;
12334 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12338 SET_H_INSN_PREFIXED_P (opval);
12339 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12344 SEM_BRANCH_FINI (vpc);
12349 CASE (sem, INSN_JUMP_M) : /* jump/jsr/jir [${Rs}${inc}] */
12351 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12352 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12353 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12354 int UNUSED written = 0;
12355 IADDR UNUSED pc = abuf->addr;
12357 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12361 SI opval = ADDSI (pc, 2);
12362 SET_H_SR (FLD (f_operand2), opval);
12363 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12366 USI opval = ({ SI tmp_addr;
12369 tmp_postinc = FLD (f_memmode);
12370 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12371 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
12372 ; if (NEBI (tmp_postinc, 0)) {
12374 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12375 tmp_addr = ADDSI (tmp_addr, 4);
12378 SI opval = tmp_addr;
12379 SET_H_GR (FLD (f_operand1), opval);
12380 written |= (1 << 7);
12381 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12386 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12387 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12392 CPU (h_xbit) = opval;
12393 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12397 SET_H_INSN_PREFIXED_P (opval);
12398 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12403 abuf->written = written;
12404 SEM_BRANCH_FINI (vpc);
12409 CASE (sem, INSN_JUMP_C) : /* jump/jsr/jir ${const32} */
12411 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12412 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12413 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
12414 int UNUSED written = 0;
12415 IADDR UNUSED pc = abuf->addr;
12417 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12421 SI opval = ADDSI (pc, 6);
12422 SET_H_SR (FLD (f_operand2), opval);
12423 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12426 USI opval = FLD (f_indir_pc__dword);
12427 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12428 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12433 CPU (h_xbit) = opval;
12434 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12438 SET_H_INSN_PREFIXED_P (opval);
12439 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12444 SEM_BRANCH_FINI (vpc);
12449 CASE (sem, INSN_BREAK) : /* break $n */
12451 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12452 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12453 #define FLD(f) abuf->fields.sfmt_break.f
12454 int UNUSED written = 0;
12455 IADDR UNUSED pc = abuf->addr;
12457 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12463 CPU (h_xbit) = opval;
12464 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12468 SET_H_INSN_PREFIXED_P (opval);
12469 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12473 USI opval = crisv10f_break_handler (current_cpu, FLD (f_u4), pc);
12474 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12475 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12479 SEM_BRANCH_FINI (vpc);
12484 CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
12486 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12487 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12488 #define FLD(f) abuf->fields.sfmt_muls_b.f
12489 int UNUSED written = 0;
12490 IADDR UNUSED pc = abuf->addr;
12491 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12497 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
12498 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12499 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12501 SI opval = tmp_newval;
12502 SET_H_GR (FLD (f_operand2), opval);
12503 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12507 BI opval = LTSI (tmp_newval, 0);
12508 CPU (h_nbit) = opval;
12509 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12512 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12513 CPU (h_zbit) = opval;
12514 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12516 SET_H_CBIT_MOVE (0);
12517 SET_H_VBIT_MOVE (0);
12521 CPU (h_xbit) = opval;
12522 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12526 SET_H_INSN_PREFIXED_P (opval);
12527 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12537 CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
12539 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12540 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12541 #define FLD(f) abuf->fields.sfmt_muls_b.f
12542 int UNUSED written = 0;
12543 IADDR UNUSED pc = abuf->addr;
12544 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12550 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
12551 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12552 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12554 SI opval = tmp_newval;
12555 SET_H_GR (FLD (f_operand2), opval);
12556 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12560 BI opval = LTSI (tmp_newval, 0);
12561 CPU (h_nbit) = opval;
12562 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12565 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12566 CPU (h_zbit) = opval;
12567 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12569 SET_H_CBIT_MOVE (0);
12570 SET_H_VBIT_MOVE (0);
12574 CPU (h_xbit) = opval;
12575 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12579 SET_H_INSN_PREFIXED_P (opval);
12580 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12590 CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
12592 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12593 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12594 #define FLD(f) abuf->fields.sfmt_muls_b.f
12595 int UNUSED written = 0;
12596 IADDR UNUSED pc = abuf->addr;
12597 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12603 tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
12604 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12605 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12607 SI opval = tmp_newval;
12608 SET_H_GR (FLD (f_operand2), opval);
12609 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12613 BI opval = LTSI (tmp_newval, 0);
12614 CPU (h_nbit) = opval;
12615 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12618 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12619 CPU (h_zbit) = opval;
12620 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12622 SET_H_CBIT_MOVE (0);
12623 SET_H_VBIT_MOVE (0);
12627 CPU (h_xbit) = opval;
12628 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12632 SET_H_INSN_PREFIXED_P (opval);
12633 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12643 CASE (sem, INSN_BOUND_M_B_M) : /* bound-m.b [${Rs}${inc}],${Rd} */
12645 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12646 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12647 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12648 int UNUSED written = 0;
12649 IADDR UNUSED pc = abuf->addr;
12650 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12656 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
12659 tmp_postinc = FLD (f_memmode);
12660 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12661 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
12662 ; if (NEBI (tmp_postinc, 0)) {
12664 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12665 tmp_addr = ADDSI (tmp_addr, 1);
12668 SI opval = tmp_addr;
12669 SET_H_GR (FLD (f_operand1), opval);
12670 written |= (1 << 9);
12671 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12675 ; tmp_tmp_mem; }));
12676 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12677 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12678 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12680 SI opval = tmp_newval;
12681 SET_H_GR (FLD (f_operand1), opval);
12682 written |= (1 << 9);
12683 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12687 SI opval = tmp_newval;
12688 SET_H_GR (FLD (f_operand2), opval);
12689 written |= (1 << 8);
12690 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12695 BI opval = LTSI (tmp_newval, 0);
12696 CPU (h_nbit) = opval;
12697 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12700 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12701 CPU (h_zbit) = opval;
12702 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12704 SET_H_CBIT_MOVE (0);
12705 SET_H_VBIT_MOVE (0);
12709 CPU (h_xbit) = opval;
12710 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12714 SET_H_INSN_PREFIXED_P (opval);
12715 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12721 abuf->written = written;
12726 CASE (sem, INSN_BOUND_M_W_M) : /* bound-m.w [${Rs}${inc}],${Rd} */
12728 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12729 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12730 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12731 int UNUSED written = 0;
12732 IADDR UNUSED pc = abuf->addr;
12733 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12739 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
12742 tmp_postinc = FLD (f_memmode);
12743 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12744 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
12745 ; if (NEBI (tmp_postinc, 0)) {
12747 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12748 tmp_addr = ADDSI (tmp_addr, 2);
12751 SI opval = tmp_addr;
12752 SET_H_GR (FLD (f_operand1), opval);
12753 written |= (1 << 9);
12754 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12758 ; tmp_tmp_mem; }));
12759 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12760 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12761 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12763 SI opval = tmp_newval;
12764 SET_H_GR (FLD (f_operand1), opval);
12765 written |= (1 << 9);
12766 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12770 SI opval = tmp_newval;
12771 SET_H_GR (FLD (f_operand2), opval);
12772 written |= (1 << 8);
12773 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12778 BI opval = LTSI (tmp_newval, 0);
12779 CPU (h_nbit) = opval;
12780 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12783 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12784 CPU (h_zbit) = opval;
12785 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12787 SET_H_CBIT_MOVE (0);
12788 SET_H_VBIT_MOVE (0);
12792 CPU (h_xbit) = opval;
12793 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12797 SET_H_INSN_PREFIXED_P (opval);
12798 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12804 abuf->written = written;
12809 CASE (sem, INSN_BOUND_M_D_M) : /* bound-m.d [${Rs}${inc}],${Rd} */
12811 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12812 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12813 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12814 int UNUSED written = 0;
12815 IADDR UNUSED pc = abuf->addr;
12816 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12822 tmp_tmpops = ({ SI tmp_addr;
12825 tmp_postinc = FLD (f_memmode);
12826 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12827 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
12828 ; if (NEBI (tmp_postinc, 0)) {
12830 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12831 tmp_addr = ADDSI (tmp_addr, 4);
12834 SI opval = tmp_addr;
12835 SET_H_GR (FLD (f_operand1), opval);
12836 written |= (1 << 9);
12837 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12842 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12843 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12844 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12846 SI opval = tmp_newval;
12847 SET_H_GR (FLD (f_operand1), opval);
12848 written |= (1 << 9);
12849 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12853 SI opval = tmp_newval;
12854 SET_H_GR (FLD (f_operand2), opval);
12855 written |= (1 << 8);
12856 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12861 BI opval = LTSI (tmp_newval, 0);
12862 CPU (h_nbit) = opval;
12863 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12866 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12867 CPU (h_zbit) = opval;
12868 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12870 SET_H_CBIT_MOVE (0);
12871 SET_H_VBIT_MOVE (0);
12875 CPU (h_xbit) = opval;
12876 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12880 SET_H_INSN_PREFIXED_P (opval);
12881 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12887 abuf->written = written;
12892 CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
12894 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12895 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12896 #define FLD(f) abuf->fields.sfmt_bound_cb.f
12897 int UNUSED written = 0;
12898 IADDR UNUSED pc = abuf->addr;
12899 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12905 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
12906 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12907 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12909 SI opval = tmp_newval;
12910 SET_H_GR (FLD (f_operand2), opval);
12911 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12915 BI opval = LTSI (tmp_newval, 0);
12916 CPU (h_nbit) = opval;
12917 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12920 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12921 CPU (h_zbit) = opval;
12922 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12924 SET_H_CBIT_MOVE (0);
12925 SET_H_VBIT_MOVE (0);
12929 CPU (h_xbit) = opval;
12930 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12934 SET_H_INSN_PREFIXED_P (opval);
12935 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12945 CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
12947 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12948 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12949 #define FLD(f) abuf->fields.sfmt_bound_cw.f
12950 int UNUSED written = 0;
12951 IADDR UNUSED pc = abuf->addr;
12952 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12958 tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
12959 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12960 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12962 SI opval = tmp_newval;
12963 SET_H_GR (FLD (f_operand2), opval);
12964 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12968 BI opval = LTSI (tmp_newval, 0);
12969 CPU (h_nbit) = opval;
12970 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12973 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12974 CPU (h_zbit) = opval;
12975 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12977 SET_H_CBIT_MOVE (0);
12978 SET_H_VBIT_MOVE (0);
12982 CPU (h_xbit) = opval;
12983 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12987 SET_H_INSN_PREFIXED_P (opval);
12988 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12998 CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
13000 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13001 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13002 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13003 int UNUSED written = 0;
13004 IADDR UNUSED pc = abuf->addr;
13005 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13011 tmp_tmpops = FLD (f_indir_pc__dword);
13012 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13013 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13015 SI opval = tmp_newval;
13016 SET_H_GR (FLD (f_operand2), opval);
13017 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13021 BI opval = LTSI (tmp_newval, 0);
13022 CPU (h_nbit) = opval;
13023 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13026 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13027 CPU (h_zbit) = opval;
13028 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13030 SET_H_CBIT_MOVE (0);
13031 SET_H_VBIT_MOVE (0);
13035 CPU (h_xbit) = opval;
13036 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13040 SET_H_INSN_PREFIXED_P (opval);
13041 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13051 CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
13053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13055 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13056 int UNUSED written = 0;
13057 IADDR UNUSED pc = abuf->addr;
13058 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13062 tmp_truthval = ({ SI tmp_tmpcond;
13064 tmp_tmpcond = FLD (f_operand2);
13065 ; if (EQSI (tmp_tmpcond, 0)) {
13066 tmp_condres = NOTBI (CPU (h_cbit));
13068 else if (EQSI (tmp_tmpcond, 1)) {
13069 tmp_condres = CPU (h_cbit);
13071 else if (EQSI (tmp_tmpcond, 2)) {
13072 tmp_condres = NOTBI (CPU (h_zbit));
13074 else if (EQSI (tmp_tmpcond, 3)) {
13075 tmp_condres = CPU (h_zbit);
13077 else if (EQSI (tmp_tmpcond, 4)) {
13078 tmp_condres = NOTBI (CPU (h_vbit));
13080 else if (EQSI (tmp_tmpcond, 5)) {
13081 tmp_condres = CPU (h_vbit);
13083 else if (EQSI (tmp_tmpcond, 6)) {
13084 tmp_condres = NOTBI (CPU (h_nbit));
13086 else if (EQSI (tmp_tmpcond, 7)) {
13087 tmp_condres = CPU (h_nbit);
13089 else if (EQSI (tmp_tmpcond, 8)) {
13090 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
13092 else if (EQSI (tmp_tmpcond, 9)) {
13093 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
13095 else if (EQSI (tmp_tmpcond, 10)) {
13096 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
13098 else if (EQSI (tmp_tmpcond, 11)) {
13099 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
13101 else if (EQSI (tmp_tmpcond, 12)) {
13102 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
13104 else if (EQSI (tmp_tmpcond, 13)) {
13105 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
13107 else if (EQSI (tmp_tmpcond, 14)) {
13110 else if (EQSI (tmp_tmpcond, 15)) {
13111 tmp_condres = CPU (h_pbit);
13115 SI opval = ZEXTBISI (tmp_truthval);
13116 SET_H_GR (FLD (f_operand1), opval);
13117 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13122 CPU (h_xbit) = opval;
13123 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13127 SET_H_INSN_PREFIXED_P (opval);
13128 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13137 CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
13139 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13140 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13141 #define FLD(f) abuf->fields.sfmt_muls_b.f
13142 int UNUSED written = 0;
13143 IADDR UNUSED pc = abuf->addr;
13144 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13149 tmp_tmp = GET_H_GR (FLD (f_operand1));
13152 if (GESI (tmp_tmp, 0)) {
13154 tmp_tmp = SLLSI (tmp_tmp, 1);
13155 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13158 if (GESI (tmp_tmp, 0)) {
13160 tmp_tmp = SLLSI (tmp_tmp, 1);
13161 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13164 if (GESI (tmp_tmp, 0)) {
13166 tmp_tmp = SLLSI (tmp_tmp, 1);
13167 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13170 if (GESI (tmp_tmp, 0)) {
13172 tmp_tmp = SLLSI (tmp_tmp, 1);
13173 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13176 if (GESI (tmp_tmp, 0)) {
13178 tmp_tmp = SLLSI (tmp_tmp, 1);
13179 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13182 if (GESI (tmp_tmp, 0)) {
13184 tmp_tmp = SLLSI (tmp_tmp, 1);
13185 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13188 if (GESI (tmp_tmp, 0)) {
13190 tmp_tmp = SLLSI (tmp_tmp, 1);
13191 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13194 if (GESI (tmp_tmp, 0)) {
13196 tmp_tmp = SLLSI (tmp_tmp, 1);
13197 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13200 if (GESI (tmp_tmp, 0)) {
13202 tmp_tmp = SLLSI (tmp_tmp, 1);
13203 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13206 if (GESI (tmp_tmp, 0)) {
13208 tmp_tmp = SLLSI (tmp_tmp, 1);
13209 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13212 if (GESI (tmp_tmp, 0)) {
13214 tmp_tmp = SLLSI (tmp_tmp, 1);
13215 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13218 if (GESI (tmp_tmp, 0)) {
13220 tmp_tmp = SLLSI (tmp_tmp, 1);
13221 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13224 if (GESI (tmp_tmp, 0)) {
13226 tmp_tmp = SLLSI (tmp_tmp, 1);
13227 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13230 if (GESI (tmp_tmp, 0)) {
13232 tmp_tmp = SLLSI (tmp_tmp, 1);
13233 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13236 if (GESI (tmp_tmp, 0)) {
13238 tmp_tmp = SLLSI (tmp_tmp, 1);
13239 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13242 if (GESI (tmp_tmp, 0)) {
13244 tmp_tmp = SLLSI (tmp_tmp, 1);
13245 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13248 if (GESI (tmp_tmp, 0)) {
13250 tmp_tmp = SLLSI (tmp_tmp, 1);
13251 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13254 if (GESI (tmp_tmp, 0)) {
13256 tmp_tmp = SLLSI (tmp_tmp, 1);
13257 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13260 if (GESI (tmp_tmp, 0)) {
13262 tmp_tmp = SLLSI (tmp_tmp, 1);
13263 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13266 if (GESI (tmp_tmp, 0)) {
13268 tmp_tmp = SLLSI (tmp_tmp, 1);
13269 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13272 if (GESI (tmp_tmp, 0)) {
13274 tmp_tmp = SLLSI (tmp_tmp, 1);
13275 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13278 if (GESI (tmp_tmp, 0)) {
13280 tmp_tmp = SLLSI (tmp_tmp, 1);
13281 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13284 if (GESI (tmp_tmp, 0)) {
13286 tmp_tmp = SLLSI (tmp_tmp, 1);
13287 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13290 if (GESI (tmp_tmp, 0)) {
13292 tmp_tmp = SLLSI (tmp_tmp, 1);
13293 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13296 if (GESI (tmp_tmp, 0)) {
13298 tmp_tmp = SLLSI (tmp_tmp, 1);
13299 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13302 if (GESI (tmp_tmp, 0)) {
13304 tmp_tmp = SLLSI (tmp_tmp, 1);
13305 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13308 if (GESI (tmp_tmp, 0)) {
13310 tmp_tmp = SLLSI (tmp_tmp, 1);
13311 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13314 if (GESI (tmp_tmp, 0)) {
13316 tmp_tmp = SLLSI (tmp_tmp, 1);
13317 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13320 if (GESI (tmp_tmp, 0)) {
13322 tmp_tmp = SLLSI (tmp_tmp, 1);
13323 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13326 if (GESI (tmp_tmp, 0)) {
13328 tmp_tmp = SLLSI (tmp_tmp, 1);
13329 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13332 if (GESI (tmp_tmp, 0)) {
13334 tmp_tmp = SLLSI (tmp_tmp, 1);
13335 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13338 if (GESI (tmp_tmp, 0)) {
13340 tmp_tmp = SLLSI (tmp_tmp, 1);
13341 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13346 SI opval = tmp_tmpd;
13347 SET_H_GR (FLD (f_operand2), opval);
13348 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13352 BI opval = LTSI (tmp_tmpd, 0);
13353 CPU (h_nbit) = opval;
13354 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13357 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13358 CPU (h_zbit) = opval;
13359 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13361 SET_H_CBIT_MOVE (0);
13362 SET_H_VBIT_MOVE (0);
13366 CPU (h_xbit) = opval;
13367 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13371 SET_H_INSN_PREFIXED_P (opval);
13372 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13382 CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
13384 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13385 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13386 #define FLD(f) abuf->fields.sfmt_addoq.f
13387 int UNUSED written = 0;
13388 IADDR UNUSED pc = abuf->addr;
13389 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13393 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
13394 CPU (h_prefixreg_pre_v32) = opval;
13395 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13399 SET_H_INSN_PREFIXED_P (opval);
13400 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13408 CASE (sem, INSN_BDAPQPC) : /* bdapq $o,PC */
13410 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13411 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13412 #define FLD(f) abuf->fields.sfmt_addoq.f
13413 int UNUSED written = 0;
13414 IADDR UNUSED pc = abuf->addr;
13416 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13420 SI opval = ADDSI (ADDSI (pc, 2), FLD (f_s8));
13421 CPU (h_prefixreg_pre_v32) = opval;
13422 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13426 SET_H_INSN_PREFIXED_P (opval);
13427 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13429 cris_flush_simulator_decode_cache (current_cpu, pc);
13432 SEM_BRANCH_FINI (vpc);
13437 CASE (sem, INSN_BDAP_32_PC) : /* bdap ${sconst32},PC */
13439 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13440 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13441 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13442 int UNUSED written = 0;
13443 IADDR UNUSED pc = abuf->addr;
13444 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13450 tmp_offs = FLD (f_indir_pc__dword);
13451 tmp_oldpc = ADDSI (pc, 6);
13452 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
13454 SI opval = tmp_newpc;
13455 CPU (h_prefixreg_pre_v32) = opval;
13456 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13460 SET_H_INSN_PREFIXED_P (opval);
13461 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13469 CASE (sem, INSN_MOVE_M_PCPLUS_P0) : /* move [PC+],P0 */
13471 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13472 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13473 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13474 int UNUSED written = 0;
13475 IADDR UNUSED pc = abuf->addr;
13477 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13479 if (GET_H_INSN_PREFIXED_P ()) {
13482 tmp_dummy = ({ SI tmp_addr;
13485 tmp_postinc = FLD (f_memmode);
13486 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (pc) : (CPU (h_prefixreg_pre_v32)));
13487 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13488 ; if (NEBI (tmp_postinc, 0)) {
13490 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13491 tmp_addr = ADDSI (tmp_addr, 1);
13494 USI opval = tmp_addr;
13495 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13496 written |= (1 << 5);
13497 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13505 CPU (h_xbit) = opval;
13506 written |= (1 << 7);
13507 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13511 SET_H_INSN_PREFIXED_P (opval);
13512 written |= (1 << 6);
13513 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13518 cgen_rtx_error (current_cpu, "move [PC+],P0 without prefix is not implemented");
13521 abuf->written = written;
13522 SEM_BRANCH_FINI (vpc);
13527 CASE (sem, INSN_MOVE_M_SPPLUS_P8) : /* move [SP+],P8 */
13529 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13530 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13531 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13532 int UNUSED written = 0;
13533 IADDR UNUSED pc = abuf->addr;
13534 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13536 if (GET_H_INSN_PREFIXED_P ()) {
13539 tmp_dummy = ({ SI tmp_addr;
13542 tmp_postinc = FLD (f_memmode);
13543 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (((UINT) 14))) : (CPU (h_prefixreg_pre_v32)));
13544 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13545 ; if (NEBI (tmp_postinc, 0)) {
13547 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13548 tmp_addr = ADDSI (tmp_addr, 4);
13551 SI opval = tmp_addr;
13552 SET_H_GR (((UINT) 14), opval);
13553 written |= (1 << 5);
13554 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13562 CPU (h_xbit) = opval;
13563 written |= (1 << 7);
13564 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13568 SET_H_INSN_PREFIXED_P (opval);
13569 written |= (1 << 6);
13570 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13575 cgen_rtx_error (current_cpu, "move [SP+],P8 without prefix is not implemented");
13578 abuf->written = written;
13583 CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13585 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13586 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13587 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13588 int UNUSED written = 0;
13589 IADDR UNUSED pc = abuf->addr;
13590 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13594 tmp_tmps = ({ SI tmp_addr;
13597 tmp_postinc = FLD (f_memmode);
13598 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13599 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13600 ; if (NEBI (tmp_postinc, 0)) {
13602 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13603 tmp_addr = ADDSI (tmp_addr, 1);
13606 SI opval = tmp_addr;
13607 SET_H_GR (FLD (f_operand1), opval);
13608 written |= (1 << 6);
13609 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13615 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
13616 CPU (h_prefixreg_pre_v32) = opval;
13617 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13621 SET_H_INSN_PREFIXED_P (opval);
13622 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13626 abuf->written = written;
13631 CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13633 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13634 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13635 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13636 int UNUSED written = 0;
13637 IADDR UNUSED pc = abuf->addr;
13638 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13642 tmp_tmps = ({ SI tmp_addr;
13645 tmp_postinc = FLD (f_memmode);
13646 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13647 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
13648 ; if (NEBI (tmp_postinc, 0)) {
13650 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13651 tmp_addr = ADDSI (tmp_addr, 2);
13654 SI opval = tmp_addr;
13655 SET_H_GR (FLD (f_operand1), opval);
13656 written |= (1 << 6);
13657 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13663 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
13664 CPU (h_prefixreg_pre_v32) = opval;
13665 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13669 SET_H_INSN_PREFIXED_P (opval);
13670 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13674 abuf->written = written;
13679 CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13681 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13682 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13683 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13684 int UNUSED written = 0;
13685 IADDR UNUSED pc = abuf->addr;
13686 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13690 tmp_tmps = ({ SI tmp_addr;
13693 tmp_postinc = FLD (f_memmode);
13694 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13695 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13696 ; if (NEBI (tmp_postinc, 0)) {
13698 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13699 tmp_addr = ADDSI (tmp_addr, 4);
13702 SI opval = tmp_addr;
13703 SET_H_GR (FLD (f_operand1), opval);
13704 written |= (1 << 6);
13705 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13711 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
13712 CPU (h_prefixreg_pre_v32) = opval;
13713 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13717 SET_H_INSN_PREFIXED_P (opval);
13718 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13722 abuf->written = written;
13727 CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
13729 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13730 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13731 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13732 int UNUSED written = 0;
13733 IADDR UNUSED pc = abuf->addr;
13734 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13738 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
13739 CPU (h_prefixreg_pre_v32) = opval;
13740 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13744 SET_H_INSN_PREFIXED_P (opval);
13745 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13753 CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
13755 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13756 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13757 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13758 int UNUSED written = 0;
13759 IADDR UNUSED pc = abuf->addr;
13760 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13764 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
13765 CPU (h_prefixreg_pre_v32) = opval;
13766 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13770 SET_H_INSN_PREFIXED_P (opval);
13771 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13779 CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
13781 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13782 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13783 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13784 int UNUSED written = 0;
13785 IADDR UNUSED pc = abuf->addr;
13786 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13790 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
13791 CPU (h_prefixreg_pre_v32) = opval;
13792 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13796 SET_H_INSN_PREFIXED_P (opval);
13797 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13805 CASE (sem, INSN_DIP_M) : /* dip [${Rs}${inc}] */
13807 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13808 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13809 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13810 int UNUSED written = 0;
13811 IADDR UNUSED pc = abuf->addr;
13812 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13816 tmp_tmps = ({ SI tmp_addr;
13819 tmp_postinc = FLD (f_memmode);
13820 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13821 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13822 ; if (NEBI (tmp_postinc, 0)) {
13824 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13825 tmp_addr = ADDSI (tmp_addr, 4);
13828 SI opval = tmp_addr;
13829 SET_H_GR (FLD (f_operand1), opval);
13830 written |= (1 << 5);
13831 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13837 SI opval = tmp_tmps;
13838 CPU (h_prefixreg_pre_v32) = opval;
13839 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13843 SET_H_INSN_PREFIXED_P (opval);
13844 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13848 abuf->written = written;
13853 CASE (sem, INSN_DIP_C) : /* dip [PC+] */
13855 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13856 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13857 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13858 int UNUSED written = 0;
13859 IADDR UNUSED pc = abuf->addr;
13860 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13864 SI opval = FLD (f_indir_pc__dword);
13865 CPU (h_prefixreg_pre_v32) = opval;
13866 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13870 SET_H_INSN_PREFIXED_P (opval);
13871 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13879 CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13881 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13882 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13883 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13884 int UNUSED written = 0;
13885 IADDR UNUSED pc = abuf->addr;
13886 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13890 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13891 CPU (h_prefixreg_pre_v32) = opval;
13892 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13896 SET_H_INSN_PREFIXED_P (opval);
13897 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13905 CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13907 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13908 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13909 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13910 int UNUSED written = 0;
13911 IADDR UNUSED pc = abuf->addr;
13912 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13916 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13917 CPU (h_prefixreg_pre_v32) = opval;
13918 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13922 SET_H_INSN_PREFIXED_P (opval);
13923 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13931 CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
13933 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13934 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13935 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13936 int UNUSED written = 0;
13937 IADDR UNUSED pc = abuf->addr;
13938 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13942 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
13943 CPU (h_prefixreg_pre_v32) = opval;
13944 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13948 SET_H_INSN_PREFIXED_P (opval);
13949 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13957 CASE (sem, INSN_BIAP_PC_B_R) : /* biap-pc.b ${Rs-dfield}.m,PC */
13959 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13960 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13961 #define FLD(f) abuf->fields.sfmt_addoq.f
13962 int UNUSED written = 0;
13963 IADDR UNUSED pc = abuf->addr;
13964 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13968 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13969 CPU (h_prefixreg_pre_v32) = opval;
13970 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13974 SET_H_INSN_PREFIXED_P (opval);
13975 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13983 CASE (sem, INSN_BIAP_PC_W_R) : /* biap-pc.w ${Rs-dfield}.m,PC */
13985 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13986 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13987 #define FLD(f) abuf->fields.sfmt_addoq.f
13988 int UNUSED written = 0;
13989 IADDR UNUSED pc = abuf->addr;
13990 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13994 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13995 CPU (h_prefixreg_pre_v32) = opval;
13996 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14000 SET_H_INSN_PREFIXED_P (opval);
14001 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14009 CASE (sem, INSN_BIAP_PC_D_R) : /* biap-pc.d ${Rs-dfield}.m,PC */
14011 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14012 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14013 #define FLD(f) abuf->fields.sfmt_addoq.f
14014 int UNUSED written = 0;
14015 IADDR UNUSED pc = abuf->addr;
14016 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14020 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 4));
14021 CPU (h_prefixreg_pre_v32) = opval;
14022 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14026 SET_H_INSN_PREFIXED_P (opval);
14027 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14037 ENDSWITCH (sem) /* End of semantic switch. */
14039 /* At this point `vpc' contains the next insn to execute. */
14042 #undef DEFINE_SWITCH
14043 #endif /* DEFINE_SWITCH */