* ppc-linux-nat.c (have_ptrace_getsetregs): New variable.
[gdb/SamB.git] / sim / cris / semcrisv10f-switch.c
blob56d2e6b2b031b75f3440b2b74269f9d717ef321b
1 /* Simulator instruction semantics for crisv10f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2007 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifdef DEFINE_LABELS
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
31 static struct {
32 int index;
33 void *label;
34 } labels[] = {
35 { CRISV10F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
36 { CRISV10F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
37 { CRISV10F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
38 { CRISV10F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
39 { CRISV10F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
40 { CRISV10F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
41 { CRISV10F_INSN_NOP, && case_sem_INSN_NOP },
42 { CRISV10F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
43 { CRISV10F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
44 { CRISV10F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
45 { CRISV10F_INSN_MOVEPCR, && case_sem_INSN_MOVEPCR },
46 { CRISV10F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
47 { CRISV10F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
48 { CRISV10F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
49 { CRISV10F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
50 { CRISV10F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
51 { CRISV10F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
52 { CRISV10F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
53 { CRISV10F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
54 { CRISV10F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
55 { CRISV10F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
56 { CRISV10F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
57 { CRISV10F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
58 { CRISV10F_INSN_ADDQ, && case_sem_INSN_ADDQ },
59 { CRISV10F_INSN_SUBQ, && case_sem_INSN_SUBQ },
60 { CRISV10F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
61 { CRISV10F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
62 { CRISV10F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
63 { CRISV10F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
64 { CRISV10F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
65 { CRISV10F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
66 { CRISV10F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
67 { CRISV10F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
68 { CRISV10F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
69 { CRISV10F_INSN_CMPQ, && case_sem_INSN_CMPQ },
70 { CRISV10F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
71 { CRISV10F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
72 { CRISV10F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
73 { CRISV10F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
74 { CRISV10F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
75 { CRISV10F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
76 { CRISV10F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
77 { CRISV10F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
78 { CRISV10F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
79 { CRISV10F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
80 { CRISV10F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
81 { CRISV10F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
82 { CRISV10F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
83 { CRISV10F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
84 { CRISV10F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
85 { CRISV10F_INSN_MOVE_R_SPRV10, && case_sem_INSN_MOVE_R_SPRV10 },
86 { CRISV10F_INSN_MOVE_SPR_RV10, && case_sem_INSN_MOVE_SPR_RV10 },
87 { CRISV10F_INSN_RET_TYPE, && case_sem_INSN_RET_TYPE },
88 { CRISV10F_INSN_MOVE_M_SPRV10, && case_sem_INSN_MOVE_M_SPRV10 },
89 { CRISV10F_INSN_MOVE_C_SPRV10_P5, && case_sem_INSN_MOVE_C_SPRV10_P5 },
90 { CRISV10F_INSN_MOVE_C_SPRV10_P9, && case_sem_INSN_MOVE_C_SPRV10_P9 },
91 { CRISV10F_INSN_MOVE_C_SPRV10_P10, && case_sem_INSN_MOVE_C_SPRV10_P10 },
92 { CRISV10F_INSN_MOVE_C_SPRV10_P11, && case_sem_INSN_MOVE_C_SPRV10_P11 },
93 { CRISV10F_INSN_MOVE_C_SPRV10_P12, && case_sem_INSN_MOVE_C_SPRV10_P12 },
94 { CRISV10F_INSN_MOVE_C_SPRV10_P13, && case_sem_INSN_MOVE_C_SPRV10_P13 },
95 { CRISV10F_INSN_MOVE_C_SPRV10_P7, && case_sem_INSN_MOVE_C_SPRV10_P7 },
96 { CRISV10F_INSN_MOVE_C_SPRV10_P14, && case_sem_INSN_MOVE_C_SPRV10_P14 },
97 { CRISV10F_INSN_MOVE_C_SPRV10_P15, && case_sem_INSN_MOVE_C_SPRV10_P15 },
98 { CRISV10F_INSN_MOVE_SPR_MV10, && case_sem_INSN_MOVE_SPR_MV10 },
99 { CRISV10F_INSN_SBFS, && case_sem_INSN_SBFS },
100 { CRISV10F_INSN_MOVEM_R_M, && case_sem_INSN_MOVEM_R_M },
101 { CRISV10F_INSN_MOVEM_M_R, && case_sem_INSN_MOVEM_M_R },
102 { CRISV10F_INSN_MOVEM_M_PC, && case_sem_INSN_MOVEM_M_PC },
103 { CRISV10F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
104 { CRISV10F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
105 { CRISV10F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
106 { CRISV10F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
107 { CRISV10F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
108 { CRISV10F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
109 { CRISV10F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
110 { CRISV10F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
111 { CRISV10F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
112 { CRISV10F_INSN_ADDCPC, && case_sem_INSN_ADDCPC },
113 { CRISV10F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
114 { CRISV10F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
115 { CRISV10F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
116 { CRISV10F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
117 { CRISV10F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
118 { CRISV10F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
119 { CRISV10F_INSN_ADDSPCPC, && case_sem_INSN_ADDSPCPC },
120 { CRISV10F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
121 { CRISV10F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
122 { CRISV10F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
123 { CRISV10F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
124 { CRISV10F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
125 { CRISV10F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
126 { CRISV10F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
127 { CRISV10F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
128 { CRISV10F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
129 { CRISV10F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
130 { CRISV10F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
131 { CRISV10F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
132 { CRISV10F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
133 { CRISV10F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
134 { CRISV10F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
135 { CRISV10F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
136 { CRISV10F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
137 { CRISV10F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
138 { CRISV10F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
139 { CRISV10F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
140 { CRISV10F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
141 { CRISV10F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
142 { CRISV10F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
143 { CRISV10F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
144 { CRISV10F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
145 { CRISV10F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
146 { CRISV10F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
147 { CRISV10F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
148 { CRISV10F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
149 { CRISV10F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
150 { CRISV10F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
151 { CRISV10F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
152 { CRISV10F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
153 { CRISV10F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
154 { CRISV10F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
155 { CRISV10F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
156 { CRISV10F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
157 { CRISV10F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
158 { CRISV10F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
159 { CRISV10F_INSN_MULS_B, && case_sem_INSN_MULS_B },
160 { CRISV10F_INSN_MULS_W, && case_sem_INSN_MULS_W },
161 { CRISV10F_INSN_MULS_D, && case_sem_INSN_MULS_D },
162 { CRISV10F_INSN_MULU_B, && case_sem_INSN_MULU_B },
163 { CRISV10F_INSN_MULU_W, && case_sem_INSN_MULU_W },
164 { CRISV10F_INSN_MULU_D, && case_sem_INSN_MULU_D },
165 { CRISV10F_INSN_MSTEP, && case_sem_INSN_MSTEP },
166 { CRISV10F_INSN_DSTEP, && case_sem_INSN_DSTEP },
167 { CRISV10F_INSN_ABS, && case_sem_INSN_ABS },
168 { CRISV10F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
169 { CRISV10F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
170 { CRISV10F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
171 { CRISV10F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
172 { CRISV10F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
173 { CRISV10F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
174 { CRISV10F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
175 { CRISV10F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
176 { CRISV10F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
177 { CRISV10F_INSN_ANDQ, && case_sem_INSN_ANDQ },
178 { CRISV10F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
179 { CRISV10F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
180 { CRISV10F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
181 { CRISV10F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
182 { CRISV10F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
183 { CRISV10F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
184 { CRISV10F_INSN_ORCBR, && case_sem_INSN_ORCBR },
185 { CRISV10F_INSN_ORCWR, && case_sem_INSN_ORCWR },
186 { CRISV10F_INSN_ORCDR, && case_sem_INSN_ORCDR },
187 { CRISV10F_INSN_ORQ, && case_sem_INSN_ORQ },
188 { CRISV10F_INSN_XOR, && case_sem_INSN_XOR },
189 { CRISV10F_INSN_SWAP, && case_sem_INSN_SWAP },
190 { CRISV10F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
191 { CRISV10F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
192 { CRISV10F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
193 { CRISV10F_INSN_ASRQ, && case_sem_INSN_ASRQ },
194 { CRISV10F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
195 { CRISV10F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
196 { CRISV10F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
197 { CRISV10F_INSN_LSRQ, && case_sem_INSN_LSRQ },
198 { CRISV10F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
199 { CRISV10F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
200 { CRISV10F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
201 { CRISV10F_INSN_LSLQ, && case_sem_INSN_LSLQ },
202 { CRISV10F_INSN_BTST, && case_sem_INSN_BTST },
203 { CRISV10F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
204 { CRISV10F_INSN_SETF, && case_sem_INSN_SETF },
205 { CRISV10F_INSN_CLEARF, && case_sem_INSN_CLEARF },
206 { CRISV10F_INSN_BCC_B, && case_sem_INSN_BCC_B },
207 { CRISV10F_INSN_BA_B, && case_sem_INSN_BA_B },
208 { CRISV10F_INSN_BCC_W, && case_sem_INSN_BCC_W },
209 { CRISV10F_INSN_BA_W, && case_sem_INSN_BA_W },
210 { CRISV10F_INSN_JUMP_R, && case_sem_INSN_JUMP_R },
211 { CRISV10F_INSN_JUMP_M, && case_sem_INSN_JUMP_M },
212 { CRISV10F_INSN_JUMP_C, && case_sem_INSN_JUMP_C },
213 { CRISV10F_INSN_BREAK, && case_sem_INSN_BREAK },
214 { CRISV10F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
215 { CRISV10F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
216 { CRISV10F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
217 { CRISV10F_INSN_BOUND_M_B_M, && case_sem_INSN_BOUND_M_B_M },
218 { CRISV10F_INSN_BOUND_M_W_M, && case_sem_INSN_BOUND_M_W_M },
219 { CRISV10F_INSN_BOUND_M_D_M, && case_sem_INSN_BOUND_M_D_M },
220 { CRISV10F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
221 { CRISV10F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
222 { CRISV10F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
223 { CRISV10F_INSN_SCC, && case_sem_INSN_SCC },
224 { CRISV10F_INSN_LZ, && case_sem_INSN_LZ },
225 { CRISV10F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
226 { CRISV10F_INSN_BDAPQPC, && case_sem_INSN_BDAPQPC },
227 { CRISV10F_INSN_BDAP_32_PC, && case_sem_INSN_BDAP_32_PC },
228 { CRISV10F_INSN_MOVE_M_PCPLUS_P0, && case_sem_INSN_MOVE_M_PCPLUS_P0 },
229 { CRISV10F_INSN_MOVE_M_SPPLUS_P8, && case_sem_INSN_MOVE_M_SPPLUS_P8 },
230 { CRISV10F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
231 { CRISV10F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
232 { CRISV10F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
233 { CRISV10F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
234 { CRISV10F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
235 { CRISV10F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
236 { CRISV10F_INSN_DIP_M, && case_sem_INSN_DIP_M },
237 { CRISV10F_INSN_DIP_C, && case_sem_INSN_DIP_C },
238 { CRISV10F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
239 { CRISV10F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
240 { CRISV10F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
241 { CRISV10F_INSN_BIAP_PC_B_R, && case_sem_INSN_BIAP_PC_B_R },
242 { CRISV10F_INSN_BIAP_PC_W_R, && case_sem_INSN_BIAP_PC_W_R },
243 { CRISV10F_INSN_BIAP_PC_D_R, && case_sem_INSN_BIAP_PC_D_R },
244 { 0, 0 }
246 int i;
248 for (i = 0; labels[i].label != 0; ++i)
250 #if FAST_P
251 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
252 #else
253 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
254 #endif
257 #undef DEFINE_LABELS
258 #endif /* DEFINE_LABELS */
260 #ifdef DEFINE_SWITCH
262 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
263 off frills like tracing and profiling. */
264 /* FIXME: A better way would be to have TRACE_RESULT check for something
265 that can cause it to be optimized out. Another way would be to emit
266 special handlers into the instruction "stream". */
268 #if FAST_P
269 #undef TRACE_RESULT
270 #define TRACE_RESULT(cpu, abuf, name, type, val)
271 #endif
273 #undef GET_ATTR
274 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
275 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
276 #else
277 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
278 #endif
282 #if WITH_SCACHE_PBB
284 /* Branch to next handler without going around main loop. */
285 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
286 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
288 #else /* ! WITH_SCACHE_PBB */
290 #define NEXT(vpc) BREAK (sem)
291 #ifdef __GNUC__
292 #if FAST_P
293 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
294 #else
295 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
296 #endif
297 #else
298 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
299 #endif
301 #endif /* ! WITH_SCACHE_PBB */
305 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
307 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
308 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
309 #define FLD(f) abuf->fields.fmt_empty.f
310 int UNUSED written = 0;
311 IADDR UNUSED pc = abuf->addr;
312 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
315 /* Update the recorded pc in the cpu state struct.
316 Only necessary for WITH_SCACHE case, but to avoid the
317 conditional compilation .... */
318 SET_H_PC (pc);
319 /* Virtual insns have zero size. Overwrite vpc with address of next insn
320 using the default-insn-bitsize spec. When executing insns in parallel
321 we may want to queue the fault and continue execution. */
322 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
323 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
326 #undef FLD
328 NEXT (vpc);
330 CASE (sem, INSN_X_AFTER) : /* --after-- */
332 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
333 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
334 #define FLD(f) abuf->fields.fmt_empty.f
335 int UNUSED written = 0;
336 IADDR UNUSED pc = abuf->addr;
337 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
340 #if WITH_SCACHE_PBB_CRISV10F
341 crisv10f_pbb_after (current_cpu, sem_arg);
342 #endif
345 #undef FLD
347 NEXT (vpc);
349 CASE (sem, INSN_X_BEFORE) : /* --before-- */
351 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
352 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
353 #define FLD(f) abuf->fields.fmt_empty.f
354 int UNUSED written = 0;
355 IADDR UNUSED pc = abuf->addr;
356 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
359 #if WITH_SCACHE_PBB_CRISV10F
360 crisv10f_pbb_before (current_cpu, sem_arg);
361 #endif
364 #undef FLD
366 NEXT (vpc);
368 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
370 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
371 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
372 #define FLD(f) abuf->fields.fmt_empty.f
373 int UNUSED written = 0;
374 IADDR UNUSED pc = abuf->addr;
375 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
378 #if WITH_SCACHE_PBB_CRISV10F
379 #ifdef DEFINE_SWITCH
380 vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
381 pbb_br_type, pbb_br_npc);
382 BREAK (sem);
383 #else
384 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
385 vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
386 CPU_PBB_BR_TYPE (current_cpu),
387 CPU_PBB_BR_NPC (current_cpu));
388 #endif
389 #endif
392 #undef FLD
394 NEXT (vpc);
396 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
398 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
399 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
400 #define FLD(f) abuf->fields.fmt_empty.f
401 int UNUSED written = 0;
402 IADDR UNUSED pc = abuf->addr;
403 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
406 #if WITH_SCACHE_PBB_CRISV10F
407 vpc = crisv10f_pbb_chain (current_cpu, sem_arg);
408 #ifdef DEFINE_SWITCH
409 BREAK (sem);
410 #endif
411 #endif
414 #undef FLD
416 NEXT (vpc);
418 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
420 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
421 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
422 #define FLD(f) abuf->fields.fmt_empty.f
423 int UNUSED written = 0;
424 IADDR UNUSED pc = abuf->addr;
425 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
428 #if WITH_SCACHE_PBB_CRISV10F
429 #if defined DEFINE_SWITCH || defined FAST_P
430 /* In the switch case FAST_P is a constant, allowing several optimizations
431 in any called inline functions. */
432 vpc = crisv10f_pbb_begin (current_cpu, FAST_P);
433 #else
434 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
435 vpc = crisv10f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
436 #else
437 vpc = crisv10f_pbb_begin (current_cpu, 0);
438 #endif
439 #endif
440 #endif
443 #undef FLD
445 NEXT (vpc);
447 CASE (sem, INSN_NOP) : /* nop */
449 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
450 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
451 #define FLD(f) abuf->fields.fmt_empty.f
452 int UNUSED written = 0;
453 IADDR UNUSED pc = abuf->addr;
454 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
458 BI opval = 0;
459 CPU (h_xbit) = opval;
460 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
463 BI opval = 0;
464 SET_H_INSN_PREFIXED_P (opval);
465 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
469 #undef FLD
471 NEXT (vpc);
473 CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
475 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
476 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
477 #define FLD(f) abuf->fields.sfmt_add_b_r.f
478 int UNUSED written = 0;
479 IADDR UNUSED pc = abuf->addr;
480 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
483 QI tmp_newval;
484 tmp_newval = GET_H_GR (FLD (f_operand1));
486 SI tmp_oldregval;
487 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
489 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
490 SET_H_GR (FLD (f_operand2), opval);
491 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
496 BI opval = LTQI (tmp_newval, 0);
497 CPU (h_nbit) = opval;
498 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
501 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
502 CPU (h_zbit) = opval;
503 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
505 SET_H_CBIT_MOVE (0);
506 SET_H_VBIT_MOVE (0);
509 BI opval = 0;
510 CPU (h_xbit) = opval;
511 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
514 BI opval = 0;
515 SET_H_INSN_PREFIXED_P (opval);
516 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
522 #undef FLD
524 NEXT (vpc);
526 CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
528 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
529 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
530 #define FLD(f) abuf->fields.sfmt_add_b_r.f
531 int UNUSED written = 0;
532 IADDR UNUSED pc = abuf->addr;
533 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
536 HI tmp_newval;
537 tmp_newval = GET_H_GR (FLD (f_operand1));
539 SI tmp_oldregval;
540 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
542 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
543 SET_H_GR (FLD (f_operand2), opval);
544 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
549 BI opval = LTHI (tmp_newval, 0);
550 CPU (h_nbit) = opval;
551 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
554 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
555 CPU (h_zbit) = opval;
556 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
558 SET_H_CBIT_MOVE (0);
559 SET_H_VBIT_MOVE (0);
562 BI opval = 0;
563 CPU (h_xbit) = opval;
564 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
567 BI opval = 0;
568 SET_H_INSN_PREFIXED_P (opval);
569 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
575 #undef FLD
577 NEXT (vpc);
579 CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
581 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
582 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
583 #define FLD(f) abuf->fields.sfmt_add_b_r.f
584 int UNUSED written = 0;
585 IADDR UNUSED pc = abuf->addr;
586 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
589 SI tmp_newval;
590 tmp_newval = GET_H_GR (FLD (f_operand1));
592 SI opval = tmp_newval;
593 SET_H_GR (FLD (f_operand2), opval);
594 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
598 BI opval = LTSI (tmp_newval, 0);
599 CPU (h_nbit) = opval;
600 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
603 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
604 CPU (h_zbit) = opval;
605 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
607 SET_H_CBIT_MOVE (0);
608 SET_H_VBIT_MOVE (0);
611 BI opval = 0;
612 CPU (h_xbit) = opval;
613 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
616 BI opval = 0;
617 SET_H_INSN_PREFIXED_P (opval);
618 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
624 #undef FLD
626 NEXT (vpc);
628 CASE (sem, INSN_MOVEPCR) : /* move.d PC,${Rd} */
630 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
632 #define FLD(f) abuf->fields.sfmt_moveq.f
633 int UNUSED written = 0;
634 IADDR UNUSED pc = abuf->addr;
635 SEM_BRANCH_INIT
636 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
639 SI tmp_pcval;
640 tmp_pcval = ADDSI (pc, 2);
642 SI opval = tmp_pcval;
643 SET_H_GR (FLD (f_operand2), opval);
644 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
648 BI opval = LTSI (tmp_pcval, 0);
649 CPU (h_nbit) = opval;
650 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
653 BI opval = ANDIF (EQSI (tmp_pcval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
654 CPU (h_zbit) = opval;
655 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
657 SET_H_CBIT_MOVE (0);
658 SET_H_VBIT_MOVE (0);
661 BI opval = 0;
662 CPU (h_xbit) = opval;
663 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
666 BI opval = 0;
667 SET_H_INSN_PREFIXED_P (opval);
668 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
674 SEM_BRANCH_FINI (vpc);
675 #undef FLD
677 NEXT (vpc);
679 CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
681 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
682 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
683 #define FLD(f) abuf->fields.sfmt_moveq.f
684 int UNUSED written = 0;
685 IADDR UNUSED pc = abuf->addr;
686 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
689 SI tmp_newval;
690 tmp_newval = FLD (f_s6);
692 SI opval = tmp_newval;
693 SET_H_GR (FLD (f_operand2), opval);
694 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
697 SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
698 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
699 SET_H_CBIT_MOVE (0);
700 SET_H_VBIT_MOVE (0);
703 BI opval = 0;
704 CPU (h_xbit) = opval;
705 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
708 BI opval = 0;
709 SET_H_INSN_PREFIXED_P (opval);
710 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
716 #undef FLD
718 NEXT (vpc);
720 CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
722 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
723 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
724 #define FLD(f) abuf->fields.sfmt_muls_b.f
725 int UNUSED written = 0;
726 IADDR UNUSED pc = abuf->addr;
727 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
730 QI tmp_tmpops;
731 SI tmp_newval;
732 tmp_tmpops = GET_H_GR (FLD (f_operand1));
733 tmp_newval = EXTQISI (tmp_tmpops);
735 SI opval = tmp_newval;
736 SET_H_GR (FLD (f_operand2), opval);
737 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
741 BI opval = LTSI (tmp_newval, 0);
742 CPU (h_nbit) = opval;
743 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
746 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
747 CPU (h_zbit) = opval;
748 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
750 SET_H_CBIT_MOVE (0);
751 SET_H_VBIT_MOVE (0);
754 BI opval = 0;
755 CPU (h_xbit) = opval;
756 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
759 BI opval = 0;
760 SET_H_INSN_PREFIXED_P (opval);
761 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
767 #undef FLD
769 NEXT (vpc);
771 CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
773 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
774 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
775 #define FLD(f) abuf->fields.sfmt_muls_b.f
776 int UNUSED written = 0;
777 IADDR UNUSED pc = abuf->addr;
778 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
781 HI tmp_tmpops;
782 SI tmp_newval;
783 tmp_tmpops = GET_H_GR (FLD (f_operand1));
784 tmp_newval = EXTHISI (tmp_tmpops);
786 SI opval = tmp_newval;
787 SET_H_GR (FLD (f_operand2), opval);
788 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
792 BI opval = LTSI (tmp_newval, 0);
793 CPU (h_nbit) = opval;
794 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
797 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
798 CPU (h_zbit) = opval;
799 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
801 SET_H_CBIT_MOVE (0);
802 SET_H_VBIT_MOVE (0);
805 BI opval = 0;
806 CPU (h_xbit) = opval;
807 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
810 BI opval = 0;
811 SET_H_INSN_PREFIXED_P (opval);
812 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
818 #undef FLD
820 NEXT (vpc);
822 CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
824 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
825 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
826 #define FLD(f) abuf->fields.sfmt_muls_b.f
827 int UNUSED written = 0;
828 IADDR UNUSED pc = abuf->addr;
829 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
832 QI tmp_tmpops;
833 SI tmp_newval;
834 tmp_tmpops = GET_H_GR (FLD (f_operand1));
835 tmp_newval = ZEXTQISI (tmp_tmpops);
837 SI opval = tmp_newval;
838 SET_H_GR (FLD (f_operand2), opval);
839 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
843 BI opval = LTSI (tmp_newval, 0);
844 CPU (h_nbit) = opval;
845 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
848 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
849 CPU (h_zbit) = opval;
850 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
852 SET_H_CBIT_MOVE (0);
853 SET_H_VBIT_MOVE (0);
856 BI opval = 0;
857 CPU (h_xbit) = opval;
858 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
861 BI opval = 0;
862 SET_H_INSN_PREFIXED_P (opval);
863 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
869 #undef FLD
871 NEXT (vpc);
873 CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
875 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
876 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
877 #define FLD(f) abuf->fields.sfmt_muls_b.f
878 int UNUSED written = 0;
879 IADDR UNUSED pc = abuf->addr;
880 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
883 HI tmp_tmpops;
884 SI tmp_newval;
885 tmp_tmpops = GET_H_GR (FLD (f_operand1));
886 tmp_newval = ZEXTHISI (tmp_tmpops);
888 SI opval = tmp_newval;
889 SET_H_GR (FLD (f_operand2), opval);
890 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
894 BI opval = LTSI (tmp_newval, 0);
895 CPU (h_nbit) = opval;
896 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
899 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
900 CPU (h_zbit) = opval;
901 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
903 SET_H_CBIT_MOVE (0);
904 SET_H_VBIT_MOVE (0);
907 BI opval = 0;
908 CPU (h_xbit) = opval;
909 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
912 BI opval = 0;
913 SET_H_INSN_PREFIXED_P (opval);
914 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
920 #undef FLD
922 NEXT (vpc);
924 CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
926 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
927 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
928 #define FLD(f) abuf->fields.sfmt_addcbr.f
929 int UNUSED written = 0;
930 IADDR UNUSED pc = abuf->addr;
931 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
934 QI tmp_newval;
935 tmp_newval = FLD (f_indir_pc__byte);
937 SI tmp_oldregval;
938 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
940 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
941 SET_H_GR (FLD (f_operand2), opval);
942 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
947 BI opval = LTQI (tmp_newval, 0);
948 CPU (h_nbit) = opval;
949 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
952 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
953 CPU (h_zbit) = opval;
954 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
956 SET_H_CBIT_MOVE (0);
957 SET_H_VBIT_MOVE (0);
960 BI opval = 0;
961 CPU (h_xbit) = opval;
962 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
965 BI opval = 0;
966 SET_H_INSN_PREFIXED_P (opval);
967 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
973 #undef FLD
975 NEXT (vpc);
977 CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
979 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
980 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
981 #define FLD(f) abuf->fields.sfmt_addcwr.f
982 int UNUSED written = 0;
983 IADDR UNUSED pc = abuf->addr;
984 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
987 HI tmp_newval;
988 tmp_newval = FLD (f_indir_pc__word);
990 SI tmp_oldregval;
991 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
993 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
994 SET_H_GR (FLD (f_operand2), opval);
995 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1000 BI opval = LTHI (tmp_newval, 0);
1001 CPU (h_nbit) = opval;
1002 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1005 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1006 CPU (h_zbit) = opval;
1007 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1009 SET_H_CBIT_MOVE (0);
1010 SET_H_VBIT_MOVE (0);
1013 BI opval = 0;
1014 CPU (h_xbit) = opval;
1015 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1018 BI opval = 0;
1019 SET_H_INSN_PREFIXED_P (opval);
1020 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1026 #undef FLD
1028 NEXT (vpc);
1030 CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
1032 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1033 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1034 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1035 int UNUSED written = 0;
1036 IADDR UNUSED pc = abuf->addr;
1037 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1040 SI tmp_newval;
1041 tmp_newval = FLD (f_indir_pc__dword);
1043 SI opval = tmp_newval;
1044 SET_H_GR (FLD (f_operand2), opval);
1045 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1049 BI opval = LTSI (tmp_newval, 0);
1050 CPU (h_nbit) = opval;
1051 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1054 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1055 CPU (h_zbit) = opval;
1056 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1058 SET_H_CBIT_MOVE (0);
1059 SET_H_VBIT_MOVE (0);
1062 BI opval = 0;
1063 CPU (h_xbit) = opval;
1064 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1067 BI opval = 0;
1068 SET_H_INSN_PREFIXED_P (opval);
1069 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1075 #undef FLD
1077 NEXT (vpc);
1079 CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
1081 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1082 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1083 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1084 int UNUSED written = 0;
1085 IADDR UNUSED pc = abuf->addr;
1086 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1089 SI tmp_newval;
1090 tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1092 SI opval = tmp_newval;
1093 SET_H_GR (FLD (f_operand2), opval);
1094 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1098 BI opval = LTSI (tmp_newval, 0);
1099 CPU (h_nbit) = opval;
1100 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1103 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1104 CPU (h_zbit) = opval;
1105 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1107 SET_H_CBIT_MOVE (0);
1108 SET_H_VBIT_MOVE (0);
1111 BI opval = 0;
1112 CPU (h_xbit) = opval;
1113 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1116 BI opval = 0;
1117 SET_H_INSN_PREFIXED_P (opval);
1118 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1124 #undef FLD
1126 NEXT (vpc);
1128 CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
1130 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1131 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1132 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1133 int UNUSED written = 0;
1134 IADDR UNUSED pc = abuf->addr;
1135 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1138 SI tmp_newval;
1139 tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1141 SI opval = tmp_newval;
1142 SET_H_GR (FLD (f_operand2), opval);
1143 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1147 BI opval = LTSI (tmp_newval, 0);
1148 CPU (h_nbit) = opval;
1149 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1152 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1153 CPU (h_zbit) = opval;
1154 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1156 SET_H_CBIT_MOVE (0);
1157 SET_H_VBIT_MOVE (0);
1160 BI opval = 0;
1161 CPU (h_xbit) = opval;
1162 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1165 BI opval = 0;
1166 SET_H_INSN_PREFIXED_P (opval);
1167 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1173 #undef FLD
1175 NEXT (vpc);
1177 CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
1179 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1180 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1181 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1182 int UNUSED written = 0;
1183 IADDR UNUSED pc = abuf->addr;
1184 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1187 SI tmp_newval;
1188 tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1190 SI opval = tmp_newval;
1191 SET_H_GR (FLD (f_operand2), opval);
1192 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1196 BI opval = LTSI (tmp_newval, 0);
1197 CPU (h_nbit) = opval;
1198 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1201 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1202 CPU (h_zbit) = opval;
1203 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1205 SET_H_CBIT_MOVE (0);
1206 SET_H_VBIT_MOVE (0);
1209 BI opval = 0;
1210 CPU (h_xbit) = opval;
1211 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1214 BI opval = 0;
1215 SET_H_INSN_PREFIXED_P (opval);
1216 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1222 #undef FLD
1224 NEXT (vpc);
1226 CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
1228 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1229 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1230 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1231 int UNUSED written = 0;
1232 IADDR UNUSED pc = abuf->addr;
1233 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1236 SI tmp_newval;
1237 tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1239 SI opval = tmp_newval;
1240 SET_H_GR (FLD (f_operand2), opval);
1241 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1245 BI opval = LTSI (tmp_newval, 0);
1246 CPU (h_nbit) = opval;
1247 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1250 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1251 CPU (h_zbit) = opval;
1252 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1254 SET_H_CBIT_MOVE (0);
1255 SET_H_VBIT_MOVE (0);
1258 BI opval = 0;
1259 CPU (h_xbit) = opval;
1260 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1263 BI opval = 0;
1264 SET_H_INSN_PREFIXED_P (opval);
1265 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1271 #undef FLD
1273 NEXT (vpc);
1275 CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
1277 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1278 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1279 #define FLD(f) abuf->fields.sfmt_addq.f
1280 int UNUSED written = 0;
1281 IADDR UNUSED pc = abuf->addr;
1282 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1285 SI tmp_tmpopd;
1286 SI tmp_tmpops;
1287 BI tmp_carry;
1288 SI tmp_newval;
1289 tmp_tmpops = FLD (f_u6);
1290 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1291 tmp_carry = CPU (h_cbit);
1292 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1294 SI opval = tmp_newval;
1295 SET_H_GR (FLD (f_operand2), opval);
1296 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1300 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))));
1301 CPU (h_cbit) = opval;
1302 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1305 BI opval = LTSI (tmp_newval, 0);
1306 CPU (h_nbit) = opval;
1307 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1310 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1311 CPU (h_zbit) = opval;
1312 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1315 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)));
1316 CPU (h_vbit) = opval;
1317 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1321 BI opval = 0;
1322 CPU (h_xbit) = opval;
1323 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1326 BI opval = 0;
1327 SET_H_INSN_PREFIXED_P (opval);
1328 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1334 #undef FLD
1336 NEXT (vpc);
1338 CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
1340 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1341 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1342 #define FLD(f) abuf->fields.sfmt_addq.f
1343 int UNUSED written = 0;
1344 IADDR UNUSED pc = abuf->addr;
1345 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1348 SI tmp_tmpopd;
1349 SI tmp_tmpops;
1350 BI tmp_carry;
1351 SI tmp_newval;
1352 tmp_tmpops = FLD (f_u6);
1353 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1354 tmp_carry = CPU (h_cbit);
1355 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1357 SI opval = tmp_newval;
1358 SET_H_GR (FLD (f_operand2), opval);
1359 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1363 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))));
1364 CPU (h_cbit) = opval;
1365 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1368 BI opval = LTSI (tmp_newval, 0);
1369 CPU (h_nbit) = opval;
1370 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1373 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1374 CPU (h_zbit) = opval;
1375 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1378 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)));
1379 CPU (h_vbit) = opval;
1380 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1384 BI opval = 0;
1385 CPU (h_xbit) = opval;
1386 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1389 BI opval = 0;
1390 SET_H_INSN_PREFIXED_P (opval);
1391 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1397 #undef FLD
1399 NEXT (vpc);
1401 CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
1403 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1404 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1405 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1406 int UNUSED written = 0;
1407 IADDR UNUSED pc = abuf->addr;
1408 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1411 QI tmp_tmpopd;
1412 QI tmp_tmpops;
1413 BI tmp_carry;
1414 QI tmp_newval;
1415 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1416 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1417 tmp_carry = CPU (h_cbit);
1418 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1419 ((void) 0); /*nop*/
1422 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))));
1423 CPU (h_cbit) = opval;
1424 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1427 BI opval = LTQI (tmp_newval, 0);
1428 CPU (h_nbit) = opval;
1429 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1432 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1433 CPU (h_zbit) = opval;
1434 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1437 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)));
1438 CPU (h_vbit) = opval;
1439 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1443 BI opval = 0;
1444 CPU (h_xbit) = opval;
1445 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1448 BI opval = 0;
1449 SET_H_INSN_PREFIXED_P (opval);
1450 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1456 #undef FLD
1458 NEXT (vpc);
1460 CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
1462 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1463 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1464 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1465 int UNUSED written = 0;
1466 IADDR UNUSED pc = abuf->addr;
1467 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1470 HI tmp_tmpopd;
1471 HI tmp_tmpops;
1472 BI tmp_carry;
1473 HI tmp_newval;
1474 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1475 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1476 tmp_carry = CPU (h_cbit);
1477 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1478 ((void) 0); /*nop*/
1481 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))));
1482 CPU (h_cbit) = opval;
1483 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1486 BI opval = LTHI (tmp_newval, 0);
1487 CPU (h_nbit) = opval;
1488 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1491 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1492 CPU (h_zbit) = opval;
1493 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1496 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)));
1497 CPU (h_vbit) = opval;
1498 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1502 BI opval = 0;
1503 CPU (h_xbit) = opval;
1504 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1507 BI opval = 0;
1508 SET_H_INSN_PREFIXED_P (opval);
1509 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1515 #undef FLD
1517 NEXT (vpc);
1519 CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
1521 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1522 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1523 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1524 int UNUSED written = 0;
1525 IADDR UNUSED pc = abuf->addr;
1526 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1529 SI tmp_tmpopd;
1530 SI tmp_tmpops;
1531 BI tmp_carry;
1532 SI tmp_newval;
1533 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1534 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1535 tmp_carry = CPU (h_cbit);
1536 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1537 ((void) 0); /*nop*/
1540 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))));
1541 CPU (h_cbit) = opval;
1542 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1545 BI opval = LTSI (tmp_newval, 0);
1546 CPU (h_nbit) = opval;
1547 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1550 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1551 CPU (h_zbit) = opval;
1552 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1555 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)));
1556 CPU (h_vbit) = opval;
1557 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1561 BI opval = 0;
1562 CPU (h_xbit) = opval;
1563 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1566 BI opval = 0;
1567 SET_H_INSN_PREFIXED_P (opval);
1568 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1574 #undef FLD
1576 NEXT (vpc);
1578 CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1581 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1582 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1583 int UNUSED written = 0;
1584 IADDR UNUSED pc = abuf->addr;
1585 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1588 QI tmp_tmpopd;
1589 QI tmp_tmpops;
1590 BI tmp_carry;
1591 QI tmp_newval;
1592 tmp_tmpops = ({ SI tmp_addr;
1593 QI tmp_tmp_mem;
1594 BI tmp_postinc;
1595 tmp_postinc = FLD (f_memmode);
1596 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1597 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1598 ; if (NEBI (tmp_postinc, 0)) {
1600 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1601 tmp_addr = ADDSI (tmp_addr, 1);
1604 SI opval = tmp_addr;
1605 SET_H_GR (FLD (f_operand1), opval);
1606 written |= (1 << 9);
1607 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1611 ; tmp_tmp_mem; });
1612 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1613 tmp_carry = CPU (h_cbit);
1614 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1615 ((void) 0); /*nop*/
1618 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))));
1619 CPU (h_cbit) = opval;
1620 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1623 BI opval = LTQI (tmp_newval, 0);
1624 CPU (h_nbit) = opval;
1625 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1628 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1629 CPU (h_zbit) = opval;
1630 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1633 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)));
1634 CPU (h_vbit) = opval;
1635 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1639 BI opval = 0;
1640 CPU (h_xbit) = opval;
1641 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1644 BI opval = 0;
1645 SET_H_INSN_PREFIXED_P (opval);
1646 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1652 abuf->written = written;
1653 #undef FLD
1655 NEXT (vpc);
1657 CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1659 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1660 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1661 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1662 int UNUSED written = 0;
1663 IADDR UNUSED pc = abuf->addr;
1664 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1667 HI tmp_tmpopd;
1668 HI tmp_tmpops;
1669 BI tmp_carry;
1670 HI tmp_newval;
1671 tmp_tmpops = ({ SI tmp_addr;
1672 HI tmp_tmp_mem;
1673 BI tmp_postinc;
1674 tmp_postinc = FLD (f_memmode);
1675 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1676 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
1677 ; if (NEBI (tmp_postinc, 0)) {
1679 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1680 tmp_addr = ADDSI (tmp_addr, 2);
1683 SI opval = tmp_addr;
1684 SET_H_GR (FLD (f_operand1), opval);
1685 written |= (1 << 9);
1686 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1690 ; tmp_tmp_mem; });
1691 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1692 tmp_carry = CPU (h_cbit);
1693 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1694 ((void) 0); /*nop*/
1697 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))));
1698 CPU (h_cbit) = opval;
1699 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1702 BI opval = LTHI (tmp_newval, 0);
1703 CPU (h_nbit) = opval;
1704 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1707 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1708 CPU (h_zbit) = opval;
1709 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1712 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)));
1713 CPU (h_vbit) = opval;
1714 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1718 BI opval = 0;
1719 CPU (h_xbit) = opval;
1720 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1723 BI opval = 0;
1724 SET_H_INSN_PREFIXED_P (opval);
1725 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1731 abuf->written = written;
1732 #undef FLD
1734 NEXT (vpc);
1736 CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1738 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1739 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1740 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1741 int UNUSED written = 0;
1742 IADDR UNUSED pc = abuf->addr;
1743 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1746 SI tmp_tmpopd;
1747 SI tmp_tmpops;
1748 BI tmp_carry;
1749 SI tmp_newval;
1750 tmp_tmpops = ({ SI tmp_addr;
1751 SI tmp_tmp_mem;
1752 BI tmp_postinc;
1753 tmp_postinc = FLD (f_memmode);
1754 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1755 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
1756 ; if (NEBI (tmp_postinc, 0)) {
1758 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1759 tmp_addr = ADDSI (tmp_addr, 4);
1762 SI opval = tmp_addr;
1763 SET_H_GR (FLD (f_operand1), opval);
1764 written |= (1 << 9);
1765 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1769 ; tmp_tmp_mem; });
1770 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1771 tmp_carry = CPU (h_cbit);
1772 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1773 ((void) 0); /*nop*/
1776 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))));
1777 CPU (h_cbit) = opval;
1778 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1781 BI opval = LTSI (tmp_newval, 0);
1782 CPU (h_nbit) = opval;
1783 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1786 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1787 CPU (h_zbit) = opval;
1788 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1791 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)));
1792 CPU (h_vbit) = opval;
1793 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1797 BI opval = 0;
1798 CPU (h_xbit) = opval;
1799 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1802 BI opval = 0;
1803 SET_H_INSN_PREFIXED_P (opval);
1804 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1810 abuf->written = written;
1811 #undef FLD
1813 NEXT (vpc);
1815 CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
1817 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1818 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1819 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1820 int UNUSED written = 0;
1821 IADDR UNUSED pc = abuf->addr;
1822 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1825 QI tmp_tmpopd;
1826 QI tmp_tmpops;
1827 BI tmp_carry;
1828 QI tmp_newval;
1829 tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
1830 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1831 tmp_carry = CPU (h_cbit);
1832 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1833 ((void) 0); /*nop*/
1836 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))));
1837 CPU (h_cbit) = opval;
1838 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1841 BI opval = LTQI (tmp_newval, 0);
1842 CPU (h_nbit) = opval;
1843 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1846 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1847 CPU (h_zbit) = opval;
1848 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1851 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)));
1852 CPU (h_vbit) = opval;
1853 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1857 BI opval = 0;
1858 CPU (h_xbit) = opval;
1859 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1862 BI opval = 0;
1863 SET_H_INSN_PREFIXED_P (opval);
1864 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1870 #undef FLD
1872 NEXT (vpc);
1874 CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
1876 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1877 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1878 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1879 int UNUSED written = 0;
1880 IADDR UNUSED pc = abuf->addr;
1881 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1884 HI tmp_tmpopd;
1885 HI tmp_tmpops;
1886 BI tmp_carry;
1887 HI tmp_newval;
1888 tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
1889 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1890 tmp_carry = CPU (h_cbit);
1891 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1892 ((void) 0); /*nop*/
1895 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))));
1896 CPU (h_cbit) = opval;
1897 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1900 BI opval = LTHI (tmp_newval, 0);
1901 CPU (h_nbit) = opval;
1902 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1905 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1906 CPU (h_zbit) = opval;
1907 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1910 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)));
1911 CPU (h_vbit) = opval;
1912 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1916 BI opval = 0;
1917 CPU (h_xbit) = opval;
1918 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1921 BI opval = 0;
1922 SET_H_INSN_PREFIXED_P (opval);
1923 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1929 #undef FLD
1931 NEXT (vpc);
1933 CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
1935 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1936 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1937 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1938 int UNUSED written = 0;
1939 IADDR UNUSED pc = abuf->addr;
1940 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1943 SI tmp_tmpopd;
1944 SI tmp_tmpops;
1945 BI tmp_carry;
1946 SI tmp_newval;
1947 tmp_tmpops = FLD (f_indir_pc__dword);
1948 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1949 tmp_carry = CPU (h_cbit);
1950 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1951 ((void) 0); /*nop*/
1954 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))));
1955 CPU (h_cbit) = opval;
1956 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1959 BI opval = LTSI (tmp_newval, 0);
1960 CPU (h_nbit) = opval;
1961 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1964 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1965 CPU (h_zbit) = opval;
1966 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1969 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)));
1970 CPU (h_vbit) = opval;
1971 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1975 BI opval = 0;
1976 CPU (h_xbit) = opval;
1977 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1980 BI opval = 0;
1981 SET_H_INSN_PREFIXED_P (opval);
1982 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1988 #undef FLD
1990 NEXT (vpc);
1992 CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
1994 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1995 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1996 #define FLD(f) abuf->fields.sfmt_andq.f
1997 int UNUSED written = 0;
1998 IADDR UNUSED pc = abuf->addr;
1999 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2002 SI tmp_tmpopd;
2003 SI tmp_tmpops;
2004 BI tmp_carry;
2005 SI tmp_newval;
2006 tmp_tmpops = FLD (f_s6);
2007 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2008 tmp_carry = CPU (h_cbit);
2009 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2010 ((void) 0); /*nop*/
2013 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))));
2014 CPU (h_cbit) = opval;
2015 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2018 BI opval = LTSI (tmp_newval, 0);
2019 CPU (h_nbit) = opval;
2020 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2023 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2024 CPU (h_zbit) = opval;
2025 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2028 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)));
2029 CPU (h_vbit) = opval;
2030 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2034 BI opval = 0;
2035 CPU (h_xbit) = opval;
2036 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2039 BI opval = 0;
2040 SET_H_INSN_PREFIXED_P (opval);
2041 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2047 #undef FLD
2049 NEXT (vpc);
2051 CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
2053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2055 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2056 int UNUSED written = 0;
2057 IADDR UNUSED pc = abuf->addr;
2058 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2061 SI tmp_tmpopd;
2062 SI tmp_tmpops;
2063 BI tmp_carry;
2064 SI tmp_newval;
2065 tmp_tmpops = EXTQISI (({ SI tmp_addr;
2066 QI tmp_tmp_mem;
2067 BI tmp_postinc;
2068 tmp_postinc = FLD (f_memmode);
2069 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2070 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2071 ; if (NEBI (tmp_postinc, 0)) {
2073 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2074 tmp_addr = ADDSI (tmp_addr, 1);
2077 SI opval = tmp_addr;
2078 SET_H_GR (FLD (f_operand1), opval);
2079 written |= (1 << 9);
2080 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2084 ; tmp_tmp_mem; }));
2085 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2086 tmp_carry = CPU (h_cbit);
2087 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2088 ((void) 0); /*nop*/
2091 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))));
2092 CPU (h_cbit) = opval;
2093 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2096 BI opval = LTSI (tmp_newval, 0);
2097 CPU (h_nbit) = opval;
2098 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2101 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2102 CPU (h_zbit) = opval;
2103 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2106 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)));
2107 CPU (h_vbit) = opval;
2108 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2112 BI opval = 0;
2113 CPU (h_xbit) = opval;
2114 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2117 BI opval = 0;
2118 SET_H_INSN_PREFIXED_P (opval);
2119 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2125 abuf->written = written;
2126 #undef FLD
2128 NEXT (vpc);
2130 CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
2132 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2133 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2134 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2135 int UNUSED written = 0;
2136 IADDR UNUSED pc = abuf->addr;
2137 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2140 SI tmp_tmpopd;
2141 SI tmp_tmpops;
2142 BI tmp_carry;
2143 SI tmp_newval;
2144 tmp_tmpops = EXTHISI (({ SI tmp_addr;
2145 HI tmp_tmp_mem;
2146 BI tmp_postinc;
2147 tmp_postinc = FLD (f_memmode);
2148 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2149 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2150 ; if (NEBI (tmp_postinc, 0)) {
2152 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2153 tmp_addr = ADDSI (tmp_addr, 2);
2156 SI opval = tmp_addr;
2157 SET_H_GR (FLD (f_operand1), opval);
2158 written |= (1 << 9);
2159 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2163 ; tmp_tmp_mem; }));
2164 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2165 tmp_carry = CPU (h_cbit);
2166 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2167 ((void) 0); /*nop*/
2170 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))));
2171 CPU (h_cbit) = opval;
2172 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2175 BI opval = LTSI (tmp_newval, 0);
2176 CPU (h_nbit) = opval;
2177 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2180 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2181 CPU (h_zbit) = opval;
2182 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2185 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)));
2186 CPU (h_vbit) = opval;
2187 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2191 BI opval = 0;
2192 CPU (h_xbit) = opval;
2193 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2196 BI opval = 0;
2197 SET_H_INSN_PREFIXED_P (opval);
2198 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2204 abuf->written = written;
2205 #undef FLD
2207 NEXT (vpc);
2209 CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
2211 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2212 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2213 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2214 int UNUSED written = 0;
2215 IADDR UNUSED pc = abuf->addr;
2216 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2219 SI tmp_tmpopd;
2220 SI tmp_tmpops;
2221 BI tmp_carry;
2222 SI tmp_newval;
2223 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2224 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2225 tmp_carry = CPU (h_cbit);
2226 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2227 ((void) 0); /*nop*/
2230 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))));
2231 CPU (h_cbit) = opval;
2232 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2235 BI opval = LTSI (tmp_newval, 0);
2236 CPU (h_nbit) = opval;
2237 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2240 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2241 CPU (h_zbit) = opval;
2242 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2245 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)));
2246 CPU (h_vbit) = opval;
2247 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2251 BI opval = 0;
2252 CPU (h_xbit) = opval;
2253 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2256 BI opval = 0;
2257 SET_H_INSN_PREFIXED_P (opval);
2258 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2264 #undef FLD
2266 NEXT (vpc);
2268 CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
2270 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2271 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2272 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2273 int UNUSED written = 0;
2274 IADDR UNUSED pc = abuf->addr;
2275 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2278 SI tmp_tmpopd;
2279 SI tmp_tmpops;
2280 BI tmp_carry;
2281 SI tmp_newval;
2282 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2283 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2284 tmp_carry = CPU (h_cbit);
2285 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2286 ((void) 0); /*nop*/
2289 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))));
2290 CPU (h_cbit) = opval;
2291 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2294 BI opval = LTSI (tmp_newval, 0);
2295 CPU (h_nbit) = opval;
2296 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2299 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2300 CPU (h_zbit) = opval;
2301 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2304 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)));
2305 CPU (h_vbit) = opval;
2306 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2310 BI opval = 0;
2311 CPU (h_xbit) = opval;
2312 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2315 BI opval = 0;
2316 SET_H_INSN_PREFIXED_P (opval);
2317 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2323 #undef FLD
2325 NEXT (vpc);
2327 CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2329 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2330 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2331 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2332 int UNUSED written = 0;
2333 IADDR UNUSED pc = abuf->addr;
2334 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2337 SI tmp_tmpopd;
2338 SI tmp_tmpops;
2339 BI tmp_carry;
2340 SI tmp_newval;
2341 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
2342 QI tmp_tmp_mem;
2343 BI tmp_postinc;
2344 tmp_postinc = FLD (f_memmode);
2345 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2346 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2347 ; if (NEBI (tmp_postinc, 0)) {
2349 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2350 tmp_addr = ADDSI (tmp_addr, 1);
2353 SI opval = tmp_addr;
2354 SET_H_GR (FLD (f_operand1), opval);
2355 written |= (1 << 9);
2356 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2360 ; tmp_tmp_mem; }));
2361 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2362 tmp_carry = CPU (h_cbit);
2363 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2364 ((void) 0); /*nop*/
2367 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))));
2368 CPU (h_cbit) = opval;
2369 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2372 BI opval = LTSI (tmp_newval, 0);
2373 CPU (h_nbit) = opval;
2374 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2377 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2378 CPU (h_zbit) = opval;
2379 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2382 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)));
2383 CPU (h_vbit) = opval;
2384 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2388 BI opval = 0;
2389 CPU (h_xbit) = opval;
2390 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2393 BI opval = 0;
2394 SET_H_INSN_PREFIXED_P (opval);
2395 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2401 abuf->written = written;
2402 #undef FLD
2404 NEXT (vpc);
2406 CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2408 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2409 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2410 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2411 int UNUSED written = 0;
2412 IADDR UNUSED pc = abuf->addr;
2413 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2416 SI tmp_tmpopd;
2417 SI tmp_tmpops;
2418 BI tmp_carry;
2419 SI tmp_newval;
2420 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
2421 HI tmp_tmp_mem;
2422 BI tmp_postinc;
2423 tmp_postinc = FLD (f_memmode);
2424 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2425 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2426 ; if (NEBI (tmp_postinc, 0)) {
2428 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2429 tmp_addr = ADDSI (tmp_addr, 2);
2432 SI opval = tmp_addr;
2433 SET_H_GR (FLD (f_operand1), opval);
2434 written |= (1 << 9);
2435 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2439 ; tmp_tmp_mem; }));
2440 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2441 tmp_carry = CPU (h_cbit);
2442 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2443 ((void) 0); /*nop*/
2446 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))));
2447 CPU (h_cbit) = opval;
2448 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2451 BI opval = LTSI (tmp_newval, 0);
2452 CPU (h_nbit) = opval;
2453 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2456 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2457 CPU (h_zbit) = opval;
2458 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2461 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)));
2462 CPU (h_vbit) = opval;
2463 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2467 BI opval = 0;
2468 CPU (h_xbit) = opval;
2469 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2472 BI opval = 0;
2473 SET_H_INSN_PREFIXED_P (opval);
2474 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2480 abuf->written = written;
2481 #undef FLD
2483 NEXT (vpc);
2485 CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
2487 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2488 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2489 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2490 int UNUSED written = 0;
2491 IADDR UNUSED pc = abuf->addr;
2492 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2495 SI tmp_tmpopd;
2496 SI tmp_tmpops;
2497 BI tmp_carry;
2498 SI tmp_newval;
2499 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2500 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2501 tmp_carry = CPU (h_cbit);
2502 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2503 ((void) 0); /*nop*/
2506 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))));
2507 CPU (h_cbit) = opval;
2508 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2511 BI opval = LTSI (tmp_newval, 0);
2512 CPU (h_nbit) = opval;
2513 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2516 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2517 CPU (h_zbit) = opval;
2518 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2521 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)));
2522 CPU (h_vbit) = opval;
2523 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2527 BI opval = 0;
2528 CPU (h_xbit) = opval;
2529 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2532 BI opval = 0;
2533 SET_H_INSN_PREFIXED_P (opval);
2534 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2540 #undef FLD
2542 NEXT (vpc);
2544 CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
2546 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2547 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2548 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2549 int UNUSED written = 0;
2550 IADDR UNUSED pc = abuf->addr;
2551 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2554 SI tmp_tmpopd;
2555 SI tmp_tmpops;
2556 BI tmp_carry;
2557 SI tmp_newval;
2558 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2559 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2560 tmp_carry = CPU (h_cbit);
2561 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2562 ((void) 0); /*nop*/
2565 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))));
2566 CPU (h_cbit) = opval;
2567 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2570 BI opval = LTSI (tmp_newval, 0);
2571 CPU (h_nbit) = opval;
2572 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2575 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2576 CPU (h_zbit) = opval;
2577 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2580 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)));
2581 CPU (h_vbit) = opval;
2582 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2586 BI opval = 0;
2587 CPU (h_xbit) = opval;
2588 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2591 BI opval = 0;
2592 SET_H_INSN_PREFIXED_P (opval);
2593 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2599 #undef FLD
2601 NEXT (vpc);
2603 CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
2605 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2606 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2607 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2608 int UNUSED written = 0;
2609 IADDR UNUSED pc = abuf->addr;
2610 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2613 SI tmp_tmp;
2614 tmp_tmp = ({ SI tmp_addr;
2615 QI tmp_tmp_mem;
2616 BI tmp_postinc;
2617 tmp_postinc = FLD (f_memmode);
2618 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2619 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2620 ; if (NEBI (tmp_postinc, 0)) {
2622 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2623 tmp_addr = ADDSI (tmp_addr, 1);
2626 SI opval = tmp_addr;
2627 SET_H_GR (FLD (f_operand1), opval);
2628 written |= (1 << 10);
2629 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2633 ; tmp_tmp_mem; });
2635 SI tmp_oldregval;
2636 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2638 SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
2639 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2640 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2645 BI opval = LTQI (tmp_tmp, 0);
2646 CPU (h_nbit) = opval;
2647 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2650 BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2651 CPU (h_zbit) = opval;
2652 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2654 SET_H_CBIT_MOVE (0);
2655 SET_H_VBIT_MOVE (0);
2658 BI opval = 0;
2659 CPU (h_xbit) = opval;
2660 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2663 BI opval = 0;
2664 SET_H_INSN_PREFIXED_P (opval);
2665 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2671 abuf->written = written;
2672 #undef FLD
2674 NEXT (vpc);
2676 CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
2678 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2679 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2680 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2681 int UNUSED written = 0;
2682 IADDR UNUSED pc = abuf->addr;
2683 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2686 SI tmp_tmp;
2687 tmp_tmp = ({ SI tmp_addr;
2688 HI tmp_tmp_mem;
2689 BI tmp_postinc;
2690 tmp_postinc = FLD (f_memmode);
2691 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2692 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2693 ; if (NEBI (tmp_postinc, 0)) {
2695 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2696 tmp_addr = ADDSI (tmp_addr, 2);
2699 SI opval = tmp_addr;
2700 SET_H_GR (FLD (f_operand1), opval);
2701 written |= (1 << 10);
2702 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2706 ; tmp_tmp_mem; });
2708 SI tmp_oldregval;
2709 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2711 SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
2712 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2713 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2718 BI opval = LTHI (tmp_tmp, 0);
2719 CPU (h_nbit) = opval;
2720 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2723 BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2724 CPU (h_zbit) = opval;
2725 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2727 SET_H_CBIT_MOVE (0);
2728 SET_H_VBIT_MOVE (0);
2731 BI opval = 0;
2732 CPU (h_xbit) = opval;
2733 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2736 BI opval = 0;
2737 SET_H_INSN_PREFIXED_P (opval);
2738 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2744 abuf->written = written;
2745 #undef FLD
2747 NEXT (vpc);
2749 CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
2751 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2752 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2753 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2754 int UNUSED written = 0;
2755 IADDR UNUSED pc = abuf->addr;
2756 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2759 SI tmp_tmp;
2760 tmp_tmp = ({ SI tmp_addr;
2761 SI tmp_tmp_mem;
2762 BI tmp_postinc;
2763 tmp_postinc = FLD (f_memmode);
2764 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2765 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
2766 ; if (NEBI (tmp_postinc, 0)) {
2768 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2769 tmp_addr = ADDSI (tmp_addr, 4);
2772 SI opval = tmp_addr;
2773 SET_H_GR (FLD (f_operand1), opval);
2774 written |= (1 << 9);
2775 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2779 ; tmp_tmp_mem; });
2781 SI opval = tmp_tmp;
2782 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2783 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2787 BI opval = LTSI (tmp_tmp, 0);
2788 CPU (h_nbit) = opval;
2789 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2792 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2793 CPU (h_zbit) = opval;
2794 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2796 SET_H_CBIT_MOVE (0);
2797 SET_H_VBIT_MOVE (0);
2800 BI opval = 0;
2801 CPU (h_xbit) = opval;
2802 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2805 BI opval = 0;
2806 SET_H_INSN_PREFIXED_P (opval);
2807 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2813 abuf->written = written;
2814 #undef FLD
2816 NEXT (vpc);
2818 CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
2820 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2821 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2822 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2823 int UNUSED written = 0;
2824 IADDR UNUSED pc = abuf->addr;
2825 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2828 SI tmp_tmp;
2829 tmp_tmp = EXTQISI (({ SI tmp_addr;
2830 QI tmp_tmp_mem;
2831 BI tmp_postinc;
2832 tmp_postinc = FLD (f_memmode);
2833 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2834 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2835 ; if (NEBI (tmp_postinc, 0)) {
2837 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2838 tmp_addr = ADDSI (tmp_addr, 1);
2841 SI opval = tmp_addr;
2842 SET_H_GR (FLD (f_operand1), opval);
2843 written |= (1 << 8);
2844 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2848 ; tmp_tmp_mem; }));
2849 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2851 SI opval = tmp_tmp;
2852 SET_H_GR (FLD (f_operand1), opval);
2853 written |= (1 << 8);
2854 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2856 } else {
2858 SI opval = tmp_tmp;
2859 SET_H_GR (FLD (f_operand2), opval);
2860 written |= (1 << 7);
2861 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2866 BI opval = LTSI (tmp_tmp, 0);
2867 CPU (h_nbit) = opval;
2868 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2871 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2872 CPU (h_zbit) = opval;
2873 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2875 SET_H_CBIT_MOVE (0);
2876 SET_H_VBIT_MOVE (0);
2879 BI opval = 0;
2880 CPU (h_xbit) = opval;
2881 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2884 BI opval = 0;
2885 SET_H_INSN_PREFIXED_P (opval);
2886 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2892 abuf->written = written;
2893 #undef FLD
2895 NEXT (vpc);
2897 CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
2899 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2900 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2901 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2902 int UNUSED written = 0;
2903 IADDR UNUSED pc = abuf->addr;
2904 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2907 SI tmp_tmp;
2908 tmp_tmp = EXTHISI (({ SI tmp_addr;
2909 HI tmp_tmp_mem;
2910 BI tmp_postinc;
2911 tmp_postinc = FLD (f_memmode);
2912 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2913 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2914 ; if (NEBI (tmp_postinc, 0)) {
2916 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2917 tmp_addr = ADDSI (tmp_addr, 2);
2920 SI opval = tmp_addr;
2921 SET_H_GR (FLD (f_operand1), opval);
2922 written |= (1 << 8);
2923 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2927 ; tmp_tmp_mem; }));
2928 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2930 SI opval = tmp_tmp;
2931 SET_H_GR (FLD (f_operand1), opval);
2932 written |= (1 << 8);
2933 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2935 } else {
2937 SI opval = tmp_tmp;
2938 SET_H_GR (FLD (f_operand2), opval);
2939 written |= (1 << 7);
2940 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2945 BI opval = LTSI (tmp_tmp, 0);
2946 CPU (h_nbit) = opval;
2947 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2950 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2951 CPU (h_zbit) = opval;
2952 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2954 SET_H_CBIT_MOVE (0);
2955 SET_H_VBIT_MOVE (0);
2958 BI opval = 0;
2959 CPU (h_xbit) = opval;
2960 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2963 BI opval = 0;
2964 SET_H_INSN_PREFIXED_P (opval);
2965 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2971 abuf->written = written;
2972 #undef FLD
2974 NEXT (vpc);
2976 CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
2978 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2979 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2980 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2981 int UNUSED written = 0;
2982 IADDR UNUSED pc = abuf->addr;
2983 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2986 SI tmp_tmp;
2987 tmp_tmp = ZEXTQISI (({ SI tmp_addr;
2988 QI tmp_tmp_mem;
2989 BI tmp_postinc;
2990 tmp_postinc = FLD (f_memmode);
2991 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2992 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2993 ; if (NEBI (tmp_postinc, 0)) {
2995 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2996 tmp_addr = ADDSI (tmp_addr, 1);
2999 SI opval = tmp_addr;
3000 SET_H_GR (FLD (f_operand1), opval);
3001 written |= (1 << 8);
3002 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3006 ; tmp_tmp_mem; }));
3007 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3009 SI opval = tmp_tmp;
3010 SET_H_GR (FLD (f_operand1), opval);
3011 written |= (1 << 8);
3012 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3014 } else {
3016 SI opval = tmp_tmp;
3017 SET_H_GR (FLD (f_operand2), opval);
3018 written |= (1 << 7);
3019 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3024 BI opval = LTSI (tmp_tmp, 0);
3025 CPU (h_nbit) = opval;
3026 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3029 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3030 CPU (h_zbit) = opval;
3031 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3033 SET_H_CBIT_MOVE (0);
3034 SET_H_VBIT_MOVE (0);
3037 BI opval = 0;
3038 CPU (h_xbit) = opval;
3039 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3042 BI opval = 0;
3043 SET_H_INSN_PREFIXED_P (opval);
3044 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3050 abuf->written = written;
3051 #undef FLD
3053 NEXT (vpc);
3055 CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
3057 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3058 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3059 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
3060 int UNUSED written = 0;
3061 IADDR UNUSED pc = abuf->addr;
3062 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3065 SI tmp_tmp;
3066 tmp_tmp = ZEXTHISI (({ SI tmp_addr;
3067 HI tmp_tmp_mem;
3068 BI tmp_postinc;
3069 tmp_postinc = FLD (f_memmode);
3070 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3071 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
3072 ; if (NEBI (tmp_postinc, 0)) {
3074 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3075 tmp_addr = ADDSI (tmp_addr, 2);
3078 SI opval = tmp_addr;
3079 SET_H_GR (FLD (f_operand1), opval);
3080 written |= (1 << 8);
3081 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3085 ; tmp_tmp_mem; }));
3086 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3088 SI opval = tmp_tmp;
3089 SET_H_GR (FLD (f_operand1), opval);
3090 written |= (1 << 8);
3091 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3093 } else {
3095 SI opval = tmp_tmp;
3096 SET_H_GR (FLD (f_operand2), opval);
3097 written |= (1 << 7);
3098 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3103 BI opval = LTSI (tmp_tmp, 0);
3104 CPU (h_nbit) = opval;
3105 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3108 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3109 CPU (h_zbit) = opval;
3110 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3112 SET_H_CBIT_MOVE (0);
3113 SET_H_VBIT_MOVE (0);
3116 BI opval = 0;
3117 CPU (h_xbit) = opval;
3118 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3121 BI opval = 0;
3122 SET_H_INSN_PREFIXED_P (opval);
3123 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3129 abuf->written = written;
3130 #undef FLD
3132 NEXT (vpc);
3134 CASE (sem, INSN_MOVE_R_SPRV10) : /* move ${Rs},${Pd} */
3136 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3137 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3138 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3139 int UNUSED written = 0;
3140 IADDR UNUSED pc = abuf->addr;
3141 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3144 SI tmp_tmp;
3145 SI tmp_rno;
3146 tmp_tmp = GET_H_GR (FLD (f_operand1));
3147 tmp_rno = FLD (f_operand2);
3148 if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
3149 cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
3151 else {
3153 SI opval = tmp_tmp;
3154 SET_H_SR (FLD (f_operand2), opval);
3155 written |= (1 << 2);
3156 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3161 BI opval = 0;
3162 CPU (h_xbit) = opval;
3163 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3166 BI opval = 0;
3167 SET_H_INSN_PREFIXED_P (opval);
3168 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3173 abuf->written = written;
3174 #undef FLD
3176 NEXT (vpc);
3178 CASE (sem, INSN_MOVE_SPR_RV10) : /* move ${Ps},${Rd-sfield} */
3180 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3181 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3182 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3183 int UNUSED written = 0;
3184 IADDR UNUSED pc = abuf->addr;
3185 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3188 SI tmp_grno;
3189 SI tmp_prno;
3190 SI tmp_newval;
3191 tmp_prno = FLD (f_operand2);
3192 tmp_newval = GET_H_SR (FLD (f_operand2));
3193 if (EQSI (tmp_prno, 5)) {
3195 SI tmp_oldregval;
3196 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3198 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3199 SET_H_GR (FLD (f_operand1), opval);
3200 written |= (1 << 4);
3201 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3205 else if (EQSI (tmp_prno, 9)) {
3207 SI opval = tmp_newval;
3208 SET_H_GR (FLD (f_operand1), opval);
3209 written |= (1 << 4);
3210 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3213 else if (EQSI (tmp_prno, 10)) {
3215 SI opval = tmp_newval;
3216 SET_H_GR (FLD (f_operand1), opval);
3217 written |= (1 << 4);
3218 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3221 else if (EQSI (tmp_prno, 11)) {
3223 SI opval = tmp_newval;
3224 SET_H_GR (FLD (f_operand1), opval);
3225 written |= (1 << 4);
3226 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3229 else if (EQSI (tmp_prno, 12)) {
3231 SI opval = tmp_newval;
3232 SET_H_GR (FLD (f_operand1), opval);
3233 written |= (1 << 4);
3234 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3237 else if (EQSI (tmp_prno, 13)) {
3239 SI opval = tmp_newval;
3240 SET_H_GR (FLD (f_operand1), opval);
3241 written |= (1 << 4);
3242 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3245 else if (EQSI (tmp_prno, 0)) {
3247 SI tmp_oldregval;
3248 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3250 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3251 SET_H_GR (FLD (f_operand1), opval);
3252 written |= (1 << 4);
3253 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3257 else if (EQSI (tmp_prno, 1)) {
3259 SI tmp_oldregval;
3260 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3262 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3263 SET_H_GR (FLD (f_operand1), opval);
3264 written |= (1 << 4);
3265 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3269 else if (EQSI (tmp_prno, 4)) {
3271 SI tmp_oldregval;
3272 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3274 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3275 SET_H_GR (FLD (f_operand1), opval);
3276 written |= (1 << 4);
3277 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3281 else if (EQSI (tmp_prno, 8)) {
3283 SI opval = tmp_newval;
3284 SET_H_GR (FLD (f_operand1), opval);
3285 written |= (1 << 4);
3286 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3289 else if (EQSI (tmp_prno, 7)) {
3291 SI opval = tmp_newval;
3292 SET_H_GR (FLD (f_operand1), opval);
3293 written |= (1 << 4);
3294 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3297 else if (EQSI (tmp_prno, 14)) {
3299 SI opval = tmp_newval;
3300 SET_H_GR (FLD (f_operand1), opval);
3301 written |= (1 << 4);
3302 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3305 else if (EQSI (tmp_prno, 15)) {
3307 SI opval = tmp_newval;
3308 SET_H_GR (FLD (f_operand1), opval);
3309 written |= (1 << 4);
3310 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3313 else {
3314 cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
3318 BI opval = 0;
3319 CPU (h_xbit) = opval;
3320 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3323 BI opval = 0;
3324 SET_H_INSN_PREFIXED_P (opval);
3325 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3330 abuf->written = written;
3331 #undef FLD
3333 NEXT (vpc);
3335 CASE (sem, INSN_RET_TYPE) : /* ret/reti/retb */
3337 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3338 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3339 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3340 int UNUSED written = 0;
3341 IADDR UNUSED pc = abuf->addr;
3342 SEM_BRANCH_INIT
3343 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3346 SI tmp_retaddr;
3347 tmp_retaddr = GET_H_SR (FLD (f_operand2));
3350 BI opval = 0;
3351 CPU (h_xbit) = opval;
3352 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3355 BI opval = 0;
3356 SET_H_INSN_PREFIXED_P (opval);
3357 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3362 USI opval = tmp_retaddr;
3363 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3364 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3369 SEM_BRANCH_FINI (vpc);
3370 #undef FLD
3372 NEXT (vpc);
3374 CASE (sem, INSN_MOVE_M_SPRV10) : /* move [${Rs}${inc}],${Pd} */
3376 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3377 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3378 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3379 int UNUSED written = 0;
3380 IADDR UNUSED pc = abuf->addr;
3381 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3384 SI tmp_rno;
3385 SI tmp_newval;
3386 tmp_rno = FLD (f_operand2);
3387 if (EQSI (tmp_rno, 5)) {
3388 tmp_newval = EXTHISI (({ SI tmp_addr;
3389 HI tmp_tmp_mem;
3390 BI tmp_postinc;
3391 tmp_postinc = FLD (f_memmode);
3392 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3393 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
3394 ; if (NEBI (tmp_postinc, 0)) {
3396 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3397 tmp_addr = ADDSI (tmp_addr, 2);
3400 SI opval = tmp_addr;
3401 SET_H_GR (FLD (f_operand1), opval);
3402 written |= (1 << 8);
3403 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3407 ; tmp_tmp_mem; }));
3409 else if (EQSI (tmp_rno, 9)) {
3410 tmp_newval = ({ SI tmp_addr;
3411 SI tmp_tmp_mem;
3412 BI tmp_postinc;
3413 tmp_postinc = FLD (f_memmode);
3414 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3415 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3416 ; if (NEBI (tmp_postinc, 0)) {
3418 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3419 tmp_addr = ADDSI (tmp_addr, 4);
3422 SI opval = tmp_addr;
3423 SET_H_GR (FLD (f_operand1), opval);
3424 written |= (1 << 8);
3425 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3429 ; tmp_tmp_mem; });
3431 else if (EQSI (tmp_rno, 10)) {
3432 tmp_newval = ({ SI tmp_addr;
3433 SI tmp_tmp_mem;
3434 BI tmp_postinc;
3435 tmp_postinc = FLD (f_memmode);
3436 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3437 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3438 ; if (NEBI (tmp_postinc, 0)) {
3440 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3441 tmp_addr = ADDSI (tmp_addr, 4);
3444 SI opval = tmp_addr;
3445 SET_H_GR (FLD (f_operand1), opval);
3446 written |= (1 << 8);
3447 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3451 ; tmp_tmp_mem; });
3453 else if (EQSI (tmp_rno, 11)) {
3454 tmp_newval = ({ SI tmp_addr;
3455 SI tmp_tmp_mem;
3456 BI tmp_postinc;
3457 tmp_postinc = FLD (f_memmode);
3458 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3459 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3460 ; if (NEBI (tmp_postinc, 0)) {
3462 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3463 tmp_addr = ADDSI (tmp_addr, 4);
3466 SI opval = tmp_addr;
3467 SET_H_GR (FLD (f_operand1), opval);
3468 written |= (1 << 8);
3469 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3473 ; tmp_tmp_mem; });
3475 else if (EQSI (tmp_rno, 12)) {
3476 tmp_newval = ({ SI tmp_addr;
3477 SI tmp_tmp_mem;
3478 BI tmp_postinc;
3479 tmp_postinc = FLD (f_memmode);
3480 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3481 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3482 ; if (NEBI (tmp_postinc, 0)) {
3484 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3485 tmp_addr = ADDSI (tmp_addr, 4);
3488 SI opval = tmp_addr;
3489 SET_H_GR (FLD (f_operand1), opval);
3490 written |= (1 << 8);
3491 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3495 ; tmp_tmp_mem; });
3497 else if (EQSI (tmp_rno, 13)) {
3498 tmp_newval = ({ SI tmp_addr;
3499 SI tmp_tmp_mem;
3500 BI tmp_postinc;
3501 tmp_postinc = FLD (f_memmode);
3502 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3503 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3504 ; if (NEBI (tmp_postinc, 0)) {
3506 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3507 tmp_addr = ADDSI (tmp_addr, 4);
3510 SI opval = tmp_addr;
3511 SET_H_GR (FLD (f_operand1), opval);
3512 written |= (1 << 8);
3513 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3517 ; tmp_tmp_mem; });
3519 else if (EQSI (tmp_rno, 7)) {
3520 tmp_newval = ({ SI tmp_addr;
3521 SI tmp_tmp_mem;
3522 BI tmp_postinc;
3523 tmp_postinc = FLD (f_memmode);
3524 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3525 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3526 ; if (NEBI (tmp_postinc, 0)) {
3528 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3529 tmp_addr = ADDSI (tmp_addr, 4);
3532 SI opval = tmp_addr;
3533 SET_H_GR (FLD (f_operand1), opval);
3534 written |= (1 << 8);
3535 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3539 ; tmp_tmp_mem; });
3541 else if (EQSI (tmp_rno, 14)) {
3542 tmp_newval = ({ SI tmp_addr;
3543 SI tmp_tmp_mem;
3544 BI tmp_postinc;
3545 tmp_postinc = FLD (f_memmode);
3546 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3547 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3548 ; if (NEBI (tmp_postinc, 0)) {
3550 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3551 tmp_addr = ADDSI (tmp_addr, 4);
3554 SI opval = tmp_addr;
3555 SET_H_GR (FLD (f_operand1), opval);
3556 written |= (1 << 8);
3557 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3561 ; tmp_tmp_mem; });
3563 else if (EQSI (tmp_rno, 15)) {
3564 tmp_newval = ({ SI tmp_addr;
3565 SI tmp_tmp_mem;
3566 BI tmp_postinc;
3567 tmp_postinc = FLD (f_memmode);
3568 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3569 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3570 ; if (NEBI (tmp_postinc, 0)) {
3572 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3573 tmp_addr = ADDSI (tmp_addr, 4);
3576 SI opval = tmp_addr;
3577 SET_H_GR (FLD (f_operand1), opval);
3578 written |= (1 << 8);
3579 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3583 ; tmp_tmp_mem; });
3585 else {
3586 cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
3589 SI opval = tmp_newval;
3590 SET_H_SR (FLD (f_operand2), opval);
3591 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3595 BI opval = 0;
3596 CPU (h_xbit) = opval;
3597 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3600 BI opval = 0;
3601 SET_H_INSN_PREFIXED_P (opval);
3602 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3607 abuf->written = written;
3608 #undef FLD
3610 NEXT (vpc);
3612 CASE (sem, INSN_MOVE_C_SPRV10_P5) : /* move ${sconst16},${Pd} */
3614 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3615 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3616 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p5.f
3617 int UNUSED written = 0;
3618 IADDR UNUSED pc = abuf->addr;
3619 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3623 SI opval = FLD (f_indir_pc__word);
3624 SET_H_SR (FLD (f_operand2), opval);
3625 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3629 BI opval = 0;
3630 CPU (h_xbit) = opval;
3631 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3634 BI opval = 0;
3635 SET_H_INSN_PREFIXED_P (opval);
3636 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3641 #undef FLD
3643 NEXT (vpc);
3645 CASE (sem, INSN_MOVE_C_SPRV10_P9) : /* move ${const32},${Pd} */
3647 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3648 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3649 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3650 int UNUSED written = 0;
3651 IADDR UNUSED pc = abuf->addr;
3652 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3656 SI opval = FLD (f_indir_pc__dword);
3657 SET_H_SR (FLD (f_operand2), opval);
3658 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3662 BI opval = 0;
3663 CPU (h_xbit) = opval;
3664 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3667 BI opval = 0;
3668 SET_H_INSN_PREFIXED_P (opval);
3669 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3674 #undef FLD
3676 NEXT (vpc);
3678 CASE (sem, INSN_MOVE_C_SPRV10_P10) : /* move ${const32},${Pd} */
3680 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3681 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3682 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3683 int UNUSED written = 0;
3684 IADDR UNUSED pc = abuf->addr;
3685 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3689 SI opval = FLD (f_indir_pc__dword);
3690 SET_H_SR (FLD (f_operand2), opval);
3691 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3695 BI opval = 0;
3696 CPU (h_xbit) = opval;
3697 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3700 BI opval = 0;
3701 SET_H_INSN_PREFIXED_P (opval);
3702 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3707 #undef FLD
3709 NEXT (vpc);
3711 CASE (sem, INSN_MOVE_C_SPRV10_P11) : /* move ${const32},${Pd} */
3713 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3714 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3715 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3716 int UNUSED written = 0;
3717 IADDR UNUSED pc = abuf->addr;
3718 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3722 SI opval = FLD (f_indir_pc__dword);
3723 SET_H_SR (FLD (f_operand2), opval);
3724 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3728 BI opval = 0;
3729 CPU (h_xbit) = opval;
3730 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3733 BI opval = 0;
3734 SET_H_INSN_PREFIXED_P (opval);
3735 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3740 #undef FLD
3742 NEXT (vpc);
3744 CASE (sem, INSN_MOVE_C_SPRV10_P12) : /* move ${const32},${Pd} */
3746 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3747 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3748 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3749 int UNUSED written = 0;
3750 IADDR UNUSED pc = abuf->addr;
3751 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3755 SI opval = FLD (f_indir_pc__dword);
3756 SET_H_SR (FLD (f_operand2), opval);
3757 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3761 BI opval = 0;
3762 CPU (h_xbit) = opval;
3763 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3766 BI opval = 0;
3767 SET_H_INSN_PREFIXED_P (opval);
3768 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3773 #undef FLD
3775 NEXT (vpc);
3777 CASE (sem, INSN_MOVE_C_SPRV10_P13) : /* move ${const32},${Pd} */
3779 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3780 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3781 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3782 int UNUSED written = 0;
3783 IADDR UNUSED pc = abuf->addr;
3784 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3788 SI opval = FLD (f_indir_pc__dword);
3789 SET_H_SR (FLD (f_operand2), opval);
3790 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3794 BI opval = 0;
3795 CPU (h_xbit) = opval;
3796 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3799 BI opval = 0;
3800 SET_H_INSN_PREFIXED_P (opval);
3801 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3806 #undef FLD
3808 NEXT (vpc);
3810 CASE (sem, INSN_MOVE_C_SPRV10_P7) : /* move ${const32},${Pd} */
3812 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3813 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3814 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3815 int UNUSED written = 0;
3816 IADDR UNUSED pc = abuf->addr;
3817 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3821 SI opval = FLD (f_indir_pc__dword);
3822 SET_H_SR (FLD (f_operand2), opval);
3823 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3827 BI opval = 0;
3828 CPU (h_xbit) = opval;
3829 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3832 BI opval = 0;
3833 SET_H_INSN_PREFIXED_P (opval);
3834 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3839 #undef FLD
3841 NEXT (vpc);
3843 CASE (sem, INSN_MOVE_C_SPRV10_P14) : /* move ${const32},${Pd} */
3845 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3846 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3847 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3848 int UNUSED written = 0;
3849 IADDR UNUSED pc = abuf->addr;
3850 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3854 SI opval = FLD (f_indir_pc__dword);
3855 SET_H_SR (FLD (f_operand2), opval);
3856 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3860 BI opval = 0;
3861 CPU (h_xbit) = opval;
3862 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3865 BI opval = 0;
3866 SET_H_INSN_PREFIXED_P (opval);
3867 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3872 #undef FLD
3874 NEXT (vpc);
3876 CASE (sem, INSN_MOVE_C_SPRV10_P15) : /* move ${const32},${Pd} */
3878 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3879 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3880 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3881 int UNUSED written = 0;
3882 IADDR UNUSED pc = abuf->addr;
3883 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3887 SI opval = FLD (f_indir_pc__dword);
3888 SET_H_SR (FLD (f_operand2), opval);
3889 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3893 BI opval = 0;
3894 CPU (h_xbit) = opval;
3895 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3898 BI opval = 0;
3899 SET_H_INSN_PREFIXED_P (opval);
3900 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3905 #undef FLD
3907 NEXT (vpc);
3909 CASE (sem, INSN_MOVE_SPR_MV10) : /* move ${Ps},[${Rd-sfield}${inc}] */
3911 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3912 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3913 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
3914 int UNUSED written = 0;
3915 IADDR UNUSED pc = abuf->addr;
3916 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3919 SI tmp_rno;
3920 tmp_rno = FLD (f_operand2);
3921 if (EQSI (tmp_rno, 5)) {
3923 SI tmp_addr;
3924 BI tmp_postinc;
3925 tmp_postinc = FLD (f_memmode);
3926 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3927 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
3928 if (EQBI (CPU (h_pbit), 0)) {
3931 HI opval = GET_H_SR (FLD (f_operand2));
3932 SETMEMHI (current_cpu, pc, tmp_addr, opval);
3933 written |= (1 << 11);
3934 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3937 BI opval = CPU (h_pbit);
3938 CPU (h_cbit) = opval;
3939 written |= (1 << 10);
3940 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3943 } else {
3945 BI opval = 1;
3946 CPU (h_cbit) = opval;
3947 written |= (1 << 10);
3948 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3951 } else {
3953 HI opval = GET_H_SR (FLD (f_operand2));
3954 SETMEMHI (current_cpu, pc, tmp_addr, opval);
3955 written |= (1 << 11);
3956 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3959 if (NEBI (tmp_postinc, 0)) {
3961 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3962 tmp_addr = ADDSI (tmp_addr, 2);
3965 SI opval = tmp_addr;
3966 SET_H_GR (FLD (f_operand1), opval);
3967 written |= (1 << 9);
3968 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3974 else if (EQSI (tmp_rno, 9)) {
3976 SI tmp_addr;
3977 BI tmp_postinc;
3978 tmp_postinc = FLD (f_memmode);
3979 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3980 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
3981 if (EQBI (CPU (h_pbit), 0)) {
3984 SI opval = GET_H_SR (FLD (f_operand2));
3985 SETMEMSI (current_cpu, pc, tmp_addr, opval);
3986 written |= (1 << 13);
3987 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3990 BI opval = CPU (h_pbit);
3991 CPU (h_cbit) = opval;
3992 written |= (1 << 10);
3993 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3996 } else {
3998 BI opval = 1;
3999 CPU (h_cbit) = opval;
4000 written |= (1 << 10);
4001 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4004 } else {
4006 SI opval = GET_H_SR (FLD (f_operand2));
4007 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4008 written |= (1 << 13);
4009 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4012 if (NEBI (tmp_postinc, 0)) {
4014 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4015 tmp_addr = ADDSI (tmp_addr, 4);
4018 SI opval = tmp_addr;
4019 SET_H_GR (FLD (f_operand1), opval);
4020 written |= (1 << 9);
4021 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4027 else if (EQSI (tmp_rno, 10)) {
4029 SI tmp_addr;
4030 BI tmp_postinc;
4031 tmp_postinc = FLD (f_memmode);
4032 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4033 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4034 if (EQBI (CPU (h_pbit), 0)) {
4037 SI opval = GET_H_SR (FLD (f_operand2));
4038 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4039 written |= (1 << 13);
4040 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4043 BI opval = CPU (h_pbit);
4044 CPU (h_cbit) = opval;
4045 written |= (1 << 10);
4046 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4049 } else {
4051 BI opval = 1;
4052 CPU (h_cbit) = opval;
4053 written |= (1 << 10);
4054 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4057 } else {
4059 SI opval = GET_H_SR (FLD (f_operand2));
4060 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4061 written |= (1 << 13);
4062 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4065 if (NEBI (tmp_postinc, 0)) {
4067 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4068 tmp_addr = ADDSI (tmp_addr, 4);
4071 SI opval = tmp_addr;
4072 SET_H_GR (FLD (f_operand1), opval);
4073 written |= (1 << 9);
4074 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4080 else if (EQSI (tmp_rno, 11)) {
4082 SI tmp_addr;
4083 BI tmp_postinc;
4084 tmp_postinc = FLD (f_memmode);
4085 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4086 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4087 if (EQBI (CPU (h_pbit), 0)) {
4090 SI opval = GET_H_SR (FLD (f_operand2));
4091 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4092 written |= (1 << 13);
4093 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4096 BI opval = CPU (h_pbit);
4097 CPU (h_cbit) = opval;
4098 written |= (1 << 10);
4099 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4102 } else {
4104 BI opval = 1;
4105 CPU (h_cbit) = opval;
4106 written |= (1 << 10);
4107 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4110 } else {
4112 SI opval = GET_H_SR (FLD (f_operand2));
4113 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4114 written |= (1 << 13);
4115 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4118 if (NEBI (tmp_postinc, 0)) {
4120 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4121 tmp_addr = ADDSI (tmp_addr, 4);
4124 SI opval = tmp_addr;
4125 SET_H_GR (FLD (f_operand1), opval);
4126 written |= (1 << 9);
4127 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4133 else if (EQSI (tmp_rno, 12)) {
4135 SI tmp_addr;
4136 BI tmp_postinc;
4137 tmp_postinc = FLD (f_memmode);
4138 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4139 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4140 if (EQBI (CPU (h_pbit), 0)) {
4143 SI opval = GET_H_SR (FLD (f_operand2));
4144 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4145 written |= (1 << 13);
4146 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4149 BI opval = CPU (h_pbit);
4150 CPU (h_cbit) = opval;
4151 written |= (1 << 10);
4152 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4155 } else {
4157 BI opval = 1;
4158 CPU (h_cbit) = opval;
4159 written |= (1 << 10);
4160 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4163 } else {
4165 SI opval = GET_H_SR (FLD (f_operand2));
4166 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4167 written |= (1 << 13);
4168 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4171 if (NEBI (tmp_postinc, 0)) {
4173 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4174 tmp_addr = ADDSI (tmp_addr, 4);
4177 SI opval = tmp_addr;
4178 SET_H_GR (FLD (f_operand1), opval);
4179 written |= (1 << 9);
4180 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4186 else if (EQSI (tmp_rno, 13)) {
4188 SI tmp_addr;
4189 BI tmp_postinc;
4190 tmp_postinc = FLD (f_memmode);
4191 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4192 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4193 if (EQBI (CPU (h_pbit), 0)) {
4196 SI opval = GET_H_SR (FLD (f_operand2));
4197 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4198 written |= (1 << 13);
4199 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4202 BI opval = CPU (h_pbit);
4203 CPU (h_cbit) = opval;
4204 written |= (1 << 10);
4205 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4208 } else {
4210 BI opval = 1;
4211 CPU (h_cbit) = opval;
4212 written |= (1 << 10);
4213 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4216 } else {
4218 SI opval = GET_H_SR (FLD (f_operand2));
4219 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4220 written |= (1 << 13);
4221 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4224 if (NEBI (tmp_postinc, 0)) {
4226 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4227 tmp_addr = ADDSI (tmp_addr, 4);
4230 SI opval = tmp_addr;
4231 SET_H_GR (FLD (f_operand1), opval);
4232 written |= (1 << 9);
4233 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4239 else if (EQSI (tmp_rno, 0)) {
4241 SI tmp_addr;
4242 BI tmp_postinc;
4243 tmp_postinc = FLD (f_memmode);
4244 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4245 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4246 if (EQBI (CPU (h_pbit), 0)) {
4249 QI opval = GET_H_SR (FLD (f_operand2));
4250 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4251 written |= (1 << 12);
4252 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4255 BI opval = CPU (h_pbit);
4256 CPU (h_cbit) = opval;
4257 written |= (1 << 10);
4258 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4261 } else {
4263 BI opval = 1;
4264 CPU (h_cbit) = opval;
4265 written |= (1 << 10);
4266 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4269 } else {
4271 QI opval = GET_H_SR (FLD (f_operand2));
4272 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4273 written |= (1 << 12);
4274 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4277 if (NEBI (tmp_postinc, 0)) {
4279 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4280 tmp_addr = ADDSI (tmp_addr, 1);
4283 SI opval = tmp_addr;
4284 SET_H_GR (FLD (f_operand1), opval);
4285 written |= (1 << 9);
4286 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4292 else if (EQSI (tmp_rno, 1)) {
4294 SI tmp_addr;
4295 BI tmp_postinc;
4296 tmp_postinc = FLD (f_memmode);
4297 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4298 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4299 if (EQBI (CPU (h_pbit), 0)) {
4302 QI opval = GET_H_SR (FLD (f_operand2));
4303 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4304 written |= (1 << 12);
4305 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4308 BI opval = CPU (h_pbit);
4309 CPU (h_cbit) = opval;
4310 written |= (1 << 10);
4311 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4314 } else {
4316 BI opval = 1;
4317 CPU (h_cbit) = opval;
4318 written |= (1 << 10);
4319 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4322 } else {
4324 QI opval = GET_H_SR (FLD (f_operand2));
4325 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4326 written |= (1 << 12);
4327 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4330 if (NEBI (tmp_postinc, 0)) {
4332 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4333 tmp_addr = ADDSI (tmp_addr, 1);
4336 SI opval = tmp_addr;
4337 SET_H_GR (FLD (f_operand1), opval);
4338 written |= (1 << 9);
4339 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4345 else if (EQSI (tmp_rno, 4)) {
4347 SI tmp_addr;
4348 BI tmp_postinc;
4349 tmp_postinc = FLD (f_memmode);
4350 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4351 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4352 if (EQBI (CPU (h_pbit), 0)) {
4355 HI opval = GET_H_SR (FLD (f_operand2));
4356 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4357 written |= (1 << 11);
4358 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4361 BI opval = CPU (h_pbit);
4362 CPU (h_cbit) = opval;
4363 written |= (1 << 10);
4364 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4367 } else {
4369 BI opval = 1;
4370 CPU (h_cbit) = opval;
4371 written |= (1 << 10);
4372 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4375 } else {
4377 HI opval = GET_H_SR (FLD (f_operand2));
4378 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4379 written |= (1 << 11);
4380 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4383 if (NEBI (tmp_postinc, 0)) {
4385 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4386 tmp_addr = ADDSI (tmp_addr, 2);
4389 SI opval = tmp_addr;
4390 SET_H_GR (FLD (f_operand1), opval);
4391 written |= (1 << 9);
4392 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4398 else if (EQSI (tmp_rno, 8)) {
4400 SI tmp_addr;
4401 BI tmp_postinc;
4402 tmp_postinc = FLD (f_memmode);
4403 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4404 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4405 if (EQBI (CPU (h_pbit), 0)) {
4408 SI opval = GET_H_SR (FLD (f_operand2));
4409 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4410 written |= (1 << 13);
4411 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4414 BI opval = CPU (h_pbit);
4415 CPU (h_cbit) = opval;
4416 written |= (1 << 10);
4417 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4420 } else {
4422 BI opval = 1;
4423 CPU (h_cbit) = opval;
4424 written |= (1 << 10);
4425 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4428 } else {
4430 SI opval = GET_H_SR (FLD (f_operand2));
4431 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4432 written |= (1 << 13);
4433 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4436 if (NEBI (tmp_postinc, 0)) {
4438 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4439 tmp_addr = ADDSI (tmp_addr, 4);
4442 SI opval = tmp_addr;
4443 SET_H_GR (FLD (f_operand1), opval);
4444 written |= (1 << 9);
4445 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4451 else if (EQSI (tmp_rno, 7)) {
4453 SI tmp_addr;
4454 BI tmp_postinc;
4455 tmp_postinc = FLD (f_memmode);
4456 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4457 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4458 if (EQBI (CPU (h_pbit), 0)) {
4461 SI opval = GET_H_SR (FLD (f_operand2));
4462 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4463 written |= (1 << 13);
4464 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4467 BI opval = CPU (h_pbit);
4468 CPU (h_cbit) = opval;
4469 written |= (1 << 10);
4470 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4473 } else {
4475 BI opval = 1;
4476 CPU (h_cbit) = opval;
4477 written |= (1 << 10);
4478 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4481 } else {
4483 SI opval = GET_H_SR (FLD (f_operand2));
4484 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4485 written |= (1 << 13);
4486 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4489 if (NEBI (tmp_postinc, 0)) {
4491 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4492 tmp_addr = ADDSI (tmp_addr, 4);
4495 SI opval = tmp_addr;
4496 SET_H_GR (FLD (f_operand1), opval);
4497 written |= (1 << 9);
4498 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4504 else if (EQSI (tmp_rno, 14)) {
4506 SI tmp_addr;
4507 BI tmp_postinc;
4508 tmp_postinc = FLD (f_memmode);
4509 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4510 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4511 if (EQBI (CPU (h_pbit), 0)) {
4514 SI opval = GET_H_SR (FLD (f_operand2));
4515 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4516 written |= (1 << 13);
4517 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4520 BI opval = CPU (h_pbit);
4521 CPU (h_cbit) = opval;
4522 written |= (1 << 10);
4523 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4526 } else {
4528 BI opval = 1;
4529 CPU (h_cbit) = opval;
4530 written |= (1 << 10);
4531 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4534 } else {
4536 SI opval = GET_H_SR (FLD (f_operand2));
4537 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4538 written |= (1 << 13);
4539 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4542 if (NEBI (tmp_postinc, 0)) {
4544 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4545 tmp_addr = ADDSI (tmp_addr, 4);
4548 SI opval = tmp_addr;
4549 SET_H_GR (FLD (f_operand1), opval);
4550 written |= (1 << 9);
4551 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4557 else if (EQSI (tmp_rno, 15)) {
4559 SI tmp_addr;
4560 BI tmp_postinc;
4561 tmp_postinc = FLD (f_memmode);
4562 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4563 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4564 if (EQBI (CPU (h_pbit), 0)) {
4567 SI opval = GET_H_SR (FLD (f_operand2));
4568 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4569 written |= (1 << 13);
4570 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4573 BI opval = CPU (h_pbit);
4574 CPU (h_cbit) = opval;
4575 written |= (1 << 10);
4576 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4579 } else {
4581 BI opval = 1;
4582 CPU (h_cbit) = opval;
4583 written |= (1 << 10);
4584 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4587 } else {
4589 SI opval = GET_H_SR (FLD (f_operand2));
4590 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4591 written |= (1 << 13);
4592 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4595 if (NEBI (tmp_postinc, 0)) {
4597 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4598 tmp_addr = ADDSI (tmp_addr, 4);
4601 SI opval = tmp_addr;
4602 SET_H_GR (FLD (f_operand1), opval);
4603 written |= (1 << 9);
4604 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4610 else {
4611 cgen_rtx_error (current_cpu, "write from unimplemented special register");
4615 BI opval = 0;
4616 CPU (h_xbit) = opval;
4617 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4620 BI opval = 0;
4621 SET_H_INSN_PREFIXED_P (opval);
4622 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4627 abuf->written = written;
4628 #undef FLD
4630 NEXT (vpc);
4632 CASE (sem, INSN_SBFS) : /* sbfs [${Rd-sfield}${inc}] */
4634 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4635 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4636 #define FLD(f) abuf->fields.fmt_empty.f
4637 int UNUSED written = 0;
4638 IADDR UNUSED pc = abuf->addr;
4639 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4641 cgen_rtx_error (current_cpu, "SBFS isn't implemented");
4643 #undef FLD
4645 NEXT (vpc);
4647 CASE (sem, INSN_MOVEM_R_M) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4649 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4650 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4651 #define FLD(f) abuf->fields.sfmt_movem_r_m.f
4652 int UNUSED written = 0;
4653 IADDR UNUSED pc = abuf->addr;
4654 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4657 SI tmp_addr;
4658 BI tmp_postinc;
4659 tmp_postinc = FLD (f_memmode);
4661 SI tmp_dummy;
4662 tmp_dummy = GET_H_GR (FLD (f_operand2));
4664 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4666 if (GESI (FLD (f_operand2), 15)) {
4668 SI tmp_tmp;
4669 tmp_tmp = GET_H_GR (((UINT) 15));
4671 SI opval = tmp_tmp;
4672 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4673 written |= (1 << 23);
4674 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4676 tmp_addr = ADDSI (tmp_addr, 4);
4679 if (GESI (FLD (f_operand2), 14)) {
4681 SI tmp_tmp;
4682 tmp_tmp = GET_H_GR (((UINT) 14));
4684 SI opval = tmp_tmp;
4685 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4686 written |= (1 << 23);
4687 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4689 tmp_addr = ADDSI (tmp_addr, 4);
4692 if (GESI (FLD (f_operand2), 13)) {
4694 SI tmp_tmp;
4695 tmp_tmp = GET_H_GR (((UINT) 13));
4697 SI opval = tmp_tmp;
4698 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4699 written |= (1 << 23);
4700 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4702 tmp_addr = ADDSI (tmp_addr, 4);
4705 if (GESI (FLD (f_operand2), 12)) {
4707 SI tmp_tmp;
4708 tmp_tmp = GET_H_GR (((UINT) 12));
4710 SI opval = tmp_tmp;
4711 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4712 written |= (1 << 23);
4713 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4715 tmp_addr = ADDSI (tmp_addr, 4);
4718 if (GESI (FLD (f_operand2), 11)) {
4720 SI tmp_tmp;
4721 tmp_tmp = GET_H_GR (((UINT) 11));
4723 SI opval = tmp_tmp;
4724 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4725 written |= (1 << 23);
4726 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4728 tmp_addr = ADDSI (tmp_addr, 4);
4731 if (GESI (FLD (f_operand2), 10)) {
4733 SI tmp_tmp;
4734 tmp_tmp = GET_H_GR (((UINT) 10));
4736 SI opval = tmp_tmp;
4737 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4738 written |= (1 << 23);
4739 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4741 tmp_addr = ADDSI (tmp_addr, 4);
4744 if (GESI (FLD (f_operand2), 9)) {
4746 SI tmp_tmp;
4747 tmp_tmp = GET_H_GR (((UINT) 9));
4749 SI opval = tmp_tmp;
4750 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4751 written |= (1 << 23);
4752 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4754 tmp_addr = ADDSI (tmp_addr, 4);
4757 if (GESI (FLD (f_operand2), 8)) {
4759 SI tmp_tmp;
4760 tmp_tmp = GET_H_GR (((UINT) 8));
4762 SI opval = tmp_tmp;
4763 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4764 written |= (1 << 23);
4765 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4767 tmp_addr = ADDSI (tmp_addr, 4);
4770 if (GESI (FLD (f_operand2), 7)) {
4772 SI tmp_tmp;
4773 tmp_tmp = GET_H_GR (((UINT) 7));
4775 SI opval = tmp_tmp;
4776 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4777 written |= (1 << 23);
4778 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4780 tmp_addr = ADDSI (tmp_addr, 4);
4783 if (GESI (FLD (f_operand2), 6)) {
4785 SI tmp_tmp;
4786 tmp_tmp = GET_H_GR (((UINT) 6));
4788 SI opval = tmp_tmp;
4789 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4790 written |= (1 << 23);
4791 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4793 tmp_addr = ADDSI (tmp_addr, 4);
4796 if (GESI (FLD (f_operand2), 5)) {
4798 SI tmp_tmp;
4799 tmp_tmp = GET_H_GR (((UINT) 5));
4801 SI opval = tmp_tmp;
4802 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4803 written |= (1 << 23);
4804 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4806 tmp_addr = ADDSI (tmp_addr, 4);
4809 if (GESI (FLD (f_operand2), 4)) {
4811 SI tmp_tmp;
4812 tmp_tmp = GET_H_GR (((UINT) 4));
4814 SI opval = tmp_tmp;
4815 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4816 written |= (1 << 23);
4817 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4819 tmp_addr = ADDSI (tmp_addr, 4);
4822 if (GESI (FLD (f_operand2), 3)) {
4824 SI tmp_tmp;
4825 tmp_tmp = GET_H_GR (((UINT) 3));
4827 SI opval = tmp_tmp;
4828 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4829 written |= (1 << 23);
4830 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4832 tmp_addr = ADDSI (tmp_addr, 4);
4835 if (GESI (FLD (f_operand2), 2)) {
4837 SI tmp_tmp;
4838 tmp_tmp = GET_H_GR (((UINT) 2));
4840 SI opval = tmp_tmp;
4841 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4842 written |= (1 << 23);
4843 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4845 tmp_addr = ADDSI (tmp_addr, 4);
4848 if (GESI (FLD (f_operand2), 1)) {
4850 SI tmp_tmp;
4851 tmp_tmp = GET_H_GR (((UINT) 1));
4853 SI opval = tmp_tmp;
4854 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4855 written |= (1 << 23);
4856 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4858 tmp_addr = ADDSI (tmp_addr, 4);
4861 if (GESI (FLD (f_operand2), 0)) {
4863 SI tmp_tmp;
4864 tmp_tmp = GET_H_GR (((UINT) 0));
4866 SI opval = tmp_tmp;
4867 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4868 written |= (1 << 23);
4869 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4871 tmp_addr = ADDSI (tmp_addr, 4);
4875 if (NEBI (tmp_postinc, 0)) {
4877 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
4878 SET_H_GR (FLD (f_operand1), opval);
4879 written |= (1 << 22);
4880 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4885 BI opval = 0;
4886 CPU (h_xbit) = opval;
4887 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4890 BI opval = 0;
4891 SET_H_INSN_PREFIXED_P (opval);
4892 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4897 abuf->written = written;
4898 #undef FLD
4900 NEXT (vpc);
4902 CASE (sem, INSN_MOVEM_M_R) : /* movem [${Rs}${inc}],${Rd} */
4904 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4905 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4906 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
4907 int UNUSED written = 0;
4908 IADDR UNUSED pc = abuf->addr;
4909 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4912 SI tmp_addr;
4913 BI tmp_postinc;
4914 tmp_postinc = FLD (f_memmode);
4915 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4917 SI tmp_dummy;
4918 tmp_dummy = GET_H_GR (FLD (f_operand2));
4921 if (GESI (FLD (f_operand2), 14)) {
4923 SI tmp_tmp;
4924 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4926 SI opval = tmp_tmp;
4927 SET_H_GR (((UINT) 14), opval);
4928 written |= (1 << 14);
4929 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4931 tmp_addr = ADDSI (tmp_addr, 4);
4934 if (GESI (FLD (f_operand2), 13)) {
4936 SI tmp_tmp;
4937 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4939 SI opval = tmp_tmp;
4940 SET_H_GR (((UINT) 13), opval);
4941 written |= (1 << 13);
4942 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4944 tmp_addr = ADDSI (tmp_addr, 4);
4947 if (GESI (FLD (f_operand2), 12)) {
4949 SI tmp_tmp;
4950 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4952 SI opval = tmp_tmp;
4953 SET_H_GR (((UINT) 12), opval);
4954 written |= (1 << 12);
4955 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4957 tmp_addr = ADDSI (tmp_addr, 4);
4960 if (GESI (FLD (f_operand2), 11)) {
4962 SI tmp_tmp;
4963 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4965 SI opval = tmp_tmp;
4966 SET_H_GR (((UINT) 11), opval);
4967 written |= (1 << 11);
4968 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4970 tmp_addr = ADDSI (tmp_addr, 4);
4973 if (GESI (FLD (f_operand2), 10)) {
4975 SI tmp_tmp;
4976 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4978 SI opval = tmp_tmp;
4979 SET_H_GR (((UINT) 10), opval);
4980 written |= (1 << 10);
4981 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4983 tmp_addr = ADDSI (tmp_addr, 4);
4986 if (GESI (FLD (f_operand2), 9)) {
4988 SI tmp_tmp;
4989 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4991 SI opval = tmp_tmp;
4992 SET_H_GR (((UINT) 9), opval);
4993 written |= (1 << 22);
4994 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4996 tmp_addr = ADDSI (tmp_addr, 4);
4999 if (GESI (FLD (f_operand2), 8)) {
5001 SI tmp_tmp;
5002 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5004 SI opval = tmp_tmp;
5005 SET_H_GR (((UINT) 8), opval);
5006 written |= (1 << 21);
5007 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5009 tmp_addr = ADDSI (tmp_addr, 4);
5012 if (GESI (FLD (f_operand2), 7)) {
5014 SI tmp_tmp;
5015 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5017 SI opval = tmp_tmp;
5018 SET_H_GR (((UINT) 7), opval);
5019 written |= (1 << 20);
5020 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5022 tmp_addr = ADDSI (tmp_addr, 4);
5025 if (GESI (FLD (f_operand2), 6)) {
5027 SI tmp_tmp;
5028 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5030 SI opval = tmp_tmp;
5031 SET_H_GR (((UINT) 6), opval);
5032 written |= (1 << 19);
5033 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5035 tmp_addr = ADDSI (tmp_addr, 4);
5038 if (GESI (FLD (f_operand2), 5)) {
5040 SI tmp_tmp;
5041 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5043 SI opval = tmp_tmp;
5044 SET_H_GR (((UINT) 5), opval);
5045 written |= (1 << 18);
5046 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5048 tmp_addr = ADDSI (tmp_addr, 4);
5051 if (GESI (FLD (f_operand2), 4)) {
5053 SI tmp_tmp;
5054 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5056 SI opval = tmp_tmp;
5057 SET_H_GR (((UINT) 4), opval);
5058 written |= (1 << 17);
5059 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5061 tmp_addr = ADDSI (tmp_addr, 4);
5064 if (GESI (FLD (f_operand2), 3)) {
5066 SI tmp_tmp;
5067 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5069 SI opval = tmp_tmp;
5070 SET_H_GR (((UINT) 3), opval);
5071 written |= (1 << 16);
5072 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5074 tmp_addr = ADDSI (tmp_addr, 4);
5077 if (GESI (FLD (f_operand2), 2)) {
5079 SI tmp_tmp;
5080 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5082 SI opval = tmp_tmp;
5083 SET_H_GR (((UINT) 2), opval);
5084 written |= (1 << 15);
5085 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5087 tmp_addr = ADDSI (tmp_addr, 4);
5090 if (GESI (FLD (f_operand2), 1)) {
5092 SI tmp_tmp;
5093 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5095 SI opval = tmp_tmp;
5096 SET_H_GR (((UINT) 1), opval);
5097 written |= (1 << 9);
5098 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5100 tmp_addr = ADDSI (tmp_addr, 4);
5103 if (GESI (FLD (f_operand2), 0)) {
5105 SI tmp_tmp;
5106 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5108 SI opval = tmp_tmp;
5109 SET_H_GR (((UINT) 0), opval);
5110 written |= (1 << 8);
5111 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5113 tmp_addr = ADDSI (tmp_addr, 4);
5117 if (NEBI (tmp_postinc, 0)) {
5119 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
5120 SET_H_GR (FLD (f_operand1), opval);
5121 written |= (1 << 7);
5122 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5127 BI opval = 0;
5128 CPU (h_xbit) = opval;
5129 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5132 BI opval = 0;
5133 SET_H_INSN_PREFIXED_P (opval);
5134 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5139 abuf->written = written;
5140 #undef FLD
5142 NEXT (vpc);
5144 CASE (sem, INSN_MOVEM_M_PC) : /* movem [${Rs}${inc}],${Rd} */
5146 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5147 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5148 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
5149 int UNUSED written = 0;
5150 IADDR UNUSED pc = abuf->addr;
5151 SEM_BRANCH_INIT
5152 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5155 SI tmp_addr;
5156 BI tmp_postinc;
5157 tmp_postinc = FLD (f_memmode);
5158 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5161 USI opval = GETMEMSI (current_cpu, pc, tmp_addr);
5162 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
5163 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
5165 tmp_addr = ADDSI (tmp_addr, 4);
5167 SI tmp_tmp;
5168 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5170 SI opval = tmp_tmp;
5171 SET_H_GR (((UINT) 14), opval);
5172 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5174 tmp_addr = ADDSI (tmp_addr, 4);
5177 SI tmp_tmp;
5178 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5180 SI opval = tmp_tmp;
5181 SET_H_GR (((UINT) 13), opval);
5182 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5184 tmp_addr = ADDSI (tmp_addr, 4);
5187 SI tmp_tmp;
5188 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5190 SI opval = tmp_tmp;
5191 SET_H_GR (((UINT) 12), opval);
5192 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5194 tmp_addr = ADDSI (tmp_addr, 4);
5197 SI tmp_tmp;
5198 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5200 SI opval = tmp_tmp;
5201 SET_H_GR (((UINT) 11), opval);
5202 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5204 tmp_addr = ADDSI (tmp_addr, 4);
5207 SI tmp_tmp;
5208 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5210 SI opval = tmp_tmp;
5211 SET_H_GR (((UINT) 10), opval);
5212 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5214 tmp_addr = ADDSI (tmp_addr, 4);
5217 SI tmp_tmp;
5218 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5220 SI opval = tmp_tmp;
5221 SET_H_GR (((UINT) 9), opval);
5222 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5224 tmp_addr = ADDSI (tmp_addr, 4);
5227 SI tmp_tmp;
5228 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5230 SI opval = tmp_tmp;
5231 SET_H_GR (((UINT) 8), opval);
5232 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5234 tmp_addr = ADDSI (tmp_addr, 4);
5237 SI tmp_tmp;
5238 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5240 SI opval = tmp_tmp;
5241 SET_H_GR (((UINT) 7), opval);
5242 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5244 tmp_addr = ADDSI (tmp_addr, 4);
5247 SI tmp_tmp;
5248 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5250 SI opval = tmp_tmp;
5251 SET_H_GR (((UINT) 6), opval);
5252 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5254 tmp_addr = ADDSI (tmp_addr, 4);
5257 SI tmp_tmp;
5258 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5260 SI opval = tmp_tmp;
5261 SET_H_GR (((UINT) 5), opval);
5262 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5264 tmp_addr = ADDSI (tmp_addr, 4);
5267 SI tmp_tmp;
5268 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5270 SI opval = tmp_tmp;
5271 SET_H_GR (((UINT) 4), opval);
5272 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5274 tmp_addr = ADDSI (tmp_addr, 4);
5277 SI tmp_tmp;
5278 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5280 SI opval = tmp_tmp;
5281 SET_H_GR (((UINT) 3), opval);
5282 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5284 tmp_addr = ADDSI (tmp_addr, 4);
5287 SI tmp_tmp;
5288 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5290 SI opval = tmp_tmp;
5291 SET_H_GR (((UINT) 2), opval);
5292 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5294 tmp_addr = ADDSI (tmp_addr, 4);
5297 SI tmp_tmp;
5298 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5300 SI opval = tmp_tmp;
5301 SET_H_GR (((UINT) 1), opval);
5302 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5304 tmp_addr = ADDSI (tmp_addr, 4);
5307 SI tmp_tmp;
5308 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5310 SI opval = tmp_tmp;
5311 SET_H_GR (((UINT) 0), opval);
5312 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5314 tmp_addr = ADDSI (tmp_addr, 4);
5317 if (NEBI (tmp_postinc, 0)) {
5319 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
5320 SET_H_GR (FLD (f_operand1), opval);
5321 written |= (1 << 5);
5322 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5327 BI opval = 0;
5328 CPU (h_xbit) = opval;
5329 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5332 BI opval = 0;
5333 SET_H_INSN_PREFIXED_P (opval);
5334 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5339 abuf->written = written;
5340 SEM_BRANCH_FINI (vpc);
5341 #undef FLD
5343 NEXT (vpc);
5345 CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
5347 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5348 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5349 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5350 int UNUSED written = 0;
5351 IADDR UNUSED pc = abuf->addr;
5352 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5355 QI tmp_tmpopd;
5356 QI tmp_tmpops;
5357 BI tmp_carry;
5358 QI tmp_newval;
5359 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5360 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5361 tmp_carry = CPU (h_cbit);
5362 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5364 SI tmp_oldregval;
5365 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5367 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5368 SET_H_GR (FLD (f_operand2), opval);
5369 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5374 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))));
5375 CPU (h_cbit) = opval;
5376 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5379 BI opval = LTQI (tmp_newval, 0);
5380 CPU (h_nbit) = opval;
5381 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5384 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5385 CPU (h_zbit) = opval;
5386 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5389 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)));
5390 CPU (h_vbit) = opval;
5391 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5395 BI opval = 0;
5396 CPU (h_xbit) = opval;
5397 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5400 BI opval = 0;
5401 SET_H_INSN_PREFIXED_P (opval);
5402 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5408 #undef FLD
5410 NEXT (vpc);
5412 CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
5414 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5415 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5416 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5417 int UNUSED written = 0;
5418 IADDR UNUSED pc = abuf->addr;
5419 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5422 HI tmp_tmpopd;
5423 HI tmp_tmpops;
5424 BI tmp_carry;
5425 HI tmp_newval;
5426 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5427 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5428 tmp_carry = CPU (h_cbit);
5429 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5431 SI tmp_oldregval;
5432 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5434 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5435 SET_H_GR (FLD (f_operand2), opval);
5436 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5441 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))));
5442 CPU (h_cbit) = opval;
5443 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5446 BI opval = LTHI (tmp_newval, 0);
5447 CPU (h_nbit) = opval;
5448 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5451 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5452 CPU (h_zbit) = opval;
5453 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5456 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)));
5457 CPU (h_vbit) = opval;
5458 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5462 BI opval = 0;
5463 CPU (h_xbit) = opval;
5464 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5467 BI opval = 0;
5468 SET_H_INSN_PREFIXED_P (opval);
5469 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5475 #undef FLD
5477 NEXT (vpc);
5479 CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
5481 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5482 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5483 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5484 int UNUSED written = 0;
5485 IADDR UNUSED pc = abuf->addr;
5486 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5489 SI tmp_tmpopd;
5490 SI tmp_tmpops;
5491 BI tmp_carry;
5492 SI tmp_newval;
5493 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5494 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5495 tmp_carry = CPU (h_cbit);
5496 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5498 SI opval = tmp_newval;
5499 SET_H_GR (FLD (f_operand2), opval);
5500 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5504 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))));
5505 CPU (h_cbit) = opval;
5506 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5509 BI opval = LTSI (tmp_newval, 0);
5510 CPU (h_nbit) = opval;
5511 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5514 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5515 CPU (h_zbit) = opval;
5516 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5519 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)));
5520 CPU (h_vbit) = opval;
5521 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5525 BI opval = 0;
5526 CPU (h_xbit) = opval;
5527 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5530 BI opval = 0;
5531 SET_H_INSN_PREFIXED_P (opval);
5532 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5538 #undef FLD
5540 NEXT (vpc);
5542 CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
5544 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5545 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5546 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5547 int UNUSED written = 0;
5548 IADDR UNUSED pc = abuf->addr;
5549 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5552 QI tmp_tmpopd;
5553 QI tmp_tmpops;
5554 BI tmp_carry;
5555 QI tmp_newval;
5556 tmp_tmpops = ({ SI tmp_addr;
5557 QI tmp_tmp_mem;
5558 BI tmp_postinc;
5559 tmp_postinc = FLD (f_memmode);
5560 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5561 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
5562 ; if (NEBI (tmp_postinc, 0)) {
5564 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5565 tmp_addr = ADDSI (tmp_addr, 1);
5568 SI opval = tmp_addr;
5569 SET_H_GR (FLD (f_operand1), opval);
5570 written |= (1 << 12);
5571 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5575 ; tmp_tmp_mem; });
5576 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5577 tmp_carry = CPU (h_cbit);
5578 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5580 SI tmp_oldregval;
5581 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5583 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5584 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5585 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5590 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))));
5591 CPU (h_cbit) = opval;
5592 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5595 BI opval = LTQI (tmp_newval, 0);
5596 CPU (h_nbit) = opval;
5597 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5600 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5601 CPU (h_zbit) = opval;
5602 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5605 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)));
5606 CPU (h_vbit) = opval;
5607 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5611 BI opval = 0;
5612 CPU (h_xbit) = opval;
5613 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5616 BI opval = 0;
5617 SET_H_INSN_PREFIXED_P (opval);
5618 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5624 abuf->written = written;
5625 #undef FLD
5627 NEXT (vpc);
5629 CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
5631 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5632 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5633 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5634 int UNUSED written = 0;
5635 IADDR UNUSED pc = abuf->addr;
5636 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5639 HI tmp_tmpopd;
5640 HI tmp_tmpops;
5641 BI tmp_carry;
5642 HI tmp_newval;
5643 tmp_tmpops = ({ SI tmp_addr;
5644 HI tmp_tmp_mem;
5645 BI tmp_postinc;
5646 tmp_postinc = FLD (f_memmode);
5647 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5648 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
5649 ; if (NEBI (tmp_postinc, 0)) {
5651 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5652 tmp_addr = ADDSI (tmp_addr, 2);
5655 SI opval = tmp_addr;
5656 SET_H_GR (FLD (f_operand1), opval);
5657 written |= (1 << 12);
5658 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5662 ; tmp_tmp_mem; });
5663 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5664 tmp_carry = CPU (h_cbit);
5665 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5667 SI tmp_oldregval;
5668 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5670 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5671 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5672 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5677 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))));
5678 CPU (h_cbit) = opval;
5679 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5682 BI opval = LTHI (tmp_newval, 0);
5683 CPU (h_nbit) = opval;
5684 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5687 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5688 CPU (h_zbit) = opval;
5689 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5692 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)));
5693 CPU (h_vbit) = opval;
5694 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5698 BI opval = 0;
5699 CPU (h_xbit) = opval;
5700 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5703 BI opval = 0;
5704 SET_H_INSN_PREFIXED_P (opval);
5705 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5711 abuf->written = written;
5712 #undef FLD
5714 NEXT (vpc);
5716 CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
5718 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5719 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5720 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5721 int UNUSED written = 0;
5722 IADDR UNUSED pc = abuf->addr;
5723 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5726 SI tmp_tmpopd;
5727 SI tmp_tmpops;
5728 BI tmp_carry;
5729 SI tmp_newval;
5730 tmp_tmpops = ({ SI tmp_addr;
5731 SI tmp_tmp_mem;
5732 BI tmp_postinc;
5733 tmp_postinc = FLD (f_memmode);
5734 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5735 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
5736 ; if (NEBI (tmp_postinc, 0)) {
5738 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5739 tmp_addr = ADDSI (tmp_addr, 4);
5742 SI opval = tmp_addr;
5743 SET_H_GR (FLD (f_operand1), opval);
5744 written |= (1 << 11);
5745 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5749 ; tmp_tmp_mem; });
5750 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5751 tmp_carry = CPU (h_cbit);
5752 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5754 SI opval = tmp_newval;
5755 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5756 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5760 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))));
5761 CPU (h_cbit) = opval;
5762 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5765 BI opval = LTSI (tmp_newval, 0);
5766 CPU (h_nbit) = opval;
5767 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5770 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5771 CPU (h_zbit) = opval;
5772 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5775 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)));
5776 CPU (h_vbit) = opval;
5777 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5781 BI opval = 0;
5782 CPU (h_xbit) = opval;
5783 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5786 BI opval = 0;
5787 SET_H_INSN_PREFIXED_P (opval);
5788 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5794 abuf->written = written;
5795 #undef FLD
5797 NEXT (vpc);
5799 CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
5801 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5802 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5803 #define FLD(f) abuf->fields.sfmt_addcbr.f
5804 int UNUSED written = 0;
5805 IADDR UNUSED pc = abuf->addr;
5806 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5809 QI tmp_tmpopd;
5810 QI tmp_tmpops;
5811 BI tmp_carry;
5812 QI tmp_newval;
5813 tmp_tmpops = FLD (f_indir_pc__byte);
5814 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5815 tmp_carry = CPU (h_cbit);
5816 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5818 SI tmp_oldregval;
5819 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5821 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5822 SET_H_GR (FLD (f_operand2), opval);
5823 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5828 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))));
5829 CPU (h_cbit) = opval;
5830 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5833 BI opval = LTQI (tmp_newval, 0);
5834 CPU (h_nbit) = opval;
5835 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5838 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5839 CPU (h_zbit) = opval;
5840 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5843 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)));
5844 CPU (h_vbit) = opval;
5845 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5849 BI opval = 0;
5850 CPU (h_xbit) = opval;
5851 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5854 BI opval = 0;
5855 SET_H_INSN_PREFIXED_P (opval);
5856 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5862 #undef FLD
5864 NEXT (vpc);
5866 CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
5868 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5869 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5870 #define FLD(f) abuf->fields.sfmt_addcwr.f
5871 int UNUSED written = 0;
5872 IADDR UNUSED pc = abuf->addr;
5873 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5876 HI tmp_tmpopd;
5877 HI tmp_tmpops;
5878 BI tmp_carry;
5879 HI tmp_newval;
5880 tmp_tmpops = FLD (f_indir_pc__word);
5881 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5882 tmp_carry = CPU (h_cbit);
5883 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5885 SI tmp_oldregval;
5886 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5888 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5889 SET_H_GR (FLD (f_operand2), opval);
5890 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5895 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))));
5896 CPU (h_cbit) = opval;
5897 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5900 BI opval = LTHI (tmp_newval, 0);
5901 CPU (h_nbit) = opval;
5902 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5905 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5906 CPU (h_zbit) = opval;
5907 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5910 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)));
5911 CPU (h_vbit) = opval;
5912 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5916 BI opval = 0;
5917 CPU (h_xbit) = opval;
5918 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5921 BI opval = 0;
5922 SET_H_INSN_PREFIXED_P (opval);
5923 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5929 #undef FLD
5931 NEXT (vpc);
5933 CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
5935 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5936 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5937 #define FLD(f) abuf->fields.sfmt_addcdr.f
5938 int UNUSED written = 0;
5939 IADDR UNUSED pc = abuf->addr;
5940 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
5943 SI tmp_tmpopd;
5944 SI tmp_tmpops;
5945 BI tmp_carry;
5946 SI tmp_newval;
5947 tmp_tmpops = FLD (f_indir_pc__dword);
5948 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5949 tmp_carry = CPU (h_cbit);
5950 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5952 SI opval = tmp_newval;
5953 SET_H_GR (FLD (f_operand2), opval);
5954 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5958 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))));
5959 CPU (h_cbit) = opval;
5960 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5963 BI opval = LTSI (tmp_newval, 0);
5964 CPU (h_nbit) = opval;
5965 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5968 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5969 CPU (h_zbit) = opval;
5970 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5973 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)));
5974 CPU (h_vbit) = opval;
5975 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5979 BI opval = 0;
5980 CPU (h_xbit) = opval;
5981 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5984 BI opval = 0;
5985 SET_H_INSN_PREFIXED_P (opval);
5986 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5992 #undef FLD
5994 NEXT (vpc);
5996 CASE (sem, INSN_ADDCPC) : /* add.d ${sconst32},PC */
5998 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5999 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6000 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
6001 int UNUSED written = 0;
6002 IADDR UNUSED pc = abuf->addr;
6003 SEM_BRANCH_INIT
6004 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
6007 SI tmp_newpc;
6008 SI tmp_oldpc;
6009 SI tmp_offs;
6010 tmp_offs = FLD (f_indir_pc__dword);
6011 tmp_oldpc = ADDSI (pc, 6);
6012 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
6014 USI opval = tmp_newpc;
6015 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
6016 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6020 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))));
6021 CPU (h_cbit) = opval;
6022 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6025 BI opval = LTSI (tmp_newpc, 0);
6026 CPU (h_nbit) = opval;
6027 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6030 BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6031 CPU (h_zbit) = opval;
6032 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6035 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)));
6036 CPU (h_vbit) = opval;
6037 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6041 BI opval = 0;
6042 CPU (h_xbit) = opval;
6043 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6046 BI opval = 0;
6047 SET_H_INSN_PREFIXED_P (opval);
6048 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6054 SEM_BRANCH_FINI (vpc);
6055 #undef FLD
6057 NEXT (vpc);
6059 CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
6061 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6062 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6063 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6064 int UNUSED written = 0;
6065 IADDR UNUSED pc = abuf->addr;
6066 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6069 SI tmp_tmpopd;
6070 SI tmp_tmpops;
6071 BI tmp_carry;
6072 SI tmp_newval;
6073 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6074 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6075 tmp_carry = CPU (h_cbit);
6076 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6078 SI opval = tmp_newval;
6079 SET_H_GR (FLD (f_operand2), opval);
6080 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6084 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))));
6085 CPU (h_cbit) = opval;
6086 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6089 BI opval = LTSI (tmp_newval, 0);
6090 CPU (h_nbit) = opval;
6091 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6094 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6095 CPU (h_zbit) = opval;
6096 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6099 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)));
6100 CPU (h_vbit) = opval;
6101 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6105 BI opval = 0;
6106 CPU (h_xbit) = opval;
6107 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6110 BI opval = 0;
6111 SET_H_INSN_PREFIXED_P (opval);
6112 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6118 #undef FLD
6120 NEXT (vpc);
6122 CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
6124 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6125 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6126 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6127 int UNUSED written = 0;
6128 IADDR UNUSED pc = abuf->addr;
6129 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6132 SI tmp_tmpopd;
6133 SI tmp_tmpops;
6134 BI tmp_carry;
6135 SI tmp_newval;
6136 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6137 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6138 tmp_carry = CPU (h_cbit);
6139 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6141 SI opval = tmp_newval;
6142 SET_H_GR (FLD (f_operand2), opval);
6143 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6147 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))));
6148 CPU (h_cbit) = opval;
6149 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6152 BI opval = LTSI (tmp_newval, 0);
6153 CPU (h_nbit) = opval;
6154 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6157 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6158 CPU (h_zbit) = opval;
6159 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6162 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)));
6163 CPU (h_vbit) = opval;
6164 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6168 BI opval = 0;
6169 CPU (h_xbit) = opval;
6170 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6173 BI opval = 0;
6174 SET_H_INSN_PREFIXED_P (opval);
6175 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6181 #undef FLD
6183 NEXT (vpc);
6185 CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
6187 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6188 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6189 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6190 int UNUSED written = 0;
6191 IADDR UNUSED pc = abuf->addr;
6192 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6195 SI tmp_tmpopd;
6196 SI tmp_tmpops;
6197 BI tmp_carry;
6198 SI tmp_newval;
6199 tmp_tmpops = EXTQISI (({ SI tmp_addr;
6200 QI tmp_tmp_mem;
6201 BI tmp_postinc;
6202 tmp_postinc = FLD (f_memmode);
6203 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6204 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6205 ; if (NEBI (tmp_postinc, 0)) {
6207 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6208 tmp_addr = ADDSI (tmp_addr, 1);
6211 SI opval = tmp_addr;
6212 SET_H_GR (FLD (f_operand1), opval);
6213 written |= (1 << 11);
6214 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6218 ; tmp_tmp_mem; }));
6219 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6220 tmp_carry = CPU (h_cbit);
6221 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6223 SI opval = tmp_newval;
6224 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6225 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6229 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))));
6230 CPU (h_cbit) = opval;
6231 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6234 BI opval = LTSI (tmp_newval, 0);
6235 CPU (h_nbit) = opval;
6236 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6239 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6240 CPU (h_zbit) = opval;
6241 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6244 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)));
6245 CPU (h_vbit) = opval;
6246 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6250 BI opval = 0;
6251 CPU (h_xbit) = opval;
6252 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6255 BI opval = 0;
6256 SET_H_INSN_PREFIXED_P (opval);
6257 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6263 abuf->written = written;
6264 #undef FLD
6266 NEXT (vpc);
6268 CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
6270 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6271 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6272 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6273 int UNUSED written = 0;
6274 IADDR UNUSED pc = abuf->addr;
6275 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6278 SI tmp_tmpopd;
6279 SI tmp_tmpops;
6280 BI tmp_carry;
6281 SI tmp_newval;
6282 tmp_tmpops = EXTHISI (({ SI tmp_addr;
6283 HI tmp_tmp_mem;
6284 BI tmp_postinc;
6285 tmp_postinc = FLD (f_memmode);
6286 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6287 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6288 ; if (NEBI (tmp_postinc, 0)) {
6290 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6291 tmp_addr = ADDSI (tmp_addr, 2);
6294 SI opval = tmp_addr;
6295 SET_H_GR (FLD (f_operand1), opval);
6296 written |= (1 << 11);
6297 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6301 ; tmp_tmp_mem; }));
6302 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6303 tmp_carry = CPU (h_cbit);
6304 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6306 SI opval = tmp_newval;
6307 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6308 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6312 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))));
6313 CPU (h_cbit) = opval;
6314 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6317 BI opval = LTSI (tmp_newval, 0);
6318 CPU (h_nbit) = opval;
6319 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6322 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6323 CPU (h_zbit) = opval;
6324 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6327 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)));
6328 CPU (h_vbit) = opval;
6329 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6333 BI opval = 0;
6334 CPU (h_xbit) = opval;
6335 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6338 BI opval = 0;
6339 SET_H_INSN_PREFIXED_P (opval);
6340 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6346 abuf->written = written;
6347 #undef FLD
6349 NEXT (vpc);
6351 CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
6353 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6354 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6355 #define FLD(f) abuf->fields.sfmt_addcbr.f
6356 int UNUSED written = 0;
6357 IADDR UNUSED pc = abuf->addr;
6358 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6361 SI tmp_tmpopd;
6362 SI tmp_tmpops;
6363 BI tmp_carry;
6364 SI tmp_newval;
6365 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6366 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6367 tmp_carry = CPU (h_cbit);
6368 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6370 SI opval = tmp_newval;
6371 SET_H_GR (FLD (f_operand2), opval);
6372 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6376 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))));
6377 CPU (h_cbit) = opval;
6378 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6381 BI opval = LTSI (tmp_newval, 0);
6382 CPU (h_nbit) = opval;
6383 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6386 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6387 CPU (h_zbit) = opval;
6388 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6391 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)));
6392 CPU (h_vbit) = opval;
6393 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6397 BI opval = 0;
6398 CPU (h_xbit) = opval;
6399 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6402 BI opval = 0;
6403 SET_H_INSN_PREFIXED_P (opval);
6404 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6410 #undef FLD
6412 NEXT (vpc);
6414 CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
6416 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6417 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6418 #define FLD(f) abuf->fields.sfmt_addcwr.f
6419 int UNUSED written = 0;
6420 IADDR UNUSED pc = abuf->addr;
6421 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6424 SI tmp_tmpopd;
6425 SI tmp_tmpops;
6426 BI tmp_carry;
6427 SI tmp_newval;
6428 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6429 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6430 tmp_carry = CPU (h_cbit);
6431 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6433 SI opval = tmp_newval;
6434 SET_H_GR (FLD (f_operand2), opval);
6435 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6439 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))));
6440 CPU (h_cbit) = opval;
6441 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6444 BI opval = LTSI (tmp_newval, 0);
6445 CPU (h_nbit) = opval;
6446 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6449 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6450 CPU (h_zbit) = opval;
6451 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6454 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)));
6455 CPU (h_vbit) = opval;
6456 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6460 BI opval = 0;
6461 CPU (h_xbit) = opval;
6462 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6465 BI opval = 0;
6466 SET_H_INSN_PREFIXED_P (opval);
6467 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6473 #undef FLD
6475 NEXT (vpc);
6477 CASE (sem, INSN_ADDSPCPC) : /* adds.w [PC],PC */
6479 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6480 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6481 #define FLD(f) abuf->fields.fmt_empty.f
6482 int UNUSED written = 0;
6483 IADDR UNUSED pc = abuf->addr;
6484 SEM_BRANCH_INIT
6485 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6488 SI tmp_newpc;
6489 SI tmp_oldpc;
6490 HI tmp_offs;
6491 if (NOTBI (GET_H_INSN_PREFIXED_P ())) {
6492 cgen_rtx_error (current_cpu, "Unexpected adds.w [PC],PC without prefix");
6494 tmp_offs = GETMEMHI (current_cpu, pc, CPU (h_prefixreg_pre_v32));
6495 tmp_oldpc = ADDSI (pc, 2);
6496 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
6498 USI opval = tmp_newpc;
6499 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
6500 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6504 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))));
6505 CPU (h_cbit) = opval;
6506 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6509 BI opval = LTSI (tmp_newpc, 0);
6510 CPU (h_nbit) = opval;
6511 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6514 BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6515 CPU (h_zbit) = opval;
6516 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6519 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)));
6520 CPU (h_vbit) = opval;
6521 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6525 BI opval = 0;
6526 CPU (h_xbit) = opval;
6527 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6530 BI opval = 0;
6531 SET_H_INSN_PREFIXED_P (opval);
6532 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6538 SEM_BRANCH_FINI (vpc);
6539 #undef FLD
6541 NEXT (vpc);
6543 CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
6545 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6546 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6547 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6548 int UNUSED written = 0;
6549 IADDR UNUSED pc = abuf->addr;
6550 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6553 SI tmp_tmpopd;
6554 SI tmp_tmpops;
6555 BI tmp_carry;
6556 SI tmp_newval;
6557 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6558 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6559 tmp_carry = CPU (h_cbit);
6560 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6562 SI opval = tmp_newval;
6563 SET_H_GR (FLD (f_operand2), opval);
6564 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6568 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))));
6569 CPU (h_cbit) = opval;
6570 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6573 BI opval = LTSI (tmp_newval, 0);
6574 CPU (h_nbit) = opval;
6575 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6578 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6579 CPU (h_zbit) = opval;
6580 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6583 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)));
6584 CPU (h_vbit) = opval;
6585 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6589 BI opval = 0;
6590 CPU (h_xbit) = opval;
6591 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6594 BI opval = 0;
6595 SET_H_INSN_PREFIXED_P (opval);
6596 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6602 #undef FLD
6604 NEXT (vpc);
6606 CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
6608 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6609 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6610 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6611 int UNUSED written = 0;
6612 IADDR UNUSED pc = abuf->addr;
6613 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6616 SI tmp_tmpopd;
6617 SI tmp_tmpops;
6618 BI tmp_carry;
6619 SI tmp_newval;
6620 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6621 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6622 tmp_carry = CPU (h_cbit);
6623 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6625 SI opval = tmp_newval;
6626 SET_H_GR (FLD (f_operand2), opval);
6627 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6631 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))));
6632 CPU (h_cbit) = opval;
6633 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6636 BI opval = LTSI (tmp_newval, 0);
6637 CPU (h_nbit) = opval;
6638 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6641 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6642 CPU (h_zbit) = opval;
6643 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6646 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)));
6647 CPU (h_vbit) = opval;
6648 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6652 BI opval = 0;
6653 CPU (h_xbit) = opval;
6654 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6657 BI opval = 0;
6658 SET_H_INSN_PREFIXED_P (opval);
6659 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6665 #undef FLD
6667 NEXT (vpc);
6669 CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
6671 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6672 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6673 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6674 int UNUSED written = 0;
6675 IADDR UNUSED pc = abuf->addr;
6676 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6679 SI tmp_tmpopd;
6680 SI tmp_tmpops;
6681 BI tmp_carry;
6682 SI tmp_newval;
6683 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
6684 QI tmp_tmp_mem;
6685 BI tmp_postinc;
6686 tmp_postinc = FLD (f_memmode);
6687 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6688 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6689 ; if (NEBI (tmp_postinc, 0)) {
6691 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6692 tmp_addr = ADDSI (tmp_addr, 1);
6695 SI opval = tmp_addr;
6696 SET_H_GR (FLD (f_operand1), opval);
6697 written |= (1 << 11);
6698 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6702 ; tmp_tmp_mem; }));
6703 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6704 tmp_carry = CPU (h_cbit);
6705 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6707 SI opval = tmp_newval;
6708 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6709 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6713 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))));
6714 CPU (h_cbit) = opval;
6715 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6718 BI opval = LTSI (tmp_newval, 0);
6719 CPU (h_nbit) = opval;
6720 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6723 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6724 CPU (h_zbit) = opval;
6725 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6728 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)));
6729 CPU (h_vbit) = opval;
6730 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6734 BI opval = 0;
6735 CPU (h_xbit) = opval;
6736 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6739 BI opval = 0;
6740 SET_H_INSN_PREFIXED_P (opval);
6741 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6747 abuf->written = written;
6748 #undef FLD
6750 NEXT (vpc);
6752 CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
6754 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6755 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6756 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6757 int UNUSED written = 0;
6758 IADDR UNUSED pc = abuf->addr;
6759 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6762 SI tmp_tmpopd;
6763 SI tmp_tmpops;
6764 BI tmp_carry;
6765 SI tmp_newval;
6766 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
6767 HI tmp_tmp_mem;
6768 BI tmp_postinc;
6769 tmp_postinc = FLD (f_memmode);
6770 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6771 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6772 ; if (NEBI (tmp_postinc, 0)) {
6774 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6775 tmp_addr = ADDSI (tmp_addr, 2);
6778 SI opval = tmp_addr;
6779 SET_H_GR (FLD (f_operand1), opval);
6780 written |= (1 << 11);
6781 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6785 ; tmp_tmp_mem; }));
6786 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6787 tmp_carry = CPU (h_cbit);
6788 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6790 SI opval = tmp_newval;
6791 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6792 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6796 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))));
6797 CPU (h_cbit) = opval;
6798 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6801 BI opval = LTSI (tmp_newval, 0);
6802 CPU (h_nbit) = opval;
6803 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6806 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6807 CPU (h_zbit) = opval;
6808 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6811 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)));
6812 CPU (h_vbit) = opval;
6813 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6817 BI opval = 0;
6818 CPU (h_xbit) = opval;
6819 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6822 BI opval = 0;
6823 SET_H_INSN_PREFIXED_P (opval);
6824 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6830 abuf->written = written;
6831 #undef FLD
6833 NEXT (vpc);
6835 CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
6837 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6838 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6839 #define FLD(f) abuf->fields.sfmt_addcbr.f
6840 int UNUSED written = 0;
6841 IADDR UNUSED pc = abuf->addr;
6842 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6845 SI tmp_tmpopd;
6846 SI tmp_tmpops;
6847 BI tmp_carry;
6848 SI tmp_newval;
6849 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6850 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6851 tmp_carry = CPU (h_cbit);
6852 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6854 SI opval = tmp_newval;
6855 SET_H_GR (FLD (f_operand2), opval);
6856 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6860 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))));
6861 CPU (h_cbit) = opval;
6862 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6865 BI opval = LTSI (tmp_newval, 0);
6866 CPU (h_nbit) = opval;
6867 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6870 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6871 CPU (h_zbit) = opval;
6872 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6875 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)));
6876 CPU (h_vbit) = opval;
6877 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6881 BI opval = 0;
6882 CPU (h_xbit) = opval;
6883 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6886 BI opval = 0;
6887 SET_H_INSN_PREFIXED_P (opval);
6888 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6894 #undef FLD
6896 NEXT (vpc);
6898 CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
6900 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6901 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6902 #define FLD(f) abuf->fields.sfmt_addcwr.f
6903 int UNUSED written = 0;
6904 IADDR UNUSED pc = abuf->addr;
6905 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6908 SI tmp_tmpopd;
6909 SI tmp_tmpops;
6910 BI tmp_carry;
6911 SI tmp_newval;
6912 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6913 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6914 tmp_carry = CPU (h_cbit);
6915 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6917 SI opval = tmp_newval;
6918 SET_H_GR (FLD (f_operand2), opval);
6919 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6923 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))));
6924 CPU (h_cbit) = opval;
6925 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6928 BI opval = LTSI (tmp_newval, 0);
6929 CPU (h_nbit) = opval;
6930 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6933 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6934 CPU (h_zbit) = opval;
6935 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6938 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)));
6939 CPU (h_vbit) = opval;
6940 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6944 BI opval = 0;
6945 CPU (h_xbit) = opval;
6946 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6949 BI opval = 0;
6950 SET_H_INSN_PREFIXED_P (opval);
6951 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6957 #undef FLD
6959 NEXT (vpc);
6961 CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
6963 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6964 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6965 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6966 int UNUSED written = 0;
6967 IADDR UNUSED pc = abuf->addr;
6968 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6971 QI tmp_tmpopd;
6972 QI tmp_tmpops;
6973 BI tmp_carry;
6974 QI tmp_newval;
6975 tmp_tmpops = GET_H_GR (FLD (f_operand1));
6976 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6977 tmp_carry = CPU (h_cbit);
6978 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6980 SI tmp_oldregval;
6981 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
6983 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
6984 SET_H_GR (FLD (f_operand2), opval);
6985 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6990 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))));
6991 CPU (h_cbit) = opval;
6992 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6995 BI opval = LTQI (tmp_newval, 0);
6996 CPU (h_nbit) = opval;
6997 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7000 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7001 CPU (h_zbit) = opval;
7002 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7005 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)));
7006 CPU (h_vbit) = opval;
7007 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7011 BI opval = 0;
7012 CPU (h_xbit) = opval;
7013 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7016 BI opval = 0;
7017 SET_H_INSN_PREFIXED_P (opval);
7018 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7024 #undef FLD
7026 NEXT (vpc);
7028 CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
7030 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7031 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7032 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7033 int UNUSED written = 0;
7034 IADDR UNUSED pc = abuf->addr;
7035 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7038 HI tmp_tmpopd;
7039 HI tmp_tmpops;
7040 BI tmp_carry;
7041 HI tmp_newval;
7042 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7043 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7044 tmp_carry = CPU (h_cbit);
7045 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7047 SI tmp_oldregval;
7048 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7050 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7051 SET_H_GR (FLD (f_operand2), opval);
7052 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7057 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))));
7058 CPU (h_cbit) = opval;
7059 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7062 BI opval = LTHI (tmp_newval, 0);
7063 CPU (h_nbit) = opval;
7064 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7067 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7068 CPU (h_zbit) = opval;
7069 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7072 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)));
7073 CPU (h_vbit) = opval;
7074 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7078 BI opval = 0;
7079 CPU (h_xbit) = opval;
7080 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7083 BI opval = 0;
7084 SET_H_INSN_PREFIXED_P (opval);
7085 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7091 #undef FLD
7093 NEXT (vpc);
7095 CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
7097 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7098 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7099 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7100 int UNUSED written = 0;
7101 IADDR UNUSED pc = abuf->addr;
7102 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7105 SI tmp_tmpopd;
7106 SI tmp_tmpops;
7107 BI tmp_carry;
7108 SI tmp_newval;
7109 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7110 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7111 tmp_carry = CPU (h_cbit);
7112 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7114 SI opval = tmp_newval;
7115 SET_H_GR (FLD (f_operand2), opval);
7116 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7120 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))));
7121 CPU (h_cbit) = opval;
7122 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7125 BI opval = LTSI (tmp_newval, 0);
7126 CPU (h_nbit) = opval;
7127 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7130 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7131 CPU (h_zbit) = opval;
7132 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7135 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)));
7136 CPU (h_vbit) = opval;
7137 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7141 BI opval = 0;
7142 CPU (h_xbit) = opval;
7143 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7146 BI opval = 0;
7147 SET_H_INSN_PREFIXED_P (opval);
7148 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7154 #undef FLD
7156 NEXT (vpc);
7158 CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
7160 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7161 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7162 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7163 int UNUSED written = 0;
7164 IADDR UNUSED pc = abuf->addr;
7165 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7168 QI tmp_tmpopd;
7169 QI tmp_tmpops;
7170 BI tmp_carry;
7171 QI tmp_newval;
7172 tmp_tmpops = ({ SI tmp_addr;
7173 QI tmp_tmp_mem;
7174 BI tmp_postinc;
7175 tmp_postinc = FLD (f_memmode);
7176 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7177 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7178 ; if (NEBI (tmp_postinc, 0)) {
7180 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7181 tmp_addr = ADDSI (tmp_addr, 1);
7184 SI opval = tmp_addr;
7185 SET_H_GR (FLD (f_operand1), opval);
7186 written |= (1 << 12);
7187 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7191 ; tmp_tmp_mem; });
7192 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7193 tmp_carry = CPU (h_cbit);
7194 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7196 SI tmp_oldregval;
7197 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7199 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7200 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7201 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7206 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))));
7207 CPU (h_cbit) = opval;
7208 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7211 BI opval = LTQI (tmp_newval, 0);
7212 CPU (h_nbit) = opval;
7213 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7216 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7217 CPU (h_zbit) = opval;
7218 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7221 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)));
7222 CPU (h_vbit) = opval;
7223 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7227 BI opval = 0;
7228 CPU (h_xbit) = opval;
7229 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7232 BI opval = 0;
7233 SET_H_INSN_PREFIXED_P (opval);
7234 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7240 abuf->written = written;
7241 #undef FLD
7243 NEXT (vpc);
7245 CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
7247 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7248 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7249 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7250 int UNUSED written = 0;
7251 IADDR UNUSED pc = abuf->addr;
7252 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7255 HI tmp_tmpopd;
7256 HI tmp_tmpops;
7257 BI tmp_carry;
7258 HI tmp_newval;
7259 tmp_tmpops = ({ SI tmp_addr;
7260 HI tmp_tmp_mem;
7261 BI tmp_postinc;
7262 tmp_postinc = FLD (f_memmode);
7263 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7264 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7265 ; if (NEBI (tmp_postinc, 0)) {
7267 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7268 tmp_addr = ADDSI (tmp_addr, 2);
7271 SI opval = tmp_addr;
7272 SET_H_GR (FLD (f_operand1), opval);
7273 written |= (1 << 12);
7274 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7278 ; tmp_tmp_mem; });
7279 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7280 tmp_carry = CPU (h_cbit);
7281 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7283 SI tmp_oldregval;
7284 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7286 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7287 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7288 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7293 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))));
7294 CPU (h_cbit) = opval;
7295 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7298 BI opval = LTHI (tmp_newval, 0);
7299 CPU (h_nbit) = opval;
7300 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7303 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7304 CPU (h_zbit) = opval;
7305 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7308 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)));
7309 CPU (h_vbit) = opval;
7310 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7314 BI opval = 0;
7315 CPU (h_xbit) = opval;
7316 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7319 BI opval = 0;
7320 SET_H_INSN_PREFIXED_P (opval);
7321 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7327 abuf->written = written;
7328 #undef FLD
7330 NEXT (vpc);
7332 CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
7334 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7335 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7336 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7337 int UNUSED written = 0;
7338 IADDR UNUSED pc = abuf->addr;
7339 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7342 SI tmp_tmpopd;
7343 SI tmp_tmpops;
7344 BI tmp_carry;
7345 SI tmp_newval;
7346 tmp_tmpops = ({ SI tmp_addr;
7347 SI tmp_tmp_mem;
7348 BI tmp_postinc;
7349 tmp_postinc = FLD (f_memmode);
7350 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7351 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
7352 ; if (NEBI (tmp_postinc, 0)) {
7354 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7355 tmp_addr = ADDSI (tmp_addr, 4);
7358 SI opval = tmp_addr;
7359 SET_H_GR (FLD (f_operand1), opval);
7360 written |= (1 << 11);
7361 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7365 ; tmp_tmp_mem; });
7366 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7367 tmp_carry = CPU (h_cbit);
7368 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7370 SI opval = tmp_newval;
7371 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7372 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7376 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))));
7377 CPU (h_cbit) = opval;
7378 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7381 BI opval = LTSI (tmp_newval, 0);
7382 CPU (h_nbit) = opval;
7383 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7386 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7387 CPU (h_zbit) = opval;
7388 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7391 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)));
7392 CPU (h_vbit) = opval;
7393 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7397 BI opval = 0;
7398 CPU (h_xbit) = opval;
7399 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7402 BI opval = 0;
7403 SET_H_INSN_PREFIXED_P (opval);
7404 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7410 abuf->written = written;
7411 #undef FLD
7413 NEXT (vpc);
7415 CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
7417 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7418 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7419 #define FLD(f) abuf->fields.sfmt_addcbr.f
7420 int UNUSED written = 0;
7421 IADDR UNUSED pc = abuf->addr;
7422 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7425 QI tmp_tmpopd;
7426 QI tmp_tmpops;
7427 BI tmp_carry;
7428 QI tmp_newval;
7429 tmp_tmpops = FLD (f_indir_pc__byte);
7430 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7431 tmp_carry = CPU (h_cbit);
7432 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7434 SI tmp_oldregval;
7435 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7437 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7438 SET_H_GR (FLD (f_operand2), opval);
7439 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7444 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))));
7445 CPU (h_cbit) = opval;
7446 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7449 BI opval = LTQI (tmp_newval, 0);
7450 CPU (h_nbit) = opval;
7451 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7454 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7455 CPU (h_zbit) = opval;
7456 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7459 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)));
7460 CPU (h_vbit) = opval;
7461 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7465 BI opval = 0;
7466 CPU (h_xbit) = opval;
7467 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7470 BI opval = 0;
7471 SET_H_INSN_PREFIXED_P (opval);
7472 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7478 #undef FLD
7480 NEXT (vpc);
7482 CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
7484 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7485 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7486 #define FLD(f) abuf->fields.sfmt_addcwr.f
7487 int UNUSED written = 0;
7488 IADDR UNUSED pc = abuf->addr;
7489 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7492 HI tmp_tmpopd;
7493 HI tmp_tmpops;
7494 BI tmp_carry;
7495 HI tmp_newval;
7496 tmp_tmpops = FLD (f_indir_pc__word);
7497 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7498 tmp_carry = CPU (h_cbit);
7499 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7501 SI tmp_oldregval;
7502 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7504 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7505 SET_H_GR (FLD (f_operand2), opval);
7506 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7511 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))));
7512 CPU (h_cbit) = opval;
7513 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7516 BI opval = LTHI (tmp_newval, 0);
7517 CPU (h_nbit) = opval;
7518 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7521 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7522 CPU (h_zbit) = opval;
7523 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7526 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)));
7527 CPU (h_vbit) = opval;
7528 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7532 BI opval = 0;
7533 CPU (h_xbit) = opval;
7534 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7537 BI opval = 0;
7538 SET_H_INSN_PREFIXED_P (opval);
7539 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7545 #undef FLD
7547 NEXT (vpc);
7549 CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
7551 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7552 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7553 #define FLD(f) abuf->fields.sfmt_addcdr.f
7554 int UNUSED written = 0;
7555 IADDR UNUSED pc = abuf->addr;
7556 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
7559 SI tmp_tmpopd;
7560 SI tmp_tmpops;
7561 BI tmp_carry;
7562 SI tmp_newval;
7563 tmp_tmpops = FLD (f_indir_pc__dword);
7564 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7565 tmp_carry = CPU (h_cbit);
7566 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7568 SI opval = tmp_newval;
7569 SET_H_GR (FLD (f_operand2), opval);
7570 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7574 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))));
7575 CPU (h_cbit) = opval;
7576 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7579 BI opval = LTSI (tmp_newval, 0);
7580 CPU (h_nbit) = opval;
7581 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7584 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7585 CPU (h_zbit) = opval;
7586 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7589 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)));
7590 CPU (h_vbit) = opval;
7591 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7595 BI opval = 0;
7596 CPU (h_xbit) = opval;
7597 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7600 BI opval = 0;
7601 SET_H_INSN_PREFIXED_P (opval);
7602 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7608 #undef FLD
7610 NEXT (vpc);
7612 CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
7614 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7615 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7616 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7617 int UNUSED written = 0;
7618 IADDR UNUSED pc = abuf->addr;
7619 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7622 SI tmp_tmpopd;
7623 SI tmp_tmpops;
7624 BI tmp_carry;
7625 SI tmp_newval;
7626 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
7627 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7628 tmp_carry = CPU (h_cbit);
7629 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7631 SI opval = tmp_newval;
7632 SET_H_GR (FLD (f_operand2), opval);
7633 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7637 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))));
7638 CPU (h_cbit) = opval;
7639 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7642 BI opval = LTSI (tmp_newval, 0);
7643 CPU (h_nbit) = opval;
7644 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7647 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7648 CPU (h_zbit) = opval;
7649 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7652 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)));
7653 CPU (h_vbit) = opval;
7654 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7658 BI opval = 0;
7659 CPU (h_xbit) = opval;
7660 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7663 BI opval = 0;
7664 SET_H_INSN_PREFIXED_P (opval);
7665 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7671 #undef FLD
7673 NEXT (vpc);
7675 CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
7677 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7678 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7679 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7680 int UNUSED written = 0;
7681 IADDR UNUSED pc = abuf->addr;
7682 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7685 SI tmp_tmpopd;
7686 SI tmp_tmpops;
7687 BI tmp_carry;
7688 SI tmp_newval;
7689 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
7690 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7691 tmp_carry = CPU (h_cbit);
7692 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7694 SI opval = tmp_newval;
7695 SET_H_GR (FLD (f_operand2), opval);
7696 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7700 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))));
7701 CPU (h_cbit) = opval;
7702 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7705 BI opval = LTSI (tmp_newval, 0);
7706 CPU (h_nbit) = opval;
7707 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7710 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7711 CPU (h_zbit) = opval;
7712 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7715 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)));
7716 CPU (h_vbit) = opval;
7717 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7721 BI opval = 0;
7722 CPU (h_xbit) = opval;
7723 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7726 BI opval = 0;
7727 SET_H_INSN_PREFIXED_P (opval);
7728 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7734 #undef FLD
7736 NEXT (vpc);
7738 CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
7740 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7741 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7742 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7743 int UNUSED written = 0;
7744 IADDR UNUSED pc = abuf->addr;
7745 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7748 SI tmp_tmpopd;
7749 SI tmp_tmpops;
7750 BI tmp_carry;
7751 SI tmp_newval;
7752 tmp_tmpops = EXTQISI (({ SI tmp_addr;
7753 QI tmp_tmp_mem;
7754 BI tmp_postinc;
7755 tmp_postinc = FLD (f_memmode);
7756 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7757 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7758 ; if (NEBI (tmp_postinc, 0)) {
7760 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7761 tmp_addr = ADDSI (tmp_addr, 1);
7764 SI opval = tmp_addr;
7765 SET_H_GR (FLD (f_operand1), opval);
7766 written |= (1 << 11);
7767 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7771 ; tmp_tmp_mem; }));
7772 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7773 tmp_carry = CPU (h_cbit);
7774 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7776 SI opval = tmp_newval;
7777 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7778 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7782 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))));
7783 CPU (h_cbit) = opval;
7784 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7787 BI opval = LTSI (tmp_newval, 0);
7788 CPU (h_nbit) = opval;
7789 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7792 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7793 CPU (h_zbit) = opval;
7794 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7797 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)));
7798 CPU (h_vbit) = opval;
7799 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7803 BI opval = 0;
7804 CPU (h_xbit) = opval;
7805 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7808 BI opval = 0;
7809 SET_H_INSN_PREFIXED_P (opval);
7810 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7816 abuf->written = written;
7817 #undef FLD
7819 NEXT (vpc);
7821 CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
7823 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7824 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7825 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7826 int UNUSED written = 0;
7827 IADDR UNUSED pc = abuf->addr;
7828 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7831 SI tmp_tmpopd;
7832 SI tmp_tmpops;
7833 BI tmp_carry;
7834 SI tmp_newval;
7835 tmp_tmpops = EXTHISI (({ SI tmp_addr;
7836 HI tmp_tmp_mem;
7837 BI tmp_postinc;
7838 tmp_postinc = FLD (f_memmode);
7839 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7840 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7841 ; if (NEBI (tmp_postinc, 0)) {
7843 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7844 tmp_addr = ADDSI (tmp_addr, 2);
7847 SI opval = tmp_addr;
7848 SET_H_GR (FLD (f_operand1), opval);
7849 written |= (1 << 11);
7850 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7854 ; tmp_tmp_mem; }));
7855 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7856 tmp_carry = CPU (h_cbit);
7857 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7859 SI opval = tmp_newval;
7860 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7861 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7865 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))));
7866 CPU (h_cbit) = opval;
7867 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7870 BI opval = LTSI (tmp_newval, 0);
7871 CPU (h_nbit) = opval;
7872 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7875 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7876 CPU (h_zbit) = opval;
7877 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7880 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)));
7881 CPU (h_vbit) = opval;
7882 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7886 BI opval = 0;
7887 CPU (h_xbit) = opval;
7888 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7891 BI opval = 0;
7892 SET_H_INSN_PREFIXED_P (opval);
7893 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7899 abuf->written = written;
7900 #undef FLD
7902 NEXT (vpc);
7904 CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
7906 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7907 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7908 #define FLD(f) abuf->fields.sfmt_addcbr.f
7909 int UNUSED written = 0;
7910 IADDR UNUSED pc = abuf->addr;
7911 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7914 SI tmp_tmpopd;
7915 SI tmp_tmpops;
7916 BI tmp_carry;
7917 SI tmp_newval;
7918 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
7919 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7920 tmp_carry = CPU (h_cbit);
7921 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7923 SI opval = tmp_newval;
7924 SET_H_GR (FLD (f_operand2), opval);
7925 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7929 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))));
7930 CPU (h_cbit) = opval;
7931 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7934 BI opval = LTSI (tmp_newval, 0);
7935 CPU (h_nbit) = opval;
7936 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7939 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7940 CPU (h_zbit) = opval;
7941 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7944 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)));
7945 CPU (h_vbit) = opval;
7946 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7950 BI opval = 0;
7951 CPU (h_xbit) = opval;
7952 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7955 BI opval = 0;
7956 SET_H_INSN_PREFIXED_P (opval);
7957 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7963 #undef FLD
7965 NEXT (vpc);
7967 CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
7969 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7970 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7971 #define FLD(f) abuf->fields.sfmt_addcwr.f
7972 int UNUSED written = 0;
7973 IADDR UNUSED pc = abuf->addr;
7974 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7977 SI tmp_tmpopd;
7978 SI tmp_tmpops;
7979 BI tmp_carry;
7980 SI tmp_newval;
7981 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
7982 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7983 tmp_carry = CPU (h_cbit);
7984 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7986 SI opval = tmp_newval;
7987 SET_H_GR (FLD (f_operand2), opval);
7988 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7992 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))));
7993 CPU (h_cbit) = opval;
7994 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7997 BI opval = LTSI (tmp_newval, 0);
7998 CPU (h_nbit) = opval;
7999 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8002 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8003 CPU (h_zbit) = opval;
8004 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8007 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)));
8008 CPU (h_vbit) = opval;
8009 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8013 BI opval = 0;
8014 CPU (h_xbit) = opval;
8015 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8018 BI opval = 0;
8019 SET_H_INSN_PREFIXED_P (opval);
8020 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8026 #undef FLD
8028 NEXT (vpc);
8030 CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
8032 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8033 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8034 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8035 int UNUSED written = 0;
8036 IADDR UNUSED pc = abuf->addr;
8037 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8040 SI tmp_tmpopd;
8041 SI tmp_tmpops;
8042 BI tmp_carry;
8043 SI tmp_newval;
8044 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
8045 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8046 tmp_carry = CPU (h_cbit);
8047 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8049 SI opval = tmp_newval;
8050 SET_H_GR (FLD (f_operand2), opval);
8051 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8055 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))));
8056 CPU (h_cbit) = opval;
8057 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8060 BI opval = LTSI (tmp_newval, 0);
8061 CPU (h_nbit) = opval;
8062 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8065 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8066 CPU (h_zbit) = opval;
8067 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8070 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)));
8071 CPU (h_vbit) = opval;
8072 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8076 BI opval = 0;
8077 CPU (h_xbit) = opval;
8078 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8081 BI opval = 0;
8082 SET_H_INSN_PREFIXED_P (opval);
8083 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8089 #undef FLD
8091 NEXT (vpc);
8093 CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
8095 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8096 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8097 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8098 int UNUSED written = 0;
8099 IADDR UNUSED pc = abuf->addr;
8100 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8103 SI tmp_tmpopd;
8104 SI tmp_tmpops;
8105 BI tmp_carry;
8106 SI tmp_newval;
8107 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
8108 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8109 tmp_carry = CPU (h_cbit);
8110 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8112 SI opval = tmp_newval;
8113 SET_H_GR (FLD (f_operand2), opval);
8114 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8118 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))));
8119 CPU (h_cbit) = opval;
8120 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8123 BI opval = LTSI (tmp_newval, 0);
8124 CPU (h_nbit) = opval;
8125 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8128 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8129 CPU (h_zbit) = opval;
8130 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8133 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)));
8134 CPU (h_vbit) = opval;
8135 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8139 BI opval = 0;
8140 CPU (h_xbit) = opval;
8141 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8144 BI opval = 0;
8145 SET_H_INSN_PREFIXED_P (opval);
8146 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8152 #undef FLD
8154 NEXT (vpc);
8156 CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
8158 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8159 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8160 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8161 int UNUSED written = 0;
8162 IADDR UNUSED pc = abuf->addr;
8163 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8166 SI tmp_tmpopd;
8167 SI tmp_tmpops;
8168 BI tmp_carry;
8169 SI tmp_newval;
8170 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
8171 QI tmp_tmp_mem;
8172 BI tmp_postinc;
8173 tmp_postinc = FLD (f_memmode);
8174 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8175 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8176 ; if (NEBI (tmp_postinc, 0)) {
8178 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8179 tmp_addr = ADDSI (tmp_addr, 1);
8182 SI opval = tmp_addr;
8183 SET_H_GR (FLD (f_operand1), opval);
8184 written |= (1 << 11);
8185 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8189 ; tmp_tmp_mem; }));
8190 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8191 tmp_carry = CPU (h_cbit);
8192 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8194 SI opval = tmp_newval;
8195 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8196 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8200 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))));
8201 CPU (h_cbit) = opval;
8202 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8205 BI opval = LTSI (tmp_newval, 0);
8206 CPU (h_nbit) = opval;
8207 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8210 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8211 CPU (h_zbit) = opval;
8212 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8215 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)));
8216 CPU (h_vbit) = opval;
8217 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8221 BI opval = 0;
8222 CPU (h_xbit) = opval;
8223 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8226 BI opval = 0;
8227 SET_H_INSN_PREFIXED_P (opval);
8228 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8234 abuf->written = written;
8235 #undef FLD
8237 NEXT (vpc);
8239 CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
8241 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8242 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8243 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8244 int UNUSED written = 0;
8245 IADDR UNUSED pc = abuf->addr;
8246 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8249 SI tmp_tmpopd;
8250 SI tmp_tmpops;
8251 BI tmp_carry;
8252 SI tmp_newval;
8253 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
8254 HI tmp_tmp_mem;
8255 BI tmp_postinc;
8256 tmp_postinc = FLD (f_memmode);
8257 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8258 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8259 ; if (NEBI (tmp_postinc, 0)) {
8261 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8262 tmp_addr = ADDSI (tmp_addr, 2);
8265 SI opval = tmp_addr;
8266 SET_H_GR (FLD (f_operand1), opval);
8267 written |= (1 << 11);
8268 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8272 ; tmp_tmp_mem; }));
8273 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8274 tmp_carry = CPU (h_cbit);
8275 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8277 SI opval = tmp_newval;
8278 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8279 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8283 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))));
8284 CPU (h_cbit) = opval;
8285 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8288 BI opval = LTSI (tmp_newval, 0);
8289 CPU (h_nbit) = opval;
8290 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8293 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8294 CPU (h_zbit) = opval;
8295 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8298 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)));
8299 CPU (h_vbit) = opval;
8300 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8304 BI opval = 0;
8305 CPU (h_xbit) = opval;
8306 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8309 BI opval = 0;
8310 SET_H_INSN_PREFIXED_P (opval);
8311 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8317 abuf->written = written;
8318 #undef FLD
8320 NEXT (vpc);
8322 CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
8324 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8325 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8326 #define FLD(f) abuf->fields.sfmt_addcbr.f
8327 int UNUSED written = 0;
8328 IADDR UNUSED pc = abuf->addr;
8329 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8332 SI tmp_tmpopd;
8333 SI tmp_tmpops;
8334 BI tmp_carry;
8335 SI tmp_newval;
8336 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
8337 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8338 tmp_carry = CPU (h_cbit);
8339 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8341 SI opval = tmp_newval;
8342 SET_H_GR (FLD (f_operand2), opval);
8343 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8347 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))));
8348 CPU (h_cbit) = opval;
8349 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8352 BI opval = LTSI (tmp_newval, 0);
8353 CPU (h_nbit) = opval;
8354 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8357 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8358 CPU (h_zbit) = opval;
8359 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8362 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)));
8363 CPU (h_vbit) = opval;
8364 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8368 BI opval = 0;
8369 CPU (h_xbit) = opval;
8370 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8373 BI opval = 0;
8374 SET_H_INSN_PREFIXED_P (opval);
8375 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8381 #undef FLD
8383 NEXT (vpc);
8385 CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
8387 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8388 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8389 #define FLD(f) abuf->fields.sfmt_addcwr.f
8390 int UNUSED written = 0;
8391 IADDR UNUSED pc = abuf->addr;
8392 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8395 SI tmp_tmpopd;
8396 SI tmp_tmpops;
8397 BI tmp_carry;
8398 SI tmp_newval;
8399 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
8400 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8401 tmp_carry = CPU (h_cbit);
8402 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8404 SI opval = tmp_newval;
8405 SET_H_GR (FLD (f_operand2), opval);
8406 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8410 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))));
8411 CPU (h_cbit) = opval;
8412 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8415 BI opval = LTSI (tmp_newval, 0);
8416 CPU (h_nbit) = opval;
8417 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8420 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8421 CPU (h_zbit) = opval;
8422 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8425 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)));
8426 CPU (h_vbit) = opval;
8427 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8431 BI opval = 0;
8432 CPU (h_xbit) = opval;
8433 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8436 BI opval = 0;
8437 SET_H_INSN_PREFIXED_P (opval);
8438 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8444 #undef FLD
8446 NEXT (vpc);
8448 CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8450 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8451 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8452 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8453 int UNUSED written = 0;
8454 IADDR UNUSED pc = abuf->addr;
8455 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8459 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
8460 SET_H_GR (FLD (f_operand1), opval);
8461 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8465 BI opval = 0;
8466 CPU (h_xbit) = opval;
8467 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8470 BI opval = 0;
8471 SET_H_INSN_PREFIXED_P (opval);
8472 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8477 #undef FLD
8479 NEXT (vpc);
8481 CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8483 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8484 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8485 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8486 int UNUSED written = 0;
8487 IADDR UNUSED pc = abuf->addr;
8488 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8492 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
8493 SET_H_GR (FLD (f_operand1), opval);
8494 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8498 BI opval = 0;
8499 CPU (h_xbit) = opval;
8500 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8503 BI opval = 0;
8504 SET_H_INSN_PREFIXED_P (opval);
8505 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8510 #undef FLD
8512 NEXT (vpc);
8514 CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8516 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8517 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8518 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8519 int UNUSED written = 0;
8520 IADDR UNUSED pc = abuf->addr;
8521 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8525 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
8526 SET_H_GR (FLD (f_operand1), opval);
8527 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8531 BI opval = 0;
8532 CPU (h_xbit) = opval;
8533 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8536 BI opval = 0;
8537 SET_H_INSN_PREFIXED_P (opval);
8538 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8543 #undef FLD
8545 NEXT (vpc);
8547 CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
8549 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8550 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8551 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8552 int UNUSED written = 0;
8553 IADDR UNUSED pc = abuf->addr;
8554 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8557 QI tmp_tmpopd;
8558 QI tmp_tmpops;
8559 BI tmp_carry;
8560 QI tmp_newval;
8561 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8562 tmp_tmpopd = 0;
8563 tmp_carry = CPU (h_cbit);
8564 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8566 SI tmp_oldregval;
8567 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
8569 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
8570 SET_H_GR (FLD (f_operand2), opval);
8571 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8576 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))));
8577 CPU (h_cbit) = opval;
8578 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8581 BI opval = LTQI (tmp_newval, 0);
8582 CPU (h_nbit) = opval;
8583 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8586 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8587 CPU (h_zbit) = opval;
8588 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8591 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)));
8592 CPU (h_vbit) = opval;
8593 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8597 BI opval = 0;
8598 CPU (h_xbit) = opval;
8599 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8602 BI opval = 0;
8603 SET_H_INSN_PREFIXED_P (opval);
8604 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8610 #undef FLD
8612 NEXT (vpc);
8614 CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
8616 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8617 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8618 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8619 int UNUSED written = 0;
8620 IADDR UNUSED pc = abuf->addr;
8621 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8624 HI tmp_tmpopd;
8625 HI tmp_tmpops;
8626 BI tmp_carry;
8627 HI tmp_newval;
8628 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8629 tmp_tmpopd = 0;
8630 tmp_carry = CPU (h_cbit);
8631 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8633 SI tmp_oldregval;
8634 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
8636 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
8637 SET_H_GR (FLD (f_operand2), opval);
8638 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8643 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))));
8644 CPU (h_cbit) = opval;
8645 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8648 BI opval = LTHI (tmp_newval, 0);
8649 CPU (h_nbit) = opval;
8650 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8653 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8654 CPU (h_zbit) = opval;
8655 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8658 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)));
8659 CPU (h_vbit) = opval;
8660 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8664 BI opval = 0;
8665 CPU (h_xbit) = opval;
8666 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8669 BI opval = 0;
8670 SET_H_INSN_PREFIXED_P (opval);
8671 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8677 #undef FLD
8679 NEXT (vpc);
8681 CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
8683 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8684 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8685 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8686 int UNUSED written = 0;
8687 IADDR UNUSED pc = abuf->addr;
8688 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8691 SI tmp_tmpopd;
8692 SI tmp_tmpops;
8693 BI tmp_carry;
8694 SI tmp_newval;
8695 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8696 tmp_tmpopd = 0;
8697 tmp_carry = CPU (h_cbit);
8698 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8700 SI opval = tmp_newval;
8701 SET_H_GR (FLD (f_operand2), opval);
8702 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8706 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))));
8707 CPU (h_cbit) = opval;
8708 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8711 BI opval = LTSI (tmp_newval, 0);
8712 CPU (h_nbit) = opval;
8713 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8716 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8717 CPU (h_zbit) = opval;
8718 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8721 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)));
8722 CPU (h_vbit) = opval;
8723 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8727 BI opval = 0;
8728 CPU (h_xbit) = opval;
8729 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8732 BI opval = 0;
8733 SET_H_INSN_PREFIXED_P (opval);
8734 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8740 #undef FLD
8742 NEXT (vpc);
8744 CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
8746 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8747 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8748 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8749 int UNUSED written = 0;
8750 IADDR UNUSED pc = abuf->addr;
8751 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8754 QI tmp_tmpd;
8755 tmp_tmpd = ({ SI tmp_addr;
8756 QI tmp_tmp_mem;
8757 BI tmp_postinc;
8758 tmp_postinc = FLD (f_memmode);
8759 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8760 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8761 ; if (NEBI (tmp_postinc, 0)) {
8763 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8764 tmp_addr = ADDSI (tmp_addr, 1);
8767 SI opval = tmp_addr;
8768 SET_H_GR (FLD (f_operand1), opval);
8769 written |= (1 << 8);
8770 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8774 ; tmp_tmp_mem; });
8776 QI tmp_tmpopd;
8777 QI tmp_tmpops;
8778 BI tmp_carry;
8779 QI tmp_newval;
8780 tmp_tmpops = 0;
8781 tmp_tmpopd = tmp_tmpd;
8782 tmp_carry = CPU (h_cbit);
8783 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8784 ((void) 0); /*nop*/
8787 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))));
8788 CPU (h_cbit) = opval;
8789 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8792 BI opval = LTQI (tmp_newval, 0);
8793 CPU (h_nbit) = opval;
8794 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8797 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8798 CPU (h_zbit) = opval;
8799 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8802 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)));
8803 CPU (h_vbit) = opval;
8804 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8808 BI opval = 0;
8809 CPU (h_xbit) = opval;
8810 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8813 BI opval = 0;
8814 SET_H_INSN_PREFIXED_P (opval);
8815 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8822 abuf->written = written;
8823 #undef FLD
8825 NEXT (vpc);
8827 CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
8829 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8830 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8831 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8832 int UNUSED written = 0;
8833 IADDR UNUSED pc = abuf->addr;
8834 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8837 HI tmp_tmpd;
8838 tmp_tmpd = ({ SI tmp_addr;
8839 HI tmp_tmp_mem;
8840 BI tmp_postinc;
8841 tmp_postinc = FLD (f_memmode);
8842 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8843 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8844 ; if (NEBI (tmp_postinc, 0)) {
8846 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8847 tmp_addr = ADDSI (tmp_addr, 2);
8850 SI opval = tmp_addr;
8851 SET_H_GR (FLD (f_operand1), opval);
8852 written |= (1 << 8);
8853 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8857 ; tmp_tmp_mem; });
8859 HI tmp_tmpopd;
8860 HI tmp_tmpops;
8861 BI tmp_carry;
8862 HI tmp_newval;
8863 tmp_tmpops = 0;
8864 tmp_tmpopd = tmp_tmpd;
8865 tmp_carry = CPU (h_cbit);
8866 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8867 ((void) 0); /*nop*/
8870 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))));
8871 CPU (h_cbit) = opval;
8872 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8875 BI opval = LTHI (tmp_newval, 0);
8876 CPU (h_nbit) = opval;
8877 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8880 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8881 CPU (h_zbit) = opval;
8882 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8885 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)));
8886 CPU (h_vbit) = opval;
8887 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8891 BI opval = 0;
8892 CPU (h_xbit) = opval;
8893 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8896 BI opval = 0;
8897 SET_H_INSN_PREFIXED_P (opval);
8898 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8905 abuf->written = written;
8906 #undef FLD
8908 NEXT (vpc);
8910 CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
8912 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8913 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8914 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8915 int UNUSED written = 0;
8916 IADDR UNUSED pc = abuf->addr;
8917 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8920 SI tmp_tmpd;
8921 tmp_tmpd = ({ SI tmp_addr;
8922 SI tmp_tmp_mem;
8923 BI tmp_postinc;
8924 tmp_postinc = FLD (f_memmode);
8925 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8926 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
8927 ; if (NEBI (tmp_postinc, 0)) {
8929 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8930 tmp_addr = ADDSI (tmp_addr, 4);
8933 SI opval = tmp_addr;
8934 SET_H_GR (FLD (f_operand1), opval);
8935 written |= (1 << 8);
8936 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8940 ; tmp_tmp_mem; });
8942 SI tmp_tmpopd;
8943 SI tmp_tmpops;
8944 BI tmp_carry;
8945 SI tmp_newval;
8946 tmp_tmpops = 0;
8947 tmp_tmpopd = tmp_tmpd;
8948 tmp_carry = CPU (h_cbit);
8949 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8950 ((void) 0); /*nop*/
8953 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))));
8954 CPU (h_cbit) = opval;
8955 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8958 BI opval = LTSI (tmp_newval, 0);
8959 CPU (h_nbit) = opval;
8960 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8963 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8964 CPU (h_zbit) = opval;
8965 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8968 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)));
8969 CPU (h_vbit) = opval;
8970 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8974 BI opval = 0;
8975 CPU (h_xbit) = opval;
8976 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8979 BI opval = 0;
8980 SET_H_INSN_PREFIXED_P (opval);
8981 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8988 abuf->written = written;
8989 #undef FLD
8991 NEXT (vpc);
8993 CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
8995 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8996 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8997 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8998 int UNUSED written = 0;
8999 IADDR UNUSED pc = abuf->addr;
9000 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9003 QI tmp_tmpd;
9004 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9006 SI tmp_addr;
9007 BI tmp_postinc;
9008 tmp_postinc = FLD (f_memmode);
9009 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9010 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9011 if (EQBI (CPU (h_pbit), 0)) {
9014 QI opval = tmp_tmpd;
9015 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9016 written |= (1 << 10);
9017 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9020 BI opval = CPU (h_pbit);
9021 CPU (h_cbit) = opval;
9022 written |= (1 << 9);
9023 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9026 } else {
9028 BI opval = 1;
9029 CPU (h_cbit) = opval;
9030 written |= (1 << 9);
9031 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9034 } else {
9036 QI opval = tmp_tmpd;
9037 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9038 written |= (1 << 10);
9039 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9042 if (NEBI (tmp_postinc, 0)) {
9044 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9045 tmp_addr = ADDSI (tmp_addr, 1);
9048 SI opval = tmp_addr;
9049 SET_H_GR (FLD (f_operand1), opval);
9050 written |= (1 << 8);
9051 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9058 BI opval = 0;
9059 CPU (h_xbit) = opval;
9060 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9063 BI opval = 0;
9064 SET_H_INSN_PREFIXED_P (opval);
9065 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9070 abuf->written = written;
9071 #undef FLD
9073 NEXT (vpc);
9075 CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9077 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9078 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9079 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9080 int UNUSED written = 0;
9081 IADDR UNUSED pc = abuf->addr;
9082 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9085 HI tmp_tmpd;
9086 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9088 SI tmp_addr;
9089 BI tmp_postinc;
9090 tmp_postinc = FLD (f_memmode);
9091 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9092 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9093 if (EQBI (CPU (h_pbit), 0)) {
9096 HI opval = tmp_tmpd;
9097 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9098 written |= (1 << 10);
9099 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9102 BI opval = CPU (h_pbit);
9103 CPU (h_cbit) = opval;
9104 written |= (1 << 9);
9105 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9108 } else {
9110 BI opval = 1;
9111 CPU (h_cbit) = opval;
9112 written |= (1 << 9);
9113 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9116 } else {
9118 HI opval = tmp_tmpd;
9119 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9120 written |= (1 << 10);
9121 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9124 if (NEBI (tmp_postinc, 0)) {
9126 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9127 tmp_addr = ADDSI (tmp_addr, 2);
9130 SI opval = tmp_addr;
9131 SET_H_GR (FLD (f_operand1), opval);
9132 written |= (1 << 8);
9133 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9140 BI opval = 0;
9141 CPU (h_xbit) = opval;
9142 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9145 BI opval = 0;
9146 SET_H_INSN_PREFIXED_P (opval);
9147 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9152 abuf->written = written;
9153 #undef FLD
9155 NEXT (vpc);
9157 CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9159 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9160 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9161 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9162 int UNUSED written = 0;
9163 IADDR UNUSED pc = abuf->addr;
9164 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9167 SI tmp_tmpd;
9168 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9170 SI tmp_addr;
9171 BI tmp_postinc;
9172 tmp_postinc = FLD (f_memmode);
9173 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9174 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9175 if (EQBI (CPU (h_pbit), 0)) {
9178 SI opval = tmp_tmpd;
9179 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9180 written |= (1 << 10);
9181 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9184 BI opval = CPU (h_pbit);
9185 CPU (h_cbit) = opval;
9186 written |= (1 << 9);
9187 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9190 } else {
9192 BI opval = 1;
9193 CPU (h_cbit) = opval;
9194 written |= (1 << 9);
9195 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9198 } else {
9200 SI opval = tmp_tmpd;
9201 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9202 written |= (1 << 10);
9203 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9206 if (NEBI (tmp_postinc, 0)) {
9208 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9209 tmp_addr = ADDSI (tmp_addr, 4);
9212 SI opval = tmp_addr;
9213 SET_H_GR (FLD (f_operand1), opval);
9214 written |= (1 << 8);
9215 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9222 BI opval = 0;
9223 CPU (h_xbit) = opval;
9224 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9227 BI opval = 0;
9228 SET_H_INSN_PREFIXED_P (opval);
9229 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9234 abuf->written = written;
9235 #undef FLD
9237 NEXT (vpc);
9239 CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
9241 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9242 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9243 #define FLD(f) abuf->fields.sfmt_muls_b.f
9244 int UNUSED written = 0;
9245 IADDR UNUSED pc = abuf->addr;
9246 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9249 DI tmp_src1;
9250 DI tmp_src2;
9251 DI tmp_tmpr;
9252 tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9253 tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9254 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9256 SI opval = TRUNCDISI (tmp_tmpr);
9257 SET_H_GR (FLD (f_operand2), opval);
9258 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9261 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9262 SET_H_SR (((UINT) 7), opval);
9263 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9267 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9268 CPU (h_cbit) = opval;
9269 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9272 BI opval = LTDI (tmp_tmpr, 0);
9273 CPU (h_nbit) = opval;
9274 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9277 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9278 CPU (h_zbit) = opval;
9279 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9282 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9283 CPU (h_vbit) = opval;
9284 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9288 BI opval = 0;
9289 CPU (h_xbit) = opval;
9290 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9293 BI opval = 0;
9294 SET_H_INSN_PREFIXED_P (opval);
9295 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9301 #undef FLD
9303 NEXT (vpc);
9305 CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
9307 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9308 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9309 #define FLD(f) abuf->fields.sfmt_muls_b.f
9310 int UNUSED written = 0;
9311 IADDR UNUSED pc = abuf->addr;
9312 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9315 DI tmp_src1;
9316 DI tmp_src2;
9317 DI tmp_tmpr;
9318 tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9319 tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9320 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9322 SI opval = TRUNCDISI (tmp_tmpr);
9323 SET_H_GR (FLD (f_operand2), opval);
9324 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9327 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9328 SET_H_SR (((UINT) 7), opval);
9329 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9333 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9334 CPU (h_cbit) = opval;
9335 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9338 BI opval = LTDI (tmp_tmpr, 0);
9339 CPU (h_nbit) = opval;
9340 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9343 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9344 CPU (h_zbit) = opval;
9345 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9348 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9349 CPU (h_vbit) = opval;
9350 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9354 BI opval = 0;
9355 CPU (h_xbit) = opval;
9356 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9359 BI opval = 0;
9360 SET_H_INSN_PREFIXED_P (opval);
9361 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9367 #undef FLD
9369 NEXT (vpc);
9371 CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
9373 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9374 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9375 #define FLD(f) abuf->fields.sfmt_muls_b.f
9376 int UNUSED written = 0;
9377 IADDR UNUSED pc = abuf->addr;
9378 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9381 DI tmp_src1;
9382 DI tmp_src2;
9383 DI tmp_tmpr;
9384 tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9385 tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9386 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9388 SI opval = TRUNCDISI (tmp_tmpr);
9389 SET_H_GR (FLD (f_operand2), opval);
9390 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9393 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9394 SET_H_SR (((UINT) 7), opval);
9395 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9399 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9400 CPU (h_cbit) = opval;
9401 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9404 BI opval = LTDI (tmp_tmpr, 0);
9405 CPU (h_nbit) = opval;
9406 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9409 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9410 CPU (h_zbit) = opval;
9411 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9414 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9415 CPU (h_vbit) = opval;
9416 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9420 BI opval = 0;
9421 CPU (h_xbit) = opval;
9422 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9425 BI opval = 0;
9426 SET_H_INSN_PREFIXED_P (opval);
9427 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9433 #undef FLD
9435 NEXT (vpc);
9437 CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
9439 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9440 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9441 #define FLD(f) abuf->fields.sfmt_muls_b.f
9442 int UNUSED written = 0;
9443 IADDR UNUSED pc = abuf->addr;
9444 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9447 DI tmp_src1;
9448 DI tmp_src2;
9449 DI tmp_tmpr;
9450 tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9451 tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9452 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9454 SI opval = TRUNCDISI (tmp_tmpr);
9455 SET_H_GR (FLD (f_operand2), opval);
9456 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9459 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9460 SET_H_SR (((UINT) 7), opval);
9461 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9465 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9466 CPU (h_cbit) = opval;
9467 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9470 BI opval = LTDI (tmp_tmpr, 0);
9471 CPU (h_nbit) = opval;
9472 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9475 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9476 CPU (h_zbit) = opval;
9477 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9480 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9481 CPU (h_vbit) = opval;
9482 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9486 BI opval = 0;
9487 CPU (h_xbit) = opval;
9488 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9491 BI opval = 0;
9492 SET_H_INSN_PREFIXED_P (opval);
9493 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9499 #undef FLD
9501 NEXT (vpc);
9503 CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
9505 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9506 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9507 #define FLD(f) abuf->fields.sfmt_muls_b.f
9508 int UNUSED written = 0;
9509 IADDR UNUSED pc = abuf->addr;
9510 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9513 DI tmp_src1;
9514 DI tmp_src2;
9515 DI tmp_tmpr;
9516 tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9517 tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9518 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9520 SI opval = TRUNCDISI (tmp_tmpr);
9521 SET_H_GR (FLD (f_operand2), opval);
9522 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9525 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9526 SET_H_SR (((UINT) 7), opval);
9527 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9531 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9532 CPU (h_cbit) = opval;
9533 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9536 BI opval = LTDI (tmp_tmpr, 0);
9537 CPU (h_nbit) = opval;
9538 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9541 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9542 CPU (h_zbit) = opval;
9543 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9546 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9547 CPU (h_vbit) = opval;
9548 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9552 BI opval = 0;
9553 CPU (h_xbit) = opval;
9554 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9557 BI opval = 0;
9558 SET_H_INSN_PREFIXED_P (opval);
9559 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9565 #undef FLD
9567 NEXT (vpc);
9569 CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
9571 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9572 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9573 #define FLD(f) abuf->fields.sfmt_muls_b.f
9574 int UNUSED written = 0;
9575 IADDR UNUSED pc = abuf->addr;
9576 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9579 DI tmp_src1;
9580 DI tmp_src2;
9581 DI tmp_tmpr;
9582 tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9583 tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9584 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9586 SI opval = TRUNCDISI (tmp_tmpr);
9587 SET_H_GR (FLD (f_operand2), opval);
9588 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9591 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9592 SET_H_SR (((UINT) 7), opval);
9593 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9597 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9598 CPU (h_cbit) = opval;
9599 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9602 BI opval = LTDI (tmp_tmpr, 0);
9603 CPU (h_nbit) = opval;
9604 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9607 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9608 CPU (h_zbit) = opval;
9609 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9612 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9613 CPU (h_vbit) = opval;
9614 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9618 BI opval = 0;
9619 CPU (h_xbit) = opval;
9620 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9623 BI opval = 0;
9624 SET_H_INSN_PREFIXED_P (opval);
9625 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9631 #undef FLD
9633 NEXT (vpc);
9635 CASE (sem, INSN_MSTEP) : /* mstep $Rs,$Rd */
9637 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9638 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9639 #define FLD(f) abuf->fields.sfmt_muls_b.f
9640 int UNUSED written = 0;
9641 IADDR UNUSED pc = abuf->addr;
9642 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9645 SI tmp_tmpd;
9646 SI tmp_tmps;
9647 tmp_tmps = GET_H_GR (FLD (f_operand1));
9648 tmp_tmpd = ADDSI (SLLSI (GET_H_GR (FLD (f_operand2)), 1), ((CPU (h_nbit)) ? (tmp_tmps) : (0)));
9650 SI opval = tmp_tmpd;
9651 SET_H_GR (FLD (f_operand2), opval);
9652 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9656 BI opval = LTSI (tmp_tmpd, 0);
9657 CPU (h_nbit) = opval;
9658 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9661 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9662 CPU (h_zbit) = opval;
9663 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9665 SET_H_CBIT_MOVE (0);
9666 SET_H_VBIT_MOVE (0);
9669 BI opval = 0;
9670 CPU (h_xbit) = opval;
9671 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9674 BI opval = 0;
9675 SET_H_INSN_PREFIXED_P (opval);
9676 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9682 #undef FLD
9684 NEXT (vpc);
9686 CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
9688 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9689 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9690 #define FLD(f) abuf->fields.sfmt_muls_b.f
9691 int UNUSED written = 0;
9692 IADDR UNUSED pc = abuf->addr;
9693 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9696 SI tmp_tmp;
9697 SI tmp_tmps;
9698 SI tmp_tmpd;
9699 tmp_tmps = GET_H_GR (FLD (f_operand1));
9700 tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
9701 tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
9703 SI opval = tmp_tmpd;
9704 SET_H_GR (FLD (f_operand2), opval);
9705 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9709 BI opval = LTSI (tmp_tmpd, 0);
9710 CPU (h_nbit) = opval;
9711 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9714 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9715 CPU (h_zbit) = opval;
9716 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9718 SET_H_CBIT_MOVE (0);
9719 SET_H_VBIT_MOVE (0);
9722 BI opval = 0;
9723 CPU (h_xbit) = opval;
9724 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9727 BI opval = 0;
9728 SET_H_INSN_PREFIXED_P (opval);
9729 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9735 #undef FLD
9737 NEXT (vpc);
9739 CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
9741 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9742 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9743 #define FLD(f) abuf->fields.sfmt_muls_b.f
9744 int UNUSED written = 0;
9745 IADDR UNUSED pc = abuf->addr;
9746 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9749 SI tmp_tmpd;
9750 tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
9752 SI opval = tmp_tmpd;
9753 SET_H_GR (FLD (f_operand2), opval);
9754 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9758 BI opval = LTSI (tmp_tmpd, 0);
9759 CPU (h_nbit) = opval;
9760 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9763 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9764 CPU (h_zbit) = opval;
9765 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9767 SET_H_CBIT_MOVE (0);
9768 SET_H_VBIT_MOVE (0);
9771 BI opval = 0;
9772 CPU (h_xbit) = opval;
9773 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9776 BI opval = 0;
9777 SET_H_INSN_PREFIXED_P (opval);
9778 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9784 #undef FLD
9786 NEXT (vpc);
9788 CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
9790 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9791 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9792 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9793 int UNUSED written = 0;
9794 IADDR UNUSED pc = abuf->addr;
9795 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9798 QI tmp_tmpd;
9799 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9801 SI tmp_oldregval;
9802 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
9804 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
9805 SET_H_GR (FLD (f_operand2), opval);
9806 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9811 BI opval = LTQI (tmp_tmpd, 0);
9812 CPU (h_nbit) = opval;
9813 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9816 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9817 CPU (h_zbit) = opval;
9818 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9820 SET_H_CBIT_MOVE (0);
9821 SET_H_VBIT_MOVE (0);
9824 BI opval = 0;
9825 CPU (h_xbit) = opval;
9826 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9829 BI opval = 0;
9830 SET_H_INSN_PREFIXED_P (opval);
9831 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9837 #undef FLD
9839 NEXT (vpc);
9841 CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
9843 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9844 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9845 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9846 int UNUSED written = 0;
9847 IADDR UNUSED pc = abuf->addr;
9848 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9851 HI tmp_tmpd;
9852 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9854 SI tmp_oldregval;
9855 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
9857 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
9858 SET_H_GR (FLD (f_operand2), opval);
9859 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9864 BI opval = LTHI (tmp_tmpd, 0);
9865 CPU (h_nbit) = opval;
9866 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9869 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9870 CPU (h_zbit) = opval;
9871 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9873 SET_H_CBIT_MOVE (0);
9874 SET_H_VBIT_MOVE (0);
9877 BI opval = 0;
9878 CPU (h_xbit) = opval;
9879 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9882 BI opval = 0;
9883 SET_H_INSN_PREFIXED_P (opval);
9884 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9890 #undef FLD
9892 NEXT (vpc);
9894 CASE (sem, INSN_AND_D_R) : /* and.d $Rs,$Rd */
9896 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9897 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9898 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9899 int UNUSED written = 0;
9900 IADDR UNUSED pc = abuf->addr;
9901 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9904 SI tmp_tmpd;
9905 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9907 SI opval = tmp_tmpd;
9908 SET_H_GR (FLD (f_operand2), opval);
9909 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9913 BI opval = LTSI (tmp_tmpd, 0);
9914 CPU (h_nbit) = opval;
9915 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9918 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9919 CPU (h_zbit) = opval;
9920 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9922 SET_H_CBIT_MOVE (0);
9923 SET_H_VBIT_MOVE (0);
9926 BI opval = 0;
9927 CPU (h_xbit) = opval;
9928 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9931 BI opval = 0;
9932 SET_H_INSN_PREFIXED_P (opval);
9933 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9939 #undef FLD
9941 NEXT (vpc);
9943 CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
9945 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9946 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9947 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
9948 int UNUSED written = 0;
9949 IADDR UNUSED pc = abuf->addr;
9950 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9953 QI tmp_tmpd;
9954 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
9955 QI tmp_tmp_mem;
9956 BI tmp_postinc;
9957 tmp_postinc = FLD (f_memmode);
9958 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9959 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
9960 ; if (NEBI (tmp_postinc, 0)) {
9962 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9963 tmp_addr = ADDSI (tmp_addr, 1);
9966 SI opval = tmp_addr;
9967 SET_H_GR (FLD (f_operand1), opval);
9968 written |= (1 << 11);
9969 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9973 ; tmp_tmp_mem; }));
9975 SI tmp_oldregval;
9976 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
9978 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
9979 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
9980 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9985 BI opval = LTQI (tmp_tmpd, 0);
9986 CPU (h_nbit) = opval;
9987 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9990 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9991 CPU (h_zbit) = opval;
9992 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9994 SET_H_CBIT_MOVE (0);
9995 SET_H_VBIT_MOVE (0);
9998 BI opval = 0;
9999 CPU (h_xbit) = opval;
10000 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10003 BI opval = 0;
10004 SET_H_INSN_PREFIXED_P (opval);
10005 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10011 abuf->written = written;
10012 #undef FLD
10014 NEXT (vpc);
10016 CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
10018 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10019 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10020 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10021 int UNUSED written = 0;
10022 IADDR UNUSED pc = abuf->addr;
10023 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10026 HI tmp_tmpd;
10027 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10028 HI tmp_tmp_mem;
10029 BI tmp_postinc;
10030 tmp_postinc = FLD (f_memmode);
10031 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10032 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10033 ; if (NEBI (tmp_postinc, 0)) {
10035 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10036 tmp_addr = ADDSI (tmp_addr, 2);
10039 SI opval = tmp_addr;
10040 SET_H_GR (FLD (f_operand1), opval);
10041 written |= (1 << 11);
10042 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10046 ; tmp_tmp_mem; }));
10048 SI tmp_oldregval;
10049 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10051 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10052 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10053 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10058 BI opval = LTHI (tmp_tmpd, 0);
10059 CPU (h_nbit) = opval;
10060 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10063 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10064 CPU (h_zbit) = opval;
10065 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10067 SET_H_CBIT_MOVE (0);
10068 SET_H_VBIT_MOVE (0);
10071 BI opval = 0;
10072 CPU (h_xbit) = opval;
10073 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10076 BI opval = 0;
10077 SET_H_INSN_PREFIXED_P (opval);
10078 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10084 abuf->written = written;
10085 #undef FLD
10087 NEXT (vpc);
10089 CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
10091 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10092 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10093 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10094 int UNUSED written = 0;
10095 IADDR UNUSED pc = abuf->addr;
10096 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10099 SI tmp_tmpd;
10100 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10101 SI tmp_tmp_mem;
10102 BI tmp_postinc;
10103 tmp_postinc = FLD (f_memmode);
10104 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10105 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10106 ; if (NEBI (tmp_postinc, 0)) {
10108 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10109 tmp_addr = ADDSI (tmp_addr, 4);
10112 SI opval = tmp_addr;
10113 SET_H_GR (FLD (f_operand1), opval);
10114 written |= (1 << 10);
10115 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10119 ; tmp_tmp_mem; }));
10121 SI opval = tmp_tmpd;
10122 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10123 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10127 BI opval = LTSI (tmp_tmpd, 0);
10128 CPU (h_nbit) = opval;
10129 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10132 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10133 CPU (h_zbit) = opval;
10134 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10136 SET_H_CBIT_MOVE (0);
10137 SET_H_VBIT_MOVE (0);
10140 BI opval = 0;
10141 CPU (h_xbit) = opval;
10142 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10145 BI opval = 0;
10146 SET_H_INSN_PREFIXED_P (opval);
10147 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10153 abuf->written = written;
10154 #undef FLD
10156 NEXT (vpc);
10158 CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
10160 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10161 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10162 #define FLD(f) abuf->fields.sfmt_addcbr.f
10163 int UNUSED written = 0;
10164 IADDR UNUSED pc = abuf->addr;
10165 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10168 QI tmp_tmpd;
10169 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10171 SI tmp_oldregval;
10172 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10174 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10175 SET_H_GR (FLD (f_operand2), opval);
10176 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10181 BI opval = LTQI (tmp_tmpd, 0);
10182 CPU (h_nbit) = opval;
10183 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10186 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10187 CPU (h_zbit) = opval;
10188 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10190 SET_H_CBIT_MOVE (0);
10191 SET_H_VBIT_MOVE (0);
10194 BI opval = 0;
10195 CPU (h_xbit) = opval;
10196 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10199 BI opval = 0;
10200 SET_H_INSN_PREFIXED_P (opval);
10201 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10207 #undef FLD
10209 NEXT (vpc);
10211 CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
10213 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10214 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10215 #define FLD(f) abuf->fields.sfmt_addcwr.f
10216 int UNUSED written = 0;
10217 IADDR UNUSED pc = abuf->addr;
10218 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10221 HI tmp_tmpd;
10222 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10224 SI tmp_oldregval;
10225 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10227 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10228 SET_H_GR (FLD (f_operand2), opval);
10229 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10234 BI opval = LTHI (tmp_tmpd, 0);
10235 CPU (h_nbit) = opval;
10236 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10239 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10240 CPU (h_zbit) = opval;
10241 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10243 SET_H_CBIT_MOVE (0);
10244 SET_H_VBIT_MOVE (0);
10247 BI opval = 0;
10248 CPU (h_xbit) = opval;
10249 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10252 BI opval = 0;
10253 SET_H_INSN_PREFIXED_P (opval);
10254 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10260 #undef FLD
10262 NEXT (vpc);
10264 CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
10266 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10267 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10268 #define FLD(f) abuf->fields.sfmt_addcdr.f
10269 int UNUSED written = 0;
10270 IADDR UNUSED pc = abuf->addr;
10271 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10274 SI tmp_tmpd;
10275 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10277 SI opval = tmp_tmpd;
10278 SET_H_GR (FLD (f_operand2), opval);
10279 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10283 BI opval = LTSI (tmp_tmpd, 0);
10284 CPU (h_nbit) = opval;
10285 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10288 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10289 CPU (h_zbit) = opval;
10290 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10292 SET_H_CBIT_MOVE (0);
10293 SET_H_VBIT_MOVE (0);
10296 BI opval = 0;
10297 CPU (h_xbit) = opval;
10298 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10301 BI opval = 0;
10302 SET_H_INSN_PREFIXED_P (opval);
10303 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10309 #undef FLD
10311 NEXT (vpc);
10313 CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
10315 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10316 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10317 #define FLD(f) abuf->fields.sfmt_andq.f
10318 int UNUSED written = 0;
10319 IADDR UNUSED pc = abuf->addr;
10320 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10323 SI tmp_tmpd;
10324 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10326 SI opval = tmp_tmpd;
10327 SET_H_GR (FLD (f_operand2), opval);
10328 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10332 BI opval = LTSI (tmp_tmpd, 0);
10333 CPU (h_nbit) = opval;
10334 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10337 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10338 CPU (h_zbit) = opval;
10339 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10341 SET_H_CBIT_MOVE (0);
10342 SET_H_VBIT_MOVE (0);
10345 BI opval = 0;
10346 CPU (h_xbit) = opval;
10347 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10350 BI opval = 0;
10351 SET_H_INSN_PREFIXED_P (opval);
10352 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10358 #undef FLD
10360 NEXT (vpc);
10362 CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
10364 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10365 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10366 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10367 int UNUSED written = 0;
10368 IADDR UNUSED pc = abuf->addr;
10369 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10372 QI tmp_tmpd;
10373 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10375 SI tmp_oldregval;
10376 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10378 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10379 SET_H_GR (FLD (f_operand2), opval);
10380 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10385 BI opval = LTQI (tmp_tmpd, 0);
10386 CPU (h_nbit) = opval;
10387 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10390 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10391 CPU (h_zbit) = opval;
10392 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10394 SET_H_CBIT_MOVE (0);
10395 SET_H_VBIT_MOVE (0);
10398 BI opval = 0;
10399 CPU (h_xbit) = opval;
10400 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10403 BI opval = 0;
10404 SET_H_INSN_PREFIXED_P (opval);
10405 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10411 #undef FLD
10413 NEXT (vpc);
10415 CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
10417 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10418 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10419 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10420 int UNUSED written = 0;
10421 IADDR UNUSED pc = abuf->addr;
10422 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10425 HI tmp_tmpd;
10426 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10428 SI tmp_oldregval;
10429 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10431 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10432 SET_H_GR (FLD (f_operand2), opval);
10433 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10438 BI opval = LTHI (tmp_tmpd, 0);
10439 CPU (h_nbit) = opval;
10440 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10443 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10444 CPU (h_zbit) = opval;
10445 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10447 SET_H_CBIT_MOVE (0);
10448 SET_H_VBIT_MOVE (0);
10451 BI opval = 0;
10452 CPU (h_xbit) = opval;
10453 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10456 BI opval = 0;
10457 SET_H_INSN_PREFIXED_P (opval);
10458 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10464 #undef FLD
10466 NEXT (vpc);
10468 CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
10470 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10471 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10472 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10473 int UNUSED written = 0;
10474 IADDR UNUSED pc = abuf->addr;
10475 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10478 SI tmp_tmpd;
10479 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10481 SI opval = tmp_tmpd;
10482 SET_H_GR (FLD (f_operand2), opval);
10483 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10487 BI opval = LTSI (tmp_tmpd, 0);
10488 CPU (h_nbit) = opval;
10489 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10492 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10493 CPU (h_zbit) = opval;
10494 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10496 SET_H_CBIT_MOVE (0);
10497 SET_H_VBIT_MOVE (0);
10500 BI opval = 0;
10501 CPU (h_xbit) = opval;
10502 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10505 BI opval = 0;
10506 SET_H_INSN_PREFIXED_P (opval);
10507 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10513 #undef FLD
10515 NEXT (vpc);
10517 CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
10519 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10520 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10521 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10522 int UNUSED written = 0;
10523 IADDR UNUSED pc = abuf->addr;
10524 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10527 QI tmp_tmpd;
10528 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10529 QI tmp_tmp_mem;
10530 BI tmp_postinc;
10531 tmp_postinc = FLD (f_memmode);
10532 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10533 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10534 ; if (NEBI (tmp_postinc, 0)) {
10536 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10537 tmp_addr = ADDSI (tmp_addr, 1);
10540 SI opval = tmp_addr;
10541 SET_H_GR (FLD (f_operand1), opval);
10542 written |= (1 << 11);
10543 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10547 ; tmp_tmp_mem; }));
10549 SI tmp_oldregval;
10550 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10552 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10553 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10554 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10559 BI opval = LTQI (tmp_tmpd, 0);
10560 CPU (h_nbit) = opval;
10561 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10564 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10565 CPU (h_zbit) = opval;
10566 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10568 SET_H_CBIT_MOVE (0);
10569 SET_H_VBIT_MOVE (0);
10572 BI opval = 0;
10573 CPU (h_xbit) = opval;
10574 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10577 BI opval = 0;
10578 SET_H_INSN_PREFIXED_P (opval);
10579 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10585 abuf->written = written;
10586 #undef FLD
10588 NEXT (vpc);
10590 CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
10592 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10593 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10594 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10595 int UNUSED written = 0;
10596 IADDR UNUSED pc = abuf->addr;
10597 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10600 HI tmp_tmpd;
10601 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10602 HI tmp_tmp_mem;
10603 BI tmp_postinc;
10604 tmp_postinc = FLD (f_memmode);
10605 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10606 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10607 ; if (NEBI (tmp_postinc, 0)) {
10609 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10610 tmp_addr = ADDSI (tmp_addr, 2);
10613 SI opval = tmp_addr;
10614 SET_H_GR (FLD (f_operand1), opval);
10615 written |= (1 << 11);
10616 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10620 ; tmp_tmp_mem; }));
10622 SI tmp_oldregval;
10623 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10625 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10626 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10627 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10632 BI opval = LTHI (tmp_tmpd, 0);
10633 CPU (h_nbit) = opval;
10634 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10637 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10638 CPU (h_zbit) = opval;
10639 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10641 SET_H_CBIT_MOVE (0);
10642 SET_H_VBIT_MOVE (0);
10645 BI opval = 0;
10646 CPU (h_xbit) = opval;
10647 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10650 BI opval = 0;
10651 SET_H_INSN_PREFIXED_P (opval);
10652 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10658 abuf->written = written;
10659 #undef FLD
10661 NEXT (vpc);
10663 CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
10665 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10666 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10667 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10668 int UNUSED written = 0;
10669 IADDR UNUSED pc = abuf->addr;
10670 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10673 SI tmp_tmpd;
10674 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10675 SI tmp_tmp_mem;
10676 BI tmp_postinc;
10677 tmp_postinc = FLD (f_memmode);
10678 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10679 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10680 ; if (NEBI (tmp_postinc, 0)) {
10682 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10683 tmp_addr = ADDSI (tmp_addr, 4);
10686 SI opval = tmp_addr;
10687 SET_H_GR (FLD (f_operand1), opval);
10688 written |= (1 << 10);
10689 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10693 ; tmp_tmp_mem; }));
10695 SI opval = tmp_tmpd;
10696 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10697 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10701 BI opval = LTSI (tmp_tmpd, 0);
10702 CPU (h_nbit) = opval;
10703 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10706 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10707 CPU (h_zbit) = opval;
10708 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10710 SET_H_CBIT_MOVE (0);
10711 SET_H_VBIT_MOVE (0);
10714 BI opval = 0;
10715 CPU (h_xbit) = opval;
10716 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10719 BI opval = 0;
10720 SET_H_INSN_PREFIXED_P (opval);
10721 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10727 abuf->written = written;
10728 #undef FLD
10730 NEXT (vpc);
10732 CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
10734 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10735 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10736 #define FLD(f) abuf->fields.sfmt_addcbr.f
10737 int UNUSED written = 0;
10738 IADDR UNUSED pc = abuf->addr;
10739 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10742 QI tmp_tmpd;
10743 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10745 SI tmp_oldregval;
10746 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10748 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10749 SET_H_GR (FLD (f_operand2), opval);
10750 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10755 BI opval = LTQI (tmp_tmpd, 0);
10756 CPU (h_nbit) = opval;
10757 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10760 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10761 CPU (h_zbit) = opval;
10762 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10764 SET_H_CBIT_MOVE (0);
10765 SET_H_VBIT_MOVE (0);
10768 BI opval = 0;
10769 CPU (h_xbit) = opval;
10770 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10773 BI opval = 0;
10774 SET_H_INSN_PREFIXED_P (opval);
10775 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10781 #undef FLD
10783 NEXT (vpc);
10785 CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
10787 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10788 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10789 #define FLD(f) abuf->fields.sfmt_addcwr.f
10790 int UNUSED written = 0;
10791 IADDR UNUSED pc = abuf->addr;
10792 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10795 HI tmp_tmpd;
10796 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10798 SI tmp_oldregval;
10799 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10801 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10802 SET_H_GR (FLD (f_operand2), opval);
10803 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10808 BI opval = LTHI (tmp_tmpd, 0);
10809 CPU (h_nbit) = opval;
10810 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10813 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10814 CPU (h_zbit) = opval;
10815 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10817 SET_H_CBIT_MOVE (0);
10818 SET_H_VBIT_MOVE (0);
10821 BI opval = 0;
10822 CPU (h_xbit) = opval;
10823 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10826 BI opval = 0;
10827 SET_H_INSN_PREFIXED_P (opval);
10828 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10834 #undef FLD
10836 NEXT (vpc);
10838 CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
10840 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10841 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10842 #define FLD(f) abuf->fields.sfmt_addcdr.f
10843 int UNUSED written = 0;
10844 IADDR UNUSED pc = abuf->addr;
10845 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10848 SI tmp_tmpd;
10849 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10851 SI opval = tmp_tmpd;
10852 SET_H_GR (FLD (f_operand2), opval);
10853 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10857 BI opval = LTSI (tmp_tmpd, 0);
10858 CPU (h_nbit) = opval;
10859 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10862 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10863 CPU (h_zbit) = opval;
10864 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10866 SET_H_CBIT_MOVE (0);
10867 SET_H_VBIT_MOVE (0);
10870 BI opval = 0;
10871 CPU (h_xbit) = opval;
10872 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10875 BI opval = 0;
10876 SET_H_INSN_PREFIXED_P (opval);
10877 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10883 #undef FLD
10885 NEXT (vpc);
10887 CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
10889 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10890 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10891 #define FLD(f) abuf->fields.sfmt_andq.f
10892 int UNUSED written = 0;
10893 IADDR UNUSED pc = abuf->addr;
10894 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10897 SI tmp_tmpd;
10898 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10900 SI opval = tmp_tmpd;
10901 SET_H_GR (FLD (f_operand2), opval);
10902 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10906 BI opval = LTSI (tmp_tmpd, 0);
10907 CPU (h_nbit) = opval;
10908 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10911 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10912 CPU (h_zbit) = opval;
10913 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10915 SET_H_CBIT_MOVE (0);
10916 SET_H_VBIT_MOVE (0);
10919 BI opval = 0;
10920 CPU (h_xbit) = opval;
10921 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10924 BI opval = 0;
10925 SET_H_INSN_PREFIXED_P (opval);
10926 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10932 #undef FLD
10934 NEXT (vpc);
10936 CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
10938 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10939 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10940 #define FLD(f) abuf->fields.sfmt_muls_b.f
10941 int UNUSED written = 0;
10942 IADDR UNUSED pc = abuf->addr;
10943 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10946 SI tmp_tmpd;
10947 tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10949 SI opval = tmp_tmpd;
10950 SET_H_GR (FLD (f_operand2), opval);
10951 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10955 BI opval = LTSI (tmp_tmpd, 0);
10956 CPU (h_nbit) = opval;
10957 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10960 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10961 CPU (h_zbit) = opval;
10962 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10964 SET_H_CBIT_MOVE (0);
10965 SET_H_VBIT_MOVE (0);
10968 BI opval = 0;
10969 CPU (h_xbit) = opval;
10970 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10973 BI opval = 0;
10974 SET_H_INSN_PREFIXED_P (opval);
10975 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10981 #undef FLD
10983 NEXT (vpc);
10985 CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
10987 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10988 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10989 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
10990 int UNUSED written = 0;
10991 IADDR UNUSED pc = abuf->addr;
10992 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10995 SI tmp_tmps;
10996 SI tmp_tmpd;
10997 tmp_tmps = GET_H_GR (FLD (f_operand1));
10998 tmp_tmpd = ({ SI tmp_tmpcode;
10999 SI tmp_tmpval;
11000 SI tmp_tmpres;
11001 tmp_tmpcode = FLD (f_operand2);
11002 ; tmp_tmpval = tmp_tmps;
11003 ; if (EQSI (tmp_tmpcode, 0)) {
11004 tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
11006 else if (EQSI (tmp_tmpcode, 1)) {
11007 tmp_tmpres = ({ SI tmp_tmpr;
11008 tmp_tmpr = tmp_tmpval;
11009 ; 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)))))))); });
11011 else if (EQSI (tmp_tmpcode, 2)) {
11012 tmp_tmpres = ({ SI tmp_tmpb;
11013 tmp_tmpb = tmp_tmpval;
11014 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11016 else if (EQSI (tmp_tmpcode, 3)) {
11017 tmp_tmpres = ({ SI tmp_tmpr;
11018 tmp_tmpr = ({ SI tmp_tmpb;
11019 tmp_tmpb = tmp_tmpval;
11020 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11021 ; 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)))))))); });
11023 else if (EQSI (tmp_tmpcode, 4)) {
11024 tmp_tmpres = ({ SI tmp_tmpb;
11025 tmp_tmpb = tmp_tmpval;
11026 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11028 else if (EQSI (tmp_tmpcode, 5)) {
11029 tmp_tmpres = ({ SI tmp_tmpr;
11030 tmp_tmpr = ({ SI tmp_tmpb;
11031 tmp_tmpb = tmp_tmpval;
11032 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11033 ; 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)))))))); });
11035 else if (EQSI (tmp_tmpcode, 6)) {
11036 tmp_tmpres = ({ SI tmp_tmpb;
11037 tmp_tmpb = ({ SI tmp_tmpb;
11038 tmp_tmpb = tmp_tmpval;
11039 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11040 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11042 else if (EQSI (tmp_tmpcode, 7)) {
11043 tmp_tmpres = ({ SI tmp_tmpr;
11044 tmp_tmpr = ({ SI tmp_tmpb;
11045 tmp_tmpb = ({ SI tmp_tmpb;
11046 tmp_tmpb = tmp_tmpval;
11047 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11048 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11049 ; 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)))))))); });
11051 else if (EQSI (tmp_tmpcode, 8)) {
11052 tmp_tmpres = INVSI (tmp_tmpval);
11054 else if (EQSI (tmp_tmpcode, 9)) {
11055 tmp_tmpres = ({ SI tmp_tmpr;
11056 tmp_tmpr = INVSI (tmp_tmpval);
11057 ; 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)))))))); });
11059 else if (EQSI (tmp_tmpcode, 10)) {
11060 tmp_tmpres = ({ SI tmp_tmpb;
11061 tmp_tmpb = INVSI (tmp_tmpval);
11062 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11064 else if (EQSI (tmp_tmpcode, 11)) {
11065 tmp_tmpres = ({ SI tmp_tmpr;
11066 tmp_tmpr = ({ SI tmp_tmpb;
11067 tmp_tmpb = INVSI (tmp_tmpval);
11068 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11069 ; 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)))))))); });
11071 else if (EQSI (tmp_tmpcode, 12)) {
11072 tmp_tmpres = ({ SI tmp_tmpb;
11073 tmp_tmpb = INVSI (tmp_tmpval);
11074 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11076 else if (EQSI (tmp_tmpcode, 13)) {
11077 tmp_tmpres = ({ SI tmp_tmpr;
11078 tmp_tmpr = ({ SI tmp_tmpb;
11079 tmp_tmpb = INVSI (tmp_tmpval);
11080 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11081 ; 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)))))))); });
11083 else if (EQSI (tmp_tmpcode, 14)) {
11084 tmp_tmpres = ({ SI tmp_tmpb;
11085 tmp_tmpb = ({ SI tmp_tmpb;
11086 tmp_tmpb = INVSI (tmp_tmpval);
11087 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11088 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11090 else if (EQSI (tmp_tmpcode, 15)) {
11091 tmp_tmpres = ({ SI tmp_tmpr;
11092 tmp_tmpr = ({ SI tmp_tmpb;
11093 tmp_tmpb = ({ SI tmp_tmpb;
11094 tmp_tmpb = INVSI (tmp_tmpval);
11095 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11096 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11097 ; 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)))))))); });
11099 ; tmp_tmpres; });
11101 SI opval = tmp_tmpd;
11102 SET_H_GR (FLD (f_operand1), opval);
11103 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11107 BI opval = LTSI (tmp_tmpd, 0);
11108 CPU (h_nbit) = opval;
11109 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11112 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11113 CPU (h_zbit) = opval;
11114 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11116 SET_H_CBIT_MOVE (0);
11117 SET_H_VBIT_MOVE (0);
11120 BI opval = 0;
11121 CPU (h_xbit) = opval;
11122 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11125 BI opval = 0;
11126 SET_H_INSN_PREFIXED_P (opval);
11127 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11133 #undef FLD
11135 NEXT (vpc);
11137 CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
11139 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11140 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11141 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11142 int UNUSED written = 0;
11143 IADDR UNUSED pc = abuf->addr;
11144 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11147 QI tmp_tmpd;
11148 SI tmp_cnt1;
11149 SI tmp_cnt2;
11150 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11151 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11152 tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11154 SI tmp_oldregval;
11155 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11157 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11158 SET_H_GR (FLD (f_operand2), opval);
11159 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11164 BI opval = LTQI (tmp_tmpd, 0);
11165 CPU (h_nbit) = opval;
11166 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11169 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11170 CPU (h_zbit) = opval;
11171 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11173 SET_H_CBIT_MOVE (0);
11174 SET_H_VBIT_MOVE (0);
11177 BI opval = 0;
11178 CPU (h_xbit) = opval;
11179 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11182 BI opval = 0;
11183 SET_H_INSN_PREFIXED_P (opval);
11184 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11190 #undef FLD
11192 NEXT (vpc);
11194 CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
11196 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11197 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11198 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11199 int UNUSED written = 0;
11200 IADDR UNUSED pc = abuf->addr;
11201 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11204 HI tmp_tmpd;
11205 SI tmp_cnt1;
11206 SI tmp_cnt2;
11207 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11208 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11209 tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11211 SI tmp_oldregval;
11212 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11214 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11215 SET_H_GR (FLD (f_operand2), opval);
11216 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11221 BI opval = LTHI (tmp_tmpd, 0);
11222 CPU (h_nbit) = opval;
11223 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11226 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11227 CPU (h_zbit) = opval;
11228 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11230 SET_H_CBIT_MOVE (0);
11231 SET_H_VBIT_MOVE (0);
11234 BI opval = 0;
11235 CPU (h_xbit) = opval;
11236 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11239 BI opval = 0;
11240 SET_H_INSN_PREFIXED_P (opval);
11241 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11247 #undef FLD
11249 NEXT (vpc);
11251 CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
11253 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11254 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11255 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11256 int UNUSED written = 0;
11257 IADDR UNUSED pc = abuf->addr;
11258 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11261 SI tmp_tmpd;
11262 SI tmp_cnt1;
11263 SI tmp_cnt2;
11264 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11265 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11266 tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11268 SI opval = tmp_tmpd;
11269 SET_H_GR (FLD (f_operand2), opval);
11270 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11274 BI opval = LTSI (tmp_tmpd, 0);
11275 CPU (h_nbit) = opval;
11276 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11279 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11280 CPU (h_zbit) = opval;
11281 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11283 SET_H_CBIT_MOVE (0);
11284 SET_H_VBIT_MOVE (0);
11287 BI opval = 0;
11288 CPU (h_xbit) = opval;
11289 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11292 BI opval = 0;
11293 SET_H_INSN_PREFIXED_P (opval);
11294 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11300 #undef FLD
11302 NEXT (vpc);
11304 CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
11306 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11307 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11308 #define FLD(f) abuf->fields.sfmt_asrq.f
11309 int UNUSED written = 0;
11310 IADDR UNUSED pc = abuf->addr;
11311 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11314 SI tmp_tmpd;
11315 tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11317 SI opval = tmp_tmpd;
11318 SET_H_GR (FLD (f_operand2), opval);
11319 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11323 BI opval = LTSI (tmp_tmpd, 0);
11324 CPU (h_nbit) = opval;
11325 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11328 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11329 CPU (h_zbit) = opval;
11330 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11332 SET_H_CBIT_MOVE (0);
11333 SET_H_VBIT_MOVE (0);
11336 BI opval = 0;
11337 CPU (h_xbit) = opval;
11338 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11341 BI opval = 0;
11342 SET_H_INSN_PREFIXED_P (opval);
11343 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11349 #undef FLD
11351 NEXT (vpc);
11353 CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
11355 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11356 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11357 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11358 int UNUSED written = 0;
11359 IADDR UNUSED pc = abuf->addr;
11360 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11363 SI tmp_tmpd;
11364 SI tmp_cnt;
11365 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11366 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11368 SI tmp_oldregval;
11369 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11371 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11372 SET_H_GR (FLD (f_operand2), opval);
11373 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11378 BI opval = LTQI (tmp_tmpd, 0);
11379 CPU (h_nbit) = opval;
11380 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11383 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11384 CPU (h_zbit) = opval;
11385 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11387 SET_H_CBIT_MOVE (0);
11388 SET_H_VBIT_MOVE (0);
11391 BI opval = 0;
11392 CPU (h_xbit) = opval;
11393 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11396 BI opval = 0;
11397 SET_H_INSN_PREFIXED_P (opval);
11398 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11404 #undef FLD
11406 NEXT (vpc);
11408 CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $Rs,$Rd */
11410 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11411 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11412 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11413 int UNUSED written = 0;
11414 IADDR UNUSED pc = abuf->addr;
11415 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11418 SI tmp_tmpd;
11419 SI tmp_cnt;
11420 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11421 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11423 SI tmp_oldregval;
11424 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11426 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11427 SET_H_GR (FLD (f_operand2), opval);
11428 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11433 BI opval = LTHI (tmp_tmpd, 0);
11434 CPU (h_nbit) = opval;
11435 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11438 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11439 CPU (h_zbit) = opval;
11440 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11442 SET_H_CBIT_MOVE (0);
11443 SET_H_VBIT_MOVE (0);
11446 BI opval = 0;
11447 CPU (h_xbit) = opval;
11448 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11451 BI opval = 0;
11452 SET_H_INSN_PREFIXED_P (opval);
11453 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11459 #undef FLD
11461 NEXT (vpc);
11463 CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
11465 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11466 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11467 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11468 int UNUSED written = 0;
11469 IADDR UNUSED pc = abuf->addr;
11470 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11473 SI tmp_tmpd;
11474 SI tmp_cnt;
11475 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11476 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11478 SI opval = tmp_tmpd;
11479 SET_H_GR (FLD (f_operand2), opval);
11480 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11484 BI opval = LTSI (tmp_tmpd, 0);
11485 CPU (h_nbit) = opval;
11486 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11489 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11490 CPU (h_zbit) = opval;
11491 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11493 SET_H_CBIT_MOVE (0);
11494 SET_H_VBIT_MOVE (0);
11497 BI opval = 0;
11498 CPU (h_xbit) = opval;
11499 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11502 BI opval = 0;
11503 SET_H_INSN_PREFIXED_P (opval);
11504 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11510 #undef FLD
11512 NEXT (vpc);
11514 CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
11516 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11517 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11518 #define FLD(f) abuf->fields.sfmt_asrq.f
11519 int UNUSED written = 0;
11520 IADDR UNUSED pc = abuf->addr;
11521 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11524 SI tmp_tmpd;
11525 tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11527 SI opval = tmp_tmpd;
11528 SET_H_GR (FLD (f_operand2), opval);
11529 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11533 BI opval = LTSI (tmp_tmpd, 0);
11534 CPU (h_nbit) = opval;
11535 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11538 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11539 CPU (h_zbit) = opval;
11540 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11542 SET_H_CBIT_MOVE (0);
11543 SET_H_VBIT_MOVE (0);
11546 BI opval = 0;
11547 CPU (h_xbit) = opval;
11548 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11551 BI opval = 0;
11552 SET_H_INSN_PREFIXED_P (opval);
11553 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11559 #undef FLD
11561 NEXT (vpc);
11563 CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
11565 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11566 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11567 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11568 int UNUSED written = 0;
11569 IADDR UNUSED pc = abuf->addr;
11570 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11573 SI tmp_tmpd;
11574 SI tmp_cnt;
11575 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11576 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11578 SI tmp_oldregval;
11579 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11581 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11582 SET_H_GR (FLD (f_operand2), opval);
11583 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11588 BI opval = LTQI (tmp_tmpd, 0);
11589 CPU (h_nbit) = opval;
11590 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11593 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11594 CPU (h_zbit) = opval;
11595 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11597 SET_H_CBIT_MOVE (0);
11598 SET_H_VBIT_MOVE (0);
11601 BI opval = 0;
11602 CPU (h_xbit) = opval;
11603 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11606 BI opval = 0;
11607 SET_H_INSN_PREFIXED_P (opval);
11608 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11614 #undef FLD
11616 NEXT (vpc);
11618 CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
11620 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11621 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11622 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11623 int UNUSED written = 0;
11624 IADDR UNUSED pc = abuf->addr;
11625 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11628 SI tmp_tmpd;
11629 SI tmp_cnt;
11630 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11631 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11633 SI tmp_oldregval;
11634 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11636 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11637 SET_H_GR (FLD (f_operand2), opval);
11638 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11643 BI opval = LTHI (tmp_tmpd, 0);
11644 CPU (h_nbit) = opval;
11645 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11648 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11649 CPU (h_zbit) = opval;
11650 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11652 SET_H_CBIT_MOVE (0);
11653 SET_H_VBIT_MOVE (0);
11656 BI opval = 0;
11657 CPU (h_xbit) = opval;
11658 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11661 BI opval = 0;
11662 SET_H_INSN_PREFIXED_P (opval);
11663 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11669 #undef FLD
11671 NEXT (vpc);
11673 CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
11675 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11676 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11677 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11678 int UNUSED written = 0;
11679 IADDR UNUSED pc = abuf->addr;
11680 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11683 SI tmp_tmpd;
11684 SI tmp_cnt;
11685 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11686 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11688 SI opval = tmp_tmpd;
11689 SET_H_GR (FLD (f_operand2), opval);
11690 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11694 BI opval = LTSI (tmp_tmpd, 0);
11695 CPU (h_nbit) = opval;
11696 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11699 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11700 CPU (h_zbit) = opval;
11701 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11703 SET_H_CBIT_MOVE (0);
11704 SET_H_VBIT_MOVE (0);
11707 BI opval = 0;
11708 CPU (h_xbit) = opval;
11709 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11712 BI opval = 0;
11713 SET_H_INSN_PREFIXED_P (opval);
11714 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11720 #undef FLD
11722 NEXT (vpc);
11724 CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
11726 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11727 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11728 #define FLD(f) abuf->fields.sfmt_asrq.f
11729 int UNUSED written = 0;
11730 IADDR UNUSED pc = abuf->addr;
11731 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11734 SI tmp_tmpd;
11735 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11737 SI opval = tmp_tmpd;
11738 SET_H_GR (FLD (f_operand2), opval);
11739 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11743 BI opval = LTSI (tmp_tmpd, 0);
11744 CPU (h_nbit) = opval;
11745 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11748 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11749 CPU (h_zbit) = opval;
11750 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11752 SET_H_CBIT_MOVE (0);
11753 SET_H_VBIT_MOVE (0);
11756 BI opval = 0;
11757 CPU (h_xbit) = opval;
11758 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11761 BI opval = 0;
11762 SET_H_INSN_PREFIXED_P (opval);
11763 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11769 #undef FLD
11771 NEXT (vpc);
11773 CASE (sem, INSN_BTST) : /* $Rs,$Rd */
11775 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11776 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11777 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11778 int UNUSED written = 0;
11779 IADDR UNUSED pc = abuf->addr;
11780 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11783 SI tmp_tmpd;
11784 SI tmp_cnt;
11785 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
11788 BI opval = LTSI (tmp_tmpd, 0);
11789 CPU (h_nbit) = opval;
11790 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11793 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11794 CPU (h_zbit) = opval;
11795 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11797 SET_H_CBIT_MOVE (0);
11798 SET_H_VBIT_MOVE (0);
11801 BI opval = 0;
11802 CPU (h_xbit) = opval;
11803 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11806 BI opval = 0;
11807 SET_H_INSN_PREFIXED_P (opval);
11808 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11814 #undef FLD
11816 NEXT (vpc);
11818 CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
11820 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11821 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11822 #define FLD(f) abuf->fields.sfmt_asrq.f
11823 int UNUSED written = 0;
11824 IADDR UNUSED pc = abuf->addr;
11825 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11828 SI tmp_tmpd;
11829 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
11832 BI opval = LTSI (tmp_tmpd, 0);
11833 CPU (h_nbit) = opval;
11834 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11837 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11838 CPU (h_zbit) = opval;
11839 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11841 SET_H_CBIT_MOVE (0);
11842 SET_H_VBIT_MOVE (0);
11845 BI opval = 0;
11846 CPU (h_xbit) = opval;
11847 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11850 BI opval = 0;
11851 SET_H_INSN_PREFIXED_P (opval);
11852 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11858 #undef FLD
11860 NEXT (vpc);
11862 CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
11864 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11865 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11866 #define FLD(f) abuf->fields.sfmt_setf.f
11867 int UNUSED written = 0;
11868 IADDR UNUSED pc = abuf->addr;
11869 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11872 SI tmp_tmp;
11873 tmp_tmp = FLD (f_dstsrc);
11874 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
11876 BI opval = 1;
11877 CPU (h_cbit) = opval;
11878 written |= (1 << 1);
11879 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
11882 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
11884 BI opval = 1;
11885 CPU (h_vbit) = opval;
11886 written |= (1 << 7);
11887 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
11890 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
11892 BI opval = 1;
11893 CPU (h_zbit) = opval;
11894 written |= (1 << 9);
11895 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11898 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
11900 BI opval = 1;
11901 CPU (h_nbit) = opval;
11902 written |= (1 << 3);
11903 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11906 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11908 BI opval = 1;
11909 CPU (h_xbit) = opval;
11910 written |= (1 << 8);
11911 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11914 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
11916 BI opval = 1;
11917 SET_H_IBIT (opval);
11918 written |= (1 << 2);
11919 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
11922 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
11924 BI opval = 1;
11925 SET_H_UBIT (opval);
11926 written |= (1 << 6);
11927 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
11930 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
11932 BI opval = 1;
11933 CPU (h_pbit) = opval;
11934 written |= (1 << 4);
11935 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
11939 BI opval = 0;
11940 SET_H_INSN_PREFIXED_P (opval);
11941 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11943 if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11945 BI opval = 0;
11946 CPU (h_xbit) = opval;
11947 written |= (1 << 8);
11948 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11953 abuf->written = written;
11954 #undef FLD
11956 NEXT (vpc);
11958 CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
11960 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11961 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11962 #define FLD(f) abuf->fields.sfmt_setf.f
11963 int UNUSED written = 0;
11964 IADDR UNUSED pc = abuf->addr;
11965 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11968 SI tmp_tmp;
11969 tmp_tmp = FLD (f_dstsrc);
11970 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
11972 BI opval = 0;
11973 CPU (h_cbit) = opval;
11974 written |= (1 << 1);
11975 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
11978 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
11980 BI opval = 0;
11981 CPU (h_vbit) = opval;
11982 written |= (1 << 7);
11983 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
11986 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
11988 BI opval = 0;
11989 CPU (h_zbit) = opval;
11990 written |= (1 << 9);
11991 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11994 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
11996 BI opval = 0;
11997 CPU (h_nbit) = opval;
11998 written |= (1 << 3);
11999 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12002 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12004 BI opval = 0;
12005 CPU (h_xbit) = opval;
12006 written |= (1 << 8);
12007 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12010 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12012 BI opval = 0;
12013 SET_H_IBIT (opval);
12014 written |= (1 << 2);
12015 TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12018 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12020 BI opval = 0;
12021 SET_H_UBIT (opval);
12022 written |= (1 << 6);
12023 TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12026 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12028 BI opval = 0;
12029 CPU (h_pbit) = opval;
12030 written |= (1 << 4);
12031 TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12036 BI opval = 0;
12037 CPU (h_xbit) = opval;
12038 written |= (1 << 8);
12039 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12042 BI opval = 0;
12043 SET_H_INSN_PREFIXED_P (opval);
12044 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12049 abuf->written = written;
12050 #undef FLD
12052 NEXT (vpc);
12054 CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
12056 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12057 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12058 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12059 int UNUSED written = 0;
12060 IADDR UNUSED pc = abuf->addr;
12061 SEM_BRANCH_INIT
12062 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12065 BI tmp_truthval;
12066 tmp_truthval = ({ SI tmp_tmpcond;
12067 BI tmp_condres;
12068 tmp_tmpcond = FLD (f_operand2);
12069 ; if (EQSI (tmp_tmpcond, 0)) {
12070 tmp_condres = NOTBI (CPU (h_cbit));
12072 else if (EQSI (tmp_tmpcond, 1)) {
12073 tmp_condres = CPU (h_cbit);
12075 else if (EQSI (tmp_tmpcond, 2)) {
12076 tmp_condres = NOTBI (CPU (h_zbit));
12078 else if (EQSI (tmp_tmpcond, 3)) {
12079 tmp_condres = CPU (h_zbit);
12081 else if (EQSI (tmp_tmpcond, 4)) {
12082 tmp_condres = NOTBI (CPU (h_vbit));
12084 else if (EQSI (tmp_tmpcond, 5)) {
12085 tmp_condres = CPU (h_vbit);
12087 else if (EQSI (tmp_tmpcond, 6)) {
12088 tmp_condres = NOTBI (CPU (h_nbit));
12090 else if (EQSI (tmp_tmpcond, 7)) {
12091 tmp_condres = CPU (h_nbit);
12093 else if (EQSI (tmp_tmpcond, 8)) {
12094 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12096 else if (EQSI (tmp_tmpcond, 9)) {
12097 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12099 else if (EQSI (tmp_tmpcond, 10)) {
12100 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12102 else if (EQSI (tmp_tmpcond, 11)) {
12103 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12105 else if (EQSI (tmp_tmpcond, 12)) {
12106 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12108 else if (EQSI (tmp_tmpcond, 13)) {
12109 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12111 else if (EQSI (tmp_tmpcond, 14)) {
12112 tmp_condres = 1;
12114 else if (EQSI (tmp_tmpcond, 15)) {
12115 tmp_condres = CPU (h_pbit);
12117 ; tmp_condres; });
12118 crisv10f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
12121 BI opval = 0;
12122 CPU (h_xbit) = opval;
12123 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12126 BI opval = 0;
12127 SET_H_INSN_PREFIXED_P (opval);
12128 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12131 if (tmp_truthval) {
12134 USI opval = FLD (i_o_pcrel);
12135 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12136 written |= (1 << 8);
12137 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12143 abuf->written = written;
12144 SEM_BRANCH_FINI (vpc);
12145 #undef FLD
12147 NEXT (vpc);
12149 CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
12151 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12152 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12153 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12154 int UNUSED written = 0;
12155 IADDR UNUSED pc = abuf->addr;
12156 SEM_BRANCH_INIT
12157 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12162 BI opval = 0;
12163 CPU (h_xbit) = opval;
12164 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12167 BI opval = 0;
12168 SET_H_INSN_PREFIXED_P (opval);
12169 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12174 USI opval = FLD (i_o_pcrel);
12175 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12176 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12181 SEM_BRANCH_FINI (vpc);
12182 #undef FLD
12184 NEXT (vpc);
12186 CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
12188 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12189 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12190 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12191 int UNUSED written = 0;
12192 IADDR UNUSED pc = abuf->addr;
12193 SEM_BRANCH_INIT
12194 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12197 BI tmp_truthval;
12198 tmp_truthval = ({ SI tmp_tmpcond;
12199 BI tmp_condres;
12200 tmp_tmpcond = FLD (f_operand2);
12201 ; if (EQSI (tmp_tmpcond, 0)) {
12202 tmp_condres = NOTBI (CPU (h_cbit));
12204 else if (EQSI (tmp_tmpcond, 1)) {
12205 tmp_condres = CPU (h_cbit);
12207 else if (EQSI (tmp_tmpcond, 2)) {
12208 tmp_condres = NOTBI (CPU (h_zbit));
12210 else if (EQSI (tmp_tmpcond, 3)) {
12211 tmp_condres = CPU (h_zbit);
12213 else if (EQSI (tmp_tmpcond, 4)) {
12214 tmp_condres = NOTBI (CPU (h_vbit));
12216 else if (EQSI (tmp_tmpcond, 5)) {
12217 tmp_condres = CPU (h_vbit);
12219 else if (EQSI (tmp_tmpcond, 6)) {
12220 tmp_condres = NOTBI (CPU (h_nbit));
12222 else if (EQSI (tmp_tmpcond, 7)) {
12223 tmp_condres = CPU (h_nbit);
12225 else if (EQSI (tmp_tmpcond, 8)) {
12226 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12228 else if (EQSI (tmp_tmpcond, 9)) {
12229 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12231 else if (EQSI (tmp_tmpcond, 10)) {
12232 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12234 else if (EQSI (tmp_tmpcond, 11)) {
12235 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12237 else if (EQSI (tmp_tmpcond, 12)) {
12238 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12240 else if (EQSI (tmp_tmpcond, 13)) {
12241 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12243 else if (EQSI (tmp_tmpcond, 14)) {
12244 tmp_condres = 1;
12246 else if (EQSI (tmp_tmpcond, 15)) {
12247 tmp_condres = CPU (h_pbit);
12249 ; tmp_condres; });
12250 crisv10f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
12253 BI opval = 0;
12254 CPU (h_xbit) = opval;
12255 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12258 BI opval = 0;
12259 SET_H_INSN_PREFIXED_P (opval);
12260 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12263 if (tmp_truthval) {
12266 USI opval = FLD (i_o_word_pcrel);
12267 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12268 written |= (1 << 8);
12269 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12275 abuf->written = written;
12276 SEM_BRANCH_FINI (vpc);
12277 #undef FLD
12279 NEXT (vpc);
12281 CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
12283 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12284 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12285 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12286 int UNUSED written = 0;
12287 IADDR UNUSED pc = abuf->addr;
12288 SEM_BRANCH_INIT
12289 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12294 BI opval = 0;
12295 CPU (h_xbit) = opval;
12296 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12299 BI opval = 0;
12300 SET_H_INSN_PREFIXED_P (opval);
12301 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12306 USI opval = FLD (i_o_word_pcrel);
12307 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12308 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12313 SEM_BRANCH_FINI (vpc);
12314 #undef FLD
12316 NEXT (vpc);
12318 CASE (sem, INSN_JUMP_R) : /* jump/jsr/jir ${Rs} */
12320 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12321 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12322 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12323 int UNUSED written = 0;
12324 IADDR UNUSED pc = abuf->addr;
12325 SEM_BRANCH_INIT
12326 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12330 SI opval = ADDSI (pc, 2);
12331 SET_H_SR (FLD (f_operand2), opval);
12332 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12335 USI opval = GET_H_GR (FLD (f_operand1));
12336 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12337 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12341 BI opval = 0;
12342 CPU (h_xbit) = opval;
12343 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12346 BI opval = 0;
12347 SET_H_INSN_PREFIXED_P (opval);
12348 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12353 SEM_BRANCH_FINI (vpc);
12354 #undef FLD
12356 NEXT (vpc);
12358 CASE (sem, INSN_JUMP_M) : /* jump/jsr/jir [${Rs}${inc}] */
12360 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12361 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12362 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12363 int UNUSED written = 0;
12364 IADDR UNUSED pc = abuf->addr;
12365 SEM_BRANCH_INIT
12366 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12370 SI opval = ADDSI (pc, 2);
12371 SET_H_SR (FLD (f_operand2), opval);
12372 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12375 USI opval = ({ SI tmp_addr;
12376 SI tmp_tmp_mem;
12377 BI tmp_postinc;
12378 tmp_postinc = FLD (f_memmode);
12379 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12380 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
12381 ; if (NEBI (tmp_postinc, 0)) {
12383 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12384 tmp_addr = ADDSI (tmp_addr, 4);
12387 SI opval = tmp_addr;
12388 SET_H_GR (FLD (f_operand1), opval);
12389 written |= (1 << 7);
12390 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12394 ; tmp_tmp_mem; });
12395 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12396 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12400 BI opval = 0;
12401 CPU (h_xbit) = opval;
12402 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12405 BI opval = 0;
12406 SET_H_INSN_PREFIXED_P (opval);
12407 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12412 abuf->written = written;
12413 SEM_BRANCH_FINI (vpc);
12414 #undef FLD
12416 NEXT (vpc);
12418 CASE (sem, INSN_JUMP_C) : /* jump/jsr/jir ${const32} */
12420 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12421 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12422 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
12423 int UNUSED written = 0;
12424 IADDR UNUSED pc = abuf->addr;
12425 SEM_BRANCH_INIT
12426 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12430 SI opval = ADDSI (pc, 6);
12431 SET_H_SR (FLD (f_operand2), opval);
12432 TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12435 USI opval = FLD (f_indir_pc__dword);
12436 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12437 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12441 BI opval = 0;
12442 CPU (h_xbit) = opval;
12443 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12446 BI opval = 0;
12447 SET_H_INSN_PREFIXED_P (opval);
12448 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12453 SEM_BRANCH_FINI (vpc);
12454 #undef FLD
12456 NEXT (vpc);
12458 CASE (sem, INSN_BREAK) : /* break $n */
12460 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12461 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12462 #define FLD(f) abuf->fields.sfmt_break.f
12463 int UNUSED written = 0;
12464 IADDR UNUSED pc = abuf->addr;
12465 SEM_BRANCH_INIT
12466 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12471 BI opval = 0;
12472 CPU (h_xbit) = opval;
12473 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12476 BI opval = 0;
12477 SET_H_INSN_PREFIXED_P (opval);
12478 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12482 USI opval = crisv10f_break_handler (current_cpu, FLD (f_u4), pc);
12483 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12484 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12488 SEM_BRANCH_FINI (vpc);
12489 #undef FLD
12491 NEXT (vpc);
12493 CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
12495 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12496 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12497 #define FLD(f) abuf->fields.sfmt_muls_b.f
12498 int UNUSED written = 0;
12499 IADDR UNUSED pc = abuf->addr;
12500 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12503 SI tmp_tmpopd;
12504 SI tmp_tmpops;
12505 SI tmp_newval;
12506 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
12507 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12508 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12510 SI opval = tmp_newval;
12511 SET_H_GR (FLD (f_operand2), opval);
12512 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12516 BI opval = LTSI (tmp_newval, 0);
12517 CPU (h_nbit) = opval;
12518 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12521 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12522 CPU (h_zbit) = opval;
12523 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12525 SET_H_CBIT_MOVE (0);
12526 SET_H_VBIT_MOVE (0);
12529 BI opval = 0;
12530 CPU (h_xbit) = opval;
12531 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12534 BI opval = 0;
12535 SET_H_INSN_PREFIXED_P (opval);
12536 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12542 #undef FLD
12544 NEXT (vpc);
12546 CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
12548 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12549 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12550 #define FLD(f) abuf->fields.sfmt_muls_b.f
12551 int UNUSED written = 0;
12552 IADDR UNUSED pc = abuf->addr;
12553 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12556 SI tmp_tmpopd;
12557 SI tmp_tmpops;
12558 SI tmp_newval;
12559 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
12560 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12561 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12563 SI opval = tmp_newval;
12564 SET_H_GR (FLD (f_operand2), opval);
12565 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12569 BI opval = LTSI (tmp_newval, 0);
12570 CPU (h_nbit) = opval;
12571 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12574 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12575 CPU (h_zbit) = opval;
12576 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12578 SET_H_CBIT_MOVE (0);
12579 SET_H_VBIT_MOVE (0);
12582 BI opval = 0;
12583 CPU (h_xbit) = opval;
12584 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12587 BI opval = 0;
12588 SET_H_INSN_PREFIXED_P (opval);
12589 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12595 #undef FLD
12597 NEXT (vpc);
12599 CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
12601 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12602 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12603 #define FLD(f) abuf->fields.sfmt_muls_b.f
12604 int UNUSED written = 0;
12605 IADDR UNUSED pc = abuf->addr;
12606 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12609 SI tmp_tmpopd;
12610 SI tmp_tmpops;
12611 SI tmp_newval;
12612 tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
12613 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12614 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12616 SI opval = tmp_newval;
12617 SET_H_GR (FLD (f_operand2), opval);
12618 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12622 BI opval = LTSI (tmp_newval, 0);
12623 CPU (h_nbit) = opval;
12624 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12627 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12628 CPU (h_zbit) = opval;
12629 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12631 SET_H_CBIT_MOVE (0);
12632 SET_H_VBIT_MOVE (0);
12635 BI opval = 0;
12636 CPU (h_xbit) = opval;
12637 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12640 BI opval = 0;
12641 SET_H_INSN_PREFIXED_P (opval);
12642 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12648 #undef FLD
12650 NEXT (vpc);
12652 CASE (sem, INSN_BOUND_M_B_M) : /* bound-m.b [${Rs}${inc}],${Rd} */
12654 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12655 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12656 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12657 int UNUSED written = 0;
12658 IADDR UNUSED pc = abuf->addr;
12659 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12662 SI tmp_tmpopd;
12663 SI tmp_tmpops;
12664 SI tmp_newval;
12665 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
12666 QI tmp_tmp_mem;
12667 BI tmp_postinc;
12668 tmp_postinc = FLD (f_memmode);
12669 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12670 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
12671 ; if (NEBI (tmp_postinc, 0)) {
12673 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12674 tmp_addr = ADDSI (tmp_addr, 1);
12677 SI opval = tmp_addr;
12678 SET_H_GR (FLD (f_operand1), opval);
12679 written |= (1 << 9);
12680 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12684 ; tmp_tmp_mem; }));
12685 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12686 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12687 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12689 SI opval = tmp_newval;
12690 SET_H_GR (FLD (f_operand1), opval);
12691 written |= (1 << 9);
12692 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12694 } else {
12696 SI opval = tmp_newval;
12697 SET_H_GR (FLD (f_operand2), opval);
12698 written |= (1 << 8);
12699 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12704 BI opval = LTSI (tmp_newval, 0);
12705 CPU (h_nbit) = opval;
12706 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12709 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12710 CPU (h_zbit) = opval;
12711 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12713 SET_H_CBIT_MOVE (0);
12714 SET_H_VBIT_MOVE (0);
12717 BI opval = 0;
12718 CPU (h_xbit) = opval;
12719 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12722 BI opval = 0;
12723 SET_H_INSN_PREFIXED_P (opval);
12724 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12730 abuf->written = written;
12731 #undef FLD
12733 NEXT (vpc);
12735 CASE (sem, INSN_BOUND_M_W_M) : /* bound-m.w [${Rs}${inc}],${Rd} */
12737 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12738 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12739 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12740 int UNUSED written = 0;
12741 IADDR UNUSED pc = abuf->addr;
12742 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12745 SI tmp_tmpopd;
12746 SI tmp_tmpops;
12747 SI tmp_newval;
12748 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
12749 HI tmp_tmp_mem;
12750 BI tmp_postinc;
12751 tmp_postinc = FLD (f_memmode);
12752 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12753 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
12754 ; if (NEBI (tmp_postinc, 0)) {
12756 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12757 tmp_addr = ADDSI (tmp_addr, 2);
12760 SI opval = tmp_addr;
12761 SET_H_GR (FLD (f_operand1), opval);
12762 written |= (1 << 9);
12763 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12767 ; tmp_tmp_mem; }));
12768 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12769 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12770 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12772 SI opval = tmp_newval;
12773 SET_H_GR (FLD (f_operand1), opval);
12774 written |= (1 << 9);
12775 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12777 } else {
12779 SI opval = tmp_newval;
12780 SET_H_GR (FLD (f_operand2), opval);
12781 written |= (1 << 8);
12782 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12787 BI opval = LTSI (tmp_newval, 0);
12788 CPU (h_nbit) = opval;
12789 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12792 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12793 CPU (h_zbit) = opval;
12794 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12796 SET_H_CBIT_MOVE (0);
12797 SET_H_VBIT_MOVE (0);
12800 BI opval = 0;
12801 CPU (h_xbit) = opval;
12802 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12805 BI opval = 0;
12806 SET_H_INSN_PREFIXED_P (opval);
12807 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12813 abuf->written = written;
12814 #undef FLD
12816 NEXT (vpc);
12818 CASE (sem, INSN_BOUND_M_D_M) : /* bound-m.d [${Rs}${inc}],${Rd} */
12820 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12821 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12822 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12823 int UNUSED written = 0;
12824 IADDR UNUSED pc = abuf->addr;
12825 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12828 SI tmp_tmpopd;
12829 SI tmp_tmpops;
12830 SI tmp_newval;
12831 tmp_tmpops = ({ SI tmp_addr;
12832 SI tmp_tmp_mem;
12833 BI tmp_postinc;
12834 tmp_postinc = FLD (f_memmode);
12835 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12836 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
12837 ; if (NEBI (tmp_postinc, 0)) {
12839 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12840 tmp_addr = ADDSI (tmp_addr, 4);
12843 SI opval = tmp_addr;
12844 SET_H_GR (FLD (f_operand1), opval);
12845 written |= (1 << 9);
12846 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12850 ; tmp_tmp_mem; });
12851 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12852 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12853 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12855 SI opval = tmp_newval;
12856 SET_H_GR (FLD (f_operand1), opval);
12857 written |= (1 << 9);
12858 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12860 } else {
12862 SI opval = tmp_newval;
12863 SET_H_GR (FLD (f_operand2), opval);
12864 written |= (1 << 8);
12865 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12870 BI opval = LTSI (tmp_newval, 0);
12871 CPU (h_nbit) = opval;
12872 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12875 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12876 CPU (h_zbit) = opval;
12877 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12879 SET_H_CBIT_MOVE (0);
12880 SET_H_VBIT_MOVE (0);
12883 BI opval = 0;
12884 CPU (h_xbit) = opval;
12885 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12888 BI opval = 0;
12889 SET_H_INSN_PREFIXED_P (opval);
12890 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12896 abuf->written = written;
12897 #undef FLD
12899 NEXT (vpc);
12901 CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
12903 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12904 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12905 #define FLD(f) abuf->fields.sfmt_bound_cb.f
12906 int UNUSED written = 0;
12907 IADDR UNUSED pc = abuf->addr;
12908 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12911 SI tmp_tmpopd;
12912 SI tmp_tmpops;
12913 SI tmp_newval;
12914 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
12915 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12916 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12918 SI opval = tmp_newval;
12919 SET_H_GR (FLD (f_operand2), opval);
12920 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12924 BI opval = LTSI (tmp_newval, 0);
12925 CPU (h_nbit) = opval;
12926 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12929 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12930 CPU (h_zbit) = opval;
12931 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12933 SET_H_CBIT_MOVE (0);
12934 SET_H_VBIT_MOVE (0);
12937 BI opval = 0;
12938 CPU (h_xbit) = opval;
12939 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12942 BI opval = 0;
12943 SET_H_INSN_PREFIXED_P (opval);
12944 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12950 #undef FLD
12952 NEXT (vpc);
12954 CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
12956 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12957 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12958 #define FLD(f) abuf->fields.sfmt_bound_cw.f
12959 int UNUSED written = 0;
12960 IADDR UNUSED pc = abuf->addr;
12961 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12964 SI tmp_tmpopd;
12965 SI tmp_tmpops;
12966 SI tmp_newval;
12967 tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
12968 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12969 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12971 SI opval = tmp_newval;
12972 SET_H_GR (FLD (f_operand2), opval);
12973 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12977 BI opval = LTSI (tmp_newval, 0);
12978 CPU (h_nbit) = opval;
12979 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12982 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12983 CPU (h_zbit) = opval;
12984 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12986 SET_H_CBIT_MOVE (0);
12987 SET_H_VBIT_MOVE (0);
12990 BI opval = 0;
12991 CPU (h_xbit) = opval;
12992 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12995 BI opval = 0;
12996 SET_H_INSN_PREFIXED_P (opval);
12997 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13003 #undef FLD
13005 NEXT (vpc);
13007 CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
13009 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13010 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13011 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13012 int UNUSED written = 0;
13013 IADDR UNUSED pc = abuf->addr;
13014 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13017 SI tmp_tmpopd;
13018 SI tmp_tmpops;
13019 SI tmp_newval;
13020 tmp_tmpops = FLD (f_indir_pc__dword);
13021 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13022 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13024 SI opval = tmp_newval;
13025 SET_H_GR (FLD (f_operand2), opval);
13026 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13030 BI opval = LTSI (tmp_newval, 0);
13031 CPU (h_nbit) = opval;
13032 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13035 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13036 CPU (h_zbit) = opval;
13037 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13039 SET_H_CBIT_MOVE (0);
13040 SET_H_VBIT_MOVE (0);
13043 BI opval = 0;
13044 CPU (h_xbit) = opval;
13045 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13048 BI opval = 0;
13049 SET_H_INSN_PREFIXED_P (opval);
13050 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13056 #undef FLD
13058 NEXT (vpc);
13060 CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
13062 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13063 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13064 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13065 int UNUSED written = 0;
13066 IADDR UNUSED pc = abuf->addr;
13067 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13070 BI tmp_truthval;
13071 tmp_truthval = ({ SI tmp_tmpcond;
13072 BI tmp_condres;
13073 tmp_tmpcond = FLD (f_operand2);
13074 ; if (EQSI (tmp_tmpcond, 0)) {
13075 tmp_condres = NOTBI (CPU (h_cbit));
13077 else if (EQSI (tmp_tmpcond, 1)) {
13078 tmp_condres = CPU (h_cbit);
13080 else if (EQSI (tmp_tmpcond, 2)) {
13081 tmp_condres = NOTBI (CPU (h_zbit));
13083 else if (EQSI (tmp_tmpcond, 3)) {
13084 tmp_condres = CPU (h_zbit);
13086 else if (EQSI (tmp_tmpcond, 4)) {
13087 tmp_condres = NOTBI (CPU (h_vbit));
13089 else if (EQSI (tmp_tmpcond, 5)) {
13090 tmp_condres = CPU (h_vbit);
13092 else if (EQSI (tmp_tmpcond, 6)) {
13093 tmp_condres = NOTBI (CPU (h_nbit));
13095 else if (EQSI (tmp_tmpcond, 7)) {
13096 tmp_condres = CPU (h_nbit);
13098 else if (EQSI (tmp_tmpcond, 8)) {
13099 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
13101 else if (EQSI (tmp_tmpcond, 9)) {
13102 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
13104 else if (EQSI (tmp_tmpcond, 10)) {
13105 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
13107 else if (EQSI (tmp_tmpcond, 11)) {
13108 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
13110 else if (EQSI (tmp_tmpcond, 12)) {
13111 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
13113 else if (EQSI (tmp_tmpcond, 13)) {
13114 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
13116 else if (EQSI (tmp_tmpcond, 14)) {
13117 tmp_condres = 1;
13119 else if (EQSI (tmp_tmpcond, 15)) {
13120 tmp_condres = CPU (h_pbit);
13122 ; tmp_condres; });
13124 SI opval = ZEXTBISI (tmp_truthval);
13125 SET_H_GR (FLD (f_operand1), opval);
13126 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13130 BI opval = 0;
13131 CPU (h_xbit) = opval;
13132 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13135 BI opval = 0;
13136 SET_H_INSN_PREFIXED_P (opval);
13137 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13142 #undef FLD
13144 NEXT (vpc);
13146 CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
13148 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13149 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13150 #define FLD(f) abuf->fields.sfmt_muls_b.f
13151 int UNUSED written = 0;
13152 IADDR UNUSED pc = abuf->addr;
13153 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13156 SI tmp_tmpd;
13157 SI tmp_tmp;
13158 tmp_tmp = GET_H_GR (FLD (f_operand1));
13159 tmp_tmpd = 0;
13161 if (GESI (tmp_tmp, 0)) {
13163 tmp_tmp = SLLSI (tmp_tmp, 1);
13164 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13167 if (GESI (tmp_tmp, 0)) {
13169 tmp_tmp = SLLSI (tmp_tmp, 1);
13170 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13173 if (GESI (tmp_tmp, 0)) {
13175 tmp_tmp = SLLSI (tmp_tmp, 1);
13176 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13179 if (GESI (tmp_tmp, 0)) {
13181 tmp_tmp = SLLSI (tmp_tmp, 1);
13182 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13185 if (GESI (tmp_tmp, 0)) {
13187 tmp_tmp = SLLSI (tmp_tmp, 1);
13188 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13191 if (GESI (tmp_tmp, 0)) {
13193 tmp_tmp = SLLSI (tmp_tmp, 1);
13194 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13197 if (GESI (tmp_tmp, 0)) {
13199 tmp_tmp = SLLSI (tmp_tmp, 1);
13200 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13203 if (GESI (tmp_tmp, 0)) {
13205 tmp_tmp = SLLSI (tmp_tmp, 1);
13206 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13209 if (GESI (tmp_tmp, 0)) {
13211 tmp_tmp = SLLSI (tmp_tmp, 1);
13212 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13215 if (GESI (tmp_tmp, 0)) {
13217 tmp_tmp = SLLSI (tmp_tmp, 1);
13218 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13221 if (GESI (tmp_tmp, 0)) {
13223 tmp_tmp = SLLSI (tmp_tmp, 1);
13224 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13227 if (GESI (tmp_tmp, 0)) {
13229 tmp_tmp = SLLSI (tmp_tmp, 1);
13230 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13233 if (GESI (tmp_tmp, 0)) {
13235 tmp_tmp = SLLSI (tmp_tmp, 1);
13236 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13239 if (GESI (tmp_tmp, 0)) {
13241 tmp_tmp = SLLSI (tmp_tmp, 1);
13242 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13245 if (GESI (tmp_tmp, 0)) {
13247 tmp_tmp = SLLSI (tmp_tmp, 1);
13248 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13251 if (GESI (tmp_tmp, 0)) {
13253 tmp_tmp = SLLSI (tmp_tmp, 1);
13254 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13257 if (GESI (tmp_tmp, 0)) {
13259 tmp_tmp = SLLSI (tmp_tmp, 1);
13260 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13263 if (GESI (tmp_tmp, 0)) {
13265 tmp_tmp = SLLSI (tmp_tmp, 1);
13266 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13269 if (GESI (tmp_tmp, 0)) {
13271 tmp_tmp = SLLSI (tmp_tmp, 1);
13272 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13275 if (GESI (tmp_tmp, 0)) {
13277 tmp_tmp = SLLSI (tmp_tmp, 1);
13278 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13281 if (GESI (tmp_tmp, 0)) {
13283 tmp_tmp = SLLSI (tmp_tmp, 1);
13284 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13287 if (GESI (tmp_tmp, 0)) {
13289 tmp_tmp = SLLSI (tmp_tmp, 1);
13290 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13293 if (GESI (tmp_tmp, 0)) {
13295 tmp_tmp = SLLSI (tmp_tmp, 1);
13296 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13299 if (GESI (tmp_tmp, 0)) {
13301 tmp_tmp = SLLSI (tmp_tmp, 1);
13302 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13305 if (GESI (tmp_tmp, 0)) {
13307 tmp_tmp = SLLSI (tmp_tmp, 1);
13308 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13311 if (GESI (tmp_tmp, 0)) {
13313 tmp_tmp = SLLSI (tmp_tmp, 1);
13314 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13317 if (GESI (tmp_tmp, 0)) {
13319 tmp_tmp = SLLSI (tmp_tmp, 1);
13320 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13323 if (GESI (tmp_tmp, 0)) {
13325 tmp_tmp = SLLSI (tmp_tmp, 1);
13326 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13329 if (GESI (tmp_tmp, 0)) {
13331 tmp_tmp = SLLSI (tmp_tmp, 1);
13332 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13335 if (GESI (tmp_tmp, 0)) {
13337 tmp_tmp = SLLSI (tmp_tmp, 1);
13338 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13341 if (GESI (tmp_tmp, 0)) {
13343 tmp_tmp = SLLSI (tmp_tmp, 1);
13344 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13347 if (GESI (tmp_tmp, 0)) {
13349 tmp_tmp = SLLSI (tmp_tmp, 1);
13350 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13355 SI opval = tmp_tmpd;
13356 SET_H_GR (FLD (f_operand2), opval);
13357 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13361 BI opval = LTSI (tmp_tmpd, 0);
13362 CPU (h_nbit) = opval;
13363 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13366 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13367 CPU (h_zbit) = opval;
13368 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13370 SET_H_CBIT_MOVE (0);
13371 SET_H_VBIT_MOVE (0);
13374 BI opval = 0;
13375 CPU (h_xbit) = opval;
13376 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13379 BI opval = 0;
13380 SET_H_INSN_PREFIXED_P (opval);
13381 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13387 #undef FLD
13389 NEXT (vpc);
13391 CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
13393 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13394 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13395 #define FLD(f) abuf->fields.sfmt_addoq.f
13396 int UNUSED written = 0;
13397 IADDR UNUSED pc = abuf->addr;
13398 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13402 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
13403 CPU (h_prefixreg_pre_v32) = opval;
13404 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13407 BI opval = 1;
13408 SET_H_INSN_PREFIXED_P (opval);
13409 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13413 #undef FLD
13415 NEXT (vpc);
13417 CASE (sem, INSN_BDAPQPC) : /* bdapq $o,PC */
13419 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13420 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13421 #define FLD(f) abuf->fields.sfmt_addoq.f
13422 int UNUSED written = 0;
13423 IADDR UNUSED pc = abuf->addr;
13424 SEM_BRANCH_INIT
13425 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13429 SI opval = ADDSI (ADDSI (pc, 2), FLD (f_s8));
13430 CPU (h_prefixreg_pre_v32) = opval;
13431 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13434 BI opval = 1;
13435 SET_H_INSN_PREFIXED_P (opval);
13436 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13438 cris_flush_simulator_decode_cache (current_cpu, pc);
13441 SEM_BRANCH_FINI (vpc);
13442 #undef FLD
13444 NEXT (vpc);
13446 CASE (sem, INSN_BDAP_32_PC) : /* bdap ${sconst32},PC */
13448 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13449 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13450 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13451 int UNUSED written = 0;
13452 IADDR UNUSED pc = abuf->addr;
13453 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13456 SI tmp_newpc;
13457 SI tmp_oldpc;
13458 SI tmp_offs;
13459 tmp_offs = FLD (f_indir_pc__dword);
13460 tmp_oldpc = ADDSI (pc, 6);
13461 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
13463 SI opval = tmp_newpc;
13464 CPU (h_prefixreg_pre_v32) = opval;
13465 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13468 BI opval = 1;
13469 SET_H_INSN_PREFIXED_P (opval);
13470 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13474 #undef FLD
13476 NEXT (vpc);
13478 CASE (sem, INSN_MOVE_M_PCPLUS_P0) : /* move [PC+],P0 */
13480 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13481 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13482 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13483 int UNUSED written = 0;
13484 IADDR UNUSED pc = abuf->addr;
13485 SEM_BRANCH_INIT
13486 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13488 if (GET_H_INSN_PREFIXED_P ()) {
13490 QI tmp_dummy;
13491 tmp_dummy = ({ SI tmp_addr;
13492 QI tmp_tmp_mem;
13493 BI tmp_postinc;
13494 tmp_postinc = FLD (f_memmode);
13495 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (pc) : (CPU (h_prefixreg_pre_v32)));
13496 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13497 ; if (NEBI (tmp_postinc, 0)) {
13499 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13500 tmp_addr = ADDSI (tmp_addr, 1);
13503 USI opval = tmp_addr;
13504 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13505 written |= (1 << 5);
13506 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13510 ; tmp_tmp_mem; });
13513 BI opval = 0;
13514 CPU (h_xbit) = opval;
13515 written |= (1 << 7);
13516 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13519 BI opval = 0;
13520 SET_H_INSN_PREFIXED_P (opval);
13521 written |= (1 << 6);
13522 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13526 } else {
13527 cgen_rtx_error (current_cpu, "move [PC+],P0 without prefix is not implemented");
13530 abuf->written = written;
13531 SEM_BRANCH_FINI (vpc);
13532 #undef FLD
13534 NEXT (vpc);
13536 CASE (sem, INSN_MOVE_M_SPPLUS_P8) : /* move [SP+],P8 */
13538 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13539 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13540 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13541 int UNUSED written = 0;
13542 IADDR UNUSED pc = abuf->addr;
13543 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13545 if (GET_H_INSN_PREFIXED_P ()) {
13547 SI tmp_dummy;
13548 tmp_dummy = ({ SI tmp_addr;
13549 SI tmp_tmp_mem;
13550 BI tmp_postinc;
13551 tmp_postinc = FLD (f_memmode);
13552 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (((UINT) 14))) : (CPU (h_prefixreg_pre_v32)));
13553 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13554 ; if (NEBI (tmp_postinc, 0)) {
13556 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13557 tmp_addr = ADDSI (tmp_addr, 4);
13560 SI opval = tmp_addr;
13561 SET_H_GR (((UINT) 14), opval);
13562 written |= (1 << 5);
13563 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13567 ; tmp_tmp_mem; });
13570 BI opval = 0;
13571 CPU (h_xbit) = opval;
13572 written |= (1 << 7);
13573 TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13576 BI opval = 0;
13577 SET_H_INSN_PREFIXED_P (opval);
13578 written |= (1 << 6);
13579 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13583 } else {
13584 cgen_rtx_error (current_cpu, "move [SP+],P8 without prefix is not implemented");
13587 abuf->written = written;
13588 #undef FLD
13590 NEXT (vpc);
13592 CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13594 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13595 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13596 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13597 int UNUSED written = 0;
13598 IADDR UNUSED pc = abuf->addr;
13599 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13602 QI tmp_tmps;
13603 tmp_tmps = ({ SI tmp_addr;
13604 QI tmp_tmp_mem;
13605 BI tmp_postinc;
13606 tmp_postinc = FLD (f_memmode);
13607 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13608 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13609 ; if (NEBI (tmp_postinc, 0)) {
13611 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13612 tmp_addr = ADDSI (tmp_addr, 1);
13615 SI opval = tmp_addr;
13616 SET_H_GR (FLD (f_operand1), opval);
13617 written |= (1 << 6);
13618 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13622 ; tmp_tmp_mem; });
13624 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
13625 CPU (h_prefixreg_pre_v32) = opval;
13626 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13629 BI opval = 1;
13630 SET_H_INSN_PREFIXED_P (opval);
13631 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13635 abuf->written = written;
13636 #undef FLD
13638 NEXT (vpc);
13640 CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13642 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13643 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13644 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13645 int UNUSED written = 0;
13646 IADDR UNUSED pc = abuf->addr;
13647 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13650 HI tmp_tmps;
13651 tmp_tmps = ({ SI tmp_addr;
13652 HI tmp_tmp_mem;
13653 BI tmp_postinc;
13654 tmp_postinc = FLD (f_memmode);
13655 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13656 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
13657 ; if (NEBI (tmp_postinc, 0)) {
13659 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13660 tmp_addr = ADDSI (tmp_addr, 2);
13663 SI opval = tmp_addr;
13664 SET_H_GR (FLD (f_operand1), opval);
13665 written |= (1 << 6);
13666 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13670 ; tmp_tmp_mem; });
13672 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
13673 CPU (h_prefixreg_pre_v32) = opval;
13674 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13677 BI opval = 1;
13678 SET_H_INSN_PREFIXED_P (opval);
13679 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13683 abuf->written = written;
13684 #undef FLD
13686 NEXT (vpc);
13688 CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13690 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13691 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13692 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13693 int UNUSED written = 0;
13694 IADDR UNUSED pc = abuf->addr;
13695 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13698 SI tmp_tmps;
13699 tmp_tmps = ({ SI tmp_addr;
13700 SI tmp_tmp_mem;
13701 BI tmp_postinc;
13702 tmp_postinc = FLD (f_memmode);
13703 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13704 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13705 ; if (NEBI (tmp_postinc, 0)) {
13707 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13708 tmp_addr = ADDSI (tmp_addr, 4);
13711 SI opval = tmp_addr;
13712 SET_H_GR (FLD (f_operand1), opval);
13713 written |= (1 << 6);
13714 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13718 ; tmp_tmp_mem; });
13720 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
13721 CPU (h_prefixreg_pre_v32) = opval;
13722 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13725 BI opval = 1;
13726 SET_H_INSN_PREFIXED_P (opval);
13727 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13731 abuf->written = written;
13732 #undef FLD
13734 NEXT (vpc);
13736 CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
13738 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13739 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13740 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13741 int UNUSED written = 0;
13742 IADDR UNUSED pc = abuf->addr;
13743 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13747 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
13748 CPU (h_prefixreg_pre_v32) = opval;
13749 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13752 BI opval = 1;
13753 SET_H_INSN_PREFIXED_P (opval);
13754 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13758 #undef FLD
13760 NEXT (vpc);
13762 CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
13764 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13765 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13766 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13767 int UNUSED written = 0;
13768 IADDR UNUSED pc = abuf->addr;
13769 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13773 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
13774 CPU (h_prefixreg_pre_v32) = opval;
13775 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13778 BI opval = 1;
13779 SET_H_INSN_PREFIXED_P (opval);
13780 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13784 #undef FLD
13786 NEXT (vpc);
13788 CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
13790 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13791 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13792 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13793 int UNUSED written = 0;
13794 IADDR UNUSED pc = abuf->addr;
13795 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13799 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
13800 CPU (h_prefixreg_pre_v32) = opval;
13801 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13804 BI opval = 1;
13805 SET_H_INSN_PREFIXED_P (opval);
13806 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13810 #undef FLD
13812 NEXT (vpc);
13814 CASE (sem, INSN_DIP_M) : /* dip [${Rs}${inc}] */
13816 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13817 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13818 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13819 int UNUSED written = 0;
13820 IADDR UNUSED pc = abuf->addr;
13821 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13824 SI tmp_tmps;
13825 tmp_tmps = ({ SI tmp_addr;
13826 SI tmp_tmp_mem;
13827 BI tmp_postinc;
13828 tmp_postinc = FLD (f_memmode);
13829 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13830 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13831 ; if (NEBI (tmp_postinc, 0)) {
13833 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13834 tmp_addr = ADDSI (tmp_addr, 4);
13837 SI opval = tmp_addr;
13838 SET_H_GR (FLD (f_operand1), opval);
13839 written |= (1 << 5);
13840 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13844 ; tmp_tmp_mem; });
13846 SI opval = tmp_tmps;
13847 CPU (h_prefixreg_pre_v32) = opval;
13848 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13851 BI opval = 1;
13852 SET_H_INSN_PREFIXED_P (opval);
13853 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13857 abuf->written = written;
13858 #undef FLD
13860 NEXT (vpc);
13862 CASE (sem, INSN_DIP_C) : /* dip [PC+] */
13864 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13865 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13866 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13867 int UNUSED written = 0;
13868 IADDR UNUSED pc = abuf->addr;
13869 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13873 SI opval = FLD (f_indir_pc__dword);
13874 CPU (h_prefixreg_pre_v32) = opval;
13875 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13878 BI opval = 1;
13879 SET_H_INSN_PREFIXED_P (opval);
13880 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13884 #undef FLD
13886 NEXT (vpc);
13888 CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13890 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13891 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13892 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13893 int UNUSED written = 0;
13894 IADDR UNUSED pc = abuf->addr;
13895 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13899 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13900 CPU (h_prefixreg_pre_v32) = opval;
13901 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13904 BI opval = 1;
13905 SET_H_INSN_PREFIXED_P (opval);
13906 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13910 #undef FLD
13912 NEXT (vpc);
13914 CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13916 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13917 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13918 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13919 int UNUSED written = 0;
13920 IADDR UNUSED pc = abuf->addr;
13921 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13925 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13926 CPU (h_prefixreg_pre_v32) = opval;
13927 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13930 BI opval = 1;
13931 SET_H_INSN_PREFIXED_P (opval);
13932 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13936 #undef FLD
13938 NEXT (vpc);
13940 CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
13942 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13943 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13944 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13945 int UNUSED written = 0;
13946 IADDR UNUSED pc = abuf->addr;
13947 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13951 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
13952 CPU (h_prefixreg_pre_v32) = opval;
13953 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13956 BI opval = 1;
13957 SET_H_INSN_PREFIXED_P (opval);
13958 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13962 #undef FLD
13964 NEXT (vpc);
13966 CASE (sem, INSN_BIAP_PC_B_R) : /* biap-pc.b ${Rs-dfield}.m,PC */
13968 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13969 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13970 #define FLD(f) abuf->fields.sfmt_addoq.f
13971 int UNUSED written = 0;
13972 IADDR UNUSED pc = abuf->addr;
13973 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13977 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13978 CPU (h_prefixreg_pre_v32) = opval;
13979 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13982 BI opval = 1;
13983 SET_H_INSN_PREFIXED_P (opval);
13984 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13988 #undef FLD
13990 NEXT (vpc);
13992 CASE (sem, INSN_BIAP_PC_W_R) : /* biap-pc.w ${Rs-dfield}.m,PC */
13994 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13995 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13996 #define FLD(f) abuf->fields.sfmt_addoq.f
13997 int UNUSED written = 0;
13998 IADDR UNUSED pc = abuf->addr;
13999 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14003 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 2));
14004 CPU (h_prefixreg_pre_v32) = opval;
14005 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14008 BI opval = 1;
14009 SET_H_INSN_PREFIXED_P (opval);
14010 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14014 #undef FLD
14016 NEXT (vpc);
14018 CASE (sem, INSN_BIAP_PC_D_R) : /* biap-pc.d ${Rs-dfield}.m,PC */
14020 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14021 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14022 #define FLD(f) abuf->fields.sfmt_addoq.f
14023 int UNUSED written = 0;
14024 IADDR UNUSED pc = abuf->addr;
14025 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14029 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 4));
14030 CPU (h_prefixreg_pre_v32) = opval;
14031 TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14034 BI opval = 1;
14035 SET_H_INSN_PREFIXED_P (opval);
14036 TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14040 #undef FLD
14042 NEXT (vpc);
14046 ENDSWITCH (sem) /* End of semantic switch. */
14048 /* At this point `vpc' contains the next insn to execute. */
14051 #undef DEFINE_SWITCH
14052 #endif /* DEFINE_SWITCH */