Use GNU make pattern rule in ld Makefile
[binutils-gdb.git] / sim / semcrisv32f-switch.c
blob8dd455c94e9adc3e1bc35bf9b5261ea01212e924
1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996-2023 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 { CRISV32F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
36 { CRISV32F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
37 { CRISV32F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
38 { CRISV32F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
39 { CRISV32F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
40 { CRISV32F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
41 { CRISV32F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
42 { CRISV32F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
43 { CRISV32F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
44 { CRISV32F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
45 { CRISV32F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
46 { CRISV32F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
47 { CRISV32F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
48 { CRISV32F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
49 { CRISV32F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
50 { CRISV32F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
51 { CRISV32F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
52 { CRISV32F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
53 { CRISV32F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
54 { CRISV32F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
55 { CRISV32F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
56 { CRISV32F_INSN_ADDQ, && case_sem_INSN_ADDQ },
57 { CRISV32F_INSN_SUBQ, && case_sem_INSN_SUBQ },
58 { CRISV32F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
59 { CRISV32F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
60 { CRISV32F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
61 { CRISV32F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
62 { CRISV32F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
63 { CRISV32F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
64 { CRISV32F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
65 { CRISV32F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
66 { CRISV32F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
67 { CRISV32F_INSN_CMPQ, && case_sem_INSN_CMPQ },
68 { CRISV32F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
69 { CRISV32F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
70 { CRISV32F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
71 { CRISV32F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
72 { CRISV32F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
73 { CRISV32F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
74 { CRISV32F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
75 { CRISV32F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
76 { CRISV32F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
77 { CRISV32F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
78 { CRISV32F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
79 { CRISV32F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
80 { CRISV32F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
81 { CRISV32F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
82 { CRISV32F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
83 { CRISV32F_INSN_MOVE_R_SPRV32, && case_sem_INSN_MOVE_R_SPRV32 },
84 { CRISV32F_INSN_MOVE_SPR_RV32, && case_sem_INSN_MOVE_SPR_RV32 },
85 { CRISV32F_INSN_MOVE_M_SPRV32, && case_sem_INSN_MOVE_M_SPRV32 },
86 { CRISV32F_INSN_MOVE_C_SPRV32_P2, && case_sem_INSN_MOVE_C_SPRV32_P2 },
87 { CRISV32F_INSN_MOVE_C_SPRV32_P3, && case_sem_INSN_MOVE_C_SPRV32_P3 },
88 { CRISV32F_INSN_MOVE_C_SPRV32_P5, && case_sem_INSN_MOVE_C_SPRV32_P5 },
89 { CRISV32F_INSN_MOVE_C_SPRV32_P6, && case_sem_INSN_MOVE_C_SPRV32_P6 },
90 { CRISV32F_INSN_MOVE_C_SPRV32_P7, && case_sem_INSN_MOVE_C_SPRV32_P7 },
91 { CRISV32F_INSN_MOVE_C_SPRV32_P9, && case_sem_INSN_MOVE_C_SPRV32_P9 },
92 { CRISV32F_INSN_MOVE_C_SPRV32_P10, && case_sem_INSN_MOVE_C_SPRV32_P10 },
93 { CRISV32F_INSN_MOVE_C_SPRV32_P11, && case_sem_INSN_MOVE_C_SPRV32_P11 },
94 { CRISV32F_INSN_MOVE_C_SPRV32_P12, && case_sem_INSN_MOVE_C_SPRV32_P12 },
95 { CRISV32F_INSN_MOVE_C_SPRV32_P13, && case_sem_INSN_MOVE_C_SPRV32_P13 },
96 { CRISV32F_INSN_MOVE_C_SPRV32_P14, && case_sem_INSN_MOVE_C_SPRV32_P14 },
97 { CRISV32F_INSN_MOVE_C_SPRV32_P15, && case_sem_INSN_MOVE_C_SPRV32_P15 },
98 { CRISV32F_INSN_MOVE_SPR_MV32, && case_sem_INSN_MOVE_SPR_MV32 },
99 { CRISV32F_INSN_MOVE_SS_R, && case_sem_INSN_MOVE_SS_R },
100 { CRISV32F_INSN_MOVE_R_SS, && case_sem_INSN_MOVE_R_SS },
101 { CRISV32F_INSN_MOVEM_R_M_V32, && case_sem_INSN_MOVEM_R_M_V32 },
102 { CRISV32F_INSN_MOVEM_M_R_V32, && case_sem_INSN_MOVEM_M_R_V32 },
103 { CRISV32F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
104 { CRISV32F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
105 { CRISV32F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
106 { CRISV32F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
107 { CRISV32F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
108 { CRISV32F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
109 { CRISV32F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
110 { CRISV32F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
111 { CRISV32F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
112 { CRISV32F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
113 { CRISV32F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
114 { CRISV32F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
115 { CRISV32F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
116 { CRISV32F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
117 { CRISV32F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
118 { CRISV32F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
119 { CRISV32F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
120 { CRISV32F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
121 { CRISV32F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
122 { CRISV32F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
123 { CRISV32F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
124 { CRISV32F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
125 { CRISV32F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
126 { CRISV32F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
127 { CRISV32F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
128 { CRISV32F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
129 { CRISV32F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
130 { CRISV32F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
131 { CRISV32F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
132 { CRISV32F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
133 { CRISV32F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
134 { CRISV32F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
135 { CRISV32F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
136 { CRISV32F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
137 { CRISV32F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
138 { CRISV32F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
139 { CRISV32F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
140 { CRISV32F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
141 { CRISV32F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
142 { CRISV32F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
143 { CRISV32F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
144 { CRISV32F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
145 { CRISV32F_INSN_ADDC_R, && case_sem_INSN_ADDC_R },
146 { CRISV32F_INSN_ADDC_M, && case_sem_INSN_ADDC_M },
147 { CRISV32F_INSN_ADDC_C, && case_sem_INSN_ADDC_C },
148 { CRISV32F_INSN_LAPC_D, && case_sem_INSN_LAPC_D },
149 { CRISV32F_INSN_LAPCQ, && case_sem_INSN_LAPCQ },
150 { CRISV32F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
151 { CRISV32F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
152 { CRISV32F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
153 { CRISV32F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
154 { CRISV32F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
155 { CRISV32F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
156 { CRISV32F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
157 { CRISV32F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
158 { CRISV32F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
159 { CRISV32F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
160 { CRISV32F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
161 { CRISV32F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
162 { CRISV32F_INSN_MULS_B, && case_sem_INSN_MULS_B },
163 { CRISV32F_INSN_MULS_W, && case_sem_INSN_MULS_W },
164 { CRISV32F_INSN_MULS_D, && case_sem_INSN_MULS_D },
165 { CRISV32F_INSN_MULU_B, && case_sem_INSN_MULU_B },
166 { CRISV32F_INSN_MULU_W, && case_sem_INSN_MULU_W },
167 { CRISV32F_INSN_MULU_D, && case_sem_INSN_MULU_D },
168 { CRISV32F_INSN_MCP, && case_sem_INSN_MCP },
169 { CRISV32F_INSN_DSTEP, && case_sem_INSN_DSTEP },
170 { CRISV32F_INSN_ABS, && case_sem_INSN_ABS },
171 { CRISV32F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
172 { CRISV32F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
173 { CRISV32F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
174 { CRISV32F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
175 { CRISV32F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
176 { CRISV32F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
177 { CRISV32F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
178 { CRISV32F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
179 { CRISV32F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
180 { CRISV32F_INSN_ANDQ, && case_sem_INSN_ANDQ },
181 { CRISV32F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
182 { CRISV32F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
183 { CRISV32F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
184 { CRISV32F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
185 { CRISV32F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
186 { CRISV32F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
187 { CRISV32F_INSN_ORCBR, && case_sem_INSN_ORCBR },
188 { CRISV32F_INSN_ORCWR, && case_sem_INSN_ORCWR },
189 { CRISV32F_INSN_ORCDR, && case_sem_INSN_ORCDR },
190 { CRISV32F_INSN_ORQ, && case_sem_INSN_ORQ },
191 { CRISV32F_INSN_XOR, && case_sem_INSN_XOR },
192 { CRISV32F_INSN_SWAP, && case_sem_INSN_SWAP },
193 { CRISV32F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
194 { CRISV32F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
195 { CRISV32F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
196 { CRISV32F_INSN_ASRQ, && case_sem_INSN_ASRQ },
197 { CRISV32F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
198 { CRISV32F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
199 { CRISV32F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
200 { CRISV32F_INSN_LSRQ, && case_sem_INSN_LSRQ },
201 { CRISV32F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
202 { CRISV32F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
203 { CRISV32F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
204 { CRISV32F_INSN_LSLQ, && case_sem_INSN_LSLQ },
205 { CRISV32F_INSN_BTST, && case_sem_INSN_BTST },
206 { CRISV32F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
207 { CRISV32F_INSN_SETF, && case_sem_INSN_SETF },
208 { CRISV32F_INSN_CLEARF, && case_sem_INSN_CLEARF },
209 { CRISV32F_INSN_RFE, && case_sem_INSN_RFE },
210 { CRISV32F_INSN_SFE, && case_sem_INSN_SFE },
211 { CRISV32F_INSN_RFG, && case_sem_INSN_RFG },
212 { CRISV32F_INSN_RFN, && case_sem_INSN_RFN },
213 { CRISV32F_INSN_HALT, && case_sem_INSN_HALT },
214 { CRISV32F_INSN_BCC_B, && case_sem_INSN_BCC_B },
215 { CRISV32F_INSN_BA_B, && case_sem_INSN_BA_B },
216 { CRISV32F_INSN_BCC_W, && case_sem_INSN_BCC_W },
217 { CRISV32F_INSN_BA_W, && case_sem_INSN_BA_W },
218 { CRISV32F_INSN_JAS_R, && case_sem_INSN_JAS_R },
219 { CRISV32F_INSN_JAS_C, && case_sem_INSN_JAS_C },
220 { CRISV32F_INSN_JUMP_P, && case_sem_INSN_JUMP_P },
221 { CRISV32F_INSN_BAS_C, && case_sem_INSN_BAS_C },
222 { CRISV32F_INSN_JASC_R, && case_sem_INSN_JASC_R },
223 { CRISV32F_INSN_JASC_C, && case_sem_INSN_JASC_C },
224 { CRISV32F_INSN_BASC_C, && case_sem_INSN_BASC_C },
225 { CRISV32F_INSN_BREAK, && case_sem_INSN_BREAK },
226 { CRISV32F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
227 { CRISV32F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
228 { CRISV32F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
229 { CRISV32F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
230 { CRISV32F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
231 { CRISV32F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
232 { CRISV32F_INSN_SCC, && case_sem_INSN_SCC },
233 { CRISV32F_INSN_LZ, && case_sem_INSN_LZ },
234 { CRISV32F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
235 { CRISV32F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
236 { CRISV32F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
237 { CRISV32F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
238 { CRISV32F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
239 { CRISV32F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
240 { CRISV32F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
241 { CRISV32F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
242 { CRISV32F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
243 { CRISV32F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
244 { CRISV32F_INSN_FIDXI, && case_sem_INSN_FIDXI },
245 { CRISV32F_INSN_FTAGI, && case_sem_INSN_FTAGI },
246 { CRISV32F_INSN_FIDXD, && case_sem_INSN_FIDXD },
247 { CRISV32F_INSN_FTAGD, && case_sem_INSN_FTAGD },
248 { 0, 0 }
250 int i;
252 for (i = 0; labels[i].label != 0; ++i)
254 #if FAST_P
255 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
256 #else
257 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
258 #endif
261 #undef DEFINE_LABELS
262 #endif /* DEFINE_LABELS */
264 #ifdef DEFINE_SWITCH
266 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
267 off frills like tracing and profiling. */
268 /* FIXME: A better way would be to have TRACE_RESULT check for something
269 that can cause it to be optimized out. Another way would be to emit
270 special handlers into the instruction "stream". */
272 #if FAST_P
273 #undef CGEN_TRACE_RESULT
274 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
275 #endif
277 #undef GET_ATTR
278 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
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.sfmt_empty.f
310 int UNUSED written = 0;
311 IADDR UNUSED pc = abuf->addr;
312 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
315 /* Update the recorded pc in the cpu state struct.
316 Only necessary for WITH_SCACHE case, but to avoid the
317 conditional compilation .... */
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.sfmt_empty.f
335 int UNUSED written = 0;
336 IADDR UNUSED pc = abuf->addr;
337 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
340 #if WITH_SCACHE_PBB_CRISV32F
341 crisv32f_pbb_after (current_cpu, sem_arg);
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.sfmt_empty.f
354 int UNUSED written = 0;
355 IADDR UNUSED pc = abuf->addr;
356 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
359 #if WITH_SCACHE_PBB_CRISV32F
360 crisv32f_pbb_before (current_cpu, sem_arg);
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.sfmt_empty.f
373 int UNUSED written = 0;
374 IADDR UNUSED pc = abuf->addr;
375 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
378 #if WITH_SCACHE_PBB_CRISV32F
379 #ifdef DEFINE_SWITCH
380 vpc = crisv32f_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 = crisv32f_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.sfmt_empty.f
401 int UNUSED written = 0;
402 IADDR UNUSED pc = abuf->addr;
403 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
406 #if WITH_SCACHE_PBB_CRISV32F
407 vpc = crisv32f_pbb_chain (current_cpu, sem_arg);
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.sfmt_empty.f
423 int UNUSED written = 0;
424 IADDR UNUSED pc = abuf->addr;
425 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
428 #if WITH_SCACHE_PBB_CRISV32F
429 #if defined DEFINE_SWITCH || defined FAST_P
430 /* In the switch case FAST_P is a constant, allowing several optimizations
431 in any called inline functions. */
432 vpc = crisv32f_pbb_begin (current_cpu, FAST_P);
433 #else
434 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
435 vpc = crisv32f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
436 #else
437 vpc = crisv32f_pbb_begin (current_cpu, 0);
438 #endif
439 #endif
440 #endif
443 #undef FLD
445 NEXT (vpc);
447 CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
449 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
450 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
451 #define FLD(f) abuf->fields.sfmt_addc_m.f
452 int UNUSED written = 0;
453 IADDR UNUSED pc = abuf->addr;
454 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
457 QI tmp_newval;
458 tmp_newval = GET_H_GR (FLD (f_operand1));
460 SI tmp_oldregval;
461 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
463 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
464 SET_H_GR (FLD (f_operand2), opval);
465 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
470 BI opval = LTQI (tmp_newval, 0);
471 CPU (h_nbit) = opval;
472 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
475 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
476 CPU (h_zbit) = opval;
477 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
479 SET_H_CBIT_MOVE (0);
480 SET_H_VBIT_MOVE (0);
483 BI opval = 0;
484 CPU (h_xbit) = opval;
485 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
488 BI opval = 0;
489 SET_H_INSN_PREFIXED_P (opval);
490 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
496 #undef FLD
498 NEXT (vpc);
500 CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
502 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
503 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
504 #define FLD(f) abuf->fields.sfmt_addc_m.f
505 int UNUSED written = 0;
506 IADDR UNUSED pc = abuf->addr;
507 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
510 HI tmp_newval;
511 tmp_newval = GET_H_GR (FLD (f_operand1));
513 SI tmp_oldregval;
514 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
516 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
517 SET_H_GR (FLD (f_operand2), opval);
518 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
523 BI opval = LTHI (tmp_newval, 0);
524 CPU (h_nbit) = opval;
525 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
528 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
529 CPU (h_zbit) = opval;
530 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
532 SET_H_CBIT_MOVE (0);
533 SET_H_VBIT_MOVE (0);
536 BI opval = 0;
537 CPU (h_xbit) = opval;
538 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
541 BI opval = 0;
542 SET_H_INSN_PREFIXED_P (opval);
543 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
549 #undef FLD
551 NEXT (vpc);
553 CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
555 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
556 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
557 #define FLD(f) abuf->fields.sfmt_addc_m.f
558 int UNUSED written = 0;
559 IADDR UNUSED pc = abuf->addr;
560 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
563 SI tmp_newval;
564 tmp_newval = GET_H_GR (FLD (f_operand1));
566 SI opval = tmp_newval;
567 SET_H_GR (FLD (f_operand2), opval);
568 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
572 BI opval = LTSI (tmp_newval, 0);
573 CPU (h_nbit) = opval;
574 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
577 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
578 CPU (h_zbit) = opval;
579 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
581 SET_H_CBIT_MOVE (0);
582 SET_H_VBIT_MOVE (0);
585 BI opval = 0;
586 CPU (h_xbit) = opval;
587 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
590 BI opval = 0;
591 SET_H_INSN_PREFIXED_P (opval);
592 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
598 #undef FLD
600 NEXT (vpc);
602 CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
604 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
605 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
606 #define FLD(f) abuf->fields.sfmt_moveq.f
607 int UNUSED written = 0;
608 IADDR UNUSED pc = abuf->addr;
609 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
612 SI tmp_newval;
613 tmp_newval = FLD (f_s6);
615 SI opval = tmp_newval;
616 SET_H_GR (FLD (f_operand2), opval);
617 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
620 SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
621 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
622 SET_H_CBIT_MOVE (0);
623 SET_H_VBIT_MOVE (0);
626 BI opval = 0;
627 CPU (h_xbit) = opval;
628 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
631 BI opval = 0;
632 SET_H_INSN_PREFIXED_P (opval);
633 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
639 #undef FLD
641 NEXT (vpc);
643 CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
645 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
646 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
647 #define FLD(f) abuf->fields.sfmt_muls_b.f
648 int UNUSED written = 0;
649 IADDR UNUSED pc = abuf->addr;
650 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
653 QI tmp_tmpops;
654 SI tmp_newval;
655 tmp_tmpops = GET_H_GR (FLD (f_operand1));
656 tmp_newval = EXTQISI (tmp_tmpops);
658 SI opval = tmp_newval;
659 SET_H_GR (FLD (f_operand2), opval);
660 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
664 BI opval = LTSI (tmp_newval, 0);
665 CPU (h_nbit) = opval;
666 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
669 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
670 CPU (h_zbit) = opval;
671 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
673 SET_H_CBIT_MOVE (0);
674 SET_H_VBIT_MOVE (0);
677 BI opval = 0;
678 CPU (h_xbit) = opval;
679 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
682 BI opval = 0;
683 SET_H_INSN_PREFIXED_P (opval);
684 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
690 #undef FLD
692 NEXT (vpc);
694 CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
696 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
697 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
698 #define FLD(f) abuf->fields.sfmt_muls_b.f
699 int UNUSED written = 0;
700 IADDR UNUSED pc = abuf->addr;
701 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
704 HI tmp_tmpops;
705 SI tmp_newval;
706 tmp_tmpops = GET_H_GR (FLD (f_operand1));
707 tmp_newval = EXTHISI (tmp_tmpops);
709 SI opval = tmp_newval;
710 SET_H_GR (FLD (f_operand2), opval);
711 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
715 BI opval = LTSI (tmp_newval, 0);
716 CPU (h_nbit) = opval;
717 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
720 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
721 CPU (h_zbit) = opval;
722 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
724 SET_H_CBIT_MOVE (0);
725 SET_H_VBIT_MOVE (0);
728 BI opval = 0;
729 CPU (h_xbit) = opval;
730 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
733 BI opval = 0;
734 SET_H_INSN_PREFIXED_P (opval);
735 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
741 #undef FLD
743 NEXT (vpc);
745 CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
747 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
748 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
749 #define FLD(f) abuf->fields.sfmt_muls_b.f
750 int UNUSED written = 0;
751 IADDR UNUSED pc = abuf->addr;
752 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
755 QI tmp_tmpops;
756 SI tmp_newval;
757 tmp_tmpops = GET_H_GR (FLD (f_operand1));
758 tmp_newval = ZEXTQISI (tmp_tmpops);
760 SI opval = tmp_newval;
761 SET_H_GR (FLD (f_operand2), opval);
762 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
766 BI opval = LTSI (tmp_newval, 0);
767 CPU (h_nbit) = opval;
768 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
771 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
772 CPU (h_zbit) = opval;
773 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
775 SET_H_CBIT_MOVE (0);
776 SET_H_VBIT_MOVE (0);
779 BI opval = 0;
780 CPU (h_xbit) = opval;
781 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
784 BI opval = 0;
785 SET_H_INSN_PREFIXED_P (opval);
786 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
792 #undef FLD
794 NEXT (vpc);
796 CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
799 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
800 #define FLD(f) abuf->fields.sfmt_muls_b.f
801 int UNUSED written = 0;
802 IADDR UNUSED pc = abuf->addr;
803 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
806 HI tmp_tmpops;
807 SI tmp_newval;
808 tmp_tmpops = GET_H_GR (FLD (f_operand1));
809 tmp_newval = ZEXTHISI (tmp_tmpops);
811 SI opval = tmp_newval;
812 SET_H_GR (FLD (f_operand2), opval);
813 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
817 BI opval = LTSI (tmp_newval, 0);
818 CPU (h_nbit) = opval;
819 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
822 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
823 CPU (h_zbit) = opval;
824 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
826 SET_H_CBIT_MOVE (0);
827 SET_H_VBIT_MOVE (0);
830 BI opval = 0;
831 CPU (h_xbit) = opval;
832 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
835 BI opval = 0;
836 SET_H_INSN_PREFIXED_P (opval);
837 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
843 #undef FLD
845 NEXT (vpc);
847 CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
849 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
850 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
851 #define FLD(f) abuf->fields.sfmt_addcbr.f
852 int UNUSED written = 0;
853 IADDR UNUSED pc = abuf->addr;
854 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
857 QI tmp_newval;
858 tmp_newval = FLD (f_indir_pc__byte);
860 SI tmp_oldregval;
861 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
863 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
864 SET_H_GR (FLD (f_operand2), opval);
865 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
870 BI opval = LTQI (tmp_newval, 0);
871 CPU (h_nbit) = opval;
872 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
875 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
876 CPU (h_zbit) = opval;
877 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
879 SET_H_CBIT_MOVE (0);
880 SET_H_VBIT_MOVE (0);
883 BI opval = 0;
884 CPU (h_xbit) = opval;
885 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
888 BI opval = 0;
889 SET_H_INSN_PREFIXED_P (opval);
890 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
896 #undef FLD
898 NEXT (vpc);
900 CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
902 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
903 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
904 #define FLD(f) abuf->fields.sfmt_addcwr.f
905 int UNUSED written = 0;
906 IADDR UNUSED pc = abuf->addr;
907 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
910 HI tmp_newval;
911 tmp_newval = FLD (f_indir_pc__word);
913 SI tmp_oldregval;
914 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
916 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
917 SET_H_GR (FLD (f_operand2), opval);
918 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
923 BI opval = LTHI (tmp_newval, 0);
924 CPU (h_nbit) = opval;
925 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
928 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
929 CPU (h_zbit) = opval;
930 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
932 SET_H_CBIT_MOVE (0);
933 SET_H_VBIT_MOVE (0);
936 BI opval = 0;
937 CPU (h_xbit) = opval;
938 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
941 BI opval = 0;
942 SET_H_INSN_PREFIXED_P (opval);
943 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
949 #undef FLD
951 NEXT (vpc);
953 CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
955 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
956 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
957 #define FLD(f) abuf->fields.sfmt_bound_cd.f
958 int UNUSED written = 0;
959 IADDR UNUSED pc = abuf->addr;
960 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
963 SI tmp_newval;
964 tmp_newval = FLD (f_indir_pc__dword);
966 SI opval = tmp_newval;
967 SET_H_GR (FLD (f_operand2), opval);
968 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
972 BI opval = LTSI (tmp_newval, 0);
973 CPU (h_nbit) = opval;
974 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
977 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
978 CPU (h_zbit) = opval;
979 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
981 SET_H_CBIT_MOVE (0);
982 SET_H_VBIT_MOVE (0);
985 BI opval = 0;
986 CPU (h_xbit) = opval;
987 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
990 BI opval = 0;
991 SET_H_INSN_PREFIXED_P (opval);
992 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
998 #undef FLD
1000 NEXT (vpc);
1002 CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
1004 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1005 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1006 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1007 int UNUSED written = 0;
1008 IADDR UNUSED pc = abuf->addr;
1009 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1012 SI tmp_newval;
1013 tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1015 SI opval = tmp_newval;
1016 SET_H_GR (FLD (f_operand2), opval);
1017 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1021 BI opval = LTSI (tmp_newval, 0);
1022 CPU (h_nbit) = opval;
1023 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1026 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1027 CPU (h_zbit) = opval;
1028 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1030 SET_H_CBIT_MOVE (0);
1031 SET_H_VBIT_MOVE (0);
1034 BI opval = 0;
1035 CPU (h_xbit) = opval;
1036 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1039 BI opval = 0;
1040 SET_H_INSN_PREFIXED_P (opval);
1041 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1047 #undef FLD
1049 NEXT (vpc);
1051 CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
1053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1055 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1056 int UNUSED written = 0;
1057 IADDR UNUSED pc = abuf->addr;
1058 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1061 SI tmp_newval;
1062 tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1064 SI opval = tmp_newval;
1065 SET_H_GR (FLD (f_operand2), opval);
1066 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1070 BI opval = LTSI (tmp_newval, 0);
1071 CPU (h_nbit) = opval;
1072 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1075 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1076 CPU (h_zbit) = opval;
1077 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1079 SET_H_CBIT_MOVE (0);
1080 SET_H_VBIT_MOVE (0);
1083 BI opval = 0;
1084 CPU (h_xbit) = opval;
1085 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1088 BI opval = 0;
1089 SET_H_INSN_PREFIXED_P (opval);
1090 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1096 #undef FLD
1098 NEXT (vpc);
1100 CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
1102 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1103 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1104 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1105 int UNUSED written = 0;
1106 IADDR UNUSED pc = abuf->addr;
1107 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1110 SI tmp_newval;
1111 tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1113 SI opval = tmp_newval;
1114 SET_H_GR (FLD (f_operand2), opval);
1115 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1119 BI opval = LTSI (tmp_newval, 0);
1120 CPU (h_nbit) = opval;
1121 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1124 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1125 CPU (h_zbit) = opval;
1126 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1128 SET_H_CBIT_MOVE (0);
1129 SET_H_VBIT_MOVE (0);
1132 BI opval = 0;
1133 CPU (h_xbit) = opval;
1134 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1137 BI opval = 0;
1138 SET_H_INSN_PREFIXED_P (opval);
1139 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1145 #undef FLD
1147 NEXT (vpc);
1149 CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
1151 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1152 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1153 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1154 int UNUSED written = 0;
1155 IADDR UNUSED pc = abuf->addr;
1156 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1159 SI tmp_newval;
1160 tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1162 SI opval = tmp_newval;
1163 SET_H_GR (FLD (f_operand2), opval);
1164 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1168 BI opval = LTSI (tmp_newval, 0);
1169 CPU (h_nbit) = opval;
1170 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1173 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1174 CPU (h_zbit) = opval;
1175 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1177 SET_H_CBIT_MOVE (0);
1178 SET_H_VBIT_MOVE (0);
1181 BI opval = 0;
1182 CPU (h_xbit) = opval;
1183 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1186 BI opval = 0;
1187 SET_H_INSN_PREFIXED_P (opval);
1188 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1194 #undef FLD
1196 NEXT (vpc);
1198 CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
1200 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1201 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1202 #define FLD(f) abuf->fields.sfmt_addq.f
1203 int UNUSED written = 0;
1204 IADDR UNUSED pc = abuf->addr;
1205 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1208 SI tmp_tmpopd;
1209 SI tmp_tmpops;
1210 BI tmp_carry;
1211 SI tmp_newval;
1212 tmp_tmpops = FLD (f_u6);
1213 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1214 tmp_carry = CPU (h_cbit);
1215 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1217 SI opval = tmp_newval;
1218 SET_H_GR (FLD (f_operand2), opval);
1219 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1223 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
1224 CPU (h_cbit) = opval;
1225 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1228 BI opval = LTSI (tmp_newval, 0);
1229 CPU (h_nbit) = opval;
1230 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1233 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1234 CPU (h_zbit) = opval;
1235 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1238 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1239 CPU (h_vbit) = opval;
1240 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1244 BI opval = 0;
1245 CPU (h_xbit) = opval;
1246 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1249 BI opval = 0;
1250 SET_H_INSN_PREFIXED_P (opval);
1251 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1257 #undef FLD
1259 NEXT (vpc);
1261 CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
1263 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1264 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1265 #define FLD(f) abuf->fields.sfmt_addq.f
1266 int UNUSED written = 0;
1267 IADDR UNUSED pc = abuf->addr;
1268 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1271 SI tmp_tmpopd;
1272 SI tmp_tmpops;
1273 BI tmp_carry;
1274 SI tmp_newval;
1275 tmp_tmpops = FLD (f_u6);
1276 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1277 tmp_carry = CPU (h_cbit);
1278 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1280 SI opval = tmp_newval;
1281 SET_H_GR (FLD (f_operand2), opval);
1282 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1286 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1287 CPU (h_cbit) = opval;
1288 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1291 BI opval = LTSI (tmp_newval, 0);
1292 CPU (h_nbit) = opval;
1293 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1296 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1297 CPU (h_zbit) = opval;
1298 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1301 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1302 CPU (h_vbit) = opval;
1303 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1307 BI opval = 0;
1308 CPU (h_xbit) = opval;
1309 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1312 BI opval = 0;
1313 SET_H_INSN_PREFIXED_P (opval);
1314 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1320 #undef FLD
1322 NEXT (vpc);
1324 CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
1326 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1327 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1328 #define FLD(f) abuf->fields.sfmt_muls_b.f
1329 int UNUSED written = 0;
1330 IADDR UNUSED pc = abuf->addr;
1331 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1334 QI tmp_tmpopd;
1335 QI tmp_tmpops;
1336 BI tmp_carry;
1337 QI tmp_newval;
1338 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1339 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1340 tmp_carry = CPU (h_cbit);
1341 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1342 ((void) 0); /*nop*/
1345 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
1346 CPU (h_cbit) = opval;
1347 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1350 BI opval = LTQI (tmp_newval, 0);
1351 CPU (h_nbit) = opval;
1352 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1355 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1356 CPU (h_zbit) = opval;
1357 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1360 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
1361 CPU (h_vbit) = opval;
1362 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1366 BI opval = 0;
1367 CPU (h_xbit) = opval;
1368 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1371 BI opval = 0;
1372 SET_H_INSN_PREFIXED_P (opval);
1373 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1379 #undef FLD
1381 NEXT (vpc);
1383 CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
1385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1387 #define FLD(f) abuf->fields.sfmt_muls_b.f
1388 int UNUSED written = 0;
1389 IADDR UNUSED pc = abuf->addr;
1390 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1393 HI tmp_tmpopd;
1394 HI tmp_tmpops;
1395 BI tmp_carry;
1396 HI tmp_newval;
1397 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1398 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1399 tmp_carry = CPU (h_cbit);
1400 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1401 ((void) 0); /*nop*/
1404 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
1405 CPU (h_cbit) = opval;
1406 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1409 BI opval = LTHI (tmp_newval, 0);
1410 CPU (h_nbit) = opval;
1411 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1414 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1415 CPU (h_zbit) = opval;
1416 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1419 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
1420 CPU (h_vbit) = opval;
1421 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1425 BI opval = 0;
1426 CPU (h_xbit) = opval;
1427 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1430 BI opval = 0;
1431 SET_H_INSN_PREFIXED_P (opval);
1432 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1438 #undef FLD
1440 NEXT (vpc);
1442 CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
1444 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1445 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1446 #define FLD(f) abuf->fields.sfmt_muls_b.f
1447 int UNUSED written = 0;
1448 IADDR UNUSED pc = abuf->addr;
1449 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1452 SI tmp_tmpopd;
1453 SI tmp_tmpops;
1454 BI tmp_carry;
1455 SI tmp_newval;
1456 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1457 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1458 tmp_carry = CPU (h_cbit);
1459 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1460 ((void) 0); /*nop*/
1463 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1464 CPU (h_cbit) = opval;
1465 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1468 BI opval = LTSI (tmp_newval, 0);
1469 CPU (h_nbit) = opval;
1470 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1473 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1474 CPU (h_zbit) = opval;
1475 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1478 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1479 CPU (h_vbit) = opval;
1480 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1484 BI opval = 0;
1485 CPU (h_xbit) = opval;
1486 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1489 BI opval = 0;
1490 SET_H_INSN_PREFIXED_P (opval);
1491 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1497 #undef FLD
1499 NEXT (vpc);
1501 CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1503 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1504 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1505 #define FLD(f) abuf->fields.sfmt_addc_m.f
1506 int UNUSED written = 0;
1507 IADDR UNUSED pc = abuf->addr;
1508 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1511 QI tmp_tmpopd;
1512 QI tmp_tmpops;
1513 BI tmp_carry;
1514 QI tmp_newval;
1515 tmp_tmpops = ({ SI tmp_addr;
1516 QI tmp_tmp_mem;
1517 BI tmp_postinc;
1518 tmp_postinc = FLD (f_memmode);
1519 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1520 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1521 ; if (NEBI (tmp_postinc, 0)) {
1523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1524 tmp_addr = ADDSI (tmp_addr, 1);
1527 SI opval = tmp_addr;
1528 SET_H_GR (FLD (f_operand1), opval);
1529 written |= (1 << 9);
1530 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1534 ; tmp_tmp_mem; });
1535 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1536 tmp_carry = CPU (h_cbit);
1537 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1538 ((void) 0); /*nop*/
1541 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
1542 CPU (h_cbit) = opval;
1543 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1546 BI opval = LTQI (tmp_newval, 0);
1547 CPU (h_nbit) = opval;
1548 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1551 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1552 CPU (h_zbit) = opval;
1553 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1556 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
1557 CPU (h_vbit) = opval;
1558 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1562 BI opval = 0;
1563 CPU (h_xbit) = opval;
1564 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1567 BI opval = 0;
1568 SET_H_INSN_PREFIXED_P (opval);
1569 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1575 abuf->written = written;
1576 #undef FLD
1578 NEXT (vpc);
1580 CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1582 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1583 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1584 #define FLD(f) abuf->fields.sfmt_addc_m.f
1585 int UNUSED written = 0;
1586 IADDR UNUSED pc = abuf->addr;
1587 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1590 HI tmp_tmpopd;
1591 HI tmp_tmpops;
1592 BI tmp_carry;
1593 HI tmp_newval;
1594 tmp_tmpops = ({ SI tmp_addr;
1595 HI tmp_tmp_mem;
1596 BI tmp_postinc;
1597 tmp_postinc = FLD (f_memmode);
1598 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1599 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
1600 ; if (NEBI (tmp_postinc, 0)) {
1602 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1603 tmp_addr = ADDSI (tmp_addr, 2);
1606 SI opval = tmp_addr;
1607 SET_H_GR (FLD (f_operand1), opval);
1608 written |= (1 << 9);
1609 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1613 ; tmp_tmp_mem; });
1614 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1615 tmp_carry = CPU (h_cbit);
1616 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1617 ((void) 0); /*nop*/
1620 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
1621 CPU (h_cbit) = opval;
1622 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1625 BI opval = LTHI (tmp_newval, 0);
1626 CPU (h_nbit) = opval;
1627 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1630 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1631 CPU (h_zbit) = opval;
1632 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1635 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
1636 CPU (h_vbit) = opval;
1637 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1641 BI opval = 0;
1642 CPU (h_xbit) = opval;
1643 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1646 BI opval = 0;
1647 SET_H_INSN_PREFIXED_P (opval);
1648 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1654 abuf->written = written;
1655 #undef FLD
1657 NEXT (vpc);
1659 CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1661 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1662 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1663 #define FLD(f) abuf->fields.sfmt_addc_m.f
1664 int UNUSED written = 0;
1665 IADDR UNUSED pc = abuf->addr;
1666 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1669 SI tmp_tmpopd;
1670 SI tmp_tmpops;
1671 BI tmp_carry;
1672 SI tmp_newval;
1673 tmp_tmpops = ({ SI tmp_addr;
1674 SI tmp_tmp_mem;
1675 BI tmp_postinc;
1676 tmp_postinc = FLD (f_memmode);
1677 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1678 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
1679 ; if (NEBI (tmp_postinc, 0)) {
1681 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1682 tmp_addr = ADDSI (tmp_addr, 4);
1685 SI opval = tmp_addr;
1686 SET_H_GR (FLD (f_operand1), opval);
1687 written |= (1 << 9);
1688 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1692 ; tmp_tmp_mem; });
1693 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1694 tmp_carry = CPU (h_cbit);
1695 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1696 ((void) 0); /*nop*/
1699 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1700 CPU (h_cbit) = opval;
1701 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1704 BI opval = LTSI (tmp_newval, 0);
1705 CPU (h_nbit) = opval;
1706 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1709 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1710 CPU (h_zbit) = opval;
1711 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1714 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1715 CPU (h_vbit) = opval;
1716 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1720 BI opval = 0;
1721 CPU (h_xbit) = opval;
1722 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1725 BI opval = 0;
1726 SET_H_INSN_PREFIXED_P (opval);
1727 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1733 abuf->written = written;
1734 #undef FLD
1736 NEXT (vpc);
1738 CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
1740 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1741 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1742 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1743 int UNUSED written = 0;
1744 IADDR UNUSED pc = abuf->addr;
1745 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1748 QI tmp_tmpopd;
1749 QI tmp_tmpops;
1750 BI tmp_carry;
1751 QI tmp_newval;
1752 tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
1753 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1754 tmp_carry = CPU (h_cbit);
1755 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1756 ((void) 0); /*nop*/
1759 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
1760 CPU (h_cbit) = opval;
1761 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1764 BI opval = LTQI (tmp_newval, 0);
1765 CPU (h_nbit) = opval;
1766 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1769 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1770 CPU (h_zbit) = opval;
1771 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1774 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
1775 CPU (h_vbit) = opval;
1776 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1780 BI opval = 0;
1781 CPU (h_xbit) = opval;
1782 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1785 BI opval = 0;
1786 SET_H_INSN_PREFIXED_P (opval);
1787 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1793 #undef FLD
1795 NEXT (vpc);
1797 CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
1799 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1800 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1801 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1802 int UNUSED written = 0;
1803 IADDR UNUSED pc = abuf->addr;
1804 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1807 HI tmp_tmpopd;
1808 HI tmp_tmpops;
1809 BI tmp_carry;
1810 HI tmp_newval;
1811 tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
1812 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1813 tmp_carry = CPU (h_cbit);
1814 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1815 ((void) 0); /*nop*/
1818 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
1819 CPU (h_cbit) = opval;
1820 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1823 BI opval = LTHI (tmp_newval, 0);
1824 CPU (h_nbit) = opval;
1825 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1828 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1829 CPU (h_zbit) = opval;
1830 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1833 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
1834 CPU (h_vbit) = opval;
1835 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1839 BI opval = 0;
1840 CPU (h_xbit) = opval;
1841 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1844 BI opval = 0;
1845 SET_H_INSN_PREFIXED_P (opval);
1846 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1852 #undef FLD
1854 NEXT (vpc);
1856 CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
1858 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1859 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1860 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1861 int UNUSED written = 0;
1862 IADDR UNUSED pc = abuf->addr;
1863 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1866 SI tmp_tmpopd;
1867 SI tmp_tmpops;
1868 BI tmp_carry;
1869 SI tmp_newval;
1870 tmp_tmpops = FLD (f_indir_pc__dword);
1871 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1872 tmp_carry = CPU (h_cbit);
1873 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1874 ((void) 0); /*nop*/
1877 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1878 CPU (h_cbit) = opval;
1879 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1882 BI opval = LTSI (tmp_newval, 0);
1883 CPU (h_nbit) = opval;
1884 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1887 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1888 CPU (h_zbit) = opval;
1889 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1892 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1893 CPU (h_vbit) = opval;
1894 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1898 BI opval = 0;
1899 CPU (h_xbit) = opval;
1900 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1903 BI opval = 0;
1904 SET_H_INSN_PREFIXED_P (opval);
1905 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1911 #undef FLD
1913 NEXT (vpc);
1915 CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
1917 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1918 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1919 #define FLD(f) abuf->fields.sfmt_andq.f
1920 int UNUSED written = 0;
1921 IADDR UNUSED pc = abuf->addr;
1922 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1925 SI tmp_tmpopd;
1926 SI tmp_tmpops;
1927 BI tmp_carry;
1928 SI tmp_newval;
1929 tmp_tmpops = FLD (f_s6);
1930 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1931 tmp_carry = CPU (h_cbit);
1932 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1933 ((void) 0); /*nop*/
1936 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
1937 CPU (h_cbit) = opval;
1938 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1941 BI opval = LTSI (tmp_newval, 0);
1942 CPU (h_nbit) = opval;
1943 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1946 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1947 CPU (h_zbit) = opval;
1948 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1951 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
1952 CPU (h_vbit) = opval;
1953 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1957 BI opval = 0;
1958 CPU (h_xbit) = opval;
1959 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1962 BI opval = 0;
1963 SET_H_INSN_PREFIXED_P (opval);
1964 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1970 #undef FLD
1972 NEXT (vpc);
1974 CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
1976 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1977 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1978 #define FLD(f) abuf->fields.sfmt_addc_m.f
1979 int UNUSED written = 0;
1980 IADDR UNUSED pc = abuf->addr;
1981 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1984 SI tmp_tmpopd;
1985 SI tmp_tmpops;
1986 BI tmp_carry;
1987 SI tmp_newval;
1988 tmp_tmpops = EXTQISI (({ SI tmp_addr;
1989 QI tmp_tmp_mem;
1990 BI tmp_postinc;
1991 tmp_postinc = FLD (f_memmode);
1992 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
1993 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1994 ; if (NEBI (tmp_postinc, 0)) {
1996 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1997 tmp_addr = ADDSI (tmp_addr, 1);
2000 SI opval = tmp_addr;
2001 SET_H_GR (FLD (f_operand1), opval);
2002 written |= (1 << 9);
2003 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2007 ; tmp_tmp_mem; }));
2008 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2009 tmp_carry = CPU (h_cbit);
2010 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2011 ((void) 0); /*nop*/
2014 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2015 CPU (h_cbit) = opval;
2016 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2019 BI opval = LTSI (tmp_newval, 0);
2020 CPU (h_nbit) = opval;
2021 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2024 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2025 CPU (h_zbit) = opval;
2026 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2029 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2030 CPU (h_vbit) = opval;
2031 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2035 BI opval = 0;
2036 CPU (h_xbit) = opval;
2037 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2040 BI opval = 0;
2041 SET_H_INSN_PREFIXED_P (opval);
2042 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2048 abuf->written = written;
2049 #undef FLD
2051 NEXT (vpc);
2053 CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
2055 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2056 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2057 #define FLD(f) abuf->fields.sfmt_addc_m.f
2058 int UNUSED written = 0;
2059 IADDR UNUSED pc = abuf->addr;
2060 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2063 SI tmp_tmpopd;
2064 SI tmp_tmpops;
2065 BI tmp_carry;
2066 SI tmp_newval;
2067 tmp_tmpops = EXTHISI (({ SI tmp_addr;
2068 HI tmp_tmp_mem;
2069 BI tmp_postinc;
2070 tmp_postinc = FLD (f_memmode);
2071 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2072 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2073 ; if (NEBI (tmp_postinc, 0)) {
2075 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2076 tmp_addr = ADDSI (tmp_addr, 2);
2079 SI opval = tmp_addr;
2080 SET_H_GR (FLD (f_operand1), opval);
2081 written |= (1 << 9);
2082 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2086 ; tmp_tmp_mem; }));
2087 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2088 tmp_carry = CPU (h_cbit);
2089 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2090 ((void) 0); /*nop*/
2093 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2094 CPU (h_cbit) = opval;
2095 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2098 BI opval = LTSI (tmp_newval, 0);
2099 CPU (h_nbit) = opval;
2100 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2103 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2104 CPU (h_zbit) = opval;
2105 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2108 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2109 CPU (h_vbit) = opval;
2110 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2114 BI opval = 0;
2115 CPU (h_xbit) = opval;
2116 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2119 BI opval = 0;
2120 SET_H_INSN_PREFIXED_P (opval);
2121 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2127 abuf->written = written;
2128 #undef FLD
2130 NEXT (vpc);
2132 CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
2134 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2135 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2136 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2137 int UNUSED written = 0;
2138 IADDR UNUSED pc = abuf->addr;
2139 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2142 SI tmp_tmpopd;
2143 SI tmp_tmpops;
2144 BI tmp_carry;
2145 SI tmp_newval;
2146 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2147 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2148 tmp_carry = CPU (h_cbit);
2149 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2150 ((void) 0); /*nop*/
2153 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2154 CPU (h_cbit) = opval;
2155 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2158 BI opval = LTSI (tmp_newval, 0);
2159 CPU (h_nbit) = opval;
2160 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2163 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2164 CPU (h_zbit) = opval;
2165 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2168 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2169 CPU (h_vbit) = opval;
2170 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2174 BI opval = 0;
2175 CPU (h_xbit) = opval;
2176 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2179 BI opval = 0;
2180 SET_H_INSN_PREFIXED_P (opval);
2181 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2187 #undef FLD
2189 NEXT (vpc);
2191 CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
2193 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2194 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2195 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2196 int UNUSED written = 0;
2197 IADDR UNUSED pc = abuf->addr;
2198 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2201 SI tmp_tmpopd;
2202 SI tmp_tmpops;
2203 BI tmp_carry;
2204 SI tmp_newval;
2205 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2206 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2207 tmp_carry = CPU (h_cbit);
2208 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2209 ((void) 0); /*nop*/
2212 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2213 CPU (h_cbit) = opval;
2214 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2217 BI opval = LTSI (tmp_newval, 0);
2218 CPU (h_nbit) = opval;
2219 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2222 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2223 CPU (h_zbit) = opval;
2224 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2227 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2228 CPU (h_vbit) = opval;
2229 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2233 BI opval = 0;
2234 CPU (h_xbit) = opval;
2235 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2238 BI opval = 0;
2239 SET_H_INSN_PREFIXED_P (opval);
2240 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2246 #undef FLD
2248 NEXT (vpc);
2250 CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2252 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2253 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2254 #define FLD(f) abuf->fields.sfmt_addc_m.f
2255 int UNUSED written = 0;
2256 IADDR UNUSED pc = abuf->addr;
2257 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2260 SI tmp_tmpopd;
2261 SI tmp_tmpops;
2262 BI tmp_carry;
2263 SI tmp_newval;
2264 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
2265 QI tmp_tmp_mem;
2266 BI tmp_postinc;
2267 tmp_postinc = FLD (f_memmode);
2268 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2269 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2270 ; if (NEBI (tmp_postinc, 0)) {
2272 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2273 tmp_addr = ADDSI (tmp_addr, 1);
2276 SI opval = tmp_addr;
2277 SET_H_GR (FLD (f_operand1), opval);
2278 written |= (1 << 9);
2279 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2283 ; tmp_tmp_mem; }));
2284 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2285 tmp_carry = CPU (h_cbit);
2286 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2287 ((void) 0); /*nop*/
2290 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2291 CPU (h_cbit) = opval;
2292 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2295 BI opval = LTSI (tmp_newval, 0);
2296 CPU (h_nbit) = opval;
2297 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2300 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2301 CPU (h_zbit) = opval;
2302 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2305 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2306 CPU (h_vbit) = opval;
2307 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2311 BI opval = 0;
2312 CPU (h_xbit) = opval;
2313 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2316 BI opval = 0;
2317 SET_H_INSN_PREFIXED_P (opval);
2318 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2324 abuf->written = written;
2325 #undef FLD
2327 NEXT (vpc);
2329 CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2331 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2332 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2333 #define FLD(f) abuf->fields.sfmt_addc_m.f
2334 int UNUSED written = 0;
2335 IADDR UNUSED pc = abuf->addr;
2336 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2339 SI tmp_tmpopd;
2340 SI tmp_tmpops;
2341 BI tmp_carry;
2342 SI tmp_newval;
2343 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
2344 HI tmp_tmp_mem;
2345 BI tmp_postinc;
2346 tmp_postinc = FLD (f_memmode);
2347 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2348 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2349 ; if (NEBI (tmp_postinc, 0)) {
2351 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2352 tmp_addr = ADDSI (tmp_addr, 2);
2355 SI opval = tmp_addr;
2356 SET_H_GR (FLD (f_operand1), opval);
2357 written |= (1 << 9);
2358 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2362 ; tmp_tmp_mem; }));
2363 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2364 tmp_carry = CPU (h_cbit);
2365 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2366 ((void) 0); /*nop*/
2369 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2370 CPU (h_cbit) = opval;
2371 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2374 BI opval = LTSI (tmp_newval, 0);
2375 CPU (h_nbit) = opval;
2376 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2379 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2380 CPU (h_zbit) = opval;
2381 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2384 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2385 CPU (h_vbit) = opval;
2386 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2390 BI opval = 0;
2391 CPU (h_xbit) = opval;
2392 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2395 BI opval = 0;
2396 SET_H_INSN_PREFIXED_P (opval);
2397 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2403 abuf->written = written;
2404 #undef FLD
2406 NEXT (vpc);
2408 CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
2410 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2411 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2412 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2413 int UNUSED written = 0;
2414 IADDR UNUSED pc = abuf->addr;
2415 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2418 SI tmp_tmpopd;
2419 SI tmp_tmpops;
2420 BI tmp_carry;
2421 SI tmp_newval;
2422 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2423 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2424 tmp_carry = CPU (h_cbit);
2425 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2426 ((void) 0); /*nop*/
2429 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2430 CPU (h_cbit) = opval;
2431 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2434 BI opval = LTSI (tmp_newval, 0);
2435 CPU (h_nbit) = opval;
2436 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2439 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2440 CPU (h_zbit) = opval;
2441 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2444 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2445 CPU (h_vbit) = opval;
2446 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2450 BI opval = 0;
2451 CPU (h_xbit) = opval;
2452 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2455 BI opval = 0;
2456 SET_H_INSN_PREFIXED_P (opval);
2457 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2463 #undef FLD
2465 NEXT (vpc);
2467 CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
2469 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2470 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2471 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2472 int UNUSED written = 0;
2473 IADDR UNUSED pc = abuf->addr;
2474 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2477 SI tmp_tmpopd;
2478 SI tmp_tmpops;
2479 BI tmp_carry;
2480 SI tmp_newval;
2481 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2482 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2483 tmp_carry = CPU (h_cbit);
2484 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2485 ((void) 0); /*nop*/
2488 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
2489 CPU (h_cbit) = opval;
2490 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2493 BI opval = LTSI (tmp_newval, 0);
2494 CPU (h_nbit) = opval;
2495 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2498 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2499 CPU (h_zbit) = opval;
2500 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2503 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
2504 CPU (h_vbit) = opval;
2505 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2509 BI opval = 0;
2510 CPU (h_xbit) = opval;
2511 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2514 BI opval = 0;
2515 SET_H_INSN_PREFIXED_P (opval);
2516 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2522 #undef FLD
2524 NEXT (vpc);
2526 CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
2528 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2529 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2530 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2531 int UNUSED written = 0;
2532 IADDR UNUSED pc = abuf->addr;
2533 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2536 SI tmp_tmp;
2537 tmp_tmp = ({ SI tmp_addr;
2538 QI tmp_tmp_mem;
2539 BI tmp_postinc;
2540 tmp_postinc = FLD (f_memmode);
2541 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2542 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2543 ; if (NEBI (tmp_postinc, 0)) {
2545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2546 tmp_addr = ADDSI (tmp_addr, 1);
2549 SI opval = tmp_addr;
2550 SET_H_GR (FLD (f_operand1), opval);
2551 written |= (1 << 10);
2552 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2556 ; tmp_tmp_mem; });
2558 SI tmp_oldregval;
2559 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2561 SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
2562 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2563 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2568 BI opval = LTQI (tmp_tmp, 0);
2569 CPU (h_nbit) = opval;
2570 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2573 BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2574 CPU (h_zbit) = opval;
2575 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2577 SET_H_CBIT_MOVE (0);
2578 SET_H_VBIT_MOVE (0);
2581 BI opval = 0;
2582 CPU (h_xbit) = opval;
2583 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2586 BI opval = 0;
2587 SET_H_INSN_PREFIXED_P (opval);
2588 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2594 abuf->written = written;
2595 #undef FLD
2597 NEXT (vpc);
2599 CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
2601 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2602 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2603 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2604 int UNUSED written = 0;
2605 IADDR UNUSED pc = abuf->addr;
2606 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2609 SI tmp_tmp;
2610 tmp_tmp = ({ SI tmp_addr;
2611 HI tmp_tmp_mem;
2612 BI tmp_postinc;
2613 tmp_postinc = FLD (f_memmode);
2614 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2615 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2616 ; if (NEBI (tmp_postinc, 0)) {
2618 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2619 tmp_addr = ADDSI (tmp_addr, 2);
2622 SI opval = tmp_addr;
2623 SET_H_GR (FLD (f_operand1), opval);
2624 written |= (1 << 10);
2625 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2629 ; tmp_tmp_mem; });
2631 SI tmp_oldregval;
2632 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2634 SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
2635 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2636 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2641 BI opval = LTHI (tmp_tmp, 0);
2642 CPU (h_nbit) = opval;
2643 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2646 BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2647 CPU (h_zbit) = opval;
2648 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2650 SET_H_CBIT_MOVE (0);
2651 SET_H_VBIT_MOVE (0);
2654 BI opval = 0;
2655 CPU (h_xbit) = opval;
2656 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2659 BI opval = 0;
2660 SET_H_INSN_PREFIXED_P (opval);
2661 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2667 abuf->written = written;
2668 #undef FLD
2670 NEXT (vpc);
2672 CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
2674 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2675 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2676 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2677 int UNUSED written = 0;
2678 IADDR UNUSED pc = abuf->addr;
2679 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2682 SI tmp_tmp;
2683 tmp_tmp = ({ SI tmp_addr;
2684 SI tmp_tmp_mem;
2685 BI tmp_postinc;
2686 tmp_postinc = FLD (f_memmode);
2687 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2688 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
2689 ; if (NEBI (tmp_postinc, 0)) {
2691 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2692 tmp_addr = ADDSI (tmp_addr, 4);
2695 SI opval = tmp_addr;
2696 SET_H_GR (FLD (f_operand1), opval);
2697 written |= (1 << 9);
2698 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2702 ; tmp_tmp_mem; });
2704 SI opval = tmp_tmp;
2705 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2706 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2710 BI opval = LTSI (tmp_tmp, 0);
2711 CPU (h_nbit) = opval;
2712 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2715 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2716 CPU (h_zbit) = opval;
2717 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2719 SET_H_CBIT_MOVE (0);
2720 SET_H_VBIT_MOVE (0);
2723 BI opval = 0;
2724 CPU (h_xbit) = opval;
2725 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2728 BI opval = 0;
2729 SET_H_INSN_PREFIXED_P (opval);
2730 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2736 abuf->written = written;
2737 #undef FLD
2739 NEXT (vpc);
2741 CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
2743 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2744 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2745 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2746 int UNUSED written = 0;
2747 IADDR UNUSED pc = abuf->addr;
2748 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2751 SI tmp_tmp;
2752 tmp_tmp = EXTQISI (({ SI tmp_addr;
2753 QI tmp_tmp_mem;
2754 BI tmp_postinc;
2755 tmp_postinc = FLD (f_memmode);
2756 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2757 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2758 ; if (NEBI (tmp_postinc, 0)) {
2760 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2761 tmp_addr = ADDSI (tmp_addr, 1);
2764 SI opval = tmp_addr;
2765 SET_H_GR (FLD (f_operand1), opval);
2766 written |= (1 << 8);
2767 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2771 ; tmp_tmp_mem; }));
2772 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2774 SI opval = tmp_tmp;
2775 SET_H_GR (FLD (f_operand1), opval);
2776 written |= (1 << 8);
2777 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2779 } else {
2781 SI opval = tmp_tmp;
2782 SET_H_GR (FLD (f_operand2), opval);
2783 written |= (1 << 7);
2784 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2789 BI opval = LTSI (tmp_tmp, 0);
2790 CPU (h_nbit) = opval;
2791 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2794 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2795 CPU (h_zbit) = opval;
2796 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2798 SET_H_CBIT_MOVE (0);
2799 SET_H_VBIT_MOVE (0);
2802 BI opval = 0;
2803 CPU (h_xbit) = opval;
2804 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2807 BI opval = 0;
2808 SET_H_INSN_PREFIXED_P (opval);
2809 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2815 abuf->written = written;
2816 #undef FLD
2818 NEXT (vpc);
2820 CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
2822 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2823 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2824 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2825 int UNUSED written = 0;
2826 IADDR UNUSED pc = abuf->addr;
2827 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2830 SI tmp_tmp;
2831 tmp_tmp = EXTHISI (({ SI tmp_addr;
2832 HI tmp_tmp_mem;
2833 BI tmp_postinc;
2834 tmp_postinc = FLD (f_memmode);
2835 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2836 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2837 ; if (NEBI (tmp_postinc, 0)) {
2839 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2840 tmp_addr = ADDSI (tmp_addr, 2);
2843 SI opval = tmp_addr;
2844 SET_H_GR (FLD (f_operand1), opval);
2845 written |= (1 << 8);
2846 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2850 ; tmp_tmp_mem; }));
2851 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2853 SI opval = tmp_tmp;
2854 SET_H_GR (FLD (f_operand1), opval);
2855 written |= (1 << 8);
2856 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2858 } else {
2860 SI opval = tmp_tmp;
2861 SET_H_GR (FLD (f_operand2), opval);
2862 written |= (1 << 7);
2863 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2868 BI opval = LTSI (tmp_tmp, 0);
2869 CPU (h_nbit) = opval;
2870 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2873 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2874 CPU (h_zbit) = opval;
2875 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2877 SET_H_CBIT_MOVE (0);
2878 SET_H_VBIT_MOVE (0);
2881 BI opval = 0;
2882 CPU (h_xbit) = opval;
2883 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2886 BI opval = 0;
2887 SET_H_INSN_PREFIXED_P (opval);
2888 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2894 abuf->written = written;
2895 #undef FLD
2897 NEXT (vpc);
2899 CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
2901 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2902 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2903 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2904 int UNUSED written = 0;
2905 IADDR UNUSED pc = abuf->addr;
2906 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2909 SI tmp_tmp;
2910 tmp_tmp = ZEXTQISI (({ SI tmp_addr;
2911 QI tmp_tmp_mem;
2912 BI tmp_postinc;
2913 tmp_postinc = FLD (f_memmode);
2914 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2915 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2916 ; if (NEBI (tmp_postinc, 0)) {
2918 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2919 tmp_addr = ADDSI (tmp_addr, 1);
2922 SI opval = tmp_addr;
2923 SET_H_GR (FLD (f_operand1), opval);
2924 written |= (1 << 8);
2925 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2929 ; tmp_tmp_mem; }));
2930 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2932 SI opval = tmp_tmp;
2933 SET_H_GR (FLD (f_operand1), opval);
2934 written |= (1 << 8);
2935 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2937 } else {
2939 SI opval = tmp_tmp;
2940 SET_H_GR (FLD (f_operand2), opval);
2941 written |= (1 << 7);
2942 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2947 BI opval = LTSI (tmp_tmp, 0);
2948 CPU (h_nbit) = opval;
2949 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2952 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2953 CPU (h_zbit) = opval;
2954 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2956 SET_H_CBIT_MOVE (0);
2957 SET_H_VBIT_MOVE (0);
2960 BI opval = 0;
2961 CPU (h_xbit) = opval;
2962 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2965 BI opval = 0;
2966 SET_H_INSN_PREFIXED_P (opval);
2967 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2973 abuf->written = written;
2974 #undef FLD
2976 NEXT (vpc);
2978 CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
2980 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2981 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2982 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2983 int UNUSED written = 0;
2984 IADDR UNUSED pc = abuf->addr;
2985 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2988 SI tmp_tmp;
2989 tmp_tmp = ZEXTHISI (({ SI tmp_addr;
2990 HI tmp_tmp_mem;
2991 BI tmp_postinc;
2992 tmp_postinc = FLD (f_memmode);
2993 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
2994 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2995 ; if (NEBI (tmp_postinc, 0)) {
2997 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2998 tmp_addr = ADDSI (tmp_addr, 2);
3001 SI opval = tmp_addr;
3002 SET_H_GR (FLD (f_operand1), opval);
3003 written |= (1 << 8);
3004 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3008 ; tmp_tmp_mem; }));
3009 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3011 SI opval = tmp_tmp;
3012 SET_H_GR (FLD (f_operand1), opval);
3013 written |= (1 << 8);
3014 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3016 } else {
3018 SI opval = tmp_tmp;
3019 SET_H_GR (FLD (f_operand2), opval);
3020 written |= (1 << 7);
3021 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3026 BI opval = LTSI (tmp_tmp, 0);
3027 CPU (h_nbit) = opval;
3028 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3031 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3032 CPU (h_zbit) = opval;
3033 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3035 SET_H_CBIT_MOVE (0);
3036 SET_H_VBIT_MOVE (0);
3039 BI opval = 0;
3040 CPU (h_xbit) = opval;
3041 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3044 BI opval = 0;
3045 SET_H_INSN_PREFIXED_P (opval);
3046 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3052 abuf->written = written;
3053 #undef FLD
3055 NEXT (vpc);
3057 CASE (sem, INSN_MOVE_R_SPRV32) : /* move ${Rs},${Pd} */
3059 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3060 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3061 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3062 int UNUSED written = 0;
3063 IADDR UNUSED pc = abuf->addr;
3064 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3067 SI tmp_tmp;
3068 SI tmp_rno;
3069 tmp_tmp = GET_H_GR (FLD (f_operand1));
3070 tmp_rno = FLD (f_operand2);
3071 if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
3072 cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
3074 else {
3076 SI opval = tmp_tmp;
3077 SET_H_SR (FLD (f_operand2), opval);
3078 written |= (1 << 2);
3079 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3084 BI opval = 0;
3085 CPU (h_xbit) = opval;
3086 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3089 BI opval = 0;
3090 SET_H_INSN_PREFIXED_P (opval);
3091 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3096 abuf->written = written;
3097 #undef FLD
3099 NEXT (vpc);
3101 CASE (sem, INSN_MOVE_SPR_RV32) : /* move ${Ps},${Rd-sfield} */
3103 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3104 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3105 #define FLD(f) abuf->fields.sfmt_mcp.f
3106 int UNUSED written = 0;
3107 IADDR UNUSED pc = abuf->addr;
3108 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3111 SI tmp_grno;
3112 SI tmp_prno;
3113 SI tmp_newval;
3114 tmp_prno = FLD (f_operand2);
3115 tmp_newval = GET_H_SR (FLD (f_operand2));
3116 if (EQSI (tmp_prno, 2)) {
3118 SI opval = tmp_newval;
3119 SET_H_GR (FLD (f_operand1), opval);
3120 written |= (1 << 4);
3121 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3124 else if (EQSI (tmp_prno, 3)) {
3126 SI tmp_oldregval;
3127 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3129 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3130 SET_H_GR (FLD (f_operand1), opval);
3131 written |= (1 << 4);
3132 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3136 else if (EQSI (tmp_prno, 5)) {
3138 SI opval = tmp_newval;
3139 SET_H_GR (FLD (f_operand1), opval);
3140 written |= (1 << 4);
3141 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3144 else if (EQSI (tmp_prno, 6)) {
3146 SI opval = tmp_newval;
3147 SET_H_GR (FLD (f_operand1), opval);
3148 written |= (1 << 4);
3149 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3152 else if (EQSI (tmp_prno, 7)) {
3154 SI opval = tmp_newval;
3155 SET_H_GR (FLD (f_operand1), opval);
3156 written |= (1 << 4);
3157 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3160 else if (EQSI (tmp_prno, 9)) {
3162 SI opval = tmp_newval;
3163 SET_H_GR (FLD (f_operand1), opval);
3164 written |= (1 << 4);
3165 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3168 else if (EQSI (tmp_prno, 10)) {
3170 SI opval = tmp_newval;
3171 SET_H_GR (FLD (f_operand1), opval);
3172 written |= (1 << 4);
3173 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3176 else if (EQSI (tmp_prno, 11)) {
3178 SI opval = tmp_newval;
3179 SET_H_GR (FLD (f_operand1), opval);
3180 written |= (1 << 4);
3181 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3184 else if (EQSI (tmp_prno, 12)) {
3186 SI opval = tmp_newval;
3187 SET_H_GR (FLD (f_operand1), opval);
3188 written |= (1 << 4);
3189 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3192 else if (EQSI (tmp_prno, 13)) {
3194 SI opval = tmp_newval;
3195 SET_H_GR (FLD (f_operand1), opval);
3196 written |= (1 << 4);
3197 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3200 else if (EQSI (tmp_prno, 14)) {
3202 SI opval = tmp_newval;
3203 SET_H_GR (FLD (f_operand1), opval);
3204 written |= (1 << 4);
3205 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3208 else if (EQSI (tmp_prno, 15)) {
3210 SI opval = tmp_newval;
3211 SET_H_GR (FLD (f_operand1), opval);
3212 written |= (1 << 4);
3213 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3216 else if (EQSI (tmp_prno, 0)) {
3218 SI tmp_oldregval;
3219 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3221 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3222 SET_H_GR (FLD (f_operand1), opval);
3223 written |= (1 << 4);
3224 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3228 else if (EQSI (tmp_prno, 1)) {
3230 SI tmp_oldregval;
3231 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3233 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3234 SET_H_GR (FLD (f_operand1), opval);
3235 written |= (1 << 4);
3236 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3240 else if (EQSI (tmp_prno, 4)) {
3242 SI tmp_oldregval;
3243 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand1));
3245 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3246 SET_H_GR (FLD (f_operand1), opval);
3247 written |= (1 << 4);
3248 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3252 else if (EQSI (tmp_prno, 8)) {
3254 SI opval = tmp_newval;
3255 SET_H_GR (FLD (f_operand1), opval);
3256 written |= (1 << 4);
3257 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3260 else {
3261 cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
3265 BI opval = 0;
3266 CPU (h_xbit) = opval;
3267 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3270 BI opval = 0;
3271 SET_H_INSN_PREFIXED_P (opval);
3272 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3277 abuf->written = written;
3278 #undef FLD
3280 NEXT (vpc);
3282 CASE (sem, INSN_MOVE_M_SPRV32) : /* move [${Rs}${inc}],${Pd} */
3284 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3285 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3286 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3287 int UNUSED written = 0;
3288 IADDR UNUSED pc = abuf->addr;
3289 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3292 SI tmp_rno;
3293 SI tmp_newval;
3294 tmp_rno = FLD (f_operand2);
3295 if (EQSI (tmp_rno, 2)) {
3296 tmp_newval = ({ SI tmp_addr;
3297 SI tmp_tmp_mem;
3298 BI tmp_postinc;
3299 tmp_postinc = FLD (f_memmode);
3300 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3301 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3302 ; if (NEBI (tmp_postinc, 0)) {
3304 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3305 tmp_addr = ADDSI (tmp_addr, 4);
3308 SI opval = tmp_addr;
3309 SET_H_GR (FLD (f_operand1), opval);
3310 written |= (1 << 8);
3311 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3315 ; tmp_tmp_mem; });
3317 else if (EQSI (tmp_rno, 3)) {
3318 tmp_newval = EXTQISI (({ SI tmp_addr;
3319 QI tmp_tmp_mem;
3320 BI tmp_postinc;
3321 tmp_postinc = FLD (f_memmode);
3322 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3323 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
3324 ; if (NEBI (tmp_postinc, 0)) {
3326 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3327 tmp_addr = ADDSI (tmp_addr, 1);
3330 SI opval = tmp_addr;
3331 SET_H_GR (FLD (f_operand1), opval);
3332 written |= (1 << 8);
3333 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3337 ; tmp_tmp_mem; }));
3339 else if (EQSI (tmp_rno, 5)) {
3340 tmp_newval = ({ SI tmp_addr;
3341 SI tmp_tmp_mem;
3342 BI tmp_postinc;
3343 tmp_postinc = FLD (f_memmode);
3344 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3345 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3346 ; if (NEBI (tmp_postinc, 0)) {
3348 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3349 tmp_addr = ADDSI (tmp_addr, 4);
3352 SI opval = tmp_addr;
3353 SET_H_GR (FLD (f_operand1), opval);
3354 written |= (1 << 8);
3355 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3359 ; tmp_tmp_mem; });
3361 else if (EQSI (tmp_rno, 6)) {
3362 tmp_newval = ({ SI tmp_addr;
3363 SI tmp_tmp_mem;
3364 BI tmp_postinc;
3365 tmp_postinc = FLD (f_memmode);
3366 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3367 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3368 ; if (NEBI (tmp_postinc, 0)) {
3370 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3371 tmp_addr = ADDSI (tmp_addr, 4);
3374 SI opval = tmp_addr;
3375 SET_H_GR (FLD (f_operand1), opval);
3376 written |= (1 << 8);
3377 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3381 ; tmp_tmp_mem; });
3383 else if (EQSI (tmp_rno, 7)) {
3384 tmp_newval = ({ SI tmp_addr;
3385 SI tmp_tmp_mem;
3386 BI tmp_postinc;
3387 tmp_postinc = FLD (f_memmode);
3388 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3389 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3390 ; if (NEBI (tmp_postinc, 0)) {
3392 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3393 tmp_addr = ADDSI (tmp_addr, 4);
3396 SI opval = tmp_addr;
3397 SET_H_GR (FLD (f_operand1), opval);
3398 written |= (1 << 8);
3399 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3403 ; tmp_tmp_mem; });
3405 else if (EQSI (tmp_rno, 9)) {
3406 tmp_newval = ({ SI tmp_addr;
3407 SI tmp_tmp_mem;
3408 BI tmp_postinc;
3409 tmp_postinc = FLD (f_memmode);
3410 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3411 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3412 ; if (NEBI (tmp_postinc, 0)) {
3414 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3415 tmp_addr = ADDSI (tmp_addr, 4);
3418 SI opval = tmp_addr;
3419 SET_H_GR (FLD (f_operand1), opval);
3420 written |= (1 << 8);
3421 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3425 ; tmp_tmp_mem; });
3427 else if (EQSI (tmp_rno, 10)) {
3428 tmp_newval = ({ SI tmp_addr;
3429 SI tmp_tmp_mem;
3430 BI tmp_postinc;
3431 tmp_postinc = FLD (f_memmode);
3432 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3433 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3434 ; if (NEBI (tmp_postinc, 0)) {
3436 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3437 tmp_addr = ADDSI (tmp_addr, 4);
3440 SI opval = tmp_addr;
3441 SET_H_GR (FLD (f_operand1), opval);
3442 written |= (1 << 8);
3443 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3447 ; tmp_tmp_mem; });
3449 else if (EQSI (tmp_rno, 11)) {
3450 tmp_newval = ({ SI tmp_addr;
3451 SI tmp_tmp_mem;
3452 BI tmp_postinc;
3453 tmp_postinc = FLD (f_memmode);
3454 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3455 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3456 ; if (NEBI (tmp_postinc, 0)) {
3458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3459 tmp_addr = ADDSI (tmp_addr, 4);
3462 SI opval = tmp_addr;
3463 SET_H_GR (FLD (f_operand1), opval);
3464 written |= (1 << 8);
3465 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3469 ; tmp_tmp_mem; });
3471 else if (EQSI (tmp_rno, 12)) {
3472 tmp_newval = ({ SI tmp_addr;
3473 SI tmp_tmp_mem;
3474 BI tmp_postinc;
3475 tmp_postinc = FLD (f_memmode);
3476 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3477 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3478 ; if (NEBI (tmp_postinc, 0)) {
3480 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3481 tmp_addr = ADDSI (tmp_addr, 4);
3484 SI opval = tmp_addr;
3485 SET_H_GR (FLD (f_operand1), opval);
3486 written |= (1 << 8);
3487 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3491 ; tmp_tmp_mem; });
3493 else if (EQSI (tmp_rno, 13)) {
3494 tmp_newval = ({ SI tmp_addr;
3495 SI tmp_tmp_mem;
3496 BI tmp_postinc;
3497 tmp_postinc = FLD (f_memmode);
3498 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3499 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3500 ; if (NEBI (tmp_postinc, 0)) {
3502 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3503 tmp_addr = ADDSI (tmp_addr, 4);
3506 SI opval = tmp_addr;
3507 SET_H_GR (FLD (f_operand1), opval);
3508 written |= (1 << 8);
3509 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3513 ; tmp_tmp_mem; });
3515 else if (EQSI (tmp_rno, 14)) {
3516 tmp_newval = ({ SI tmp_addr;
3517 SI tmp_tmp_mem;
3518 BI tmp_postinc;
3519 tmp_postinc = FLD (f_memmode);
3520 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3521 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3522 ; if (NEBI (tmp_postinc, 0)) {
3524 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3525 tmp_addr = ADDSI (tmp_addr, 4);
3528 SI opval = tmp_addr;
3529 SET_H_GR (FLD (f_operand1), opval);
3530 written |= (1 << 8);
3531 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3535 ; tmp_tmp_mem; });
3537 else if (EQSI (tmp_rno, 15)) {
3538 tmp_newval = ({ SI tmp_addr;
3539 SI tmp_tmp_mem;
3540 BI tmp_postinc;
3541 tmp_postinc = FLD (f_memmode);
3542 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
3543 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3544 ; if (NEBI (tmp_postinc, 0)) {
3546 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3547 tmp_addr = ADDSI (tmp_addr, 4);
3550 SI opval = tmp_addr;
3551 SET_H_GR (FLD (f_operand1), opval);
3552 written |= (1 << 8);
3553 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3557 ; tmp_tmp_mem; });
3559 else {
3560 cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
3563 SI opval = tmp_newval;
3564 SET_H_SR (FLD (f_operand2), opval);
3565 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3569 BI opval = 0;
3570 CPU (h_xbit) = opval;
3571 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3574 BI opval = 0;
3575 SET_H_INSN_PREFIXED_P (opval);
3576 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3581 abuf->written = written;
3582 #undef FLD
3584 NEXT (vpc);
3586 CASE (sem, INSN_MOVE_C_SPRV32_P2) : /* move ${const32},${Pd} */
3588 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3589 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3590 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3591 int UNUSED written = 0;
3592 IADDR UNUSED pc = abuf->addr;
3593 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3597 SI opval = FLD (f_indir_pc__dword);
3598 SET_H_SR (FLD (f_operand2), opval);
3599 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3603 BI opval = 0;
3604 CPU (h_xbit) = opval;
3605 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3608 BI opval = 0;
3609 SET_H_INSN_PREFIXED_P (opval);
3610 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3615 #undef FLD
3617 NEXT (vpc);
3619 CASE (sem, INSN_MOVE_C_SPRV32_P3) : /* move ${const32},${Pd} */
3621 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3622 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3623 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3624 int UNUSED written = 0;
3625 IADDR UNUSED pc = abuf->addr;
3626 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3630 SI opval = FLD (f_indir_pc__dword);
3631 SET_H_SR (FLD (f_operand2), opval);
3632 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3636 BI opval = 0;
3637 CPU (h_xbit) = opval;
3638 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3641 BI opval = 0;
3642 SET_H_INSN_PREFIXED_P (opval);
3643 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3648 #undef FLD
3650 NEXT (vpc);
3652 CASE (sem, INSN_MOVE_C_SPRV32_P5) : /* move ${const32},${Pd} */
3654 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3655 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3656 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3657 int UNUSED written = 0;
3658 IADDR UNUSED pc = abuf->addr;
3659 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3663 SI opval = FLD (f_indir_pc__dword);
3664 SET_H_SR (FLD (f_operand2), opval);
3665 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3669 BI opval = 0;
3670 CPU (h_xbit) = opval;
3671 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3674 BI opval = 0;
3675 SET_H_INSN_PREFIXED_P (opval);
3676 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3681 #undef FLD
3683 NEXT (vpc);
3685 CASE (sem, INSN_MOVE_C_SPRV32_P6) : /* move ${const32},${Pd} */
3687 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3688 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3689 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3690 int UNUSED written = 0;
3691 IADDR UNUSED pc = abuf->addr;
3692 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3696 SI opval = FLD (f_indir_pc__dword);
3697 SET_H_SR (FLD (f_operand2), opval);
3698 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3702 BI opval = 0;
3703 CPU (h_xbit) = opval;
3704 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3707 BI opval = 0;
3708 SET_H_INSN_PREFIXED_P (opval);
3709 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3714 #undef FLD
3716 NEXT (vpc);
3718 CASE (sem, INSN_MOVE_C_SPRV32_P7) : /* move ${const32},${Pd} */
3720 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3721 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3722 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3723 int UNUSED written = 0;
3724 IADDR UNUSED pc = abuf->addr;
3725 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3729 SI opval = FLD (f_indir_pc__dword);
3730 SET_H_SR (FLD (f_operand2), opval);
3731 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3735 BI opval = 0;
3736 CPU (h_xbit) = opval;
3737 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3740 BI opval = 0;
3741 SET_H_INSN_PREFIXED_P (opval);
3742 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3747 #undef FLD
3749 NEXT (vpc);
3751 CASE (sem, INSN_MOVE_C_SPRV32_P9) : /* move ${const32},${Pd} */
3753 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3754 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3755 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3756 int UNUSED written = 0;
3757 IADDR UNUSED pc = abuf->addr;
3758 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3762 SI opval = FLD (f_indir_pc__dword);
3763 SET_H_SR (FLD (f_operand2), opval);
3764 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3768 BI opval = 0;
3769 CPU (h_xbit) = opval;
3770 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3773 BI opval = 0;
3774 SET_H_INSN_PREFIXED_P (opval);
3775 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3780 #undef FLD
3782 NEXT (vpc);
3784 CASE (sem, INSN_MOVE_C_SPRV32_P10) : /* move ${const32},${Pd} */
3786 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3787 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3788 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3789 int UNUSED written = 0;
3790 IADDR UNUSED pc = abuf->addr;
3791 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3795 SI opval = FLD (f_indir_pc__dword);
3796 SET_H_SR (FLD (f_operand2), opval);
3797 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3801 BI opval = 0;
3802 CPU (h_xbit) = opval;
3803 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3806 BI opval = 0;
3807 SET_H_INSN_PREFIXED_P (opval);
3808 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3813 #undef FLD
3815 NEXT (vpc);
3817 CASE (sem, INSN_MOVE_C_SPRV32_P11) : /* move ${const32},${Pd} */
3819 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3820 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3821 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3822 int UNUSED written = 0;
3823 IADDR UNUSED pc = abuf->addr;
3824 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3828 SI opval = FLD (f_indir_pc__dword);
3829 SET_H_SR (FLD (f_operand2), opval);
3830 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3834 BI opval = 0;
3835 CPU (h_xbit) = opval;
3836 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3839 BI opval = 0;
3840 SET_H_INSN_PREFIXED_P (opval);
3841 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3846 #undef FLD
3848 NEXT (vpc);
3850 CASE (sem, INSN_MOVE_C_SPRV32_P12) : /* move ${const32},${Pd} */
3852 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3853 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3854 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3855 int UNUSED written = 0;
3856 IADDR UNUSED pc = abuf->addr;
3857 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3861 SI opval = FLD (f_indir_pc__dword);
3862 SET_H_SR (FLD (f_operand2), opval);
3863 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3867 BI opval = 0;
3868 CPU (h_xbit) = opval;
3869 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3872 BI opval = 0;
3873 SET_H_INSN_PREFIXED_P (opval);
3874 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3879 #undef FLD
3881 NEXT (vpc);
3883 CASE (sem, INSN_MOVE_C_SPRV32_P13) : /* move ${const32},${Pd} */
3885 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3886 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3887 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3888 int UNUSED written = 0;
3889 IADDR UNUSED pc = abuf->addr;
3890 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3894 SI opval = FLD (f_indir_pc__dword);
3895 SET_H_SR (FLD (f_operand2), opval);
3896 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3900 BI opval = 0;
3901 CPU (h_xbit) = opval;
3902 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3905 BI opval = 0;
3906 SET_H_INSN_PREFIXED_P (opval);
3907 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3912 #undef FLD
3914 NEXT (vpc);
3916 CASE (sem, INSN_MOVE_C_SPRV32_P14) : /* move ${const32},${Pd} */
3918 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3919 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3920 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3921 int UNUSED written = 0;
3922 IADDR UNUSED pc = abuf->addr;
3923 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3927 SI opval = FLD (f_indir_pc__dword);
3928 SET_H_SR (FLD (f_operand2), opval);
3929 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3933 BI opval = 0;
3934 CPU (h_xbit) = opval;
3935 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3938 BI opval = 0;
3939 SET_H_INSN_PREFIXED_P (opval);
3940 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3945 #undef FLD
3947 NEXT (vpc);
3949 CASE (sem, INSN_MOVE_C_SPRV32_P15) : /* move ${const32},${Pd} */
3951 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3952 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3953 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3954 int UNUSED written = 0;
3955 IADDR UNUSED pc = abuf->addr;
3956 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3960 SI opval = FLD (f_indir_pc__dword);
3961 SET_H_SR (FLD (f_operand2), opval);
3962 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3966 BI opval = 0;
3967 CPU (h_xbit) = opval;
3968 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3971 BI opval = 0;
3972 SET_H_INSN_PREFIXED_P (opval);
3973 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3978 #undef FLD
3980 NEXT (vpc);
3982 CASE (sem, INSN_MOVE_SPR_MV32) : /* move ${Ps},[${Rd-sfield}${inc}] */
3984 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3985 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3986 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3987 int UNUSED written = 0;
3988 IADDR UNUSED pc = abuf->addr;
3989 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3992 SI tmp_rno;
3993 tmp_rno = FLD (f_operand2);
3994 if (EQSI (tmp_rno, 2)) {
3996 SI tmp_addr;
3997 BI tmp_postinc;
3998 tmp_postinc = FLD (f_memmode);
3999 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4000 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4001 if (EQBI (CPU (h_pbit), 0)) {
4004 SI opval = GET_H_SR (FLD (f_operand2));
4005 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4006 written |= (1 << 13);
4007 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4010 BI opval = CPU (h_pbit);
4011 CPU (h_cbit) = opval;
4012 written |= (1 << 10);
4013 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4016 } else {
4018 BI opval = 1;
4019 CPU (h_cbit) = opval;
4020 written |= (1 << 10);
4021 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4024 } else {
4026 SI opval = GET_H_SR (FLD (f_operand2));
4027 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4028 written |= (1 << 13);
4029 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4032 if (NEBI (tmp_postinc, 0)) {
4034 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4035 tmp_addr = ADDSI (tmp_addr, 4);
4038 SI opval = tmp_addr;
4039 SET_H_GR (FLD (f_operand1), opval);
4040 written |= (1 << 9);
4041 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4047 else if (EQSI (tmp_rno, 3)) {
4049 SI tmp_addr;
4050 BI tmp_postinc;
4051 tmp_postinc = FLD (f_memmode);
4052 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4053 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4054 if (EQBI (CPU (h_pbit), 0)) {
4057 QI opval = GET_H_SR (FLD (f_operand2));
4058 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4059 written |= (1 << 12);
4060 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4063 BI opval = CPU (h_pbit);
4064 CPU (h_cbit) = opval;
4065 written |= (1 << 10);
4066 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4069 } else {
4071 BI opval = 1;
4072 CPU (h_cbit) = opval;
4073 written |= (1 << 10);
4074 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4077 } else {
4079 QI opval = GET_H_SR (FLD (f_operand2));
4080 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4081 written |= (1 << 12);
4082 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4085 if (NEBI (tmp_postinc, 0)) {
4087 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4088 tmp_addr = ADDSI (tmp_addr, 1);
4091 SI opval = tmp_addr;
4092 SET_H_GR (FLD (f_operand1), opval);
4093 written |= (1 << 9);
4094 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4100 else if (EQSI (tmp_rno, 5)) {
4102 SI tmp_addr;
4103 BI tmp_postinc;
4104 tmp_postinc = FLD (f_memmode);
4105 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4106 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4107 if (EQBI (CPU (h_pbit), 0)) {
4110 SI opval = GET_H_SR (FLD (f_operand2));
4111 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4112 written |= (1 << 13);
4113 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4116 BI opval = CPU (h_pbit);
4117 CPU (h_cbit) = opval;
4118 written |= (1 << 10);
4119 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4122 } else {
4124 BI opval = 1;
4125 CPU (h_cbit) = opval;
4126 written |= (1 << 10);
4127 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4130 } else {
4132 SI opval = GET_H_SR (FLD (f_operand2));
4133 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4134 written |= (1 << 13);
4135 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4138 if (NEBI (tmp_postinc, 0)) {
4140 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4141 tmp_addr = ADDSI (tmp_addr, 4);
4144 SI opval = tmp_addr;
4145 SET_H_GR (FLD (f_operand1), opval);
4146 written |= (1 << 9);
4147 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4153 else if (EQSI (tmp_rno, 6)) {
4155 SI tmp_addr;
4156 BI tmp_postinc;
4157 tmp_postinc = FLD (f_memmode);
4158 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4159 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4160 if (EQBI (CPU (h_pbit), 0)) {
4163 SI opval = GET_H_SR (FLD (f_operand2));
4164 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4165 written |= (1 << 13);
4166 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4169 BI opval = CPU (h_pbit);
4170 CPU (h_cbit) = opval;
4171 written |= (1 << 10);
4172 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4175 } else {
4177 BI opval = 1;
4178 CPU (h_cbit) = opval;
4179 written |= (1 << 10);
4180 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4183 } else {
4185 SI opval = GET_H_SR (FLD (f_operand2));
4186 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4187 written |= (1 << 13);
4188 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4191 if (NEBI (tmp_postinc, 0)) {
4193 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4194 tmp_addr = ADDSI (tmp_addr, 4);
4197 SI opval = tmp_addr;
4198 SET_H_GR (FLD (f_operand1), opval);
4199 written |= (1 << 9);
4200 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4206 else if (EQSI (tmp_rno, 7)) {
4208 SI tmp_addr;
4209 BI tmp_postinc;
4210 tmp_postinc = FLD (f_memmode);
4211 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4212 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4213 if (EQBI (CPU (h_pbit), 0)) {
4216 SI opval = GET_H_SR (FLD (f_operand2));
4217 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4218 written |= (1 << 13);
4219 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4222 BI opval = CPU (h_pbit);
4223 CPU (h_cbit) = opval;
4224 written |= (1 << 10);
4225 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4228 } else {
4230 BI opval = 1;
4231 CPU (h_cbit) = opval;
4232 written |= (1 << 10);
4233 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4236 } else {
4238 SI opval = GET_H_SR (FLD (f_operand2));
4239 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4240 written |= (1 << 13);
4241 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4244 if (NEBI (tmp_postinc, 0)) {
4246 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4247 tmp_addr = ADDSI (tmp_addr, 4);
4250 SI opval = tmp_addr;
4251 SET_H_GR (FLD (f_operand1), opval);
4252 written |= (1 << 9);
4253 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4259 else if (EQSI (tmp_rno, 9)) {
4261 SI tmp_addr;
4262 BI tmp_postinc;
4263 tmp_postinc = FLD (f_memmode);
4264 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4265 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4266 if (EQBI (CPU (h_pbit), 0)) {
4269 SI opval = GET_H_SR (FLD (f_operand2));
4270 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4271 written |= (1 << 13);
4272 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4275 BI opval = CPU (h_pbit);
4276 CPU (h_cbit) = opval;
4277 written |= (1 << 10);
4278 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4281 } else {
4283 BI opval = 1;
4284 CPU (h_cbit) = opval;
4285 written |= (1 << 10);
4286 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4289 } else {
4291 SI opval = GET_H_SR (FLD (f_operand2));
4292 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4293 written |= (1 << 13);
4294 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4297 if (NEBI (tmp_postinc, 0)) {
4299 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4300 tmp_addr = ADDSI (tmp_addr, 4);
4303 SI opval = tmp_addr;
4304 SET_H_GR (FLD (f_operand1), opval);
4305 written |= (1 << 9);
4306 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4312 else if (EQSI (tmp_rno, 10)) {
4314 SI tmp_addr;
4315 BI tmp_postinc;
4316 tmp_postinc = FLD (f_memmode);
4317 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4318 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4319 if (EQBI (CPU (h_pbit), 0)) {
4322 SI opval = GET_H_SR (FLD (f_operand2));
4323 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4324 written |= (1 << 13);
4325 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4328 BI opval = CPU (h_pbit);
4329 CPU (h_cbit) = opval;
4330 written |= (1 << 10);
4331 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4334 } else {
4336 BI opval = 1;
4337 CPU (h_cbit) = opval;
4338 written |= (1 << 10);
4339 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4342 } else {
4344 SI opval = GET_H_SR (FLD (f_operand2));
4345 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4346 written |= (1 << 13);
4347 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4350 if (NEBI (tmp_postinc, 0)) {
4352 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4353 tmp_addr = ADDSI (tmp_addr, 4);
4356 SI opval = tmp_addr;
4357 SET_H_GR (FLD (f_operand1), opval);
4358 written |= (1 << 9);
4359 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4365 else if (EQSI (tmp_rno, 11)) {
4367 SI tmp_addr;
4368 BI tmp_postinc;
4369 tmp_postinc = FLD (f_memmode);
4370 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4371 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4372 if (EQBI (CPU (h_pbit), 0)) {
4375 SI opval = GET_H_SR (FLD (f_operand2));
4376 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4377 written |= (1 << 13);
4378 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4381 BI opval = CPU (h_pbit);
4382 CPU (h_cbit) = opval;
4383 written |= (1 << 10);
4384 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4387 } else {
4389 BI opval = 1;
4390 CPU (h_cbit) = opval;
4391 written |= (1 << 10);
4392 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4395 } else {
4397 SI opval = GET_H_SR (FLD (f_operand2));
4398 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4399 written |= (1 << 13);
4400 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4403 if (NEBI (tmp_postinc, 0)) {
4405 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4406 tmp_addr = ADDSI (tmp_addr, 4);
4409 SI opval = tmp_addr;
4410 SET_H_GR (FLD (f_operand1), opval);
4411 written |= (1 << 9);
4412 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4418 else if (EQSI (tmp_rno, 12)) {
4420 SI tmp_addr;
4421 BI tmp_postinc;
4422 tmp_postinc = FLD (f_memmode);
4423 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4424 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4425 if (EQBI (CPU (h_pbit), 0)) {
4428 SI opval = GET_H_SR (FLD (f_operand2));
4429 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4430 written |= (1 << 13);
4431 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4434 BI opval = CPU (h_pbit);
4435 CPU (h_cbit) = opval;
4436 written |= (1 << 10);
4437 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4440 } else {
4442 BI opval = 1;
4443 CPU (h_cbit) = opval;
4444 written |= (1 << 10);
4445 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4448 } else {
4450 SI opval = GET_H_SR (FLD (f_operand2));
4451 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4452 written |= (1 << 13);
4453 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4456 if (NEBI (tmp_postinc, 0)) {
4458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4459 tmp_addr = ADDSI (tmp_addr, 4);
4462 SI opval = tmp_addr;
4463 SET_H_GR (FLD (f_operand1), opval);
4464 written |= (1 << 9);
4465 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4471 else if (EQSI (tmp_rno, 13)) {
4473 SI tmp_addr;
4474 BI tmp_postinc;
4475 tmp_postinc = FLD (f_memmode);
4476 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4477 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4478 if (EQBI (CPU (h_pbit), 0)) {
4481 SI opval = GET_H_SR (FLD (f_operand2));
4482 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4483 written |= (1 << 13);
4484 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4487 BI opval = CPU (h_pbit);
4488 CPU (h_cbit) = opval;
4489 written |= (1 << 10);
4490 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4493 } else {
4495 BI opval = 1;
4496 CPU (h_cbit) = opval;
4497 written |= (1 << 10);
4498 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4501 } else {
4503 SI opval = GET_H_SR (FLD (f_operand2));
4504 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4505 written |= (1 << 13);
4506 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4509 if (NEBI (tmp_postinc, 0)) {
4511 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4512 tmp_addr = ADDSI (tmp_addr, 4);
4515 SI opval = tmp_addr;
4516 SET_H_GR (FLD (f_operand1), opval);
4517 written |= (1 << 9);
4518 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4524 else if (EQSI (tmp_rno, 14)) {
4526 SI tmp_addr;
4527 BI tmp_postinc;
4528 tmp_postinc = FLD (f_memmode);
4529 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4530 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4531 if (EQBI (CPU (h_pbit), 0)) {
4534 SI opval = GET_H_SR (FLD (f_operand2));
4535 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4536 written |= (1 << 13);
4537 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4540 BI opval = CPU (h_pbit);
4541 CPU (h_cbit) = opval;
4542 written |= (1 << 10);
4543 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4546 } else {
4548 BI opval = 1;
4549 CPU (h_cbit) = opval;
4550 written |= (1 << 10);
4551 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4554 } else {
4556 SI opval = GET_H_SR (FLD (f_operand2));
4557 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4558 written |= (1 << 13);
4559 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4562 if (NEBI (tmp_postinc, 0)) {
4564 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4565 tmp_addr = ADDSI (tmp_addr, 4);
4568 SI opval = tmp_addr;
4569 SET_H_GR (FLD (f_operand1), opval);
4570 written |= (1 << 9);
4571 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4577 else if (EQSI (tmp_rno, 15)) {
4579 SI tmp_addr;
4580 BI tmp_postinc;
4581 tmp_postinc = FLD (f_memmode);
4582 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4583 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4584 if (EQBI (CPU (h_pbit), 0)) {
4587 SI opval = GET_H_SR (FLD (f_operand2));
4588 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4589 written |= (1 << 13);
4590 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4593 BI opval = CPU (h_pbit);
4594 CPU (h_cbit) = opval;
4595 written |= (1 << 10);
4596 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4599 } else {
4601 BI opval = 1;
4602 CPU (h_cbit) = opval;
4603 written |= (1 << 10);
4604 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4607 } else {
4609 SI opval = GET_H_SR (FLD (f_operand2));
4610 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4611 written |= (1 << 13);
4612 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4615 if (NEBI (tmp_postinc, 0)) {
4617 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4618 tmp_addr = ADDSI (tmp_addr, 4);
4621 SI opval = tmp_addr;
4622 SET_H_GR (FLD (f_operand1), opval);
4623 written |= (1 << 9);
4624 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4630 else if (EQSI (tmp_rno, 0)) {
4632 SI tmp_addr;
4633 BI tmp_postinc;
4634 tmp_postinc = FLD (f_memmode);
4635 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4636 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4637 if (EQBI (CPU (h_pbit), 0)) {
4640 QI opval = GET_H_SR (FLD (f_operand2));
4641 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4642 written |= (1 << 12);
4643 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4646 BI opval = CPU (h_pbit);
4647 CPU (h_cbit) = opval;
4648 written |= (1 << 10);
4649 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4652 } else {
4654 BI opval = 1;
4655 CPU (h_cbit) = opval;
4656 written |= (1 << 10);
4657 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4660 } else {
4662 QI opval = GET_H_SR (FLD (f_operand2));
4663 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4664 written |= (1 << 12);
4665 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4668 if (NEBI (tmp_postinc, 0)) {
4670 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4671 tmp_addr = ADDSI (tmp_addr, 1);
4674 SI opval = tmp_addr;
4675 SET_H_GR (FLD (f_operand1), opval);
4676 written |= (1 << 9);
4677 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4683 else if (EQSI (tmp_rno, 1)) {
4685 SI tmp_addr;
4686 BI tmp_postinc;
4687 tmp_postinc = FLD (f_memmode);
4688 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4689 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4690 if (EQBI (CPU (h_pbit), 0)) {
4693 QI opval = GET_H_SR (FLD (f_operand2));
4694 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4695 written |= (1 << 12);
4696 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4699 BI opval = CPU (h_pbit);
4700 CPU (h_cbit) = opval;
4701 written |= (1 << 10);
4702 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4705 } else {
4707 BI opval = 1;
4708 CPU (h_cbit) = opval;
4709 written |= (1 << 10);
4710 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4713 } else {
4715 QI opval = GET_H_SR (FLD (f_operand2));
4716 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4717 written |= (1 << 12);
4718 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4721 if (NEBI (tmp_postinc, 0)) {
4723 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4724 tmp_addr = ADDSI (tmp_addr, 1);
4727 SI opval = tmp_addr;
4728 SET_H_GR (FLD (f_operand1), opval);
4729 written |= (1 << 9);
4730 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4736 else if (EQSI (tmp_rno, 4)) {
4738 SI tmp_addr;
4739 BI tmp_postinc;
4740 tmp_postinc = FLD (f_memmode);
4741 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4742 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4743 if (EQBI (CPU (h_pbit), 0)) {
4746 HI opval = GET_H_SR (FLD (f_operand2));
4747 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4748 written |= (1 << 11);
4749 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4752 BI opval = CPU (h_pbit);
4753 CPU (h_cbit) = opval;
4754 written |= (1 << 10);
4755 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4758 } else {
4760 BI opval = 1;
4761 CPU (h_cbit) = opval;
4762 written |= (1 << 10);
4763 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4766 } else {
4768 HI opval = GET_H_SR (FLD (f_operand2));
4769 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4770 written |= (1 << 11);
4771 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4774 if (NEBI (tmp_postinc, 0)) {
4776 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4777 tmp_addr = ADDSI (tmp_addr, 2);
4780 SI opval = tmp_addr;
4781 SET_H_GR (FLD (f_operand1), opval);
4782 written |= (1 << 9);
4783 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4789 else if (EQSI (tmp_rno, 8)) {
4791 SI tmp_addr;
4792 BI tmp_postinc;
4793 tmp_postinc = FLD (f_memmode);
4794 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
4795 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
4796 if (EQBI (CPU (h_pbit), 0)) {
4799 SI opval = GET_H_SR (FLD (f_operand2));
4800 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4801 written |= (1 << 13);
4802 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4805 BI opval = CPU (h_pbit);
4806 CPU (h_cbit) = opval;
4807 written |= (1 << 10);
4808 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4811 } else {
4813 BI opval = 1;
4814 CPU (h_cbit) = opval;
4815 written |= (1 << 10);
4816 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4819 } else {
4821 SI opval = GET_H_SR (FLD (f_operand2));
4822 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4823 written |= (1 << 13);
4824 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4827 if (NEBI (tmp_postinc, 0)) {
4829 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4830 tmp_addr = ADDSI (tmp_addr, 4);
4833 SI opval = tmp_addr;
4834 SET_H_GR (FLD (f_operand1), opval);
4835 written |= (1 << 9);
4836 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4842 else {
4843 cgen_rtx_error (current_cpu, "write from unimplemented special register");
4847 BI opval = 0;
4848 CPU (h_xbit) = opval;
4849 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4852 BI opval = 0;
4853 SET_H_INSN_PREFIXED_P (opval);
4854 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4859 abuf->written = written;
4860 #undef FLD
4862 NEXT (vpc);
4864 CASE (sem, INSN_MOVE_SS_R) : /* move ${Ss},${Rd-sfield} */
4866 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4867 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4868 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4869 int UNUSED written = 0;
4870 IADDR UNUSED pc = abuf->addr;
4871 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4875 SI opval = GET_H_SUPR (FLD (f_operand2));
4876 SET_H_GR (FLD (f_operand1), opval);
4877 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4881 BI opval = 0;
4882 CPU (h_xbit) = opval;
4883 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4886 BI opval = 0;
4887 SET_H_INSN_PREFIXED_P (opval);
4888 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4893 #undef FLD
4895 NEXT (vpc);
4897 CASE (sem, INSN_MOVE_R_SS) : /* move ${Rs},${Sd} */
4899 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4900 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4901 #define FLD(f) abuf->fields.sfmt_mcp.f
4902 int UNUSED written = 0;
4903 IADDR UNUSED pc = abuf->addr;
4904 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4908 SI opval = GET_H_GR (FLD (f_operand1));
4909 SET_H_SUPR (FLD (f_operand2), opval);
4910 CGEN_TRACE_RESULT (current_cpu, abuf, "supr", 'x', opval);
4914 BI opval = 0;
4915 CPU (h_xbit) = opval;
4916 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4919 BI opval = 0;
4920 SET_H_INSN_PREFIXED_P (opval);
4921 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4926 #undef FLD
4928 NEXT (vpc);
4930 CASE (sem, INSN_MOVEM_R_M_V32) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4932 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4933 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4934 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
4935 int UNUSED written = 0;
4936 IADDR UNUSED pc = abuf->addr;
4937 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4940 SI tmp_addr;
4941 BI tmp_postinc;
4942 tmp_postinc = FLD (f_memmode);
4944 SI tmp_dummy;
4945 tmp_dummy = GET_H_GR (FLD (f_operand2));
4947 tmp_addr = GET_H_GR (FLD (f_operand1));
4949 if (GESI (FLD (f_operand2), 0)) {
4951 SI tmp_tmp;
4952 tmp_tmp = GET_H_GR (((UINT) 0));
4954 SI opval = tmp_tmp;
4955 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4956 written |= (1 << 21);
4957 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4959 tmp_addr = ADDSI (tmp_addr, 4);
4962 if (GESI (FLD (f_operand2), 1)) {
4964 SI tmp_tmp;
4965 tmp_tmp = GET_H_GR (((UINT) 1));
4967 SI opval = tmp_tmp;
4968 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4969 written |= (1 << 21);
4970 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4972 tmp_addr = ADDSI (tmp_addr, 4);
4975 if (GESI (FLD (f_operand2), 2)) {
4977 SI tmp_tmp;
4978 tmp_tmp = GET_H_GR (((UINT) 2));
4980 SI opval = tmp_tmp;
4981 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4982 written |= (1 << 21);
4983 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4985 tmp_addr = ADDSI (tmp_addr, 4);
4988 if (GESI (FLD (f_operand2), 3)) {
4990 SI tmp_tmp;
4991 tmp_tmp = GET_H_GR (((UINT) 3));
4993 SI opval = tmp_tmp;
4994 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4995 written |= (1 << 21);
4996 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4998 tmp_addr = ADDSI (tmp_addr, 4);
5001 if (GESI (FLD (f_operand2), 4)) {
5003 SI tmp_tmp;
5004 tmp_tmp = GET_H_GR (((UINT) 4));
5006 SI opval = tmp_tmp;
5007 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5008 written |= (1 << 21);
5009 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5011 tmp_addr = ADDSI (tmp_addr, 4);
5014 if (GESI (FLD (f_operand2), 5)) {
5016 SI tmp_tmp;
5017 tmp_tmp = GET_H_GR (((UINT) 5));
5019 SI opval = tmp_tmp;
5020 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5021 written |= (1 << 21);
5022 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5024 tmp_addr = ADDSI (tmp_addr, 4);
5027 if (GESI (FLD (f_operand2), 6)) {
5029 SI tmp_tmp;
5030 tmp_tmp = GET_H_GR (((UINT) 6));
5032 SI opval = tmp_tmp;
5033 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5034 written |= (1 << 21);
5035 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5037 tmp_addr = ADDSI (tmp_addr, 4);
5040 if (GESI (FLD (f_operand2), 7)) {
5042 SI tmp_tmp;
5043 tmp_tmp = GET_H_GR (((UINT) 7));
5045 SI opval = tmp_tmp;
5046 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5047 written |= (1 << 21);
5048 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5050 tmp_addr = ADDSI (tmp_addr, 4);
5053 if (GESI (FLD (f_operand2), 8)) {
5055 SI tmp_tmp;
5056 tmp_tmp = GET_H_GR (((UINT) 8));
5058 SI opval = tmp_tmp;
5059 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5060 written |= (1 << 21);
5061 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5063 tmp_addr = ADDSI (tmp_addr, 4);
5066 if (GESI (FLD (f_operand2), 9)) {
5068 SI tmp_tmp;
5069 tmp_tmp = GET_H_GR (((UINT) 9));
5071 SI opval = tmp_tmp;
5072 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5073 written |= (1 << 21);
5074 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5076 tmp_addr = ADDSI (tmp_addr, 4);
5079 if (GESI (FLD (f_operand2), 10)) {
5081 SI tmp_tmp;
5082 tmp_tmp = GET_H_GR (((UINT) 10));
5084 SI opval = tmp_tmp;
5085 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5086 written |= (1 << 21);
5087 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5089 tmp_addr = ADDSI (tmp_addr, 4);
5092 if (GESI (FLD (f_operand2), 11)) {
5094 SI tmp_tmp;
5095 tmp_tmp = GET_H_GR (((UINT) 11));
5097 SI opval = tmp_tmp;
5098 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5099 written |= (1 << 21);
5100 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5102 tmp_addr = ADDSI (tmp_addr, 4);
5105 if (GESI (FLD (f_operand2), 12)) {
5107 SI tmp_tmp;
5108 tmp_tmp = GET_H_GR (((UINT) 12));
5110 SI opval = tmp_tmp;
5111 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5112 written |= (1 << 21);
5113 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5115 tmp_addr = ADDSI (tmp_addr, 4);
5118 if (GESI (FLD (f_operand2), 13)) {
5120 SI tmp_tmp;
5121 tmp_tmp = GET_H_GR (((UINT) 13));
5123 SI opval = tmp_tmp;
5124 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5125 written |= (1 << 21);
5126 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5128 tmp_addr = ADDSI (tmp_addr, 4);
5131 if (GESI (FLD (f_operand2), 14)) {
5133 SI tmp_tmp;
5134 tmp_tmp = GET_H_GR (((UINT) 14));
5136 SI opval = tmp_tmp;
5137 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5138 written |= (1 << 21);
5139 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5141 tmp_addr = ADDSI (tmp_addr, 4);
5144 if (GESI (FLD (f_operand2), 15)) {
5146 SI tmp_tmp;
5147 tmp_tmp = GET_H_GR (((UINT) 15));
5149 SI opval = tmp_tmp;
5150 SETMEMSI (current_cpu, pc, tmp_addr, opval);
5151 written |= (1 << 21);
5152 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5154 tmp_addr = ADDSI (tmp_addr, 4);
5158 if (NEBI (tmp_postinc, 0)) {
5160 SI opval = tmp_addr;
5161 SET_H_GR (FLD (f_operand1), opval);
5162 written |= (1 << 20);
5163 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5168 BI opval = 0;
5169 CPU (h_xbit) = opval;
5170 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5173 BI opval = 0;
5174 SET_H_INSN_PREFIXED_P (opval);
5175 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5180 abuf->written = written;
5181 #undef FLD
5183 NEXT (vpc);
5185 CASE (sem, INSN_MOVEM_M_R_V32) : /* movem [${Rs}${inc}],${Rd} */
5187 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5188 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5189 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5190 int UNUSED written = 0;
5191 IADDR UNUSED pc = abuf->addr;
5192 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5195 SI tmp_addr;
5196 BI tmp_postinc;
5197 tmp_postinc = FLD (f_memmode);
5198 tmp_addr = GET_H_GR (FLD (f_operand1));
5200 SI tmp_dummy;
5201 tmp_dummy = GET_H_GR (FLD (f_operand2));
5204 if (GESI (FLD (f_operand2), 0)) {
5206 SI tmp_tmp;
5207 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5209 SI opval = tmp_tmp;
5210 SET_H_GR (((UINT) 0), opval);
5211 written |= (1 << 6);
5212 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5214 tmp_addr = ADDSI (tmp_addr, 4);
5217 if (GESI (FLD (f_operand2), 1)) {
5219 SI tmp_tmp;
5220 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5222 SI opval = tmp_tmp;
5223 SET_H_GR (((UINT) 1), opval);
5224 written |= (1 << 7);
5225 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5227 tmp_addr = ADDSI (tmp_addr, 4);
5230 if (GESI (FLD (f_operand2), 2)) {
5232 SI tmp_tmp;
5233 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5235 SI opval = tmp_tmp;
5236 SET_H_GR (((UINT) 2), opval);
5237 written |= (1 << 14);
5238 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5240 tmp_addr = ADDSI (tmp_addr, 4);
5243 if (GESI (FLD (f_operand2), 3)) {
5245 SI tmp_tmp;
5246 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5248 SI opval = tmp_tmp;
5249 SET_H_GR (((UINT) 3), opval);
5250 written |= (1 << 15);
5251 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5253 tmp_addr = ADDSI (tmp_addr, 4);
5256 if (GESI (FLD (f_operand2), 4)) {
5258 SI tmp_tmp;
5259 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5261 SI opval = tmp_tmp;
5262 SET_H_GR (((UINT) 4), opval);
5263 written |= (1 << 16);
5264 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5266 tmp_addr = ADDSI (tmp_addr, 4);
5269 if (GESI (FLD (f_operand2), 5)) {
5271 SI tmp_tmp;
5272 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5274 SI opval = tmp_tmp;
5275 SET_H_GR (((UINT) 5), opval);
5276 written |= (1 << 17);
5277 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5279 tmp_addr = ADDSI (tmp_addr, 4);
5282 if (GESI (FLD (f_operand2), 6)) {
5284 SI tmp_tmp;
5285 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5287 SI opval = tmp_tmp;
5288 SET_H_GR (((UINT) 6), opval);
5289 written |= (1 << 18);
5290 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5292 tmp_addr = ADDSI (tmp_addr, 4);
5295 if (GESI (FLD (f_operand2), 7)) {
5297 SI tmp_tmp;
5298 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5300 SI opval = tmp_tmp;
5301 SET_H_GR (((UINT) 7), opval);
5302 written |= (1 << 19);
5303 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5305 tmp_addr = ADDSI (tmp_addr, 4);
5308 if (GESI (FLD (f_operand2), 8)) {
5310 SI tmp_tmp;
5311 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5313 SI opval = tmp_tmp;
5314 SET_H_GR (((UINT) 8), opval);
5315 written |= (1 << 20);
5316 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5318 tmp_addr = ADDSI (tmp_addr, 4);
5321 if (GESI (FLD (f_operand2), 9)) {
5323 SI tmp_tmp;
5324 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5326 SI opval = tmp_tmp;
5327 SET_H_GR (((UINT) 9), opval);
5328 written |= (1 << 21);
5329 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5331 tmp_addr = ADDSI (tmp_addr, 4);
5334 if (GESI (FLD (f_operand2), 10)) {
5336 SI tmp_tmp;
5337 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5339 SI opval = tmp_tmp;
5340 SET_H_GR (((UINT) 10), opval);
5341 written |= (1 << 8);
5342 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5344 tmp_addr = ADDSI (tmp_addr, 4);
5347 if (GESI (FLD (f_operand2), 11)) {
5349 SI tmp_tmp;
5350 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5352 SI opval = tmp_tmp;
5353 SET_H_GR (((UINT) 11), opval);
5354 written |= (1 << 9);
5355 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5357 tmp_addr = ADDSI (tmp_addr, 4);
5360 if (GESI (FLD (f_operand2), 12)) {
5362 SI tmp_tmp;
5363 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5365 SI opval = tmp_tmp;
5366 SET_H_GR (((UINT) 12), opval);
5367 written |= (1 << 10);
5368 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5370 tmp_addr = ADDSI (tmp_addr, 4);
5373 if (GESI (FLD (f_operand2), 13)) {
5375 SI tmp_tmp;
5376 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5378 SI opval = tmp_tmp;
5379 SET_H_GR (((UINT) 13), opval);
5380 written |= (1 << 11);
5381 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5383 tmp_addr = ADDSI (tmp_addr, 4);
5386 if (GESI (FLD (f_operand2), 14)) {
5388 SI tmp_tmp;
5389 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5391 SI opval = tmp_tmp;
5392 SET_H_GR (((UINT) 14), opval);
5393 written |= (1 << 12);
5394 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5396 tmp_addr = ADDSI (tmp_addr, 4);
5399 if (GESI (FLD (f_operand2), 15)) {
5401 SI tmp_tmp;
5402 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5404 SI opval = tmp_tmp;
5405 SET_H_GR (((UINT) 15), opval);
5406 written |= (1 << 13);
5407 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5409 tmp_addr = ADDSI (tmp_addr, 4);
5413 if (NEBI (tmp_postinc, 0)) {
5415 SI opval = tmp_addr;
5416 SET_H_GR (FLD (f_operand1), opval);
5417 written |= (1 << 5);
5418 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5423 BI opval = 0;
5424 CPU (h_xbit) = opval;
5425 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5428 BI opval = 0;
5429 SET_H_INSN_PREFIXED_P (opval);
5430 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5435 abuf->written = written;
5436 #undef FLD
5438 NEXT (vpc);
5440 CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
5442 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5443 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5444 #define FLD(f) abuf->fields.sfmt_addc_m.f
5445 int UNUSED written = 0;
5446 IADDR UNUSED pc = abuf->addr;
5447 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5450 QI tmp_tmpopd;
5451 QI tmp_tmpops;
5452 BI tmp_carry;
5453 QI tmp_newval;
5454 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5455 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5456 tmp_carry = CPU (h_cbit);
5457 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5459 SI tmp_oldregval;
5460 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5462 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5463 SET_H_GR (FLD (f_operand2), opval);
5464 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5469 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
5470 CPU (h_cbit) = opval;
5471 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5474 BI opval = LTQI (tmp_newval, 0);
5475 CPU (h_nbit) = opval;
5476 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5479 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5480 CPU (h_zbit) = opval;
5481 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5484 BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
5485 CPU (h_vbit) = opval;
5486 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5490 BI opval = 0;
5491 CPU (h_xbit) = opval;
5492 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5495 BI opval = 0;
5496 SET_H_INSN_PREFIXED_P (opval);
5497 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5503 #undef FLD
5505 NEXT (vpc);
5507 CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
5509 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5510 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5511 #define FLD(f) abuf->fields.sfmt_addc_m.f
5512 int UNUSED written = 0;
5513 IADDR UNUSED pc = abuf->addr;
5514 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5517 HI tmp_tmpopd;
5518 HI tmp_tmpops;
5519 BI tmp_carry;
5520 HI tmp_newval;
5521 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5522 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5523 tmp_carry = CPU (h_cbit);
5524 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5526 SI tmp_oldregval;
5527 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5529 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5530 SET_H_GR (FLD (f_operand2), opval);
5531 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5536 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
5537 CPU (h_cbit) = opval;
5538 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5541 BI opval = LTHI (tmp_newval, 0);
5542 CPU (h_nbit) = opval;
5543 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5546 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5547 CPU (h_zbit) = opval;
5548 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5551 BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
5552 CPU (h_vbit) = opval;
5553 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5557 BI opval = 0;
5558 CPU (h_xbit) = opval;
5559 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5562 BI opval = 0;
5563 SET_H_INSN_PREFIXED_P (opval);
5564 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5570 #undef FLD
5572 NEXT (vpc);
5574 CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
5576 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5577 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5578 #define FLD(f) abuf->fields.sfmt_addc_m.f
5579 int UNUSED written = 0;
5580 IADDR UNUSED pc = abuf->addr;
5581 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5584 SI tmp_tmpopd;
5585 SI tmp_tmpops;
5586 BI tmp_carry;
5587 SI tmp_newval;
5588 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5589 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5590 tmp_carry = CPU (h_cbit);
5591 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5593 SI opval = tmp_newval;
5594 SET_H_GR (FLD (f_operand2), opval);
5595 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5599 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
5600 CPU (h_cbit) = opval;
5601 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5604 BI opval = LTSI (tmp_newval, 0);
5605 CPU (h_nbit) = opval;
5606 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5609 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5610 CPU (h_zbit) = opval;
5611 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5614 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
5615 CPU (h_vbit) = opval;
5616 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5620 BI opval = 0;
5621 CPU (h_xbit) = opval;
5622 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5625 BI opval = 0;
5626 SET_H_INSN_PREFIXED_P (opval);
5627 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5633 #undef FLD
5635 NEXT (vpc);
5637 CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
5639 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5640 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5641 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5642 int UNUSED written = 0;
5643 IADDR UNUSED pc = abuf->addr;
5644 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5647 QI tmp_tmpopd;
5648 QI tmp_tmpops;
5649 BI tmp_carry;
5650 QI tmp_newval;
5651 tmp_tmpops = ({ SI tmp_addr;
5652 QI tmp_tmp_mem;
5653 BI tmp_postinc;
5654 tmp_postinc = FLD (f_memmode);
5655 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5656 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
5657 ; if (NEBI (tmp_postinc, 0)) {
5659 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5660 tmp_addr = ADDSI (tmp_addr, 1);
5663 SI opval = tmp_addr;
5664 SET_H_GR (FLD (f_operand1), opval);
5665 written |= (1 << 12);
5666 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5670 ; tmp_tmp_mem; });
5671 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5672 tmp_carry = CPU (h_cbit);
5673 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5675 SI tmp_oldregval;
5676 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5678 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5679 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5680 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5685 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
5686 CPU (h_cbit) = opval;
5687 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5690 BI opval = LTQI (tmp_newval, 0);
5691 CPU (h_nbit) = opval;
5692 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5695 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5696 CPU (h_zbit) = opval;
5697 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5700 BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
5701 CPU (h_vbit) = opval;
5702 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5706 BI opval = 0;
5707 CPU (h_xbit) = opval;
5708 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5711 BI opval = 0;
5712 SET_H_INSN_PREFIXED_P (opval);
5713 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5719 abuf->written = written;
5720 #undef FLD
5722 NEXT (vpc);
5724 CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
5726 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5727 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5728 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5729 int UNUSED written = 0;
5730 IADDR UNUSED pc = abuf->addr;
5731 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5734 HI tmp_tmpopd;
5735 HI tmp_tmpops;
5736 BI tmp_carry;
5737 HI tmp_newval;
5738 tmp_tmpops = ({ SI tmp_addr;
5739 HI tmp_tmp_mem;
5740 BI tmp_postinc;
5741 tmp_postinc = FLD (f_memmode);
5742 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5743 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
5744 ; if (NEBI (tmp_postinc, 0)) {
5746 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5747 tmp_addr = ADDSI (tmp_addr, 2);
5750 SI opval = tmp_addr;
5751 SET_H_GR (FLD (f_operand1), opval);
5752 written |= (1 << 12);
5753 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5757 ; tmp_tmp_mem; });
5758 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5759 tmp_carry = CPU (h_cbit);
5760 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5762 SI tmp_oldregval;
5763 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5765 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5766 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5767 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5772 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
5773 CPU (h_cbit) = opval;
5774 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5777 BI opval = LTHI (tmp_newval, 0);
5778 CPU (h_nbit) = opval;
5779 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5782 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5783 CPU (h_zbit) = opval;
5784 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5787 BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
5788 CPU (h_vbit) = opval;
5789 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5793 BI opval = 0;
5794 CPU (h_xbit) = opval;
5795 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5798 BI opval = 0;
5799 SET_H_INSN_PREFIXED_P (opval);
5800 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5806 abuf->written = written;
5807 #undef FLD
5809 NEXT (vpc);
5811 CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
5813 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5814 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5815 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5816 int UNUSED written = 0;
5817 IADDR UNUSED pc = abuf->addr;
5818 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5821 SI tmp_tmpopd;
5822 SI tmp_tmpops;
5823 BI tmp_carry;
5824 SI tmp_newval;
5825 tmp_tmpops = ({ SI tmp_addr;
5826 SI tmp_tmp_mem;
5827 BI tmp_postinc;
5828 tmp_postinc = FLD (f_memmode);
5829 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
5830 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
5831 ; if (NEBI (tmp_postinc, 0)) {
5833 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5834 tmp_addr = ADDSI (tmp_addr, 4);
5837 SI opval = tmp_addr;
5838 SET_H_GR (FLD (f_operand1), opval);
5839 written |= (1 << 11);
5840 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5844 ; tmp_tmp_mem; });
5845 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5846 tmp_carry = CPU (h_cbit);
5847 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5849 SI opval = tmp_newval;
5850 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5851 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5855 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
5856 CPU (h_cbit) = opval;
5857 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5860 BI opval = LTSI (tmp_newval, 0);
5861 CPU (h_nbit) = opval;
5862 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5865 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5866 CPU (h_zbit) = opval;
5867 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5870 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
5871 CPU (h_vbit) = opval;
5872 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5876 BI opval = 0;
5877 CPU (h_xbit) = opval;
5878 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5881 BI opval = 0;
5882 SET_H_INSN_PREFIXED_P (opval);
5883 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5889 abuf->written = written;
5890 #undef FLD
5892 NEXT (vpc);
5894 CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
5896 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5897 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5898 #define FLD(f) abuf->fields.sfmt_addcbr.f
5899 int UNUSED written = 0;
5900 IADDR UNUSED pc = abuf->addr;
5901 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5904 QI tmp_tmpopd;
5905 QI tmp_tmpops;
5906 BI tmp_carry;
5907 QI tmp_newval;
5908 tmp_tmpops = FLD (f_indir_pc__byte);
5909 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5910 tmp_carry = CPU (h_cbit);
5911 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5913 SI tmp_oldregval;
5914 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5916 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5917 SET_H_GR (FLD (f_operand2), opval);
5918 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5923 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd, 0), GEQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_newval, 0))));
5924 CPU (h_cbit) = opval;
5925 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5928 BI opval = LTQI (tmp_newval, 0);
5929 CPU (h_nbit) = opval;
5930 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5933 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5934 CPU (h_zbit) = opval;
5935 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5938 BI opval = ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
5939 CPU (h_vbit) = opval;
5940 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5944 BI opval = 0;
5945 CPU (h_xbit) = opval;
5946 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5949 BI opval = 0;
5950 SET_H_INSN_PREFIXED_P (opval);
5951 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5957 #undef FLD
5959 NEXT (vpc);
5961 CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
5963 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5964 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5965 #define FLD(f) abuf->fields.sfmt_addcwr.f
5966 int UNUSED written = 0;
5967 IADDR UNUSED pc = abuf->addr;
5968 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5971 HI tmp_tmpopd;
5972 HI tmp_tmpops;
5973 BI tmp_carry;
5974 HI tmp_newval;
5975 tmp_tmpops = FLD (f_indir_pc__word);
5976 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5977 tmp_carry = CPU (h_cbit);
5978 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5980 SI tmp_oldregval;
5981 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
5983 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5984 SET_H_GR (FLD (f_operand2), opval);
5985 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5990 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd, 0), GEHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_newval, 0))));
5991 CPU (h_cbit) = opval;
5992 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5995 BI opval = LTHI (tmp_newval, 0);
5996 CPU (h_nbit) = opval;
5997 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6000 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6001 CPU (h_zbit) = opval;
6002 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6005 BI opval = ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
6006 CPU (h_vbit) = opval;
6007 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6011 BI opval = 0;
6012 CPU (h_xbit) = opval;
6013 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6016 BI opval = 0;
6017 SET_H_INSN_PREFIXED_P (opval);
6018 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6024 #undef FLD
6026 NEXT (vpc);
6028 CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
6030 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6031 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6032 #define FLD(f) abuf->fields.sfmt_addcdr.f
6033 int UNUSED written = 0;
6034 IADDR UNUSED pc = abuf->addr;
6035 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
6038 SI tmp_tmpopd;
6039 SI tmp_tmpops;
6040 BI tmp_carry;
6041 SI tmp_newval;
6042 tmp_tmpops = FLD (f_indir_pc__dword);
6043 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6044 tmp_carry = CPU (h_cbit);
6045 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6047 SI opval = tmp_newval;
6048 SET_H_GR (FLD (f_operand2), opval);
6049 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6053 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6054 CPU (h_cbit) = opval;
6055 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6058 BI opval = LTSI (tmp_newval, 0);
6059 CPU (h_nbit) = opval;
6060 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6063 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6064 CPU (h_zbit) = opval;
6065 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6068 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6069 CPU (h_vbit) = opval;
6070 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6074 BI opval = 0;
6075 CPU (h_xbit) = opval;
6076 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6079 BI opval = 0;
6080 SET_H_INSN_PREFIXED_P (opval);
6081 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6087 #undef FLD
6089 NEXT (vpc);
6091 CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
6093 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6094 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6095 #define FLD(f) abuf->fields.sfmt_addc_m.f
6096 int UNUSED written = 0;
6097 IADDR UNUSED pc = abuf->addr;
6098 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6101 SI tmp_tmpopd;
6102 SI tmp_tmpops;
6103 BI tmp_carry;
6104 SI tmp_newval;
6105 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6106 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6107 tmp_carry = CPU (h_cbit);
6108 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6110 SI opval = tmp_newval;
6111 SET_H_GR (FLD (f_operand2), opval);
6112 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6116 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6117 CPU (h_cbit) = opval;
6118 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6121 BI opval = LTSI (tmp_newval, 0);
6122 CPU (h_nbit) = opval;
6123 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6126 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6127 CPU (h_zbit) = opval;
6128 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6131 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6132 CPU (h_vbit) = opval;
6133 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6137 BI opval = 0;
6138 CPU (h_xbit) = opval;
6139 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6142 BI opval = 0;
6143 SET_H_INSN_PREFIXED_P (opval);
6144 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6150 #undef FLD
6152 NEXT (vpc);
6154 CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
6156 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6157 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6158 #define FLD(f) abuf->fields.sfmt_addc_m.f
6159 int UNUSED written = 0;
6160 IADDR UNUSED pc = abuf->addr;
6161 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6164 SI tmp_tmpopd;
6165 SI tmp_tmpops;
6166 BI tmp_carry;
6167 SI tmp_newval;
6168 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6169 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6170 tmp_carry = CPU (h_cbit);
6171 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6173 SI opval = tmp_newval;
6174 SET_H_GR (FLD (f_operand2), opval);
6175 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6179 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6180 CPU (h_cbit) = opval;
6181 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6184 BI opval = LTSI (tmp_newval, 0);
6185 CPU (h_nbit) = opval;
6186 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6189 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6190 CPU (h_zbit) = opval;
6191 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6194 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6195 CPU (h_vbit) = opval;
6196 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6200 BI opval = 0;
6201 CPU (h_xbit) = opval;
6202 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6205 BI opval = 0;
6206 SET_H_INSN_PREFIXED_P (opval);
6207 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6213 #undef FLD
6215 NEXT (vpc);
6217 CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
6219 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6220 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6221 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6222 int UNUSED written = 0;
6223 IADDR UNUSED pc = abuf->addr;
6224 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6227 SI tmp_tmpopd;
6228 SI tmp_tmpops;
6229 BI tmp_carry;
6230 SI tmp_newval;
6231 tmp_tmpops = EXTQISI (({ SI tmp_addr;
6232 QI tmp_tmp_mem;
6233 BI tmp_postinc;
6234 tmp_postinc = FLD (f_memmode);
6235 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6236 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6237 ; if (NEBI (tmp_postinc, 0)) {
6239 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6240 tmp_addr = ADDSI (tmp_addr, 1);
6243 SI opval = tmp_addr;
6244 SET_H_GR (FLD (f_operand1), opval);
6245 written |= (1 << 11);
6246 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6250 ; tmp_tmp_mem; }));
6251 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6252 tmp_carry = CPU (h_cbit);
6253 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6255 SI opval = tmp_newval;
6256 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6257 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6261 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6262 CPU (h_cbit) = opval;
6263 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6266 BI opval = LTSI (tmp_newval, 0);
6267 CPU (h_nbit) = opval;
6268 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6271 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6272 CPU (h_zbit) = opval;
6273 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6276 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6277 CPU (h_vbit) = opval;
6278 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6282 BI opval = 0;
6283 CPU (h_xbit) = opval;
6284 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6287 BI opval = 0;
6288 SET_H_INSN_PREFIXED_P (opval);
6289 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6295 abuf->written = written;
6296 #undef FLD
6298 NEXT (vpc);
6300 CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
6302 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6303 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6304 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6305 int UNUSED written = 0;
6306 IADDR UNUSED pc = abuf->addr;
6307 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6310 SI tmp_tmpopd;
6311 SI tmp_tmpops;
6312 BI tmp_carry;
6313 SI tmp_newval;
6314 tmp_tmpops = EXTHISI (({ SI tmp_addr;
6315 HI tmp_tmp_mem;
6316 BI tmp_postinc;
6317 tmp_postinc = FLD (f_memmode);
6318 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6319 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6320 ; if (NEBI (tmp_postinc, 0)) {
6322 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6323 tmp_addr = ADDSI (tmp_addr, 2);
6326 SI opval = tmp_addr;
6327 SET_H_GR (FLD (f_operand1), opval);
6328 written |= (1 << 11);
6329 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6333 ; tmp_tmp_mem; }));
6334 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6335 tmp_carry = CPU (h_cbit);
6336 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6338 SI opval = tmp_newval;
6339 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6340 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6344 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6345 CPU (h_cbit) = opval;
6346 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6349 BI opval = LTSI (tmp_newval, 0);
6350 CPU (h_nbit) = opval;
6351 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6354 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6355 CPU (h_zbit) = opval;
6356 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6359 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6360 CPU (h_vbit) = opval;
6361 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6365 BI opval = 0;
6366 CPU (h_xbit) = opval;
6367 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6370 BI opval = 0;
6371 SET_H_INSN_PREFIXED_P (opval);
6372 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6378 abuf->written = written;
6379 #undef FLD
6381 NEXT (vpc);
6383 CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
6385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6387 #define FLD(f) abuf->fields.sfmt_addcbr.f
6388 int UNUSED written = 0;
6389 IADDR UNUSED pc = abuf->addr;
6390 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6393 SI tmp_tmpopd;
6394 SI tmp_tmpops;
6395 BI tmp_carry;
6396 SI tmp_newval;
6397 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6398 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6399 tmp_carry = CPU (h_cbit);
6400 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6402 SI opval = tmp_newval;
6403 SET_H_GR (FLD (f_operand2), opval);
6404 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6408 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6409 CPU (h_cbit) = opval;
6410 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6413 BI opval = LTSI (tmp_newval, 0);
6414 CPU (h_nbit) = opval;
6415 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6418 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6419 CPU (h_zbit) = opval;
6420 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6423 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6424 CPU (h_vbit) = opval;
6425 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6429 BI opval = 0;
6430 CPU (h_xbit) = opval;
6431 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6434 BI opval = 0;
6435 SET_H_INSN_PREFIXED_P (opval);
6436 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6442 #undef FLD
6444 NEXT (vpc);
6446 CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
6448 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6449 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6450 #define FLD(f) abuf->fields.sfmt_addcwr.f
6451 int UNUSED written = 0;
6452 IADDR UNUSED pc = abuf->addr;
6453 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6456 SI tmp_tmpopd;
6457 SI tmp_tmpops;
6458 BI tmp_carry;
6459 SI tmp_newval;
6460 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6461 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6462 tmp_carry = CPU (h_cbit);
6463 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6465 SI opval = tmp_newval;
6466 SET_H_GR (FLD (f_operand2), opval);
6467 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6471 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6472 CPU (h_cbit) = opval;
6473 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6476 BI opval = LTSI (tmp_newval, 0);
6477 CPU (h_nbit) = opval;
6478 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6481 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6482 CPU (h_zbit) = opval;
6483 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6486 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6487 CPU (h_vbit) = opval;
6488 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6492 BI opval = 0;
6493 CPU (h_xbit) = opval;
6494 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6497 BI opval = 0;
6498 SET_H_INSN_PREFIXED_P (opval);
6499 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6505 #undef FLD
6507 NEXT (vpc);
6509 CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
6511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6513 #define FLD(f) abuf->fields.sfmt_addc_m.f
6514 int UNUSED written = 0;
6515 IADDR UNUSED pc = abuf->addr;
6516 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6519 SI tmp_tmpopd;
6520 SI tmp_tmpops;
6521 BI tmp_carry;
6522 SI tmp_newval;
6523 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6524 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6525 tmp_carry = CPU (h_cbit);
6526 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6528 SI opval = tmp_newval;
6529 SET_H_GR (FLD (f_operand2), opval);
6530 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6534 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6535 CPU (h_cbit) = opval;
6536 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6539 BI opval = LTSI (tmp_newval, 0);
6540 CPU (h_nbit) = opval;
6541 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6544 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6545 CPU (h_zbit) = opval;
6546 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6549 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6550 CPU (h_vbit) = opval;
6551 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6555 BI opval = 0;
6556 CPU (h_xbit) = opval;
6557 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6560 BI opval = 0;
6561 SET_H_INSN_PREFIXED_P (opval);
6562 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6568 #undef FLD
6570 NEXT (vpc);
6572 CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
6574 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6575 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6576 #define FLD(f) abuf->fields.sfmt_addc_m.f
6577 int UNUSED written = 0;
6578 IADDR UNUSED pc = abuf->addr;
6579 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6582 SI tmp_tmpopd;
6583 SI tmp_tmpops;
6584 BI tmp_carry;
6585 SI tmp_newval;
6586 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6587 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6588 tmp_carry = CPU (h_cbit);
6589 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6591 SI opval = tmp_newval;
6592 SET_H_GR (FLD (f_operand2), opval);
6593 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6597 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6598 CPU (h_cbit) = opval;
6599 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6602 BI opval = LTSI (tmp_newval, 0);
6603 CPU (h_nbit) = opval;
6604 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6607 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6608 CPU (h_zbit) = opval;
6609 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6612 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6613 CPU (h_vbit) = opval;
6614 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6618 BI opval = 0;
6619 CPU (h_xbit) = opval;
6620 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6623 BI opval = 0;
6624 SET_H_INSN_PREFIXED_P (opval);
6625 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6631 #undef FLD
6633 NEXT (vpc);
6635 CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
6637 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6638 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6639 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6640 int UNUSED written = 0;
6641 IADDR UNUSED pc = abuf->addr;
6642 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6645 SI tmp_tmpopd;
6646 SI tmp_tmpops;
6647 BI tmp_carry;
6648 SI tmp_newval;
6649 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
6650 QI tmp_tmp_mem;
6651 BI tmp_postinc;
6652 tmp_postinc = FLD (f_memmode);
6653 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6654 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6655 ; if (NEBI (tmp_postinc, 0)) {
6657 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6658 tmp_addr = ADDSI (tmp_addr, 1);
6661 SI opval = tmp_addr;
6662 SET_H_GR (FLD (f_operand1), opval);
6663 written |= (1 << 11);
6664 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6668 ; tmp_tmp_mem; }));
6669 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6670 tmp_carry = CPU (h_cbit);
6671 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6673 SI opval = tmp_newval;
6674 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6675 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6679 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6680 CPU (h_cbit) = opval;
6681 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6684 BI opval = LTSI (tmp_newval, 0);
6685 CPU (h_nbit) = opval;
6686 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6689 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6690 CPU (h_zbit) = opval;
6691 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6694 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6695 CPU (h_vbit) = opval;
6696 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6700 BI opval = 0;
6701 CPU (h_xbit) = opval;
6702 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6705 BI opval = 0;
6706 SET_H_INSN_PREFIXED_P (opval);
6707 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6713 abuf->written = written;
6714 #undef FLD
6716 NEXT (vpc);
6718 CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
6720 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6721 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6722 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6723 int UNUSED written = 0;
6724 IADDR UNUSED pc = abuf->addr;
6725 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6728 SI tmp_tmpopd;
6729 SI tmp_tmpops;
6730 BI tmp_carry;
6731 SI tmp_newval;
6732 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
6733 HI tmp_tmp_mem;
6734 BI tmp_postinc;
6735 tmp_postinc = FLD (f_memmode);
6736 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
6737 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6738 ; if (NEBI (tmp_postinc, 0)) {
6740 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6741 tmp_addr = ADDSI (tmp_addr, 2);
6744 SI opval = tmp_addr;
6745 SET_H_GR (FLD (f_operand1), opval);
6746 written |= (1 << 11);
6747 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6751 ; tmp_tmp_mem; }));
6752 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6753 tmp_carry = CPU (h_cbit);
6754 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6756 SI opval = tmp_newval;
6757 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6758 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6762 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6763 CPU (h_cbit) = opval;
6764 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6767 BI opval = LTSI (tmp_newval, 0);
6768 CPU (h_nbit) = opval;
6769 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6772 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6773 CPU (h_zbit) = opval;
6774 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6777 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6778 CPU (h_vbit) = opval;
6779 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6783 BI opval = 0;
6784 CPU (h_xbit) = opval;
6785 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6788 BI opval = 0;
6789 SET_H_INSN_PREFIXED_P (opval);
6790 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6796 abuf->written = written;
6797 #undef FLD
6799 NEXT (vpc);
6801 CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
6803 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6804 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6805 #define FLD(f) abuf->fields.sfmt_addcbr.f
6806 int UNUSED written = 0;
6807 IADDR UNUSED pc = abuf->addr;
6808 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6811 SI tmp_tmpopd;
6812 SI tmp_tmpops;
6813 BI tmp_carry;
6814 SI tmp_newval;
6815 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6816 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6817 tmp_carry = CPU (h_cbit);
6818 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6820 SI opval = tmp_newval;
6821 SET_H_GR (FLD (f_operand2), opval);
6822 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6826 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6827 CPU (h_cbit) = opval;
6828 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6831 BI opval = LTSI (tmp_newval, 0);
6832 CPU (h_nbit) = opval;
6833 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6836 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6837 CPU (h_zbit) = opval;
6838 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6841 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6842 CPU (h_vbit) = opval;
6843 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6847 BI opval = 0;
6848 CPU (h_xbit) = opval;
6849 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6852 BI opval = 0;
6853 SET_H_INSN_PREFIXED_P (opval);
6854 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6860 #undef FLD
6862 NEXT (vpc);
6864 CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
6866 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6867 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6868 #define FLD(f) abuf->fields.sfmt_addcwr.f
6869 int UNUSED written = 0;
6870 IADDR UNUSED pc = abuf->addr;
6871 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6874 SI tmp_tmpopd;
6875 SI tmp_tmpops;
6876 BI tmp_carry;
6877 SI tmp_newval;
6878 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6879 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6880 tmp_carry = CPU (h_cbit);
6881 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6883 SI opval = tmp_newval;
6884 SET_H_GR (FLD (f_operand2), opval);
6885 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6889 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
6890 CPU (h_cbit) = opval;
6891 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6894 BI opval = LTSI (tmp_newval, 0);
6895 CPU (h_nbit) = opval;
6896 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6899 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6900 CPU (h_zbit) = opval;
6901 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6904 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
6905 CPU (h_vbit) = opval;
6906 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6910 BI opval = 0;
6911 CPU (h_xbit) = opval;
6912 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6915 BI opval = 0;
6916 SET_H_INSN_PREFIXED_P (opval);
6917 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6923 #undef FLD
6925 NEXT (vpc);
6927 CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
6929 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6930 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6931 #define FLD(f) abuf->fields.sfmt_addc_m.f
6932 int UNUSED written = 0;
6933 IADDR UNUSED pc = abuf->addr;
6934 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6937 QI tmp_tmpopd;
6938 QI tmp_tmpops;
6939 BI tmp_carry;
6940 QI tmp_newval;
6941 tmp_tmpops = GET_H_GR (FLD (f_operand1));
6942 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6943 tmp_carry = CPU (h_cbit);
6944 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6946 SI tmp_oldregval;
6947 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
6949 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
6950 SET_H_GR (FLD (f_operand2), opval);
6951 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6956 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
6957 CPU (h_cbit) = opval;
6958 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6961 BI opval = LTQI (tmp_newval, 0);
6962 CPU (h_nbit) = opval;
6963 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6966 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6967 CPU (h_zbit) = opval;
6968 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6971 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
6972 CPU (h_vbit) = opval;
6973 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6977 BI opval = 0;
6978 CPU (h_xbit) = opval;
6979 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6982 BI opval = 0;
6983 SET_H_INSN_PREFIXED_P (opval);
6984 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6990 #undef FLD
6992 NEXT (vpc);
6994 CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
6996 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6997 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6998 #define FLD(f) abuf->fields.sfmt_addc_m.f
6999 int UNUSED written = 0;
7000 IADDR UNUSED pc = abuf->addr;
7001 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7004 HI tmp_tmpopd;
7005 HI tmp_tmpops;
7006 BI tmp_carry;
7007 HI tmp_newval;
7008 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7009 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7010 tmp_carry = CPU (h_cbit);
7011 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7013 SI tmp_oldregval;
7014 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7016 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7017 SET_H_GR (FLD (f_operand2), opval);
7018 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7023 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
7024 CPU (h_cbit) = opval;
7025 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7028 BI opval = LTHI (tmp_newval, 0);
7029 CPU (h_nbit) = opval;
7030 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7033 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7034 CPU (h_zbit) = opval;
7035 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7038 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
7039 CPU (h_vbit) = opval;
7040 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7044 BI opval = 0;
7045 CPU (h_xbit) = opval;
7046 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7049 BI opval = 0;
7050 SET_H_INSN_PREFIXED_P (opval);
7051 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7057 #undef FLD
7059 NEXT (vpc);
7061 CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
7063 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7064 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7065 #define FLD(f) abuf->fields.sfmt_addc_m.f
7066 int UNUSED written = 0;
7067 IADDR UNUSED pc = abuf->addr;
7068 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7071 SI tmp_tmpopd;
7072 SI tmp_tmpops;
7073 BI tmp_carry;
7074 SI tmp_newval;
7075 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7076 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7077 tmp_carry = CPU (h_cbit);
7078 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7080 SI opval = tmp_newval;
7081 SET_H_GR (FLD (f_operand2), opval);
7082 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7086 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7087 CPU (h_cbit) = opval;
7088 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7091 BI opval = LTSI (tmp_newval, 0);
7092 CPU (h_nbit) = opval;
7093 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7096 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7097 CPU (h_zbit) = opval;
7098 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7101 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7102 CPU (h_vbit) = opval;
7103 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7107 BI opval = 0;
7108 CPU (h_xbit) = opval;
7109 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7112 BI opval = 0;
7113 SET_H_INSN_PREFIXED_P (opval);
7114 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7120 #undef FLD
7122 NEXT (vpc);
7124 CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
7126 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7127 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7128 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7129 int UNUSED written = 0;
7130 IADDR UNUSED pc = abuf->addr;
7131 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7134 QI tmp_tmpopd;
7135 QI tmp_tmpops;
7136 BI tmp_carry;
7137 QI tmp_newval;
7138 tmp_tmpops = ({ SI tmp_addr;
7139 QI tmp_tmp_mem;
7140 BI tmp_postinc;
7141 tmp_postinc = FLD (f_memmode);
7142 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7143 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7144 ; if (NEBI (tmp_postinc, 0)) {
7146 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7147 tmp_addr = ADDSI (tmp_addr, 1);
7150 SI opval = tmp_addr;
7151 SET_H_GR (FLD (f_operand1), opval);
7152 written |= (1 << 12);
7153 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7157 ; tmp_tmp_mem; });
7158 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7159 tmp_carry = CPU (h_cbit);
7160 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7162 SI tmp_oldregval;
7163 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7165 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7166 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7167 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7172 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
7173 CPU (h_cbit) = opval;
7174 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7177 BI opval = LTQI (tmp_newval, 0);
7178 CPU (h_nbit) = opval;
7179 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7182 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7183 CPU (h_zbit) = opval;
7184 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7187 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
7188 CPU (h_vbit) = opval;
7189 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7193 BI opval = 0;
7194 CPU (h_xbit) = opval;
7195 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7198 BI opval = 0;
7199 SET_H_INSN_PREFIXED_P (opval);
7200 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7206 abuf->written = written;
7207 #undef FLD
7209 NEXT (vpc);
7211 CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
7213 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7214 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7215 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7216 int UNUSED written = 0;
7217 IADDR UNUSED pc = abuf->addr;
7218 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7221 HI tmp_tmpopd;
7222 HI tmp_tmpops;
7223 BI tmp_carry;
7224 HI tmp_newval;
7225 tmp_tmpops = ({ SI tmp_addr;
7226 HI tmp_tmp_mem;
7227 BI tmp_postinc;
7228 tmp_postinc = FLD (f_memmode);
7229 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7230 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7231 ; if (NEBI (tmp_postinc, 0)) {
7233 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7234 tmp_addr = ADDSI (tmp_addr, 2);
7237 SI opval = tmp_addr;
7238 SET_H_GR (FLD (f_operand1), opval);
7239 written |= (1 << 12);
7240 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7244 ; tmp_tmp_mem; });
7245 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7246 tmp_carry = CPU (h_cbit);
7247 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7249 SI tmp_oldregval;
7250 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7252 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7253 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7254 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7259 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
7260 CPU (h_cbit) = opval;
7261 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7264 BI opval = LTHI (tmp_newval, 0);
7265 CPU (h_nbit) = opval;
7266 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7269 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7270 CPU (h_zbit) = opval;
7271 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7274 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
7275 CPU (h_vbit) = opval;
7276 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7280 BI opval = 0;
7281 CPU (h_xbit) = opval;
7282 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7285 BI opval = 0;
7286 SET_H_INSN_PREFIXED_P (opval);
7287 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7293 abuf->written = written;
7294 #undef FLD
7296 NEXT (vpc);
7298 CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
7300 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7301 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7302 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7303 int UNUSED written = 0;
7304 IADDR UNUSED pc = abuf->addr;
7305 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7308 SI tmp_tmpopd;
7309 SI tmp_tmpops;
7310 BI tmp_carry;
7311 SI tmp_newval;
7312 tmp_tmpops = ({ SI tmp_addr;
7313 SI tmp_tmp_mem;
7314 BI tmp_postinc;
7315 tmp_postinc = FLD (f_memmode);
7316 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7317 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
7318 ; if (NEBI (tmp_postinc, 0)) {
7320 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7321 tmp_addr = ADDSI (tmp_addr, 4);
7324 SI opval = tmp_addr;
7325 SET_H_GR (FLD (f_operand1), opval);
7326 written |= (1 << 11);
7327 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7331 ; tmp_tmp_mem; });
7332 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7333 tmp_carry = CPU (h_cbit);
7334 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7336 SI opval = tmp_newval;
7337 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7338 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7342 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7343 CPU (h_cbit) = opval;
7344 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7347 BI opval = LTSI (tmp_newval, 0);
7348 CPU (h_nbit) = opval;
7349 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7352 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7353 CPU (h_zbit) = opval;
7354 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7357 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7358 CPU (h_vbit) = opval;
7359 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7363 BI opval = 0;
7364 CPU (h_xbit) = opval;
7365 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7368 BI opval = 0;
7369 SET_H_INSN_PREFIXED_P (opval);
7370 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7376 abuf->written = written;
7377 #undef FLD
7379 NEXT (vpc);
7381 CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
7383 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7384 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7385 #define FLD(f) abuf->fields.sfmt_addcbr.f
7386 int UNUSED written = 0;
7387 IADDR UNUSED pc = abuf->addr;
7388 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7391 QI tmp_tmpopd;
7392 QI tmp_tmpops;
7393 BI tmp_carry;
7394 QI tmp_newval;
7395 tmp_tmpops = FLD (f_indir_pc__byte);
7396 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7397 tmp_carry = CPU (h_cbit);
7398 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7400 SI tmp_oldregval;
7401 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7403 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7404 SET_H_GR (FLD (f_operand2), opval);
7405 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7410 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
7411 CPU (h_cbit) = opval;
7412 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7415 BI opval = LTQI (tmp_newval, 0);
7416 CPU (h_nbit) = opval;
7417 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7420 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7421 CPU (h_zbit) = opval;
7422 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7425 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
7426 CPU (h_vbit) = opval;
7427 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7431 BI opval = 0;
7432 CPU (h_xbit) = opval;
7433 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7436 BI opval = 0;
7437 SET_H_INSN_PREFIXED_P (opval);
7438 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7444 #undef FLD
7446 NEXT (vpc);
7448 CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
7450 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7451 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7452 #define FLD(f) abuf->fields.sfmt_addcwr.f
7453 int UNUSED written = 0;
7454 IADDR UNUSED pc = abuf->addr;
7455 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7458 HI tmp_tmpopd;
7459 HI tmp_tmpops;
7460 BI tmp_carry;
7461 HI tmp_newval;
7462 tmp_tmpops = FLD (f_indir_pc__word);
7463 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7464 tmp_carry = CPU (h_cbit);
7465 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7467 SI tmp_oldregval;
7468 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
7470 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7471 SET_H_GR (FLD (f_operand2), opval);
7472 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7477 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
7478 CPU (h_cbit) = opval;
7479 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7482 BI opval = LTHI (tmp_newval, 0);
7483 CPU (h_nbit) = opval;
7484 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7487 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7488 CPU (h_zbit) = opval;
7489 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7492 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
7493 CPU (h_vbit) = opval;
7494 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7498 BI opval = 0;
7499 CPU (h_xbit) = opval;
7500 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7503 BI opval = 0;
7504 SET_H_INSN_PREFIXED_P (opval);
7505 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7511 #undef FLD
7513 NEXT (vpc);
7515 CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
7517 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7518 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7519 #define FLD(f) abuf->fields.sfmt_addcdr.f
7520 int UNUSED written = 0;
7521 IADDR UNUSED pc = abuf->addr;
7522 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
7525 SI tmp_tmpopd;
7526 SI tmp_tmpops;
7527 BI tmp_carry;
7528 SI tmp_newval;
7529 tmp_tmpops = FLD (f_indir_pc__dword);
7530 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7531 tmp_carry = CPU (h_cbit);
7532 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7534 SI opval = tmp_newval;
7535 SET_H_GR (FLD (f_operand2), opval);
7536 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7540 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7541 CPU (h_cbit) = opval;
7542 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7545 BI opval = LTSI (tmp_newval, 0);
7546 CPU (h_nbit) = opval;
7547 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7550 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7551 CPU (h_zbit) = opval;
7552 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7555 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7556 CPU (h_vbit) = opval;
7557 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7561 BI opval = 0;
7562 CPU (h_xbit) = opval;
7563 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7566 BI opval = 0;
7567 SET_H_INSN_PREFIXED_P (opval);
7568 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7574 #undef FLD
7576 NEXT (vpc);
7578 CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
7580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7581 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7582 #define FLD(f) abuf->fields.sfmt_addc_m.f
7583 int UNUSED written = 0;
7584 IADDR UNUSED pc = abuf->addr;
7585 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7588 SI tmp_tmpopd;
7589 SI tmp_tmpops;
7590 BI tmp_carry;
7591 SI tmp_newval;
7592 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
7593 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7594 tmp_carry = CPU (h_cbit);
7595 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7597 SI opval = tmp_newval;
7598 SET_H_GR (FLD (f_operand2), opval);
7599 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7603 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7604 CPU (h_cbit) = opval;
7605 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7608 BI opval = LTSI (tmp_newval, 0);
7609 CPU (h_nbit) = opval;
7610 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7613 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7614 CPU (h_zbit) = opval;
7615 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7618 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7619 CPU (h_vbit) = opval;
7620 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7624 BI opval = 0;
7625 CPU (h_xbit) = opval;
7626 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7629 BI opval = 0;
7630 SET_H_INSN_PREFIXED_P (opval);
7631 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7637 #undef FLD
7639 NEXT (vpc);
7641 CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
7643 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7644 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7645 #define FLD(f) abuf->fields.sfmt_addc_m.f
7646 int UNUSED written = 0;
7647 IADDR UNUSED pc = abuf->addr;
7648 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7651 SI tmp_tmpopd;
7652 SI tmp_tmpops;
7653 BI tmp_carry;
7654 SI tmp_newval;
7655 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
7656 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7657 tmp_carry = CPU (h_cbit);
7658 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7660 SI opval = tmp_newval;
7661 SET_H_GR (FLD (f_operand2), opval);
7662 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7666 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7667 CPU (h_cbit) = opval;
7668 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7671 BI opval = LTSI (tmp_newval, 0);
7672 CPU (h_nbit) = opval;
7673 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7676 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7677 CPU (h_zbit) = opval;
7678 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7681 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7682 CPU (h_vbit) = opval;
7683 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7687 BI opval = 0;
7688 CPU (h_xbit) = opval;
7689 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7692 BI opval = 0;
7693 SET_H_INSN_PREFIXED_P (opval);
7694 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7700 #undef FLD
7702 NEXT (vpc);
7704 CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
7706 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7707 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7708 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7709 int UNUSED written = 0;
7710 IADDR UNUSED pc = abuf->addr;
7711 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7714 SI tmp_tmpopd;
7715 SI tmp_tmpops;
7716 BI tmp_carry;
7717 SI tmp_newval;
7718 tmp_tmpops = EXTQISI (({ SI tmp_addr;
7719 QI tmp_tmp_mem;
7720 BI tmp_postinc;
7721 tmp_postinc = FLD (f_memmode);
7722 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7723 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7724 ; if (NEBI (tmp_postinc, 0)) {
7726 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7727 tmp_addr = ADDSI (tmp_addr, 1);
7730 SI opval = tmp_addr;
7731 SET_H_GR (FLD (f_operand1), opval);
7732 written |= (1 << 11);
7733 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7737 ; tmp_tmp_mem; }));
7738 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7739 tmp_carry = CPU (h_cbit);
7740 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7742 SI opval = tmp_newval;
7743 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7744 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7748 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7749 CPU (h_cbit) = opval;
7750 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7753 BI opval = LTSI (tmp_newval, 0);
7754 CPU (h_nbit) = opval;
7755 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7758 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7759 CPU (h_zbit) = opval;
7760 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7763 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7764 CPU (h_vbit) = opval;
7765 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7769 BI opval = 0;
7770 CPU (h_xbit) = opval;
7771 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7774 BI opval = 0;
7775 SET_H_INSN_PREFIXED_P (opval);
7776 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7782 abuf->written = written;
7783 #undef FLD
7785 NEXT (vpc);
7787 CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
7789 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7790 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7791 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7792 int UNUSED written = 0;
7793 IADDR UNUSED pc = abuf->addr;
7794 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7797 SI tmp_tmpopd;
7798 SI tmp_tmpops;
7799 BI tmp_carry;
7800 SI tmp_newval;
7801 tmp_tmpops = EXTHISI (({ SI tmp_addr;
7802 HI tmp_tmp_mem;
7803 BI tmp_postinc;
7804 tmp_postinc = FLD (f_memmode);
7805 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
7806 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7807 ; if (NEBI (tmp_postinc, 0)) {
7809 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7810 tmp_addr = ADDSI (tmp_addr, 2);
7813 SI opval = tmp_addr;
7814 SET_H_GR (FLD (f_operand1), opval);
7815 written |= (1 << 11);
7816 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7820 ; tmp_tmp_mem; }));
7821 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7822 tmp_carry = CPU (h_cbit);
7823 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7825 SI opval = tmp_newval;
7826 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7827 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7831 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7832 CPU (h_cbit) = opval;
7833 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7836 BI opval = LTSI (tmp_newval, 0);
7837 CPU (h_nbit) = opval;
7838 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7841 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7842 CPU (h_zbit) = opval;
7843 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7846 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7847 CPU (h_vbit) = opval;
7848 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7852 BI opval = 0;
7853 CPU (h_xbit) = opval;
7854 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7857 BI opval = 0;
7858 SET_H_INSN_PREFIXED_P (opval);
7859 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7865 abuf->written = written;
7866 #undef FLD
7868 NEXT (vpc);
7870 CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
7872 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7873 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7874 #define FLD(f) abuf->fields.sfmt_addcbr.f
7875 int UNUSED written = 0;
7876 IADDR UNUSED pc = abuf->addr;
7877 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7880 SI tmp_tmpopd;
7881 SI tmp_tmpops;
7882 BI tmp_carry;
7883 SI tmp_newval;
7884 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
7885 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7886 tmp_carry = CPU (h_cbit);
7887 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7889 SI opval = tmp_newval;
7890 SET_H_GR (FLD (f_operand2), opval);
7891 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7895 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7896 CPU (h_cbit) = opval;
7897 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7900 BI opval = LTSI (tmp_newval, 0);
7901 CPU (h_nbit) = opval;
7902 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7905 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7906 CPU (h_zbit) = opval;
7907 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7910 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7911 CPU (h_vbit) = opval;
7912 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7916 BI opval = 0;
7917 CPU (h_xbit) = opval;
7918 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7921 BI opval = 0;
7922 SET_H_INSN_PREFIXED_P (opval);
7923 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7929 #undef FLD
7931 NEXT (vpc);
7933 CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
7935 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7936 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7937 #define FLD(f) abuf->fields.sfmt_addcwr.f
7938 int UNUSED written = 0;
7939 IADDR UNUSED pc = abuf->addr;
7940 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7943 SI tmp_tmpopd;
7944 SI tmp_tmpops;
7945 BI tmp_carry;
7946 SI tmp_newval;
7947 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
7948 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7949 tmp_carry = CPU (h_cbit);
7950 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7952 SI opval = tmp_newval;
7953 SET_H_GR (FLD (f_operand2), opval);
7954 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7958 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
7959 CPU (h_cbit) = opval;
7960 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7963 BI opval = LTSI (tmp_newval, 0);
7964 CPU (h_nbit) = opval;
7965 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7968 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7969 CPU (h_zbit) = opval;
7970 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7973 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
7974 CPU (h_vbit) = opval;
7975 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7979 BI opval = 0;
7980 CPU (h_xbit) = opval;
7981 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7984 BI opval = 0;
7985 SET_H_INSN_PREFIXED_P (opval);
7986 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7992 #undef FLD
7994 NEXT (vpc);
7996 CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
7998 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7999 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8000 #define FLD(f) abuf->fields.sfmt_addc_m.f
8001 int UNUSED written = 0;
8002 IADDR UNUSED pc = abuf->addr;
8003 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8006 SI tmp_tmpopd;
8007 SI tmp_tmpops;
8008 BI tmp_carry;
8009 SI tmp_newval;
8010 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
8011 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8012 tmp_carry = CPU (h_cbit);
8013 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8015 SI opval = tmp_newval;
8016 SET_H_GR (FLD (f_operand2), opval);
8017 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8021 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8022 CPU (h_cbit) = opval;
8023 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8026 BI opval = LTSI (tmp_newval, 0);
8027 CPU (h_nbit) = opval;
8028 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8031 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8032 CPU (h_zbit) = opval;
8033 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8036 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8037 CPU (h_vbit) = opval;
8038 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8042 BI opval = 0;
8043 CPU (h_xbit) = opval;
8044 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8047 BI opval = 0;
8048 SET_H_INSN_PREFIXED_P (opval);
8049 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8055 #undef FLD
8057 NEXT (vpc);
8059 CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
8061 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8062 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8063 #define FLD(f) abuf->fields.sfmt_addc_m.f
8064 int UNUSED written = 0;
8065 IADDR UNUSED pc = abuf->addr;
8066 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8069 SI tmp_tmpopd;
8070 SI tmp_tmpops;
8071 BI tmp_carry;
8072 SI tmp_newval;
8073 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
8074 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8075 tmp_carry = CPU (h_cbit);
8076 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8078 SI opval = tmp_newval;
8079 SET_H_GR (FLD (f_operand2), opval);
8080 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8084 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8085 CPU (h_cbit) = opval;
8086 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8089 BI opval = LTSI (tmp_newval, 0);
8090 CPU (h_nbit) = opval;
8091 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8094 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8095 CPU (h_zbit) = opval;
8096 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8099 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8100 CPU (h_vbit) = opval;
8101 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8105 BI opval = 0;
8106 CPU (h_xbit) = opval;
8107 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8110 BI opval = 0;
8111 SET_H_INSN_PREFIXED_P (opval);
8112 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8118 #undef FLD
8120 NEXT (vpc);
8122 CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
8124 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8125 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8126 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8127 int UNUSED written = 0;
8128 IADDR UNUSED pc = abuf->addr;
8129 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8132 SI tmp_tmpopd;
8133 SI tmp_tmpops;
8134 BI tmp_carry;
8135 SI tmp_newval;
8136 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
8137 QI tmp_tmp_mem;
8138 BI tmp_postinc;
8139 tmp_postinc = FLD (f_memmode);
8140 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8141 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8142 ; if (NEBI (tmp_postinc, 0)) {
8144 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8145 tmp_addr = ADDSI (tmp_addr, 1);
8148 SI opval = tmp_addr;
8149 SET_H_GR (FLD (f_operand1), opval);
8150 written |= (1 << 11);
8151 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8155 ; tmp_tmp_mem; }));
8156 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8157 tmp_carry = CPU (h_cbit);
8158 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8160 SI opval = tmp_newval;
8161 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8162 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8166 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8167 CPU (h_cbit) = opval;
8168 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8171 BI opval = LTSI (tmp_newval, 0);
8172 CPU (h_nbit) = opval;
8173 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8176 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8177 CPU (h_zbit) = opval;
8178 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8181 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8182 CPU (h_vbit) = opval;
8183 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8187 BI opval = 0;
8188 CPU (h_xbit) = opval;
8189 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8192 BI opval = 0;
8193 SET_H_INSN_PREFIXED_P (opval);
8194 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8200 abuf->written = written;
8201 #undef FLD
8203 NEXT (vpc);
8205 CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
8207 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8208 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8209 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8210 int UNUSED written = 0;
8211 IADDR UNUSED pc = abuf->addr;
8212 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8215 SI tmp_tmpopd;
8216 SI tmp_tmpops;
8217 BI tmp_carry;
8218 SI tmp_newval;
8219 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
8220 HI tmp_tmp_mem;
8221 BI tmp_postinc;
8222 tmp_postinc = FLD (f_memmode);
8223 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8224 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8225 ; if (NEBI (tmp_postinc, 0)) {
8227 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8228 tmp_addr = ADDSI (tmp_addr, 2);
8231 SI opval = tmp_addr;
8232 SET_H_GR (FLD (f_operand1), opval);
8233 written |= (1 << 11);
8234 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8238 ; tmp_tmp_mem; }));
8239 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8240 tmp_carry = CPU (h_cbit);
8241 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8243 SI opval = tmp_newval;
8244 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8245 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8249 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8250 CPU (h_cbit) = opval;
8251 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8254 BI opval = LTSI (tmp_newval, 0);
8255 CPU (h_nbit) = opval;
8256 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8259 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8260 CPU (h_zbit) = opval;
8261 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8264 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8265 CPU (h_vbit) = opval;
8266 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8270 BI opval = 0;
8271 CPU (h_xbit) = opval;
8272 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8275 BI opval = 0;
8276 SET_H_INSN_PREFIXED_P (opval);
8277 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8283 abuf->written = written;
8284 #undef FLD
8286 NEXT (vpc);
8288 CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
8290 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8291 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8292 #define FLD(f) abuf->fields.sfmt_addcbr.f
8293 int UNUSED written = 0;
8294 IADDR UNUSED pc = abuf->addr;
8295 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8298 SI tmp_tmpopd;
8299 SI tmp_tmpops;
8300 BI tmp_carry;
8301 SI tmp_newval;
8302 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
8303 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8304 tmp_carry = CPU (h_cbit);
8305 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8307 SI opval = tmp_newval;
8308 SET_H_GR (FLD (f_operand2), opval);
8309 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8313 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8314 CPU (h_cbit) = opval;
8315 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8318 BI opval = LTSI (tmp_newval, 0);
8319 CPU (h_nbit) = opval;
8320 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8323 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8324 CPU (h_zbit) = opval;
8325 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8328 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8329 CPU (h_vbit) = opval;
8330 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8334 BI opval = 0;
8335 CPU (h_xbit) = opval;
8336 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8339 BI opval = 0;
8340 SET_H_INSN_PREFIXED_P (opval);
8341 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8347 #undef FLD
8349 NEXT (vpc);
8351 CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
8353 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8354 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8355 #define FLD(f) abuf->fields.sfmt_addcwr.f
8356 int UNUSED written = 0;
8357 IADDR UNUSED pc = abuf->addr;
8358 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8361 SI tmp_tmpopd;
8362 SI tmp_tmpops;
8363 BI tmp_carry;
8364 SI tmp_newval;
8365 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
8366 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8367 tmp_carry = CPU (h_cbit);
8368 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8370 SI opval = tmp_newval;
8371 SET_H_GR (FLD (f_operand2), opval);
8372 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8376 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8377 CPU (h_cbit) = opval;
8378 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8381 BI opval = LTSI (tmp_newval, 0);
8382 CPU (h_nbit) = opval;
8383 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8386 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8387 CPU (h_zbit) = opval;
8388 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8391 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8392 CPU (h_vbit) = opval;
8393 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8397 BI opval = 0;
8398 CPU (h_xbit) = opval;
8399 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8402 BI opval = 0;
8403 SET_H_INSN_PREFIXED_P (opval);
8404 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8410 #undef FLD
8412 NEXT (vpc);
8414 CASE (sem, INSN_ADDC_R) : /* addc $Rs,$Rd */
8416 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8417 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8418 #define FLD(f) abuf->fields.sfmt_addc_m.f
8419 int UNUSED written = 0;
8420 IADDR UNUSED pc = abuf->addr;
8421 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8424 CPU (h_xbit) = 1;
8426 SI tmp_tmpopd;
8427 SI tmp_tmpops;
8428 BI tmp_carry;
8429 SI tmp_newval;
8430 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8431 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8432 tmp_carry = CPU (h_cbit);
8433 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8435 SI opval = tmp_newval;
8436 SET_H_GR (FLD (f_operand2), opval);
8437 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8441 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
8442 CPU (h_cbit) = opval;
8443 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8446 BI opval = LTSI (tmp_newval, 0);
8447 CPU (h_nbit) = opval;
8448 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8451 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8452 CPU (h_zbit) = opval;
8453 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8456 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8457 CPU (h_vbit) = opval;
8458 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8462 BI opval = 0;
8463 CPU (h_xbit) = opval;
8464 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8467 BI opval = 0;
8468 SET_H_INSN_PREFIXED_P (opval);
8469 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8476 #undef FLD
8478 NEXT (vpc);
8480 CASE (sem, INSN_ADDC_M) : /* addc [${Rs}${inc}],${Rd} */
8482 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8483 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8484 #define FLD(f) abuf->fields.sfmt_addc_m.f
8485 int UNUSED written = 0;
8486 IADDR UNUSED pc = abuf->addr;
8487 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8490 CPU (h_xbit) = 1;
8492 SI tmp_tmpopd;
8493 SI tmp_tmpops;
8494 BI tmp_carry;
8495 SI tmp_newval;
8496 tmp_tmpops = ({ SI tmp_addr;
8497 SI tmp_tmp_mem;
8498 BI tmp_postinc;
8499 tmp_postinc = FLD (f_memmode);
8500 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
8501 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
8502 ; if (NEBI (tmp_postinc, 0)) {
8504 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8505 tmp_addr = ADDSI (tmp_addr, 4);
8508 SI opval = tmp_addr;
8509 SET_H_GR (FLD (f_operand1), opval);
8510 written |= (1 << 10);
8511 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8515 ; tmp_tmp_mem; });
8516 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8517 tmp_carry = CPU (h_cbit);
8518 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8520 SI opval = tmp_newval;
8521 SET_H_GR (FLD (f_operand2), opval);
8522 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8526 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
8527 CPU (h_cbit) = opval;
8528 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8531 BI opval = LTSI (tmp_newval, 0);
8532 CPU (h_nbit) = opval;
8533 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8536 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8537 CPU (h_zbit) = opval;
8538 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8541 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8542 CPU (h_vbit) = opval;
8543 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8547 BI opval = 0;
8548 CPU (h_xbit) = opval;
8549 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8552 BI opval = 0;
8553 SET_H_INSN_PREFIXED_P (opval);
8554 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8561 abuf->written = written;
8562 #undef FLD
8564 NEXT (vpc);
8566 CASE (sem, INSN_ADDC_C) : /* addc ${const32},${Rd} */
8568 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8569 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8570 #define FLD(f) abuf->fields.sfmt_addcdr.f
8571 int UNUSED written = 0;
8572 IADDR UNUSED pc = abuf->addr;
8573 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
8576 CPU (h_xbit) = 1;
8578 SI tmp_tmpopd;
8579 SI tmp_tmpops;
8580 BI tmp_carry;
8581 SI tmp_newval;
8582 tmp_tmpops = FLD (f_indir_pc__dword);
8583 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8584 tmp_carry = CPU (h_cbit);
8585 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8587 SI opval = tmp_newval;
8588 SET_H_GR (FLD (f_operand2), opval);
8589 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8593 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
8594 CPU (h_cbit) = opval;
8595 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8598 BI opval = LTSI (tmp_newval, 0);
8599 CPU (h_nbit) = opval;
8600 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8603 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8604 CPU (h_zbit) = opval;
8605 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8608 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8609 CPU (h_vbit) = opval;
8610 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8614 BI opval = 0;
8615 CPU (h_xbit) = opval;
8616 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8619 BI opval = 0;
8620 SET_H_INSN_PREFIXED_P (opval);
8621 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8628 #undef FLD
8630 NEXT (vpc);
8632 CASE (sem, INSN_LAPC_D) : /* lapc.d ${const32-pcrel},${Rd} */
8634 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8635 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8636 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8637 int UNUSED written = 0;
8638 IADDR UNUSED pc = abuf->addr;
8639 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
8643 SI opval = FLD (i_const32_pcrel);
8644 SET_H_GR (FLD (f_operand2), opval);
8645 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8649 BI opval = 0;
8650 CPU (h_xbit) = opval;
8651 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8654 BI opval = 0;
8655 SET_H_INSN_PREFIXED_P (opval);
8656 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8661 #undef FLD
8663 NEXT (vpc);
8665 CASE (sem, INSN_LAPCQ) : /* lapcq ${qo},${Rd} */
8667 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8668 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8669 #define FLD(f) abuf->fields.sfmt_lapcq.f
8670 int UNUSED written = 0;
8671 IADDR UNUSED pc = abuf->addr;
8672 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8676 SI opval = FLD (i_qo);
8677 SET_H_GR (FLD (f_operand2), opval);
8678 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8682 BI opval = 0;
8683 CPU (h_xbit) = opval;
8684 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8687 BI opval = 0;
8688 SET_H_INSN_PREFIXED_P (opval);
8689 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8694 #undef FLD
8696 NEXT (vpc);
8698 CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8700 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8701 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8702 #define FLD(f) abuf->fields.sfmt_addc_m.f
8703 int UNUSED written = 0;
8704 IADDR UNUSED pc = abuf->addr;
8705 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8709 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
8710 SET_H_GR (FLD (f_operand1), opval);
8711 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8715 BI opval = 0;
8716 CPU (h_xbit) = opval;
8717 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8720 BI opval = 0;
8721 SET_H_INSN_PREFIXED_P (opval);
8722 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8727 #undef FLD
8729 NEXT (vpc);
8731 CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8733 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8734 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8735 #define FLD(f) abuf->fields.sfmt_addc_m.f
8736 int UNUSED written = 0;
8737 IADDR UNUSED pc = abuf->addr;
8738 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8742 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
8743 SET_H_GR (FLD (f_operand1), opval);
8744 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8748 BI opval = 0;
8749 CPU (h_xbit) = opval;
8750 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8753 BI opval = 0;
8754 SET_H_INSN_PREFIXED_P (opval);
8755 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8760 #undef FLD
8762 NEXT (vpc);
8764 CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8766 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8767 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8768 #define FLD(f) abuf->fields.sfmt_addc_m.f
8769 int UNUSED written = 0;
8770 IADDR UNUSED pc = abuf->addr;
8771 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8775 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
8776 SET_H_GR (FLD (f_operand1), opval);
8777 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8781 BI opval = 0;
8782 CPU (h_xbit) = opval;
8783 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8786 BI opval = 0;
8787 SET_H_INSN_PREFIXED_P (opval);
8788 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8793 #undef FLD
8795 NEXT (vpc);
8797 CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
8799 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8800 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8801 #define FLD(f) abuf->fields.sfmt_addc_m.f
8802 int UNUSED written = 0;
8803 IADDR UNUSED pc = abuf->addr;
8804 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8807 QI tmp_tmpopd;
8808 QI tmp_tmpops;
8809 BI tmp_carry;
8810 QI tmp_newval;
8811 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8812 tmp_tmpopd = 0;
8813 tmp_carry = CPU (h_cbit);
8814 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8816 SI tmp_oldregval;
8817 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
8819 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
8820 SET_H_GR (FLD (f_operand2), opval);
8821 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8826 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
8827 CPU (h_cbit) = opval;
8828 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8831 BI opval = LTQI (tmp_newval, 0);
8832 CPU (h_nbit) = opval;
8833 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8836 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8837 CPU (h_zbit) = opval;
8838 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8841 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
8842 CPU (h_vbit) = opval;
8843 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8847 BI opval = 0;
8848 CPU (h_xbit) = opval;
8849 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8852 BI opval = 0;
8853 SET_H_INSN_PREFIXED_P (opval);
8854 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8860 #undef FLD
8862 NEXT (vpc);
8864 CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
8866 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8867 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8868 #define FLD(f) abuf->fields.sfmt_addc_m.f
8869 int UNUSED written = 0;
8870 IADDR UNUSED pc = abuf->addr;
8871 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8874 HI tmp_tmpopd;
8875 HI tmp_tmpops;
8876 BI tmp_carry;
8877 HI tmp_newval;
8878 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8879 tmp_tmpopd = 0;
8880 tmp_carry = CPU (h_cbit);
8881 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8883 SI tmp_oldregval;
8884 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
8886 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
8887 SET_H_GR (FLD (f_operand2), opval);
8888 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8893 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
8894 CPU (h_cbit) = opval;
8895 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8898 BI opval = LTHI (tmp_newval, 0);
8899 CPU (h_nbit) = opval;
8900 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8903 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8904 CPU (h_zbit) = opval;
8905 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8908 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
8909 CPU (h_vbit) = opval;
8910 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8914 BI opval = 0;
8915 CPU (h_xbit) = opval;
8916 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8919 BI opval = 0;
8920 SET_H_INSN_PREFIXED_P (opval);
8921 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8927 #undef FLD
8929 NEXT (vpc);
8931 CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
8933 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8934 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8935 #define FLD(f) abuf->fields.sfmt_addc_m.f
8936 int UNUSED written = 0;
8937 IADDR UNUSED pc = abuf->addr;
8938 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8941 SI tmp_tmpopd;
8942 SI tmp_tmpops;
8943 BI tmp_carry;
8944 SI tmp_newval;
8945 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8946 tmp_tmpopd = 0;
8947 tmp_carry = CPU (h_cbit);
8948 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8950 SI opval = tmp_newval;
8951 SET_H_GR (FLD (f_operand2), opval);
8952 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8956 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
8957 CPU (h_cbit) = opval;
8958 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8961 BI opval = LTSI (tmp_newval, 0);
8962 CPU (h_nbit) = opval;
8963 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8966 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8967 CPU (h_zbit) = opval;
8968 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8971 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
8972 CPU (h_vbit) = opval;
8973 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8977 BI opval = 0;
8978 CPU (h_xbit) = opval;
8979 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8982 BI opval = 0;
8983 SET_H_INSN_PREFIXED_P (opval);
8984 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8990 #undef FLD
8992 NEXT (vpc);
8994 CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
8996 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8997 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8998 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
8999 int UNUSED written = 0;
9000 IADDR UNUSED pc = abuf->addr;
9001 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9004 QI tmp_tmpd;
9005 tmp_tmpd = ({ SI tmp_addr;
9006 QI tmp_tmp_mem;
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))) : (GET_H_PREFIXREG_V32 ()));
9010 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
9011 ; if (NEBI (tmp_postinc, 0)) {
9013 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9014 tmp_addr = ADDSI (tmp_addr, 1);
9017 SI opval = tmp_addr;
9018 SET_H_GR (FLD (f_operand1), opval);
9019 written |= (1 << 8);
9020 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9024 ; tmp_tmp_mem; });
9026 QI tmp_tmpopd;
9027 QI tmp_tmpops;
9028 BI tmp_carry;
9029 QI tmp_newval;
9030 tmp_tmpops = 0;
9031 tmp_tmpopd = tmp_tmpd;
9032 tmp_carry = CPU (h_cbit);
9033 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9034 ((void) 0); /*nop*/
9037 BI opval = ORIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd, 0), LTQI (tmp_newval, 0)), ANDIF (LTQI (tmp_tmpops, 0), LTQI (tmp_newval, 0))));
9038 CPU (h_cbit) = opval;
9039 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9042 BI opval = LTQI (tmp_newval, 0);
9043 CPU (h_nbit) = opval;
9044 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9047 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9048 CPU (h_zbit) = opval;
9049 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9052 BI opval = ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops, 0), LTQI (tmp_tmpopd, 0)), GEQI (tmp_newval, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops, 0), GEQI (tmp_tmpopd, 0)), LTQI (tmp_newval, 0)));
9053 CPU (h_vbit) = opval;
9054 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9058 BI opval = 0;
9059 CPU (h_xbit) = opval;
9060 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9063 BI opval = 0;
9064 SET_H_INSN_PREFIXED_P (opval);
9065 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9072 abuf->written = written;
9073 #undef FLD
9075 NEXT (vpc);
9077 CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
9079 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9080 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9081 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9082 int UNUSED written = 0;
9083 IADDR UNUSED pc = abuf->addr;
9084 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9087 HI tmp_tmpd;
9088 tmp_tmpd = ({ SI tmp_addr;
9089 HI tmp_tmp_mem;
9090 BI tmp_postinc;
9091 tmp_postinc = FLD (f_memmode);
9092 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9093 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
9094 ; if (NEBI (tmp_postinc, 0)) {
9096 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9097 tmp_addr = ADDSI (tmp_addr, 2);
9100 SI opval = tmp_addr;
9101 SET_H_GR (FLD (f_operand1), opval);
9102 written |= (1 << 8);
9103 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9107 ; tmp_tmp_mem; });
9109 HI tmp_tmpopd;
9110 HI tmp_tmpops;
9111 BI tmp_carry;
9112 HI tmp_newval;
9113 tmp_tmpops = 0;
9114 tmp_tmpopd = tmp_tmpd;
9115 tmp_carry = CPU (h_cbit);
9116 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9117 ((void) 0); /*nop*/
9120 BI opval = ORIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd, 0), LTHI (tmp_newval, 0)), ANDIF (LTHI (tmp_tmpops, 0), LTHI (tmp_newval, 0))));
9121 CPU (h_cbit) = opval;
9122 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9125 BI opval = LTHI (tmp_newval, 0);
9126 CPU (h_nbit) = opval;
9127 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9130 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9131 CPU (h_zbit) = opval;
9132 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9135 BI opval = ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops, 0), LTHI (tmp_tmpopd, 0)), GEHI (tmp_newval, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops, 0), GEHI (tmp_tmpopd, 0)), LTHI (tmp_newval, 0)));
9136 CPU (h_vbit) = opval;
9137 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9141 BI opval = 0;
9142 CPU (h_xbit) = opval;
9143 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9146 BI opval = 0;
9147 SET_H_INSN_PREFIXED_P (opval);
9148 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9155 abuf->written = written;
9156 #undef FLD
9158 NEXT (vpc);
9160 CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
9162 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9163 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9164 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9165 int UNUSED written = 0;
9166 IADDR UNUSED pc = abuf->addr;
9167 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9170 SI tmp_tmpd;
9171 tmp_tmpd = ({ SI tmp_addr;
9172 SI tmp_tmp_mem;
9173 BI tmp_postinc;
9174 tmp_postinc = FLD (f_memmode);
9175 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9176 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
9177 ; if (NEBI (tmp_postinc, 0)) {
9179 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9180 tmp_addr = ADDSI (tmp_addr, 4);
9183 SI opval = tmp_addr;
9184 SET_H_GR (FLD (f_operand1), opval);
9185 written |= (1 << 8);
9186 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9190 ; tmp_tmp_mem; });
9192 SI tmp_tmpopd;
9193 SI tmp_tmpops;
9194 BI tmp_carry;
9195 SI tmp_newval;
9196 tmp_tmpops = 0;
9197 tmp_tmpopd = tmp_tmpd;
9198 tmp_carry = CPU (h_cbit);
9199 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9200 ((void) 0); /*nop*/
9203 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), ORIF (ANDIF (GESI (tmp_tmpopd, 0), LTSI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_newval, 0))));
9204 CPU (h_cbit) = opval;
9205 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9208 BI opval = LTSI (tmp_newval, 0);
9209 CPU (h_nbit) = opval;
9210 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9213 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9214 CPU (h_zbit) = opval;
9215 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9218 BI opval = ORIF (ANDIF (ANDIF (GESI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
9219 CPU (h_vbit) = opval;
9220 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9224 BI opval = 0;
9225 CPU (h_xbit) = opval;
9226 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9229 BI opval = 0;
9230 SET_H_INSN_PREFIXED_P (opval);
9231 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9238 abuf->written = written;
9239 #undef FLD
9241 NEXT (vpc);
9243 CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9245 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9246 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9247 #define FLD(f) abuf->fields.sfmt_addc_m.f
9248 int UNUSED written = 0;
9249 IADDR UNUSED pc = abuf->addr;
9250 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9253 QI tmp_tmpd;
9254 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9256 SI tmp_addr;
9257 BI tmp_postinc;
9258 tmp_postinc = FLD (f_memmode);
9259 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9260 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9261 if (EQBI (CPU (h_pbit), 0)) {
9264 QI opval = tmp_tmpd;
9265 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9266 written |= (1 << 10);
9267 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9270 BI opval = CPU (h_pbit);
9271 CPU (h_cbit) = opval;
9272 written |= (1 << 9);
9273 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9276 } else {
9278 BI opval = 1;
9279 CPU (h_cbit) = opval;
9280 written |= (1 << 9);
9281 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9284 } else {
9286 QI opval = tmp_tmpd;
9287 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9288 written |= (1 << 10);
9289 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9292 if (NEBI (tmp_postinc, 0)) {
9294 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9295 tmp_addr = ADDSI (tmp_addr, 1);
9298 SI opval = tmp_addr;
9299 SET_H_GR (FLD (f_operand1), opval);
9300 written |= (1 << 8);
9301 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9308 BI opval = 0;
9309 CPU (h_xbit) = opval;
9310 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9313 BI opval = 0;
9314 SET_H_INSN_PREFIXED_P (opval);
9315 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9320 abuf->written = written;
9321 #undef FLD
9323 NEXT (vpc);
9325 CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9327 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9328 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9329 #define FLD(f) abuf->fields.sfmt_addc_m.f
9330 int UNUSED written = 0;
9331 IADDR UNUSED pc = abuf->addr;
9332 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9335 HI tmp_tmpd;
9336 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9338 SI tmp_addr;
9339 BI tmp_postinc;
9340 tmp_postinc = FLD (f_memmode);
9341 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9342 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9343 if (EQBI (CPU (h_pbit), 0)) {
9346 HI opval = tmp_tmpd;
9347 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9348 written |= (1 << 10);
9349 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9352 BI opval = CPU (h_pbit);
9353 CPU (h_cbit) = opval;
9354 written |= (1 << 9);
9355 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9358 } else {
9360 BI opval = 1;
9361 CPU (h_cbit) = opval;
9362 written |= (1 << 9);
9363 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9366 } else {
9368 HI opval = tmp_tmpd;
9369 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9370 written |= (1 << 10);
9371 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9374 if (NEBI (tmp_postinc, 0)) {
9376 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9377 tmp_addr = ADDSI (tmp_addr, 2);
9380 SI opval = tmp_addr;
9381 SET_H_GR (FLD (f_operand1), opval);
9382 written |= (1 << 8);
9383 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9390 BI opval = 0;
9391 CPU (h_xbit) = opval;
9392 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9395 BI opval = 0;
9396 SET_H_INSN_PREFIXED_P (opval);
9397 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9402 abuf->written = written;
9403 #undef FLD
9405 NEXT (vpc);
9407 CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9409 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9410 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9411 #define FLD(f) abuf->fields.sfmt_addc_m.f
9412 int UNUSED written = 0;
9413 IADDR UNUSED pc = abuf->addr;
9414 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9417 SI tmp_tmpd;
9418 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9420 SI tmp_addr;
9421 BI tmp_postinc;
9422 tmp_postinc = FLD (f_memmode);
9423 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
9424 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit), 0))) {
9425 if (EQBI (CPU (h_pbit), 0)) {
9428 SI opval = tmp_tmpd;
9429 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9430 written |= (1 << 10);
9431 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9434 BI opval = CPU (h_pbit);
9435 CPU (h_cbit) = opval;
9436 written |= (1 << 9);
9437 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9440 } else {
9442 BI opval = 1;
9443 CPU (h_cbit) = opval;
9444 written |= (1 << 9);
9445 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9448 } else {
9450 SI opval = tmp_tmpd;
9451 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9452 written |= (1 << 10);
9453 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9456 if (NEBI (tmp_postinc, 0)) {
9458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9459 tmp_addr = ADDSI (tmp_addr, 4);
9462 SI opval = tmp_addr;
9463 SET_H_GR (FLD (f_operand1), opval);
9464 written |= (1 << 8);
9465 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9472 BI opval = 0;
9473 CPU (h_xbit) = opval;
9474 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9477 BI opval = 0;
9478 SET_H_INSN_PREFIXED_P (opval);
9479 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9484 abuf->written = written;
9485 #undef FLD
9487 NEXT (vpc);
9489 CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
9491 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9492 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9493 #define FLD(f) abuf->fields.sfmt_muls_b.f
9494 int UNUSED written = 0;
9495 IADDR UNUSED pc = abuf->addr;
9496 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9499 DI tmp_src1;
9500 DI tmp_src2;
9501 DI tmp_tmpr;
9502 tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9503 tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9504 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9506 SI opval = TRUNCDISI (tmp_tmpr);
9507 SET_H_GR (FLD (f_operand2), opval);
9508 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9511 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9512 SET_H_SR (((UINT) 7), opval);
9513 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9517 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9518 CPU (h_cbit) = opval;
9519 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9522 BI opval = LTDI (tmp_tmpr, 0);
9523 CPU (h_nbit) = opval;
9524 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9527 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9528 CPU (h_zbit) = opval;
9529 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9532 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9533 CPU (h_vbit) = opval;
9534 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9538 BI opval = 0;
9539 CPU (h_xbit) = opval;
9540 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9543 BI opval = 0;
9544 SET_H_INSN_PREFIXED_P (opval);
9545 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9551 #undef FLD
9553 NEXT (vpc);
9555 CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
9557 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9558 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9559 #define FLD(f) abuf->fields.sfmt_muls_b.f
9560 int UNUSED written = 0;
9561 IADDR UNUSED pc = abuf->addr;
9562 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9565 DI tmp_src1;
9566 DI tmp_src2;
9567 DI tmp_tmpr;
9568 tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9569 tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9570 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9572 SI opval = TRUNCDISI (tmp_tmpr);
9573 SET_H_GR (FLD (f_operand2), opval);
9574 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9577 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9578 SET_H_SR (((UINT) 7), opval);
9579 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9583 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9584 CPU (h_cbit) = opval;
9585 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9588 BI opval = LTDI (tmp_tmpr, 0);
9589 CPU (h_nbit) = opval;
9590 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9593 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9594 CPU (h_zbit) = opval;
9595 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9598 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9599 CPU (h_vbit) = opval;
9600 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9604 BI opval = 0;
9605 CPU (h_xbit) = opval;
9606 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9609 BI opval = 0;
9610 SET_H_INSN_PREFIXED_P (opval);
9611 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9617 #undef FLD
9619 NEXT (vpc);
9621 CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
9623 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9624 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9625 #define FLD(f) abuf->fields.sfmt_muls_b.f
9626 int UNUSED written = 0;
9627 IADDR UNUSED pc = abuf->addr;
9628 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9631 DI tmp_src1;
9632 DI tmp_src2;
9633 DI tmp_tmpr;
9634 tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9635 tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9636 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9638 SI opval = TRUNCDISI (tmp_tmpr);
9639 SET_H_GR (FLD (f_operand2), opval);
9640 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9643 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9644 SET_H_SR (((UINT) 7), opval);
9645 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9649 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9650 CPU (h_cbit) = opval;
9651 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9654 BI opval = LTDI (tmp_tmpr, 0);
9655 CPU (h_nbit) = opval;
9656 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9659 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9660 CPU (h_zbit) = opval;
9661 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9664 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9665 CPU (h_vbit) = opval;
9666 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9670 BI opval = 0;
9671 CPU (h_xbit) = opval;
9672 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9675 BI opval = 0;
9676 SET_H_INSN_PREFIXED_P (opval);
9677 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9683 #undef FLD
9685 NEXT (vpc);
9687 CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
9689 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9690 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9691 #define FLD(f) abuf->fields.sfmt_muls_b.f
9692 int UNUSED written = 0;
9693 IADDR UNUSED pc = abuf->addr;
9694 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9697 DI tmp_src1;
9698 DI tmp_src2;
9699 DI tmp_tmpr;
9700 tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9701 tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9702 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9704 SI opval = TRUNCDISI (tmp_tmpr);
9705 SET_H_GR (FLD (f_operand2), opval);
9706 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9709 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9710 SET_H_SR (((UINT) 7), opval);
9711 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9715 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9716 CPU (h_cbit) = opval;
9717 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9720 BI opval = LTDI (tmp_tmpr, 0);
9721 CPU (h_nbit) = opval;
9722 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9725 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9726 CPU (h_zbit) = opval;
9727 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9730 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9731 CPU (h_vbit) = opval;
9732 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9736 BI opval = 0;
9737 CPU (h_xbit) = opval;
9738 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9741 BI opval = 0;
9742 SET_H_INSN_PREFIXED_P (opval);
9743 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9749 #undef FLD
9751 NEXT (vpc);
9753 CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
9755 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9756 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9757 #define FLD(f) abuf->fields.sfmt_muls_b.f
9758 int UNUSED written = 0;
9759 IADDR UNUSED pc = abuf->addr;
9760 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9763 DI tmp_src1;
9764 DI tmp_src2;
9765 DI tmp_tmpr;
9766 tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9767 tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9768 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9770 SI opval = TRUNCDISI (tmp_tmpr);
9771 SET_H_GR (FLD (f_operand2), opval);
9772 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9775 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9776 SET_H_SR (((UINT) 7), opval);
9777 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9781 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9782 CPU (h_cbit) = opval;
9783 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9786 BI opval = LTDI (tmp_tmpr, 0);
9787 CPU (h_nbit) = opval;
9788 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9791 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9792 CPU (h_zbit) = opval;
9793 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9796 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9797 CPU (h_vbit) = opval;
9798 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9802 BI opval = 0;
9803 CPU (h_xbit) = opval;
9804 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9807 BI opval = 0;
9808 SET_H_INSN_PREFIXED_P (opval);
9809 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9815 #undef FLD
9817 NEXT (vpc);
9819 CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
9821 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9822 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9823 #define FLD(f) abuf->fields.sfmt_muls_b.f
9824 int UNUSED written = 0;
9825 IADDR UNUSED pc = abuf->addr;
9826 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9829 DI tmp_src1;
9830 DI tmp_src2;
9831 DI tmp_tmpr;
9832 tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9833 tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9834 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9836 SI opval = TRUNCDISI (tmp_tmpr);
9837 SET_H_GR (FLD (f_operand2), opval);
9838 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9841 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9842 SET_H_SR (((UINT) 7), opval);
9843 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9847 BI opval = ANDIF (GET_H_V32_V32 (), CPU (h_cbit));
9848 CPU (h_cbit) = opval;
9849 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9852 BI opval = LTDI (tmp_tmpr, 0);
9853 CPU (h_nbit) = opval;
9854 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9857 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9858 CPU (h_zbit) = opval;
9859 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9862 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9863 CPU (h_vbit) = opval;
9864 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9868 BI opval = 0;
9869 CPU (h_xbit) = opval;
9870 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9873 BI opval = 0;
9874 SET_H_INSN_PREFIXED_P (opval);
9875 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9881 #undef FLD
9883 NEXT (vpc);
9885 CASE (sem, INSN_MCP) : /* mcp $Ps,$Rd */
9887 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9888 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9889 #define FLD(f) abuf->fields.sfmt_mcp.f
9890 int UNUSED written = 0;
9891 IADDR UNUSED pc = abuf->addr;
9892 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9895 CPU (h_xbit) = 1;
9896 CPU (h_zbit) = 1;
9898 SI tmp_tmpopd;
9899 SI tmp_tmpops;
9900 BI tmp_carry;
9901 SI tmp_newval;
9902 tmp_tmpops = GET_H_SR (FLD (f_operand2));
9903 tmp_tmpopd = GET_H_GR (FLD (f_operand1));
9904 tmp_carry = CPU (h_rbit);
9905 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
9907 SI opval = tmp_newval;
9908 SET_H_GR (FLD (f_operand1), opval);
9909 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9913 BI opval = ORIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd, 0), GESI (tmp_newval, 0)), ANDIF (LTSI (tmp_tmpops, 0), GESI (tmp_newval, 0))));
9914 CPU (h_rbit) = opval;
9915 CGEN_TRACE_RESULT (current_cpu, abuf, "rbit", 'x', opval);
9918 BI opval = LTSI (tmp_newval, 0);
9919 CPU (h_nbit) = opval;
9920 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9923 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9924 CPU (h_zbit) = opval;
9925 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9928 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops, 0), LTSI (tmp_tmpopd, 0)), GESI (tmp_newval, 0)), ANDIF (ANDIF (GESI (tmp_tmpops, 0), GESI (tmp_tmpopd, 0)), LTSI (tmp_newval, 0)));
9929 CPU (h_vbit) = opval;
9930 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9934 BI opval = 0;
9935 CPU (h_xbit) = opval;
9936 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9939 BI opval = 0;
9940 SET_H_INSN_PREFIXED_P (opval);
9941 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9948 #undef FLD
9950 NEXT (vpc);
9952 CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
9954 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9955 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9956 #define FLD(f) abuf->fields.sfmt_muls_b.f
9957 int UNUSED written = 0;
9958 IADDR UNUSED pc = abuf->addr;
9959 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9962 SI tmp_tmp;
9963 SI tmp_tmps;
9964 SI tmp_tmpd;
9965 tmp_tmps = GET_H_GR (FLD (f_operand1));
9966 tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
9967 tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
9969 SI opval = tmp_tmpd;
9970 SET_H_GR (FLD (f_operand2), opval);
9971 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9975 BI opval = LTSI (tmp_tmpd, 0);
9976 CPU (h_nbit) = opval;
9977 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9980 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9981 CPU (h_zbit) = opval;
9982 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9984 SET_H_CBIT_MOVE (0);
9985 SET_H_VBIT_MOVE (0);
9988 BI opval = 0;
9989 CPU (h_xbit) = opval;
9990 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9993 BI opval = 0;
9994 SET_H_INSN_PREFIXED_P (opval);
9995 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10001 #undef FLD
10003 NEXT (vpc);
10005 CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
10007 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10008 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10009 #define FLD(f) abuf->fields.sfmt_muls_b.f
10010 int UNUSED written = 0;
10011 IADDR UNUSED pc = abuf->addr;
10012 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10015 SI tmp_tmpd;
10016 tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
10018 SI opval = tmp_tmpd;
10019 SET_H_GR (FLD (f_operand2), opval);
10020 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10024 BI opval = LTSI (tmp_tmpd, 0);
10025 CPU (h_nbit) = opval;
10026 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10029 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10030 CPU (h_zbit) = opval;
10031 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10033 SET_H_CBIT_MOVE (0);
10034 SET_H_VBIT_MOVE (0);
10037 BI opval = 0;
10038 CPU (h_xbit) = opval;
10039 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10042 BI opval = 0;
10043 SET_H_INSN_PREFIXED_P (opval);
10044 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10050 #undef FLD
10052 NEXT (vpc);
10054 CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
10056 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10057 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10058 #define FLD(f) abuf->fields.sfmt_addc_m.f
10059 int UNUSED written = 0;
10060 IADDR UNUSED pc = abuf->addr;
10061 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10064 QI tmp_tmpd;
10065 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10067 SI tmp_oldregval;
10068 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10070 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10071 SET_H_GR (FLD (f_operand2), opval);
10072 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10077 BI opval = LTQI (tmp_tmpd, 0);
10078 CPU (h_nbit) = opval;
10079 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10082 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10083 CPU (h_zbit) = opval;
10084 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10086 SET_H_CBIT_MOVE (0);
10087 SET_H_VBIT_MOVE (0);
10090 BI opval = 0;
10091 CPU (h_xbit) = opval;
10092 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10095 BI opval = 0;
10096 SET_H_INSN_PREFIXED_P (opval);
10097 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10103 #undef FLD
10105 NEXT (vpc);
10107 CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
10109 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10110 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10111 #define FLD(f) abuf->fields.sfmt_addc_m.f
10112 int UNUSED written = 0;
10113 IADDR UNUSED pc = abuf->addr;
10114 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10117 HI tmp_tmpd;
10118 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10120 SI tmp_oldregval;
10121 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10123 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10124 SET_H_GR (FLD (f_operand2), opval);
10125 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10130 BI opval = LTHI (tmp_tmpd, 0);
10131 CPU (h_nbit) = opval;
10132 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10135 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10136 CPU (h_zbit) = opval;
10137 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10139 SET_H_CBIT_MOVE (0);
10140 SET_H_VBIT_MOVE (0);
10143 BI opval = 0;
10144 CPU (h_xbit) = opval;
10145 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10148 BI opval = 0;
10149 SET_H_INSN_PREFIXED_P (opval);
10150 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10156 #undef FLD
10158 NEXT (vpc);
10160 CASE (sem, INSN_AND_D_R) : /* and.d $Rs,$Rd */
10162 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10163 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10164 #define FLD(f) abuf->fields.sfmt_addc_m.f
10165 int UNUSED written = 0;
10166 IADDR UNUSED pc = abuf->addr;
10167 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10170 SI tmp_tmpd;
10171 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10173 SI opval = tmp_tmpd;
10174 SET_H_GR (FLD (f_operand2), opval);
10175 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10179 BI opval = LTSI (tmp_tmpd, 0);
10180 CPU (h_nbit) = opval;
10181 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10184 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10185 CPU (h_zbit) = opval;
10186 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10188 SET_H_CBIT_MOVE (0);
10189 SET_H_VBIT_MOVE (0);
10192 BI opval = 0;
10193 CPU (h_xbit) = opval;
10194 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10197 BI opval = 0;
10198 SET_H_INSN_PREFIXED_P (opval);
10199 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10205 #undef FLD
10207 NEXT (vpc);
10209 CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
10211 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10212 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10213 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10214 int UNUSED written = 0;
10215 IADDR UNUSED pc = abuf->addr;
10216 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10219 QI tmp_tmpd;
10220 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10221 QI tmp_tmp_mem;
10222 BI tmp_postinc;
10223 tmp_postinc = FLD (f_memmode);
10224 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10225 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10226 ; if (NEBI (tmp_postinc, 0)) {
10228 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10229 tmp_addr = ADDSI (tmp_addr, 1);
10232 SI opval = tmp_addr;
10233 SET_H_GR (FLD (f_operand1), opval);
10234 written |= (1 << 11);
10235 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10239 ; tmp_tmp_mem; }));
10241 SI tmp_oldregval;
10242 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10244 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10245 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10246 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10251 BI opval = LTQI (tmp_tmpd, 0);
10252 CPU (h_nbit) = opval;
10253 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10256 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10257 CPU (h_zbit) = opval;
10258 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10260 SET_H_CBIT_MOVE (0);
10261 SET_H_VBIT_MOVE (0);
10264 BI opval = 0;
10265 CPU (h_xbit) = opval;
10266 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10269 BI opval = 0;
10270 SET_H_INSN_PREFIXED_P (opval);
10271 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10277 abuf->written = written;
10278 #undef FLD
10280 NEXT (vpc);
10282 CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
10284 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10285 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10286 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10287 int UNUSED written = 0;
10288 IADDR UNUSED pc = abuf->addr;
10289 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10292 HI tmp_tmpd;
10293 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10294 HI tmp_tmp_mem;
10295 BI tmp_postinc;
10296 tmp_postinc = FLD (f_memmode);
10297 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10298 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10299 ; if (NEBI (tmp_postinc, 0)) {
10301 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10302 tmp_addr = ADDSI (tmp_addr, 2);
10305 SI opval = tmp_addr;
10306 SET_H_GR (FLD (f_operand1), opval);
10307 written |= (1 << 11);
10308 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10312 ; tmp_tmp_mem; }));
10314 SI tmp_oldregval;
10315 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10317 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10318 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10319 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10324 BI opval = LTHI (tmp_tmpd, 0);
10325 CPU (h_nbit) = opval;
10326 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10329 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10330 CPU (h_zbit) = opval;
10331 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10333 SET_H_CBIT_MOVE (0);
10334 SET_H_VBIT_MOVE (0);
10337 BI opval = 0;
10338 CPU (h_xbit) = opval;
10339 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10342 BI opval = 0;
10343 SET_H_INSN_PREFIXED_P (opval);
10344 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10350 abuf->written = written;
10351 #undef FLD
10353 NEXT (vpc);
10355 CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
10357 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10358 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10359 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10360 int UNUSED written = 0;
10361 IADDR UNUSED pc = abuf->addr;
10362 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10365 SI tmp_tmpd;
10366 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10367 SI tmp_tmp_mem;
10368 BI tmp_postinc;
10369 tmp_postinc = FLD (f_memmode);
10370 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10371 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10372 ; if (NEBI (tmp_postinc, 0)) {
10374 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10375 tmp_addr = ADDSI (tmp_addr, 4);
10378 SI opval = tmp_addr;
10379 SET_H_GR (FLD (f_operand1), opval);
10380 written |= (1 << 10);
10381 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10385 ; tmp_tmp_mem; }));
10387 SI opval = tmp_tmpd;
10388 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10389 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10393 BI opval = LTSI (tmp_tmpd, 0);
10394 CPU (h_nbit) = opval;
10395 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10398 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10399 CPU (h_zbit) = opval;
10400 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10402 SET_H_CBIT_MOVE (0);
10403 SET_H_VBIT_MOVE (0);
10406 BI opval = 0;
10407 CPU (h_xbit) = opval;
10408 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10411 BI opval = 0;
10412 SET_H_INSN_PREFIXED_P (opval);
10413 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10419 abuf->written = written;
10420 #undef FLD
10422 NEXT (vpc);
10424 CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
10426 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10427 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10428 #define FLD(f) abuf->fields.sfmt_addcbr.f
10429 int UNUSED written = 0;
10430 IADDR UNUSED pc = abuf->addr;
10431 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10434 QI tmp_tmpd;
10435 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10437 SI tmp_oldregval;
10438 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10440 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10441 SET_H_GR (FLD (f_operand2), opval);
10442 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10447 BI opval = LTQI (tmp_tmpd, 0);
10448 CPU (h_nbit) = opval;
10449 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10452 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10453 CPU (h_zbit) = opval;
10454 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10456 SET_H_CBIT_MOVE (0);
10457 SET_H_VBIT_MOVE (0);
10460 BI opval = 0;
10461 CPU (h_xbit) = opval;
10462 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10465 BI opval = 0;
10466 SET_H_INSN_PREFIXED_P (opval);
10467 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10473 #undef FLD
10475 NEXT (vpc);
10477 CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
10479 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10480 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10481 #define FLD(f) abuf->fields.sfmt_addcwr.f
10482 int UNUSED written = 0;
10483 IADDR UNUSED pc = abuf->addr;
10484 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10487 HI tmp_tmpd;
10488 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10490 SI tmp_oldregval;
10491 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10493 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10494 SET_H_GR (FLD (f_operand2), opval);
10495 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10500 BI opval = LTHI (tmp_tmpd, 0);
10501 CPU (h_nbit) = opval;
10502 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10505 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10506 CPU (h_zbit) = opval;
10507 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10509 SET_H_CBIT_MOVE (0);
10510 SET_H_VBIT_MOVE (0);
10513 BI opval = 0;
10514 CPU (h_xbit) = opval;
10515 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10518 BI opval = 0;
10519 SET_H_INSN_PREFIXED_P (opval);
10520 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10526 #undef FLD
10528 NEXT (vpc);
10530 CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
10532 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10533 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10534 #define FLD(f) abuf->fields.sfmt_addcdr.f
10535 int UNUSED written = 0;
10536 IADDR UNUSED pc = abuf->addr;
10537 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10540 SI tmp_tmpd;
10541 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10543 SI opval = tmp_tmpd;
10544 SET_H_GR (FLD (f_operand2), opval);
10545 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10549 BI opval = LTSI (tmp_tmpd, 0);
10550 CPU (h_nbit) = opval;
10551 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10554 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10555 CPU (h_zbit) = opval;
10556 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10558 SET_H_CBIT_MOVE (0);
10559 SET_H_VBIT_MOVE (0);
10562 BI opval = 0;
10563 CPU (h_xbit) = opval;
10564 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10567 BI opval = 0;
10568 SET_H_INSN_PREFIXED_P (opval);
10569 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10575 #undef FLD
10577 NEXT (vpc);
10579 CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
10581 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10582 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10583 #define FLD(f) abuf->fields.sfmt_andq.f
10584 int UNUSED written = 0;
10585 IADDR UNUSED pc = abuf->addr;
10586 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10589 SI tmp_tmpd;
10590 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10592 SI opval = tmp_tmpd;
10593 SET_H_GR (FLD (f_operand2), opval);
10594 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10598 BI opval = LTSI (tmp_tmpd, 0);
10599 CPU (h_nbit) = opval;
10600 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10603 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10604 CPU (h_zbit) = opval;
10605 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10607 SET_H_CBIT_MOVE (0);
10608 SET_H_VBIT_MOVE (0);
10611 BI opval = 0;
10612 CPU (h_xbit) = opval;
10613 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10616 BI opval = 0;
10617 SET_H_INSN_PREFIXED_P (opval);
10618 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10624 #undef FLD
10626 NEXT (vpc);
10628 CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
10630 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10632 #define FLD(f) abuf->fields.sfmt_addc_m.f
10633 int UNUSED written = 0;
10634 IADDR UNUSED pc = abuf->addr;
10635 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10638 QI tmp_tmpd;
10639 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10641 SI tmp_oldregval;
10642 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10644 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10645 SET_H_GR (FLD (f_operand2), opval);
10646 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10651 BI opval = LTQI (tmp_tmpd, 0);
10652 CPU (h_nbit) = opval;
10653 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10656 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10657 CPU (h_zbit) = opval;
10658 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10660 SET_H_CBIT_MOVE (0);
10661 SET_H_VBIT_MOVE (0);
10664 BI opval = 0;
10665 CPU (h_xbit) = opval;
10666 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10669 BI opval = 0;
10670 SET_H_INSN_PREFIXED_P (opval);
10671 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10677 #undef FLD
10679 NEXT (vpc);
10681 CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
10683 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10684 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10685 #define FLD(f) abuf->fields.sfmt_addc_m.f
10686 int UNUSED written = 0;
10687 IADDR UNUSED pc = abuf->addr;
10688 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10691 HI tmp_tmpd;
10692 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10694 SI tmp_oldregval;
10695 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
10697 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10698 SET_H_GR (FLD (f_operand2), opval);
10699 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10704 BI opval = LTHI (tmp_tmpd, 0);
10705 CPU (h_nbit) = opval;
10706 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10709 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10710 CPU (h_zbit) = opval;
10711 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10713 SET_H_CBIT_MOVE (0);
10714 SET_H_VBIT_MOVE (0);
10717 BI opval = 0;
10718 CPU (h_xbit) = opval;
10719 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10722 BI opval = 0;
10723 SET_H_INSN_PREFIXED_P (opval);
10724 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10730 #undef FLD
10732 NEXT (vpc);
10734 CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
10736 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10737 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10738 #define FLD(f) abuf->fields.sfmt_addc_m.f
10739 int UNUSED written = 0;
10740 IADDR UNUSED pc = abuf->addr;
10741 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10744 SI tmp_tmpd;
10745 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10747 SI opval = tmp_tmpd;
10748 SET_H_GR (FLD (f_operand2), opval);
10749 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10753 BI opval = LTSI (tmp_tmpd, 0);
10754 CPU (h_nbit) = opval;
10755 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10758 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10759 CPU (h_zbit) = opval;
10760 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10762 SET_H_CBIT_MOVE (0);
10763 SET_H_VBIT_MOVE (0);
10766 BI opval = 0;
10767 CPU (h_xbit) = opval;
10768 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10771 BI opval = 0;
10772 SET_H_INSN_PREFIXED_P (opval);
10773 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10779 #undef FLD
10781 NEXT (vpc);
10783 CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
10785 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10786 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10787 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10788 int UNUSED written = 0;
10789 IADDR UNUSED pc = abuf->addr;
10790 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10793 QI tmp_tmpd;
10794 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10795 QI tmp_tmp_mem;
10796 BI tmp_postinc;
10797 tmp_postinc = FLD (f_memmode);
10798 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10799 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10800 ; if (NEBI (tmp_postinc, 0)) {
10802 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10803 tmp_addr = ADDSI (tmp_addr, 1);
10806 SI opval = tmp_addr;
10807 SET_H_GR (FLD (f_operand1), opval);
10808 written |= (1 << 11);
10809 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10813 ; tmp_tmp_mem; }));
10815 SI tmp_oldregval;
10816 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10818 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10819 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10820 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10825 BI opval = LTQI (tmp_tmpd, 0);
10826 CPU (h_nbit) = opval;
10827 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10830 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10831 CPU (h_zbit) = opval;
10832 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10834 SET_H_CBIT_MOVE (0);
10835 SET_H_VBIT_MOVE (0);
10838 BI opval = 0;
10839 CPU (h_xbit) = opval;
10840 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10843 BI opval = 0;
10844 SET_H_INSN_PREFIXED_P (opval);
10845 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10851 abuf->written = written;
10852 #undef FLD
10854 NEXT (vpc);
10856 CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
10858 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10859 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10860 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10861 int UNUSED written = 0;
10862 IADDR UNUSED pc = abuf->addr;
10863 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10866 HI tmp_tmpd;
10867 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10868 HI tmp_tmp_mem;
10869 BI tmp_postinc;
10870 tmp_postinc = FLD (f_memmode);
10871 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10872 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10873 ; if (NEBI (tmp_postinc, 0)) {
10875 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10876 tmp_addr = ADDSI (tmp_addr, 2);
10879 SI opval = tmp_addr;
10880 SET_H_GR (FLD (f_operand1), opval);
10881 written |= (1 << 11);
10882 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10886 ; tmp_tmp_mem; }));
10888 SI tmp_oldregval;
10889 tmp_oldregval = GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10891 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10892 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10893 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10898 BI opval = LTHI (tmp_tmpd, 0);
10899 CPU (h_nbit) = opval;
10900 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10903 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10904 CPU (h_zbit) = opval;
10905 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10907 SET_H_CBIT_MOVE (0);
10908 SET_H_VBIT_MOVE (0);
10911 BI opval = 0;
10912 CPU (h_xbit) = opval;
10913 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10916 BI opval = 0;
10917 SET_H_INSN_PREFIXED_P (opval);
10918 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10924 abuf->written = written;
10925 #undef FLD
10927 NEXT (vpc);
10929 CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
10931 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10932 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10933 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10934 int UNUSED written = 0;
10935 IADDR UNUSED pc = abuf->addr;
10936 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10939 SI tmp_tmpd;
10940 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10941 SI tmp_tmp_mem;
10942 BI tmp_postinc;
10943 tmp_postinc = FLD (f_memmode);
10944 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
10945 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10946 ; if (NEBI (tmp_postinc, 0)) {
10948 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10949 tmp_addr = ADDSI (tmp_addr, 4);
10952 SI opval = tmp_addr;
10953 SET_H_GR (FLD (f_operand1), opval);
10954 written |= (1 << 10);
10955 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10959 ; tmp_tmp_mem; }));
10961 SI opval = tmp_tmpd;
10962 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10963 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10967 BI opval = LTSI (tmp_tmpd, 0);
10968 CPU (h_nbit) = opval;
10969 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10972 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10973 CPU (h_zbit) = opval;
10974 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10976 SET_H_CBIT_MOVE (0);
10977 SET_H_VBIT_MOVE (0);
10980 BI opval = 0;
10981 CPU (h_xbit) = opval;
10982 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10985 BI opval = 0;
10986 SET_H_INSN_PREFIXED_P (opval);
10987 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10993 abuf->written = written;
10994 #undef FLD
10996 NEXT (vpc);
10998 CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
11000 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11001 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11002 #define FLD(f) abuf->fields.sfmt_addcbr.f
11003 int UNUSED written = 0;
11004 IADDR UNUSED pc = abuf->addr;
11005 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11008 QI tmp_tmpd;
11009 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
11011 SI tmp_oldregval;
11012 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11014 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11015 SET_H_GR (FLD (f_operand2), opval);
11016 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11021 BI opval = LTQI (tmp_tmpd, 0);
11022 CPU (h_nbit) = opval;
11023 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11026 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11027 CPU (h_zbit) = opval;
11028 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11030 SET_H_CBIT_MOVE (0);
11031 SET_H_VBIT_MOVE (0);
11034 BI opval = 0;
11035 CPU (h_xbit) = opval;
11036 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11039 BI opval = 0;
11040 SET_H_INSN_PREFIXED_P (opval);
11041 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11047 #undef FLD
11049 NEXT (vpc);
11051 CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
11053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11055 #define FLD(f) abuf->fields.sfmt_addcwr.f
11056 int UNUSED written = 0;
11057 IADDR UNUSED pc = abuf->addr;
11058 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11061 HI tmp_tmpd;
11062 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
11064 SI tmp_oldregval;
11065 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11067 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11068 SET_H_GR (FLD (f_operand2), opval);
11069 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11074 BI opval = LTHI (tmp_tmpd, 0);
11075 CPU (h_nbit) = opval;
11076 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11079 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11080 CPU (h_zbit) = opval;
11081 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11083 SET_H_CBIT_MOVE (0);
11084 SET_H_VBIT_MOVE (0);
11087 BI opval = 0;
11088 CPU (h_xbit) = opval;
11089 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11092 BI opval = 0;
11093 SET_H_INSN_PREFIXED_P (opval);
11094 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11100 #undef FLD
11102 NEXT (vpc);
11104 CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
11106 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11107 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11108 #define FLD(f) abuf->fields.sfmt_addcdr.f
11109 int UNUSED written = 0;
11110 IADDR UNUSED pc = abuf->addr;
11111 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
11114 SI tmp_tmpd;
11115 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
11117 SI opval = tmp_tmpd;
11118 SET_H_GR (FLD (f_operand2), opval);
11119 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11123 BI opval = LTSI (tmp_tmpd, 0);
11124 CPU (h_nbit) = opval;
11125 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11128 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11129 CPU (h_zbit) = opval;
11130 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11132 SET_H_CBIT_MOVE (0);
11133 SET_H_VBIT_MOVE (0);
11136 BI opval = 0;
11137 CPU (h_xbit) = opval;
11138 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11141 BI opval = 0;
11142 SET_H_INSN_PREFIXED_P (opval);
11143 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11149 #undef FLD
11151 NEXT (vpc);
11153 CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
11155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11157 #define FLD(f) abuf->fields.sfmt_andq.f
11158 int UNUSED written = 0;
11159 IADDR UNUSED pc = abuf->addr;
11160 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11163 SI tmp_tmpd;
11164 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
11166 SI opval = tmp_tmpd;
11167 SET_H_GR (FLD (f_operand2), opval);
11168 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11172 BI opval = LTSI (tmp_tmpd, 0);
11173 CPU (h_nbit) = opval;
11174 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11177 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11178 CPU (h_zbit) = opval;
11179 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11181 SET_H_CBIT_MOVE (0);
11182 SET_H_VBIT_MOVE (0);
11185 BI opval = 0;
11186 CPU (h_xbit) = opval;
11187 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11190 BI opval = 0;
11191 SET_H_INSN_PREFIXED_P (opval);
11192 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11198 #undef FLD
11200 NEXT (vpc);
11202 CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
11204 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11205 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11206 #define FLD(f) abuf->fields.sfmt_muls_b.f
11207 int UNUSED written = 0;
11208 IADDR UNUSED pc = abuf->addr;
11209 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11212 SI tmp_tmpd;
11213 tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
11215 SI opval = tmp_tmpd;
11216 SET_H_GR (FLD (f_operand2), opval);
11217 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11221 BI opval = LTSI (tmp_tmpd, 0);
11222 CPU (h_nbit) = opval;
11223 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11226 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11227 CPU (h_zbit) = opval;
11228 CGEN_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 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11239 BI opval = 0;
11240 SET_H_INSN_PREFIXED_P (opval);
11241 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11247 #undef FLD
11249 NEXT (vpc);
11251 CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
11253 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11254 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11255 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11256 int UNUSED written = 0;
11257 IADDR UNUSED pc = abuf->addr;
11258 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11261 SI tmp_tmps;
11262 SI tmp_tmpd;
11263 tmp_tmps = GET_H_GR (FLD (f_operand1));
11264 tmp_tmpd = ({ SI tmp_tmpcode;
11265 SI tmp_tmpval;
11266 SI tmp_tmpres;
11267 tmp_tmpcode = FLD (f_operand2);
11268 ; tmp_tmpval = tmp_tmps;
11269 ; if (EQSI (tmp_tmpcode, 0)) {
11270 tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
11272 else if (EQSI (tmp_tmpcode, 1)) {
11273 tmp_tmpres = ({ SI tmp_tmpr;
11274 tmp_tmpr = tmp_tmpval;
11275 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11277 else if (EQSI (tmp_tmpcode, 2)) {
11278 tmp_tmpres = ({ SI tmp_tmpb;
11279 tmp_tmpb = tmp_tmpval;
11280 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11282 else if (EQSI (tmp_tmpcode, 3)) {
11283 tmp_tmpres = ({ SI tmp_tmpr;
11284 tmp_tmpr = ({ SI tmp_tmpb;
11285 tmp_tmpb = tmp_tmpval;
11286 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11287 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11289 else if (EQSI (tmp_tmpcode, 4)) {
11290 tmp_tmpres = ({ SI tmp_tmpb;
11291 tmp_tmpb = tmp_tmpval;
11292 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11294 else if (EQSI (tmp_tmpcode, 5)) {
11295 tmp_tmpres = ({ SI tmp_tmpr;
11296 tmp_tmpr = ({ SI tmp_tmpb;
11297 tmp_tmpb = tmp_tmpval;
11298 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11299 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11301 else if (EQSI (tmp_tmpcode, 6)) {
11302 tmp_tmpres = ({ SI tmp_tmpb;
11303 tmp_tmpb = ({ SI tmp_tmpb;
11304 tmp_tmpb = tmp_tmpval;
11305 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11306 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11308 else if (EQSI (tmp_tmpcode, 7)) {
11309 tmp_tmpres = ({ SI tmp_tmpr;
11310 tmp_tmpr = ({ SI tmp_tmpb;
11311 tmp_tmpb = ({ SI tmp_tmpb;
11312 tmp_tmpb = tmp_tmpval;
11313 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11314 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11315 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11317 else if (EQSI (tmp_tmpcode, 8)) {
11318 tmp_tmpres = INVSI (tmp_tmpval);
11320 else if (EQSI (tmp_tmpcode, 9)) {
11321 tmp_tmpres = ({ SI tmp_tmpr;
11322 tmp_tmpr = INVSI (tmp_tmpval);
11323 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11325 else if (EQSI (tmp_tmpcode, 10)) {
11326 tmp_tmpres = ({ SI tmp_tmpb;
11327 tmp_tmpb = INVSI (tmp_tmpval);
11328 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11330 else if (EQSI (tmp_tmpcode, 11)) {
11331 tmp_tmpres = ({ SI tmp_tmpr;
11332 tmp_tmpr = ({ SI tmp_tmpb;
11333 tmp_tmpb = INVSI (tmp_tmpval);
11334 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11335 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11337 else if (EQSI (tmp_tmpcode, 12)) {
11338 tmp_tmpres = ({ SI tmp_tmpb;
11339 tmp_tmpb = INVSI (tmp_tmpval);
11340 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11342 else if (EQSI (tmp_tmpcode, 13)) {
11343 tmp_tmpres = ({ SI tmp_tmpr;
11344 tmp_tmpr = ({ SI tmp_tmpb;
11345 tmp_tmpb = INVSI (tmp_tmpval);
11346 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11347 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11349 else if (EQSI (tmp_tmpcode, 14)) {
11350 tmp_tmpres = ({ SI tmp_tmpb;
11351 tmp_tmpb = ({ SI tmp_tmpb;
11352 tmp_tmpb = INVSI (tmp_tmpval);
11353 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11354 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11356 else if (EQSI (tmp_tmpcode, 15)) {
11357 tmp_tmpres = ({ SI tmp_tmpr;
11358 tmp_tmpr = ({ SI tmp_tmpb;
11359 tmp_tmpb = ({ SI tmp_tmpb;
11360 tmp_tmpb = INVSI (tmp_tmpval);
11361 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11362 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11363 ; ORSI (SLLSI (ANDSI (tmp_tmpr, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr, 0x80808080), 7)))))))); });
11365 ; tmp_tmpres; });
11367 SI opval = tmp_tmpd;
11368 SET_H_GR (FLD (f_operand1), opval);
11369 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11373 BI opval = LTSI (tmp_tmpd, 0);
11374 CPU (h_nbit) = opval;
11375 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11378 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11379 CPU (h_zbit) = opval;
11380 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11382 SET_H_CBIT_MOVE (0);
11383 SET_H_VBIT_MOVE (0);
11386 BI opval = 0;
11387 CPU (h_xbit) = opval;
11388 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11391 BI opval = 0;
11392 SET_H_INSN_PREFIXED_P (opval);
11393 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11399 #undef FLD
11401 NEXT (vpc);
11403 CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
11405 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11406 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11407 #define FLD(f) abuf->fields.sfmt_addc_m.f
11408 int UNUSED written = 0;
11409 IADDR UNUSED pc = abuf->addr;
11410 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11413 QI tmp_tmpd;
11414 SI tmp_cnt1;
11415 SI tmp_cnt2;
11416 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11417 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11418 tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11420 SI tmp_oldregval;
11421 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11423 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11424 SET_H_GR (FLD (f_operand2), opval);
11425 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11430 BI opval = LTQI (tmp_tmpd, 0);
11431 CPU (h_nbit) = opval;
11432 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11435 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11436 CPU (h_zbit) = opval;
11437 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11439 SET_H_CBIT_MOVE (0);
11440 SET_H_VBIT_MOVE (0);
11443 BI opval = 0;
11444 CPU (h_xbit) = opval;
11445 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11448 BI opval = 0;
11449 SET_H_INSN_PREFIXED_P (opval);
11450 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11456 #undef FLD
11458 NEXT (vpc);
11460 CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
11462 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11463 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11464 #define FLD(f) abuf->fields.sfmt_addc_m.f
11465 int UNUSED written = 0;
11466 IADDR UNUSED pc = abuf->addr;
11467 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11470 HI tmp_tmpd;
11471 SI tmp_cnt1;
11472 SI tmp_cnt2;
11473 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11474 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11475 tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11477 SI tmp_oldregval;
11478 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11480 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11481 SET_H_GR (FLD (f_operand2), opval);
11482 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11487 BI opval = LTHI (tmp_tmpd, 0);
11488 CPU (h_nbit) = opval;
11489 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11492 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11493 CPU (h_zbit) = opval;
11494 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11496 SET_H_CBIT_MOVE (0);
11497 SET_H_VBIT_MOVE (0);
11500 BI opval = 0;
11501 CPU (h_xbit) = opval;
11502 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11505 BI opval = 0;
11506 SET_H_INSN_PREFIXED_P (opval);
11507 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11513 #undef FLD
11515 NEXT (vpc);
11517 CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
11519 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11520 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11521 #define FLD(f) abuf->fields.sfmt_addc_m.f
11522 int UNUSED written = 0;
11523 IADDR UNUSED pc = abuf->addr;
11524 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11527 SI tmp_tmpd;
11528 SI tmp_cnt1;
11529 SI tmp_cnt2;
11530 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11531 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11532 tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11534 SI opval = tmp_tmpd;
11535 SET_H_GR (FLD (f_operand2), opval);
11536 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11540 BI opval = LTSI (tmp_tmpd, 0);
11541 CPU (h_nbit) = opval;
11542 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11545 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11546 CPU (h_zbit) = opval;
11547 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11549 SET_H_CBIT_MOVE (0);
11550 SET_H_VBIT_MOVE (0);
11553 BI opval = 0;
11554 CPU (h_xbit) = opval;
11555 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11558 BI opval = 0;
11559 SET_H_INSN_PREFIXED_P (opval);
11560 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11566 #undef FLD
11568 NEXT (vpc);
11570 CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
11572 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11573 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11574 #define FLD(f) abuf->fields.sfmt_asrq.f
11575 int UNUSED written = 0;
11576 IADDR UNUSED pc = abuf->addr;
11577 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11580 SI tmp_tmpd;
11581 tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11583 SI opval = tmp_tmpd;
11584 SET_H_GR (FLD (f_operand2), opval);
11585 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11589 BI opval = LTSI (tmp_tmpd, 0);
11590 CPU (h_nbit) = opval;
11591 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11594 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11595 CPU (h_zbit) = opval;
11596 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11598 SET_H_CBIT_MOVE (0);
11599 SET_H_VBIT_MOVE (0);
11602 BI opval = 0;
11603 CPU (h_xbit) = opval;
11604 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11607 BI opval = 0;
11608 SET_H_INSN_PREFIXED_P (opval);
11609 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11615 #undef FLD
11617 NEXT (vpc);
11619 CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
11621 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11622 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11623 #define FLD(f) abuf->fields.sfmt_addc_m.f
11624 int UNUSED written = 0;
11625 IADDR UNUSED pc = abuf->addr;
11626 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11629 SI tmp_tmpd;
11630 SI tmp_cnt;
11631 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11632 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11634 SI tmp_oldregval;
11635 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11637 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11638 SET_H_GR (FLD (f_operand2), opval);
11639 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11644 BI opval = LTQI (tmp_tmpd, 0);
11645 CPU (h_nbit) = opval;
11646 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11649 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11650 CPU (h_zbit) = opval;
11651 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11653 SET_H_CBIT_MOVE (0);
11654 SET_H_VBIT_MOVE (0);
11657 BI opval = 0;
11658 CPU (h_xbit) = opval;
11659 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11662 BI opval = 0;
11663 SET_H_INSN_PREFIXED_P (opval);
11664 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11670 #undef FLD
11672 NEXT (vpc);
11674 CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $Rs,$Rd */
11676 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11677 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11678 #define FLD(f) abuf->fields.sfmt_addc_m.f
11679 int UNUSED written = 0;
11680 IADDR UNUSED pc = abuf->addr;
11681 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11684 SI tmp_tmpd;
11685 SI tmp_cnt;
11686 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11687 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11689 SI tmp_oldregval;
11690 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11692 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11693 SET_H_GR (FLD (f_operand2), opval);
11694 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11699 BI opval = LTHI (tmp_tmpd, 0);
11700 CPU (h_nbit) = opval;
11701 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11704 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11705 CPU (h_zbit) = opval;
11706 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11708 SET_H_CBIT_MOVE (0);
11709 SET_H_VBIT_MOVE (0);
11712 BI opval = 0;
11713 CPU (h_xbit) = opval;
11714 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11717 BI opval = 0;
11718 SET_H_INSN_PREFIXED_P (opval);
11719 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11725 #undef FLD
11727 NEXT (vpc);
11729 CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
11731 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11732 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11733 #define FLD(f) abuf->fields.sfmt_addc_m.f
11734 int UNUSED written = 0;
11735 IADDR UNUSED pc = abuf->addr;
11736 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11739 SI tmp_tmpd;
11740 SI tmp_cnt;
11741 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11742 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11744 SI opval = tmp_tmpd;
11745 SET_H_GR (FLD (f_operand2), opval);
11746 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11750 BI opval = LTSI (tmp_tmpd, 0);
11751 CPU (h_nbit) = opval;
11752 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11755 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11756 CPU (h_zbit) = opval;
11757 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11759 SET_H_CBIT_MOVE (0);
11760 SET_H_VBIT_MOVE (0);
11763 BI opval = 0;
11764 CPU (h_xbit) = opval;
11765 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11768 BI opval = 0;
11769 SET_H_INSN_PREFIXED_P (opval);
11770 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11776 #undef FLD
11778 NEXT (vpc);
11780 CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
11782 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11783 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11784 #define FLD(f) abuf->fields.sfmt_asrq.f
11785 int UNUSED written = 0;
11786 IADDR UNUSED pc = abuf->addr;
11787 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11790 SI tmp_tmpd;
11791 tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11793 SI opval = tmp_tmpd;
11794 SET_H_GR (FLD (f_operand2), opval);
11795 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11799 BI opval = LTSI (tmp_tmpd, 0);
11800 CPU (h_nbit) = opval;
11801 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11804 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11805 CPU (h_zbit) = opval;
11806 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11808 SET_H_CBIT_MOVE (0);
11809 SET_H_VBIT_MOVE (0);
11812 BI opval = 0;
11813 CPU (h_xbit) = opval;
11814 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11817 BI opval = 0;
11818 SET_H_INSN_PREFIXED_P (opval);
11819 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11825 #undef FLD
11827 NEXT (vpc);
11829 CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
11831 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11832 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11833 #define FLD(f) abuf->fields.sfmt_addc_m.f
11834 int UNUSED written = 0;
11835 IADDR UNUSED pc = abuf->addr;
11836 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11839 SI tmp_tmpd;
11840 SI tmp_cnt;
11841 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11842 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11844 SI tmp_oldregval;
11845 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11847 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11848 SET_H_GR (FLD (f_operand2), opval);
11849 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11854 BI opval = LTQI (tmp_tmpd, 0);
11855 CPU (h_nbit) = opval;
11856 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11859 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11860 CPU (h_zbit) = opval;
11861 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11863 SET_H_CBIT_MOVE (0);
11864 SET_H_VBIT_MOVE (0);
11867 BI opval = 0;
11868 CPU (h_xbit) = opval;
11869 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11872 BI opval = 0;
11873 SET_H_INSN_PREFIXED_P (opval);
11874 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11880 #undef FLD
11882 NEXT (vpc);
11884 CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
11886 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11887 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11888 #define FLD(f) abuf->fields.sfmt_addc_m.f
11889 int UNUSED written = 0;
11890 IADDR UNUSED pc = abuf->addr;
11891 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11894 SI tmp_tmpd;
11895 SI tmp_cnt;
11896 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11897 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11899 SI tmp_oldregval;
11900 tmp_oldregval = GET_H_RAW_GR_ACR (FLD (f_operand2));
11902 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11903 SET_H_GR (FLD (f_operand2), opval);
11904 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11909 BI opval = LTHI (tmp_tmpd, 0);
11910 CPU (h_nbit) = opval;
11911 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11914 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11915 CPU (h_zbit) = opval;
11916 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11918 SET_H_CBIT_MOVE (0);
11919 SET_H_VBIT_MOVE (0);
11922 BI opval = 0;
11923 CPU (h_xbit) = opval;
11924 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11927 BI opval = 0;
11928 SET_H_INSN_PREFIXED_P (opval);
11929 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11935 #undef FLD
11937 NEXT (vpc);
11939 CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
11941 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11942 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11943 #define FLD(f) abuf->fields.sfmt_addc_m.f
11944 int UNUSED written = 0;
11945 IADDR UNUSED pc = abuf->addr;
11946 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11949 SI tmp_tmpd;
11950 SI tmp_cnt;
11951 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11952 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11954 SI opval = tmp_tmpd;
11955 SET_H_GR (FLD (f_operand2), opval);
11956 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11960 BI opval = LTSI (tmp_tmpd, 0);
11961 CPU (h_nbit) = opval;
11962 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11965 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11966 CPU (h_zbit) = opval;
11967 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11969 SET_H_CBIT_MOVE (0);
11970 SET_H_VBIT_MOVE (0);
11973 BI opval = 0;
11974 CPU (h_xbit) = opval;
11975 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11978 BI opval = 0;
11979 SET_H_INSN_PREFIXED_P (opval);
11980 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11986 #undef FLD
11988 NEXT (vpc);
11990 CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
11992 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11993 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11994 #define FLD(f) abuf->fields.sfmt_asrq.f
11995 int UNUSED written = 0;
11996 IADDR UNUSED pc = abuf->addr;
11997 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12000 SI tmp_tmpd;
12001 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
12003 SI opval = tmp_tmpd;
12004 SET_H_GR (FLD (f_operand2), opval);
12005 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12009 BI opval = LTSI (tmp_tmpd, 0);
12010 CPU (h_nbit) = opval;
12011 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12014 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12015 CPU (h_zbit) = opval;
12016 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12018 SET_H_CBIT_MOVE (0);
12019 SET_H_VBIT_MOVE (0);
12022 BI opval = 0;
12023 CPU (h_xbit) = opval;
12024 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12027 BI opval = 0;
12028 SET_H_INSN_PREFIXED_P (opval);
12029 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12035 #undef FLD
12037 NEXT (vpc);
12039 CASE (sem, INSN_BTST) : /* $Rs,$Rd */
12041 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12042 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12043 #define FLD(f) abuf->fields.sfmt_muls_b.f
12044 int UNUSED written = 0;
12045 IADDR UNUSED pc = abuf->addr;
12046 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12049 SI tmp_tmpd;
12050 SI tmp_cnt;
12051 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
12054 BI opval = LTSI (tmp_tmpd, 0);
12055 CPU (h_nbit) = opval;
12056 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12059 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12060 CPU (h_zbit) = opval;
12061 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12063 SET_H_CBIT_MOVE (0);
12064 SET_H_VBIT_MOVE (0);
12067 BI opval = 0;
12068 CPU (h_xbit) = opval;
12069 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12072 BI opval = 0;
12073 SET_H_INSN_PREFIXED_P (opval);
12074 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12080 #undef FLD
12082 NEXT (vpc);
12084 CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
12086 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12087 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12088 #define FLD(f) abuf->fields.sfmt_asrq.f
12089 int UNUSED written = 0;
12090 IADDR UNUSED pc = abuf->addr;
12091 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12094 SI tmp_tmpd;
12095 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
12098 BI opval = LTSI (tmp_tmpd, 0);
12099 CPU (h_nbit) = opval;
12100 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12103 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12104 CPU (h_zbit) = opval;
12105 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12107 SET_H_CBIT_MOVE (0);
12108 SET_H_VBIT_MOVE (0);
12111 BI opval = 0;
12112 CPU (h_xbit) = opval;
12113 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12116 BI opval = 0;
12117 SET_H_INSN_PREFIXED_P (opval);
12118 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12124 #undef FLD
12126 NEXT (vpc);
12128 CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
12130 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12131 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12132 #define FLD(f) abuf->fields.sfmt_setf.f
12133 int UNUSED written = 0;
12134 IADDR UNUSED pc = abuf->addr;
12135 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12138 SI tmp_tmp;
12139 tmp_tmp = FLD (f_dstsrc);
12140 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
12142 BI opval = 1;
12143 CPU (h_cbit) = opval;
12144 written |= (1 << 1);
12145 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
12148 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
12150 BI opval = 1;
12151 CPU (h_vbit) = opval;
12152 written |= (1 << 7);
12153 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
12156 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
12158 BI opval = 1;
12159 CPU (h_zbit) = opval;
12160 written |= (1 << 9);
12161 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12164 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
12166 BI opval = 1;
12167 CPU (h_nbit) = opval;
12168 written |= (1 << 3);
12169 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12172 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12174 BI opval = 1;
12175 CPU (h_xbit) = opval;
12176 written |= (1 << 8);
12177 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12180 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12182 BI opval = 1;
12183 SET_H_IBIT (opval);
12184 written |= (1 << 2);
12185 CGEN_TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12188 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12190 BI opval = 1;
12191 SET_H_UBIT (opval);
12192 written |= (1 << 6);
12193 CGEN_TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12196 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12198 BI opval = 1;
12199 CPU (h_pbit) = opval;
12200 written |= (1 << 4);
12201 CGEN_TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12205 BI opval = 0;
12206 SET_H_INSN_PREFIXED_P (opval);
12207 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12209 if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12211 BI opval = 0;
12212 CPU (h_xbit) = opval;
12213 written |= (1 << 8);
12214 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12219 abuf->written = written;
12220 #undef FLD
12222 NEXT (vpc);
12224 CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
12226 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12227 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12228 #define FLD(f) abuf->fields.sfmt_setf.f
12229 int UNUSED written = 0;
12230 IADDR UNUSED pc = abuf->addr;
12231 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12234 SI tmp_tmp;
12235 tmp_tmp = FLD (f_dstsrc);
12236 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
12238 BI opval = 0;
12239 CPU (h_cbit) = opval;
12240 written |= (1 << 1);
12241 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
12244 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
12246 BI opval = 0;
12247 CPU (h_vbit) = opval;
12248 written |= (1 << 7);
12249 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
12252 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
12254 BI opval = 0;
12255 CPU (h_zbit) = opval;
12256 written |= (1 << 9);
12257 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12260 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
12262 BI opval = 0;
12263 CPU (h_nbit) = opval;
12264 written |= (1 << 3);
12265 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12268 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12270 BI opval = 0;
12271 CPU (h_xbit) = opval;
12272 written |= (1 << 8);
12273 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12276 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12278 BI opval = 0;
12279 SET_H_IBIT (opval);
12280 written |= (1 << 2);
12281 CGEN_TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12284 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12286 BI opval = 0;
12287 SET_H_UBIT (opval);
12288 written |= (1 << 6);
12289 CGEN_TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12292 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12294 BI opval = 0;
12295 CPU (h_pbit) = opval;
12296 written |= (1 << 4);
12297 CGEN_TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12302 BI opval = 0;
12303 CPU (h_xbit) = opval;
12304 written |= (1 << 8);
12305 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12308 BI opval = 0;
12309 SET_H_INSN_PREFIXED_P (opval);
12310 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12315 abuf->written = written;
12316 #undef FLD
12318 NEXT (vpc);
12320 CASE (sem, INSN_RFE) : /* rfe */
12322 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12323 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12324 #define FLD(f) abuf->fields.sfmt_rfe.f
12325 int UNUSED written = 0;
12326 IADDR UNUSED pc = abuf->addr;
12327 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12330 USI tmp_oldccs;
12331 USI tmp_samebits;
12332 USI tmp_shiftbits;
12333 USI tmp_keepmask;
12334 BI tmp_p1;
12335 tmp_oldccs = GET_H_SR (((UINT) 13));
12336 tmp_keepmask = 0xc0000000;
12337 tmp_samebits = ANDSI (tmp_oldccs, tmp_keepmask);
12338 tmp_shiftbits = ANDSI (SRLSI (ANDSI (tmp_oldccs, 1073609728), 10), INVSI (tmp_keepmask));
12339 tmp_p1 = NESI (0, ANDSI (tmp_oldccs, 131072));
12341 SI opval = ORSI (ORSI (tmp_samebits, tmp_shiftbits), ((ANDBI (CPU (h_rbit), NOTBI (tmp_p1))) ? (0) : (128)));
12342 SET_H_SR (((UINT) 13), opval);
12343 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12347 #undef FLD
12349 NEXT (vpc);
12351 CASE (sem, INSN_SFE) : /* sfe */
12353 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12354 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12355 #define FLD(f) abuf->fields.sfmt_rfe.f
12356 int UNUSED written = 0;
12357 IADDR UNUSED pc = abuf->addr;
12358 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12361 SI tmp_oldccs;
12362 SI tmp_savemask;
12363 tmp_savemask = 0xc0000000;
12364 tmp_oldccs = GET_H_SR (((UINT) 13));
12366 SI opval = ORSI (ANDSI (tmp_savemask, tmp_oldccs), ANDSI (INVSI (tmp_savemask), SLLSI (tmp_oldccs, 10)));
12367 SET_H_SR (((UINT) 13), opval);
12368 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12372 #undef FLD
12374 NEXT (vpc);
12376 CASE (sem, INSN_RFG) : /* rfg */
12378 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12379 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12380 #define FLD(f) abuf->fields.sfmt_empty.f
12381 int UNUSED written = 0;
12382 IADDR UNUSED pc = abuf->addr;
12383 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12385 crisv32f_rfg_handler (current_cpu, pc);
12387 #undef FLD
12389 NEXT (vpc);
12391 CASE (sem, INSN_RFN) : /* rfn */
12393 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12394 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12395 #define FLD(f) abuf->fields.sfmt_rfe.f
12396 int UNUSED written = 0;
12397 IADDR UNUSED pc = abuf->addr;
12398 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12402 USI tmp_oldccs;
12403 USI tmp_samebits;
12404 USI tmp_shiftbits;
12405 USI tmp_keepmask;
12406 BI tmp_p1;
12407 tmp_oldccs = GET_H_SR (((UINT) 13));
12408 tmp_keepmask = 0xc0000000;
12409 tmp_samebits = ANDSI (tmp_oldccs, tmp_keepmask);
12410 tmp_shiftbits = ANDSI (SRLSI (ANDSI (tmp_oldccs, 1073609728), 10), INVSI (tmp_keepmask));
12411 tmp_p1 = NESI (0, ANDSI (tmp_oldccs, 131072));
12413 SI opval = ORSI (ORSI (tmp_samebits, tmp_shiftbits), ((ANDBI (CPU (h_rbit), NOTBI (tmp_p1))) ? (0) : (128)));
12414 SET_H_SR (((UINT) 13), opval);
12415 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12419 BI opval = 1;
12420 SET_H_MBIT (opval);
12421 CGEN_TRACE_RESULT (current_cpu, abuf, "mbit", 'x', opval);
12425 #undef FLD
12427 NEXT (vpc);
12429 CASE (sem, INSN_HALT) : /* halt */
12431 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12432 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12433 #define FLD(f) abuf->fields.sfmt_empty.f
12434 int UNUSED written = 0;
12435 IADDR UNUSED pc = abuf->addr;
12436 SEM_BRANCH_INIT
12437 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12440 USI opval = crisv32f_halt_handler (current_cpu, pc);
12441 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12442 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12445 SEM_BRANCH_FINI (vpc);
12446 #undef FLD
12448 NEXT (vpc);
12450 CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
12452 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12453 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12454 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12455 int UNUSED written = 0;
12456 IADDR UNUSED pc = abuf->addr;
12457 SEM_BRANCH_INIT
12458 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12461 BI tmp_truthval;
12462 tmp_truthval = ({ SI tmp_tmpcond;
12463 BI tmp_condres;
12464 tmp_tmpcond = FLD (f_operand2);
12465 ; if (EQSI (tmp_tmpcond, 0)) {
12466 tmp_condres = NOTBI (CPU (h_cbit));
12468 else if (EQSI (tmp_tmpcond, 1)) {
12469 tmp_condres = CPU (h_cbit);
12471 else if (EQSI (tmp_tmpcond, 2)) {
12472 tmp_condres = NOTBI (CPU (h_zbit));
12474 else if (EQSI (tmp_tmpcond, 3)) {
12475 tmp_condres = CPU (h_zbit);
12477 else if (EQSI (tmp_tmpcond, 4)) {
12478 tmp_condres = NOTBI (CPU (h_vbit));
12480 else if (EQSI (tmp_tmpcond, 5)) {
12481 tmp_condres = CPU (h_vbit);
12483 else if (EQSI (tmp_tmpcond, 6)) {
12484 tmp_condres = NOTBI (CPU (h_nbit));
12486 else if (EQSI (tmp_tmpcond, 7)) {
12487 tmp_condres = CPU (h_nbit);
12489 else if (EQSI (tmp_tmpcond, 8)) {
12490 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12492 else if (EQSI (tmp_tmpcond, 9)) {
12493 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12495 else if (EQSI (tmp_tmpcond, 10)) {
12496 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12498 else if (EQSI (tmp_tmpcond, 11)) {
12499 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12501 else if (EQSI (tmp_tmpcond, 12)) {
12502 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12504 else if (EQSI (tmp_tmpcond, 13)) {
12505 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12507 else if (EQSI (tmp_tmpcond, 14)) {
12508 tmp_condres = 1;
12510 else if (EQSI (tmp_tmpcond, 15)) {
12511 tmp_condres = CPU (h_pbit);
12513 ; tmp_condres; });
12514 crisv32f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
12517 BI opval = 0;
12518 CPU (h_xbit) = opval;
12519 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12522 BI opval = 0;
12523 SET_H_INSN_PREFIXED_P (opval);
12524 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12527 if (tmp_truthval) {
12530 USI opval = FLD (i_o_pcrel);
12531 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12532 written |= (1 << 8);
12533 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12539 abuf->written = written;
12540 SEM_BRANCH_FINI (vpc);
12541 #undef FLD
12543 NEXT (vpc);
12545 CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
12547 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12548 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12549 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12550 int UNUSED written = 0;
12551 IADDR UNUSED pc = abuf->addr;
12552 SEM_BRANCH_INIT
12553 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12558 BI opval = 0;
12559 CPU (h_xbit) = opval;
12560 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12563 BI opval = 0;
12564 SET_H_INSN_PREFIXED_P (opval);
12565 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12570 USI opval = FLD (i_o_pcrel);
12571 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12572 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12577 SEM_BRANCH_FINI (vpc);
12578 #undef FLD
12580 NEXT (vpc);
12582 CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
12584 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12585 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12586 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12587 int UNUSED written = 0;
12588 IADDR UNUSED pc = abuf->addr;
12589 SEM_BRANCH_INIT
12590 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12593 BI tmp_truthval;
12594 tmp_truthval = ({ SI tmp_tmpcond;
12595 BI tmp_condres;
12596 tmp_tmpcond = FLD (f_operand2);
12597 ; if (EQSI (tmp_tmpcond, 0)) {
12598 tmp_condres = NOTBI (CPU (h_cbit));
12600 else if (EQSI (tmp_tmpcond, 1)) {
12601 tmp_condres = CPU (h_cbit);
12603 else if (EQSI (tmp_tmpcond, 2)) {
12604 tmp_condres = NOTBI (CPU (h_zbit));
12606 else if (EQSI (tmp_tmpcond, 3)) {
12607 tmp_condres = CPU (h_zbit);
12609 else if (EQSI (tmp_tmpcond, 4)) {
12610 tmp_condres = NOTBI (CPU (h_vbit));
12612 else if (EQSI (tmp_tmpcond, 5)) {
12613 tmp_condres = CPU (h_vbit);
12615 else if (EQSI (tmp_tmpcond, 6)) {
12616 tmp_condres = NOTBI (CPU (h_nbit));
12618 else if (EQSI (tmp_tmpcond, 7)) {
12619 tmp_condres = CPU (h_nbit);
12621 else if (EQSI (tmp_tmpcond, 8)) {
12622 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12624 else if (EQSI (tmp_tmpcond, 9)) {
12625 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12627 else if (EQSI (tmp_tmpcond, 10)) {
12628 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12630 else if (EQSI (tmp_tmpcond, 11)) {
12631 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12633 else if (EQSI (tmp_tmpcond, 12)) {
12634 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12636 else if (EQSI (tmp_tmpcond, 13)) {
12637 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12639 else if (EQSI (tmp_tmpcond, 14)) {
12640 tmp_condres = 1;
12642 else if (EQSI (tmp_tmpcond, 15)) {
12643 tmp_condres = CPU (h_pbit);
12645 ; tmp_condres; });
12646 crisv32f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
12649 BI opval = 0;
12650 CPU (h_xbit) = opval;
12651 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12654 BI opval = 0;
12655 SET_H_INSN_PREFIXED_P (opval);
12656 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12659 if (tmp_truthval) {
12662 USI opval = FLD (i_o_word_pcrel);
12663 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12664 written |= (1 << 8);
12665 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12671 abuf->written = written;
12672 SEM_BRANCH_FINI (vpc);
12673 #undef FLD
12675 NEXT (vpc);
12677 CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
12679 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12680 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12681 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12682 int UNUSED written = 0;
12683 IADDR UNUSED pc = abuf->addr;
12684 SEM_BRANCH_INIT
12685 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12690 BI opval = 0;
12691 CPU (h_xbit) = opval;
12692 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12695 BI opval = 0;
12696 SET_H_INSN_PREFIXED_P (opval);
12697 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12702 USI opval = FLD (i_o_word_pcrel);
12703 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12704 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12709 SEM_BRANCH_FINI (vpc);
12710 #undef FLD
12712 NEXT (vpc);
12714 CASE (sem, INSN_JAS_R) : /* jas ${Rs},${Pd} */
12716 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12717 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12718 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12719 int UNUSED written = 0;
12720 IADDR UNUSED pc = abuf->addr;
12721 SEM_BRANCH_INIT
12722 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12727 BI opval = 0;
12728 CPU (h_xbit) = opval;
12729 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12732 BI opval = 0;
12733 SET_H_INSN_PREFIXED_P (opval);
12734 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12737 if (ANDIF (EQSI (FLD (f_operand1), 1), EQSI (FLD (f_operand2), 11))) {
12738 cris_flush_simulator_decode_cache (current_cpu, pc);
12743 SI opval = ADDSI (pc, 4);
12744 SET_H_SR (FLD (f_operand2), opval);
12745 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12748 USI opval = GET_H_GR (FLD (f_operand1));
12749 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12750 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12756 SEM_BRANCH_FINI (vpc);
12757 #undef FLD
12759 NEXT (vpc);
12761 CASE (sem, INSN_JAS_C) : /* jas ${const32},${Pd} */
12763 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12764 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12765 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12766 int UNUSED written = 0;
12767 IADDR UNUSED pc = abuf->addr;
12768 SEM_BRANCH_INIT
12769 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12774 BI opval = 0;
12775 CPU (h_xbit) = opval;
12776 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12779 BI opval = 0;
12780 SET_H_INSN_PREFIXED_P (opval);
12781 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12787 SI opval = ADDSI (pc, 8);
12788 SET_H_SR (FLD (f_operand2), opval);
12789 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12792 USI opval = FLD (f_indir_pc__dword);
12793 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12794 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12800 SEM_BRANCH_FINI (vpc);
12801 #undef FLD
12803 NEXT (vpc);
12805 CASE (sem, INSN_JUMP_P) : /* jump ${Ps} */
12807 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12808 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12809 #define FLD(f) abuf->fields.sfmt_mcp.f
12810 int UNUSED written = 0;
12811 IADDR UNUSED pc = abuf->addr;
12812 SEM_BRANCH_INIT
12813 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12818 BI opval = 0;
12819 CPU (h_xbit) = opval;
12820 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12823 BI opval = 0;
12824 SET_H_INSN_PREFIXED_P (opval);
12825 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12830 USI opval = GET_H_SR (FLD (f_operand2));
12831 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12832 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12837 SEM_BRANCH_FINI (vpc);
12838 #undef FLD
12840 NEXT (vpc);
12842 CASE (sem, INSN_BAS_C) : /* bas ${const32},${Pd} */
12844 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12845 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12846 #define FLD(f) abuf->fields.sfmt_bas_c.f
12847 int UNUSED written = 0;
12848 IADDR UNUSED pc = abuf->addr;
12849 SEM_BRANCH_INIT
12850 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12855 BI opval = 0;
12856 CPU (h_xbit) = opval;
12857 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12860 BI opval = 0;
12861 SET_H_INSN_PREFIXED_P (opval);
12862 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12868 SI opval = ADDSI (pc, 8);
12869 SET_H_SR (FLD (f_operand2), opval);
12870 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12873 USI opval = FLD (i_const32_pcrel);
12874 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12875 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12881 SEM_BRANCH_FINI (vpc);
12882 #undef FLD
12884 NEXT (vpc);
12886 CASE (sem, INSN_JASC_R) : /* jasc ${Rs},${Pd} */
12888 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12890 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12891 int UNUSED written = 0;
12892 IADDR UNUSED pc = abuf->addr;
12893 SEM_BRANCH_INIT
12894 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12899 BI opval = 0;
12900 CPU (h_xbit) = opval;
12901 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12904 BI opval = 0;
12905 SET_H_INSN_PREFIXED_P (opval);
12906 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12912 SI opval = ADDSI (pc, 8);
12913 SET_H_SR (FLD (f_operand2), opval);
12914 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12917 USI opval = GET_H_GR (FLD (f_operand1));
12918 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12919 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12925 SEM_BRANCH_FINI (vpc);
12926 #undef FLD
12928 NEXT (vpc);
12930 CASE (sem, INSN_JASC_C) : /* jasc ${const32},${Pd} */
12932 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12933 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12934 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12935 int UNUSED written = 0;
12936 IADDR UNUSED pc = abuf->addr;
12937 SEM_BRANCH_INIT
12938 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12943 BI opval = 0;
12944 CPU (h_xbit) = opval;
12945 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12948 BI opval = 0;
12949 SET_H_INSN_PREFIXED_P (opval);
12950 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12956 SI opval = ADDSI (pc, 12);
12957 SET_H_SR (FLD (f_operand2), opval);
12958 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12961 USI opval = FLD (f_indir_pc__dword);
12962 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12963 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12969 SEM_BRANCH_FINI (vpc);
12970 #undef FLD
12972 NEXT (vpc);
12974 CASE (sem, INSN_BASC_C) : /* basc ${const32},${Pd} */
12976 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12977 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12978 #define FLD(f) abuf->fields.sfmt_bas_c.f
12979 int UNUSED written = 0;
12980 IADDR UNUSED pc = abuf->addr;
12981 SEM_BRANCH_INIT
12982 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12987 BI opval = 0;
12988 CPU (h_xbit) = opval;
12989 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12992 BI opval = 0;
12993 SET_H_INSN_PREFIXED_P (opval);
12994 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13000 SI opval = ADDSI (pc, 12);
13001 SET_H_SR (FLD (f_operand2), opval);
13002 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
13005 USI opval = FLD (i_const32_pcrel);
13006 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13007 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13013 SEM_BRANCH_FINI (vpc);
13014 #undef FLD
13016 NEXT (vpc);
13018 CASE (sem, INSN_BREAK) : /* break $n */
13020 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13021 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13022 #define FLD(f) abuf->fields.sfmt_break.f
13023 int UNUSED written = 0;
13024 IADDR UNUSED pc = abuf->addr;
13025 SEM_BRANCH_INIT
13026 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13031 BI opval = 0;
13032 CPU (h_xbit) = opval;
13033 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13036 BI opval = 0;
13037 SET_H_INSN_PREFIXED_P (opval);
13038 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13042 USI opval = crisv32f_break_handler (current_cpu, FLD (f_u4), pc);
13043 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13044 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13048 SEM_BRANCH_FINI (vpc);
13049 #undef FLD
13051 NEXT (vpc);
13053 CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
13055 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13056 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13057 #define FLD(f) abuf->fields.sfmt_muls_b.f
13058 int UNUSED written = 0;
13059 IADDR UNUSED pc = abuf->addr;
13060 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13063 SI tmp_tmpopd;
13064 SI tmp_tmpops;
13065 SI tmp_newval;
13066 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
13067 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13068 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13070 SI opval = tmp_newval;
13071 SET_H_GR (FLD (f_operand2), opval);
13072 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13076 BI opval = LTSI (tmp_newval, 0);
13077 CPU (h_nbit) = opval;
13078 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13081 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13082 CPU (h_zbit) = opval;
13083 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13085 SET_H_CBIT_MOVE (0);
13086 SET_H_VBIT_MOVE (0);
13089 BI opval = 0;
13090 CPU (h_xbit) = opval;
13091 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13094 BI opval = 0;
13095 SET_H_INSN_PREFIXED_P (opval);
13096 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13102 #undef FLD
13104 NEXT (vpc);
13106 CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
13108 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13109 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13110 #define FLD(f) abuf->fields.sfmt_muls_b.f
13111 int UNUSED written = 0;
13112 IADDR UNUSED pc = abuf->addr;
13113 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13116 SI tmp_tmpopd;
13117 SI tmp_tmpops;
13118 SI tmp_newval;
13119 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
13120 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13121 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13123 SI opval = tmp_newval;
13124 SET_H_GR (FLD (f_operand2), opval);
13125 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13129 BI opval = LTSI (tmp_newval, 0);
13130 CPU (h_nbit) = opval;
13131 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13134 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13135 CPU (h_zbit) = opval;
13136 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13138 SET_H_CBIT_MOVE (0);
13139 SET_H_VBIT_MOVE (0);
13142 BI opval = 0;
13143 CPU (h_xbit) = opval;
13144 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13147 BI opval = 0;
13148 SET_H_INSN_PREFIXED_P (opval);
13149 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13155 #undef FLD
13157 NEXT (vpc);
13159 CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
13161 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13162 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13163 #define FLD(f) abuf->fields.sfmt_muls_b.f
13164 int UNUSED written = 0;
13165 IADDR UNUSED pc = abuf->addr;
13166 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13169 SI tmp_tmpopd;
13170 SI tmp_tmpops;
13171 SI tmp_newval;
13172 tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
13173 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13174 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13176 SI opval = tmp_newval;
13177 SET_H_GR (FLD (f_operand2), opval);
13178 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13182 BI opval = LTSI (tmp_newval, 0);
13183 CPU (h_nbit) = opval;
13184 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13187 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13188 CPU (h_zbit) = opval;
13189 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13191 SET_H_CBIT_MOVE (0);
13192 SET_H_VBIT_MOVE (0);
13195 BI opval = 0;
13196 CPU (h_xbit) = opval;
13197 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13200 BI opval = 0;
13201 SET_H_INSN_PREFIXED_P (opval);
13202 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13208 #undef FLD
13210 NEXT (vpc);
13212 CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
13214 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13215 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13216 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13217 int UNUSED written = 0;
13218 IADDR UNUSED pc = abuf->addr;
13219 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13222 SI tmp_tmpopd;
13223 SI tmp_tmpops;
13224 SI tmp_newval;
13225 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
13226 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13227 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13229 SI opval = tmp_newval;
13230 SET_H_GR (FLD (f_operand2), opval);
13231 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13235 BI opval = LTSI (tmp_newval, 0);
13236 CPU (h_nbit) = opval;
13237 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13240 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13241 CPU (h_zbit) = opval;
13242 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13244 SET_H_CBIT_MOVE (0);
13245 SET_H_VBIT_MOVE (0);
13248 BI opval = 0;
13249 CPU (h_xbit) = opval;
13250 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13253 BI opval = 0;
13254 SET_H_INSN_PREFIXED_P (opval);
13255 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13261 #undef FLD
13263 NEXT (vpc);
13265 CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
13267 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13268 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13269 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13270 int UNUSED written = 0;
13271 IADDR UNUSED pc = abuf->addr;
13272 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13275 SI tmp_tmpopd;
13276 SI tmp_tmpops;
13277 SI tmp_newval;
13278 tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
13279 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13280 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13282 SI opval = tmp_newval;
13283 SET_H_GR (FLD (f_operand2), opval);
13284 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13288 BI opval = LTSI (tmp_newval, 0);
13289 CPU (h_nbit) = opval;
13290 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13293 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13294 CPU (h_zbit) = opval;
13295 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13297 SET_H_CBIT_MOVE (0);
13298 SET_H_VBIT_MOVE (0);
13301 BI opval = 0;
13302 CPU (h_xbit) = opval;
13303 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13306 BI opval = 0;
13307 SET_H_INSN_PREFIXED_P (opval);
13308 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13314 #undef FLD
13316 NEXT (vpc);
13318 CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
13320 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13321 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13322 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13323 int UNUSED written = 0;
13324 IADDR UNUSED pc = abuf->addr;
13325 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13328 SI tmp_tmpopd;
13329 SI tmp_tmpops;
13330 SI tmp_newval;
13331 tmp_tmpops = FLD (f_indir_pc__dword);
13332 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13333 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13335 SI opval = tmp_newval;
13336 SET_H_GR (FLD (f_operand2), opval);
13337 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13341 BI opval = LTSI (tmp_newval, 0);
13342 CPU (h_nbit) = opval;
13343 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13346 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13347 CPU (h_zbit) = opval;
13348 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13350 SET_H_CBIT_MOVE (0);
13351 SET_H_VBIT_MOVE (0);
13354 BI opval = 0;
13355 CPU (h_xbit) = opval;
13356 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13359 BI opval = 0;
13360 SET_H_INSN_PREFIXED_P (opval);
13361 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13367 #undef FLD
13369 NEXT (vpc);
13371 CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
13373 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13374 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13375 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13376 int UNUSED written = 0;
13377 IADDR UNUSED pc = abuf->addr;
13378 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13381 BI tmp_truthval;
13382 tmp_truthval = ({ SI tmp_tmpcond;
13383 BI tmp_condres;
13384 tmp_tmpcond = FLD (f_operand2);
13385 ; if (EQSI (tmp_tmpcond, 0)) {
13386 tmp_condres = NOTBI (CPU (h_cbit));
13388 else if (EQSI (tmp_tmpcond, 1)) {
13389 tmp_condres = CPU (h_cbit);
13391 else if (EQSI (tmp_tmpcond, 2)) {
13392 tmp_condres = NOTBI (CPU (h_zbit));
13394 else if (EQSI (tmp_tmpcond, 3)) {
13395 tmp_condres = CPU (h_zbit);
13397 else if (EQSI (tmp_tmpcond, 4)) {
13398 tmp_condres = NOTBI (CPU (h_vbit));
13400 else if (EQSI (tmp_tmpcond, 5)) {
13401 tmp_condres = CPU (h_vbit);
13403 else if (EQSI (tmp_tmpcond, 6)) {
13404 tmp_condres = NOTBI (CPU (h_nbit));
13406 else if (EQSI (tmp_tmpcond, 7)) {
13407 tmp_condres = CPU (h_nbit);
13409 else if (EQSI (tmp_tmpcond, 8)) {
13410 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
13412 else if (EQSI (tmp_tmpcond, 9)) {
13413 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
13415 else if (EQSI (tmp_tmpcond, 10)) {
13416 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
13418 else if (EQSI (tmp_tmpcond, 11)) {
13419 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
13421 else if (EQSI (tmp_tmpcond, 12)) {
13422 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
13424 else if (EQSI (tmp_tmpcond, 13)) {
13425 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
13427 else if (EQSI (tmp_tmpcond, 14)) {
13428 tmp_condres = 1;
13430 else if (EQSI (tmp_tmpcond, 15)) {
13431 tmp_condres = CPU (h_pbit);
13433 ; tmp_condres; });
13435 SI opval = ZEXTBISI (tmp_truthval);
13436 SET_H_GR (FLD (f_operand1), opval);
13437 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13441 BI opval = 0;
13442 CPU (h_xbit) = opval;
13443 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13446 BI opval = 0;
13447 SET_H_INSN_PREFIXED_P (opval);
13448 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13453 #undef FLD
13455 NEXT (vpc);
13457 CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
13459 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13460 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13461 #define FLD(f) abuf->fields.sfmt_muls_b.f
13462 int UNUSED written = 0;
13463 IADDR UNUSED pc = abuf->addr;
13464 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13467 SI tmp_tmpd;
13468 SI tmp_tmp;
13469 tmp_tmp = GET_H_GR (FLD (f_operand1));
13470 tmp_tmpd = 0;
13472 if (GESI (tmp_tmp, 0)) {
13474 tmp_tmp = SLLSI (tmp_tmp, 1);
13475 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13478 if (GESI (tmp_tmp, 0)) {
13480 tmp_tmp = SLLSI (tmp_tmp, 1);
13481 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13484 if (GESI (tmp_tmp, 0)) {
13486 tmp_tmp = SLLSI (tmp_tmp, 1);
13487 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13490 if (GESI (tmp_tmp, 0)) {
13492 tmp_tmp = SLLSI (tmp_tmp, 1);
13493 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13496 if (GESI (tmp_tmp, 0)) {
13498 tmp_tmp = SLLSI (tmp_tmp, 1);
13499 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13502 if (GESI (tmp_tmp, 0)) {
13504 tmp_tmp = SLLSI (tmp_tmp, 1);
13505 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13508 if (GESI (tmp_tmp, 0)) {
13510 tmp_tmp = SLLSI (tmp_tmp, 1);
13511 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13514 if (GESI (tmp_tmp, 0)) {
13516 tmp_tmp = SLLSI (tmp_tmp, 1);
13517 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13520 if (GESI (tmp_tmp, 0)) {
13522 tmp_tmp = SLLSI (tmp_tmp, 1);
13523 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13526 if (GESI (tmp_tmp, 0)) {
13528 tmp_tmp = SLLSI (tmp_tmp, 1);
13529 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13532 if (GESI (tmp_tmp, 0)) {
13534 tmp_tmp = SLLSI (tmp_tmp, 1);
13535 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13538 if (GESI (tmp_tmp, 0)) {
13540 tmp_tmp = SLLSI (tmp_tmp, 1);
13541 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13544 if (GESI (tmp_tmp, 0)) {
13546 tmp_tmp = SLLSI (tmp_tmp, 1);
13547 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13550 if (GESI (tmp_tmp, 0)) {
13552 tmp_tmp = SLLSI (tmp_tmp, 1);
13553 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13556 if (GESI (tmp_tmp, 0)) {
13558 tmp_tmp = SLLSI (tmp_tmp, 1);
13559 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13562 if (GESI (tmp_tmp, 0)) {
13564 tmp_tmp = SLLSI (tmp_tmp, 1);
13565 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13568 if (GESI (tmp_tmp, 0)) {
13570 tmp_tmp = SLLSI (tmp_tmp, 1);
13571 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13574 if (GESI (tmp_tmp, 0)) {
13576 tmp_tmp = SLLSI (tmp_tmp, 1);
13577 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13580 if (GESI (tmp_tmp, 0)) {
13582 tmp_tmp = SLLSI (tmp_tmp, 1);
13583 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13586 if (GESI (tmp_tmp, 0)) {
13588 tmp_tmp = SLLSI (tmp_tmp, 1);
13589 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13592 if (GESI (tmp_tmp, 0)) {
13594 tmp_tmp = SLLSI (tmp_tmp, 1);
13595 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13598 if (GESI (tmp_tmp, 0)) {
13600 tmp_tmp = SLLSI (tmp_tmp, 1);
13601 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13604 if (GESI (tmp_tmp, 0)) {
13606 tmp_tmp = SLLSI (tmp_tmp, 1);
13607 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13610 if (GESI (tmp_tmp, 0)) {
13612 tmp_tmp = SLLSI (tmp_tmp, 1);
13613 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13616 if (GESI (tmp_tmp, 0)) {
13618 tmp_tmp = SLLSI (tmp_tmp, 1);
13619 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13622 if (GESI (tmp_tmp, 0)) {
13624 tmp_tmp = SLLSI (tmp_tmp, 1);
13625 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13628 if (GESI (tmp_tmp, 0)) {
13630 tmp_tmp = SLLSI (tmp_tmp, 1);
13631 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13634 if (GESI (tmp_tmp, 0)) {
13636 tmp_tmp = SLLSI (tmp_tmp, 1);
13637 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13640 if (GESI (tmp_tmp, 0)) {
13642 tmp_tmp = SLLSI (tmp_tmp, 1);
13643 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13646 if (GESI (tmp_tmp, 0)) {
13648 tmp_tmp = SLLSI (tmp_tmp, 1);
13649 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13652 if (GESI (tmp_tmp, 0)) {
13654 tmp_tmp = SLLSI (tmp_tmp, 1);
13655 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13658 if (GESI (tmp_tmp, 0)) {
13660 tmp_tmp = SLLSI (tmp_tmp, 1);
13661 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13666 SI opval = tmp_tmpd;
13667 SET_H_GR (FLD (f_operand2), opval);
13668 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13672 BI opval = LTSI (tmp_tmpd, 0);
13673 CPU (h_nbit) = opval;
13674 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13677 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13678 CPU (h_zbit) = opval;
13679 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13681 SET_H_CBIT_MOVE (0);
13682 SET_H_VBIT_MOVE (0);
13685 BI opval = 0;
13686 CPU (h_xbit) = opval;
13687 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13690 BI opval = 0;
13691 SET_H_INSN_PREFIXED_P (opval);
13692 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13698 #undef FLD
13700 NEXT (vpc);
13702 CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
13704 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13705 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13706 #define FLD(f) abuf->fields.sfmt_addoq.f
13707 int UNUSED written = 0;
13708 IADDR UNUSED pc = abuf->addr;
13709 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13713 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
13714 SET_H_PREFIXREG_V32 (opval);
13715 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13718 BI opval = 1;
13719 SET_H_INSN_PREFIXED_P (opval);
13720 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13724 #undef FLD
13726 NEXT (vpc);
13728 CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13730 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13731 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13732 #define FLD(f) abuf->fields.sfmt_addc_m.f
13733 int UNUSED written = 0;
13734 IADDR UNUSED pc = abuf->addr;
13735 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13738 QI tmp_tmps;
13739 tmp_tmps = ({ SI tmp_addr;
13740 QI tmp_tmp_mem;
13741 BI tmp_postinc;
13742 tmp_postinc = FLD (f_memmode);
13743 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13744 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13745 ; if (NEBI (tmp_postinc, 0)) {
13747 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13748 tmp_addr = ADDSI (tmp_addr, 1);
13751 SI opval = tmp_addr;
13752 SET_H_GR (FLD (f_operand1), opval);
13753 written |= (1 << 6);
13754 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13758 ; tmp_tmp_mem; });
13760 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
13761 SET_H_PREFIXREG_V32 (opval);
13762 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13765 BI opval = 1;
13766 SET_H_INSN_PREFIXED_P (opval);
13767 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13771 abuf->written = written;
13772 #undef FLD
13774 NEXT (vpc);
13776 CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13778 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13779 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13780 #define FLD(f) abuf->fields.sfmt_addc_m.f
13781 int UNUSED written = 0;
13782 IADDR UNUSED pc = abuf->addr;
13783 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13786 HI tmp_tmps;
13787 tmp_tmps = ({ SI tmp_addr;
13788 HI tmp_tmp_mem;
13789 BI tmp_postinc;
13790 tmp_postinc = FLD (f_memmode);
13791 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13792 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
13793 ; if (NEBI (tmp_postinc, 0)) {
13795 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13796 tmp_addr = ADDSI (tmp_addr, 2);
13799 SI opval = tmp_addr;
13800 SET_H_GR (FLD (f_operand1), opval);
13801 written |= (1 << 6);
13802 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13806 ; tmp_tmp_mem; });
13808 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
13809 SET_H_PREFIXREG_V32 (opval);
13810 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13813 BI opval = 1;
13814 SET_H_INSN_PREFIXED_P (opval);
13815 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13819 abuf->written = written;
13820 #undef FLD
13822 NEXT (vpc);
13824 CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13826 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13827 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13828 #define FLD(f) abuf->fields.sfmt_addc_m.f
13829 int UNUSED written = 0;
13830 IADDR UNUSED pc = abuf->addr;
13831 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13834 SI tmp_tmps;
13835 tmp_tmps = ({ SI tmp_addr;
13836 SI tmp_tmp_mem;
13837 BI tmp_postinc;
13838 tmp_postinc = FLD (f_memmode);
13839 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (GET_H_PREFIXREG_V32 ()));
13840 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13841 ; if (NEBI (tmp_postinc, 0)) {
13843 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13844 tmp_addr = ADDSI (tmp_addr, 4);
13847 SI opval = tmp_addr;
13848 SET_H_GR (FLD (f_operand1), opval);
13849 written |= (1 << 6);
13850 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13854 ; tmp_tmp_mem; });
13856 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
13857 SET_H_PREFIXREG_V32 (opval);
13858 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13861 BI opval = 1;
13862 SET_H_INSN_PREFIXED_P (opval);
13863 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13867 abuf->written = written;
13868 #undef FLD
13870 NEXT (vpc);
13872 CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
13874 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13875 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13876 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13877 int UNUSED written = 0;
13878 IADDR UNUSED pc = abuf->addr;
13879 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13883 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
13884 SET_H_PREFIXREG_V32 (opval);
13885 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13888 BI opval = 1;
13889 SET_H_INSN_PREFIXED_P (opval);
13890 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13894 #undef FLD
13896 NEXT (vpc);
13898 CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
13900 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13901 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13902 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13903 int UNUSED written = 0;
13904 IADDR UNUSED pc = abuf->addr;
13905 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13909 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
13910 SET_H_PREFIXREG_V32 (opval);
13911 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13914 BI opval = 1;
13915 SET_H_INSN_PREFIXED_P (opval);
13916 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13920 #undef FLD
13922 NEXT (vpc);
13924 CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
13926 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13927 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13928 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13929 int UNUSED written = 0;
13930 IADDR UNUSED pc = abuf->addr;
13931 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13935 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
13936 SET_H_PREFIXREG_V32 (opval);
13937 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13940 BI opval = 1;
13941 SET_H_INSN_PREFIXED_P (opval);
13942 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13946 #undef FLD
13948 NEXT (vpc);
13950 CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13952 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13953 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13954 #define FLD(f) abuf->fields.sfmt_muls_b.f
13955 int UNUSED written = 0;
13956 IADDR UNUSED pc = abuf->addr;
13957 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13961 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13962 SET_H_PREFIXREG_V32 (opval);
13963 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13966 BI opval = 1;
13967 SET_H_INSN_PREFIXED_P (opval);
13968 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13972 #undef FLD
13974 NEXT (vpc);
13976 CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13978 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13979 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13980 #define FLD(f) abuf->fields.sfmt_muls_b.f
13981 int UNUSED written = 0;
13982 IADDR UNUSED pc = abuf->addr;
13983 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13987 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13988 SET_H_PREFIXREG_V32 (opval);
13989 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13992 BI opval = 1;
13993 SET_H_INSN_PREFIXED_P (opval);
13994 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13998 #undef FLD
14000 NEXT (vpc);
14002 CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14004 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14005 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14006 #define FLD(f) abuf->fields.sfmt_muls_b.f
14007 int UNUSED written = 0;
14008 IADDR UNUSED pc = abuf->addr;
14009 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14013 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
14014 SET_H_PREFIXREG_V32 (opval);
14015 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14018 BI opval = 1;
14019 SET_H_INSN_PREFIXED_P (opval);
14020 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14024 #undef FLD
14026 NEXT (vpc);
14028 CASE (sem, INSN_FIDXI) : /* fidxi [$Rs] */
14030 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14031 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14032 #define FLD(f) abuf->fields.sfmt_mcp.f
14033 int UNUSED written = 0;
14034 IADDR UNUSED pc = abuf->addr;
14035 SEM_BRANCH_INIT
14036 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14039 USI opval = crisv32f_fidxi_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14040 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14041 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14044 SEM_BRANCH_FINI (vpc);
14045 #undef FLD
14047 NEXT (vpc);
14049 CASE (sem, INSN_FTAGI) : /* fidxi [$Rs] */
14051 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14052 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14053 #define FLD(f) abuf->fields.sfmt_mcp.f
14054 int UNUSED written = 0;
14055 IADDR UNUSED pc = abuf->addr;
14056 SEM_BRANCH_INIT
14057 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14060 USI opval = crisv32f_ftagi_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14061 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14062 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14065 SEM_BRANCH_FINI (vpc);
14066 #undef FLD
14068 NEXT (vpc);
14070 CASE (sem, INSN_FIDXD) : /* fidxd [$Rs] */
14072 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14073 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14074 #define FLD(f) abuf->fields.sfmt_mcp.f
14075 int UNUSED written = 0;
14076 IADDR UNUSED pc = abuf->addr;
14077 SEM_BRANCH_INIT
14078 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14081 USI opval = crisv32f_fidxd_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14082 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14083 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14086 SEM_BRANCH_FINI (vpc);
14087 #undef FLD
14089 NEXT (vpc);
14091 CASE (sem, INSN_FTAGD) : /* ftagd [$Rs] */
14093 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14094 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14095 #define FLD(f) abuf->fields.sfmt_mcp.f
14096 int UNUSED written = 0;
14097 IADDR UNUSED pc = abuf->addr;
14098 SEM_BRANCH_INIT
14099 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14102 USI opval = crisv32f_ftagd_handler (current_cpu, pc, GET_H_GR (FLD (f_operand1)));
14103 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
14104 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
14107 SEM_BRANCH_FINI (vpc);
14108 #undef FLD
14110 NEXT (vpc);
14114 ENDSWITCH (sem) /* End of semantic switch. */
14116 /* At this point `vpc' contains the next insn to execute. */
14119 #undef DEFINE_SWITCH
14120 #endif /* DEFINE_SWITCH */