1 /* Simulator instruction semantics for crisv10f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2019 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, see <http://www.gnu.org/licenses/>.
26 /* The labels have the case they have because the enum of insn types
27 is all uppercase and in the non-stdc case the insn symbol is built
28 into the enum name. */
34 { CRISV10F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
35 { CRISV10F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
36 { CRISV10F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
37 { CRISV10F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
38 { CRISV10F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
39 { CRISV10F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
40 { CRISV10F_INSN_NOP, && case_sem_INSN_NOP },
41 { CRISV10F_INSN_MOVE_B_R, && case_sem_INSN_MOVE_B_R },
42 { CRISV10F_INSN_MOVE_W_R, && case_sem_INSN_MOVE_W_R },
43 { CRISV10F_INSN_MOVE_D_R, && case_sem_INSN_MOVE_D_R },
44 { CRISV10F_INSN_MOVEPCR, && case_sem_INSN_MOVEPCR },
45 { CRISV10F_INSN_MOVEQ, && case_sem_INSN_MOVEQ },
46 { CRISV10F_INSN_MOVS_B_R, && case_sem_INSN_MOVS_B_R },
47 { CRISV10F_INSN_MOVS_W_R, && case_sem_INSN_MOVS_W_R },
48 { CRISV10F_INSN_MOVU_B_R, && case_sem_INSN_MOVU_B_R },
49 { CRISV10F_INSN_MOVU_W_R, && case_sem_INSN_MOVU_W_R },
50 { CRISV10F_INSN_MOVECBR, && case_sem_INSN_MOVECBR },
51 { CRISV10F_INSN_MOVECWR, && case_sem_INSN_MOVECWR },
52 { CRISV10F_INSN_MOVECDR, && case_sem_INSN_MOVECDR },
53 { CRISV10F_INSN_MOVSCBR, && case_sem_INSN_MOVSCBR },
54 { CRISV10F_INSN_MOVSCWR, && case_sem_INSN_MOVSCWR },
55 { CRISV10F_INSN_MOVUCBR, && case_sem_INSN_MOVUCBR },
56 { CRISV10F_INSN_MOVUCWR, && case_sem_INSN_MOVUCWR },
57 { CRISV10F_INSN_ADDQ, && case_sem_INSN_ADDQ },
58 { CRISV10F_INSN_SUBQ, && case_sem_INSN_SUBQ },
59 { CRISV10F_INSN_CMP_R_B_R, && case_sem_INSN_CMP_R_B_R },
60 { CRISV10F_INSN_CMP_R_W_R, && case_sem_INSN_CMP_R_W_R },
61 { CRISV10F_INSN_CMP_R_D_R, && case_sem_INSN_CMP_R_D_R },
62 { CRISV10F_INSN_CMP_M_B_M, && case_sem_INSN_CMP_M_B_M },
63 { CRISV10F_INSN_CMP_M_W_M, && case_sem_INSN_CMP_M_W_M },
64 { CRISV10F_INSN_CMP_M_D_M, && case_sem_INSN_CMP_M_D_M },
65 { CRISV10F_INSN_CMPCBR, && case_sem_INSN_CMPCBR },
66 { CRISV10F_INSN_CMPCWR, && case_sem_INSN_CMPCWR },
67 { CRISV10F_INSN_CMPCDR, && case_sem_INSN_CMPCDR },
68 { CRISV10F_INSN_CMPQ, && case_sem_INSN_CMPQ },
69 { CRISV10F_INSN_CMPS_M_B_M, && case_sem_INSN_CMPS_M_B_M },
70 { CRISV10F_INSN_CMPS_M_W_M, && case_sem_INSN_CMPS_M_W_M },
71 { CRISV10F_INSN_CMPSCBR, && case_sem_INSN_CMPSCBR },
72 { CRISV10F_INSN_CMPSCWR, && case_sem_INSN_CMPSCWR },
73 { CRISV10F_INSN_CMPU_M_B_M, && case_sem_INSN_CMPU_M_B_M },
74 { CRISV10F_INSN_CMPU_M_W_M, && case_sem_INSN_CMPU_M_W_M },
75 { CRISV10F_INSN_CMPUCBR, && case_sem_INSN_CMPUCBR },
76 { CRISV10F_INSN_CMPUCWR, && case_sem_INSN_CMPUCWR },
77 { CRISV10F_INSN_MOVE_M_B_M, && case_sem_INSN_MOVE_M_B_M },
78 { CRISV10F_INSN_MOVE_M_W_M, && case_sem_INSN_MOVE_M_W_M },
79 { CRISV10F_INSN_MOVE_M_D_M, && case_sem_INSN_MOVE_M_D_M },
80 { CRISV10F_INSN_MOVS_M_B_M, && case_sem_INSN_MOVS_M_B_M },
81 { CRISV10F_INSN_MOVS_M_W_M, && case_sem_INSN_MOVS_M_W_M },
82 { CRISV10F_INSN_MOVU_M_B_M, && case_sem_INSN_MOVU_M_B_M },
83 { CRISV10F_INSN_MOVU_M_W_M, && case_sem_INSN_MOVU_M_W_M },
84 { CRISV10F_INSN_MOVE_R_SPRV10, && case_sem_INSN_MOVE_R_SPRV10 },
85 { CRISV10F_INSN_MOVE_SPR_RV10, && case_sem_INSN_MOVE_SPR_RV10 },
86 { CRISV10F_INSN_RET_TYPE, && case_sem_INSN_RET_TYPE },
87 { CRISV10F_INSN_MOVE_M_SPRV10, && case_sem_INSN_MOVE_M_SPRV10 },
88 { CRISV10F_INSN_MOVE_C_SPRV10_P5, && case_sem_INSN_MOVE_C_SPRV10_P5 },
89 { CRISV10F_INSN_MOVE_C_SPRV10_P9, && case_sem_INSN_MOVE_C_SPRV10_P9 },
90 { CRISV10F_INSN_MOVE_C_SPRV10_P10, && case_sem_INSN_MOVE_C_SPRV10_P10 },
91 { CRISV10F_INSN_MOVE_C_SPRV10_P11, && case_sem_INSN_MOVE_C_SPRV10_P11 },
92 { CRISV10F_INSN_MOVE_C_SPRV10_P12, && case_sem_INSN_MOVE_C_SPRV10_P12 },
93 { CRISV10F_INSN_MOVE_C_SPRV10_P13, && case_sem_INSN_MOVE_C_SPRV10_P13 },
94 { CRISV10F_INSN_MOVE_C_SPRV10_P7, && case_sem_INSN_MOVE_C_SPRV10_P7 },
95 { CRISV10F_INSN_MOVE_C_SPRV10_P14, && case_sem_INSN_MOVE_C_SPRV10_P14 },
96 { CRISV10F_INSN_MOVE_C_SPRV10_P15, && case_sem_INSN_MOVE_C_SPRV10_P15 },
97 { CRISV10F_INSN_MOVE_SPR_MV10, && case_sem_INSN_MOVE_SPR_MV10 },
98 { CRISV10F_INSN_SBFS, && case_sem_INSN_SBFS },
99 { CRISV10F_INSN_MOVEM_R_M, && case_sem_INSN_MOVEM_R_M },
100 { CRISV10F_INSN_MOVEM_M_R, && case_sem_INSN_MOVEM_M_R },
101 { CRISV10F_INSN_MOVEM_M_PC, && case_sem_INSN_MOVEM_M_PC },
102 { CRISV10F_INSN_ADD_B_R, && case_sem_INSN_ADD_B_R },
103 { CRISV10F_INSN_ADD_W_R, && case_sem_INSN_ADD_W_R },
104 { CRISV10F_INSN_ADD_D_R, && case_sem_INSN_ADD_D_R },
105 { CRISV10F_INSN_ADD_M_B_M, && case_sem_INSN_ADD_M_B_M },
106 { CRISV10F_INSN_ADD_M_W_M, && case_sem_INSN_ADD_M_W_M },
107 { CRISV10F_INSN_ADD_M_D_M, && case_sem_INSN_ADD_M_D_M },
108 { CRISV10F_INSN_ADDCBR, && case_sem_INSN_ADDCBR },
109 { CRISV10F_INSN_ADDCWR, && case_sem_INSN_ADDCWR },
110 { CRISV10F_INSN_ADDCDR, && case_sem_INSN_ADDCDR },
111 { CRISV10F_INSN_ADDCPC, && case_sem_INSN_ADDCPC },
112 { CRISV10F_INSN_ADDS_B_R, && case_sem_INSN_ADDS_B_R },
113 { CRISV10F_INSN_ADDS_W_R, && case_sem_INSN_ADDS_W_R },
114 { CRISV10F_INSN_ADDS_M_B_M, && case_sem_INSN_ADDS_M_B_M },
115 { CRISV10F_INSN_ADDS_M_W_M, && case_sem_INSN_ADDS_M_W_M },
116 { CRISV10F_INSN_ADDSCBR, && case_sem_INSN_ADDSCBR },
117 { CRISV10F_INSN_ADDSCWR, && case_sem_INSN_ADDSCWR },
118 { CRISV10F_INSN_ADDSPCPC, && case_sem_INSN_ADDSPCPC },
119 { CRISV10F_INSN_ADDU_B_R, && case_sem_INSN_ADDU_B_R },
120 { CRISV10F_INSN_ADDU_W_R, && case_sem_INSN_ADDU_W_R },
121 { CRISV10F_INSN_ADDU_M_B_M, && case_sem_INSN_ADDU_M_B_M },
122 { CRISV10F_INSN_ADDU_M_W_M, && case_sem_INSN_ADDU_M_W_M },
123 { CRISV10F_INSN_ADDUCBR, && case_sem_INSN_ADDUCBR },
124 { CRISV10F_INSN_ADDUCWR, && case_sem_INSN_ADDUCWR },
125 { CRISV10F_INSN_SUB_B_R, && case_sem_INSN_SUB_B_R },
126 { CRISV10F_INSN_SUB_W_R, && case_sem_INSN_SUB_W_R },
127 { CRISV10F_INSN_SUB_D_R, && case_sem_INSN_SUB_D_R },
128 { CRISV10F_INSN_SUB_M_B_M, && case_sem_INSN_SUB_M_B_M },
129 { CRISV10F_INSN_SUB_M_W_M, && case_sem_INSN_SUB_M_W_M },
130 { CRISV10F_INSN_SUB_M_D_M, && case_sem_INSN_SUB_M_D_M },
131 { CRISV10F_INSN_SUBCBR, && case_sem_INSN_SUBCBR },
132 { CRISV10F_INSN_SUBCWR, && case_sem_INSN_SUBCWR },
133 { CRISV10F_INSN_SUBCDR, && case_sem_INSN_SUBCDR },
134 { CRISV10F_INSN_SUBS_B_R, && case_sem_INSN_SUBS_B_R },
135 { CRISV10F_INSN_SUBS_W_R, && case_sem_INSN_SUBS_W_R },
136 { CRISV10F_INSN_SUBS_M_B_M, && case_sem_INSN_SUBS_M_B_M },
137 { CRISV10F_INSN_SUBS_M_W_M, && case_sem_INSN_SUBS_M_W_M },
138 { CRISV10F_INSN_SUBSCBR, && case_sem_INSN_SUBSCBR },
139 { CRISV10F_INSN_SUBSCWR, && case_sem_INSN_SUBSCWR },
140 { CRISV10F_INSN_SUBU_B_R, && case_sem_INSN_SUBU_B_R },
141 { CRISV10F_INSN_SUBU_W_R, && case_sem_INSN_SUBU_W_R },
142 { CRISV10F_INSN_SUBU_M_B_M, && case_sem_INSN_SUBU_M_B_M },
143 { CRISV10F_INSN_SUBU_M_W_M, && case_sem_INSN_SUBU_M_W_M },
144 { CRISV10F_INSN_SUBUCBR, && case_sem_INSN_SUBUCBR },
145 { CRISV10F_INSN_SUBUCWR, && case_sem_INSN_SUBUCWR },
146 { CRISV10F_INSN_ADDI_B_R, && case_sem_INSN_ADDI_B_R },
147 { CRISV10F_INSN_ADDI_W_R, && case_sem_INSN_ADDI_W_R },
148 { CRISV10F_INSN_ADDI_D_R, && case_sem_INSN_ADDI_D_R },
149 { CRISV10F_INSN_NEG_B_R, && case_sem_INSN_NEG_B_R },
150 { CRISV10F_INSN_NEG_W_R, && case_sem_INSN_NEG_W_R },
151 { CRISV10F_INSN_NEG_D_R, && case_sem_INSN_NEG_D_R },
152 { CRISV10F_INSN_TEST_M_B_M, && case_sem_INSN_TEST_M_B_M },
153 { CRISV10F_INSN_TEST_M_W_M, && case_sem_INSN_TEST_M_W_M },
154 { CRISV10F_INSN_TEST_M_D_M, && case_sem_INSN_TEST_M_D_M },
155 { CRISV10F_INSN_MOVE_R_M_B_M, && case_sem_INSN_MOVE_R_M_B_M },
156 { CRISV10F_INSN_MOVE_R_M_W_M, && case_sem_INSN_MOVE_R_M_W_M },
157 { CRISV10F_INSN_MOVE_R_M_D_M, && case_sem_INSN_MOVE_R_M_D_M },
158 { CRISV10F_INSN_MULS_B, && case_sem_INSN_MULS_B },
159 { CRISV10F_INSN_MULS_W, && case_sem_INSN_MULS_W },
160 { CRISV10F_INSN_MULS_D, && case_sem_INSN_MULS_D },
161 { CRISV10F_INSN_MULU_B, && case_sem_INSN_MULU_B },
162 { CRISV10F_INSN_MULU_W, && case_sem_INSN_MULU_W },
163 { CRISV10F_INSN_MULU_D, && case_sem_INSN_MULU_D },
164 { CRISV10F_INSN_MSTEP, && case_sem_INSN_MSTEP },
165 { CRISV10F_INSN_DSTEP, && case_sem_INSN_DSTEP },
166 { CRISV10F_INSN_ABS, && case_sem_INSN_ABS },
167 { CRISV10F_INSN_AND_B_R, && case_sem_INSN_AND_B_R },
168 { CRISV10F_INSN_AND_W_R, && case_sem_INSN_AND_W_R },
169 { CRISV10F_INSN_AND_D_R, && case_sem_INSN_AND_D_R },
170 { CRISV10F_INSN_AND_M_B_M, && case_sem_INSN_AND_M_B_M },
171 { CRISV10F_INSN_AND_M_W_M, && case_sem_INSN_AND_M_W_M },
172 { CRISV10F_INSN_AND_M_D_M, && case_sem_INSN_AND_M_D_M },
173 { CRISV10F_INSN_ANDCBR, && case_sem_INSN_ANDCBR },
174 { CRISV10F_INSN_ANDCWR, && case_sem_INSN_ANDCWR },
175 { CRISV10F_INSN_ANDCDR, && case_sem_INSN_ANDCDR },
176 { CRISV10F_INSN_ANDQ, && case_sem_INSN_ANDQ },
177 { CRISV10F_INSN_ORR_B_R, && case_sem_INSN_ORR_B_R },
178 { CRISV10F_INSN_ORR_W_R, && case_sem_INSN_ORR_W_R },
179 { CRISV10F_INSN_ORR_D_R, && case_sem_INSN_ORR_D_R },
180 { CRISV10F_INSN_OR_M_B_M, && case_sem_INSN_OR_M_B_M },
181 { CRISV10F_INSN_OR_M_W_M, && case_sem_INSN_OR_M_W_M },
182 { CRISV10F_INSN_OR_M_D_M, && case_sem_INSN_OR_M_D_M },
183 { CRISV10F_INSN_ORCBR, && case_sem_INSN_ORCBR },
184 { CRISV10F_INSN_ORCWR, && case_sem_INSN_ORCWR },
185 { CRISV10F_INSN_ORCDR, && case_sem_INSN_ORCDR },
186 { CRISV10F_INSN_ORQ, && case_sem_INSN_ORQ },
187 { CRISV10F_INSN_XOR, && case_sem_INSN_XOR },
188 { CRISV10F_INSN_SWAP, && case_sem_INSN_SWAP },
189 { CRISV10F_INSN_ASRR_B_R, && case_sem_INSN_ASRR_B_R },
190 { CRISV10F_INSN_ASRR_W_R, && case_sem_INSN_ASRR_W_R },
191 { CRISV10F_INSN_ASRR_D_R, && case_sem_INSN_ASRR_D_R },
192 { CRISV10F_INSN_ASRQ, && case_sem_INSN_ASRQ },
193 { CRISV10F_INSN_LSRR_B_R, && case_sem_INSN_LSRR_B_R },
194 { CRISV10F_INSN_LSRR_W_R, && case_sem_INSN_LSRR_W_R },
195 { CRISV10F_INSN_LSRR_D_R, && case_sem_INSN_LSRR_D_R },
196 { CRISV10F_INSN_LSRQ, && case_sem_INSN_LSRQ },
197 { CRISV10F_INSN_LSLR_B_R, && case_sem_INSN_LSLR_B_R },
198 { CRISV10F_INSN_LSLR_W_R, && case_sem_INSN_LSLR_W_R },
199 { CRISV10F_INSN_LSLR_D_R, && case_sem_INSN_LSLR_D_R },
200 { CRISV10F_INSN_LSLQ, && case_sem_INSN_LSLQ },
201 { CRISV10F_INSN_BTST, && case_sem_INSN_BTST },
202 { CRISV10F_INSN_BTSTQ, && case_sem_INSN_BTSTQ },
203 { CRISV10F_INSN_SETF, && case_sem_INSN_SETF },
204 { CRISV10F_INSN_CLEARF, && case_sem_INSN_CLEARF },
205 { CRISV10F_INSN_BCC_B, && case_sem_INSN_BCC_B },
206 { CRISV10F_INSN_BA_B, && case_sem_INSN_BA_B },
207 { CRISV10F_INSN_BCC_W, && case_sem_INSN_BCC_W },
208 { CRISV10F_INSN_BA_W, && case_sem_INSN_BA_W },
209 { CRISV10F_INSN_JUMP_R, && case_sem_INSN_JUMP_R },
210 { CRISV10F_INSN_JUMP_M, && case_sem_INSN_JUMP_M },
211 { CRISV10F_INSN_JUMP_C, && case_sem_INSN_JUMP_C },
212 { CRISV10F_INSN_BREAK, && case_sem_INSN_BREAK },
213 { CRISV10F_INSN_BOUND_R_B_R, && case_sem_INSN_BOUND_R_B_R },
214 { CRISV10F_INSN_BOUND_R_W_R, && case_sem_INSN_BOUND_R_W_R },
215 { CRISV10F_INSN_BOUND_R_D_R, && case_sem_INSN_BOUND_R_D_R },
216 { CRISV10F_INSN_BOUND_M_B_M, && case_sem_INSN_BOUND_M_B_M },
217 { CRISV10F_INSN_BOUND_M_W_M, && case_sem_INSN_BOUND_M_W_M },
218 { CRISV10F_INSN_BOUND_M_D_M, && case_sem_INSN_BOUND_M_D_M },
219 { CRISV10F_INSN_BOUND_CB, && case_sem_INSN_BOUND_CB },
220 { CRISV10F_INSN_BOUND_CW, && case_sem_INSN_BOUND_CW },
221 { CRISV10F_INSN_BOUND_CD, && case_sem_INSN_BOUND_CD },
222 { CRISV10F_INSN_SCC, && case_sem_INSN_SCC },
223 { CRISV10F_INSN_LZ, && case_sem_INSN_LZ },
224 { CRISV10F_INSN_ADDOQ, && case_sem_INSN_ADDOQ },
225 { CRISV10F_INSN_BDAPQPC, && case_sem_INSN_BDAPQPC },
226 { CRISV10F_INSN_BDAP_32_PC, && case_sem_INSN_BDAP_32_PC },
227 { CRISV10F_INSN_MOVE_M_PCPLUS_P0, && case_sem_INSN_MOVE_M_PCPLUS_P0 },
228 { CRISV10F_INSN_MOVE_M_SPPLUS_P8, && case_sem_INSN_MOVE_M_SPPLUS_P8 },
229 { CRISV10F_INSN_ADDO_M_B_M, && case_sem_INSN_ADDO_M_B_M },
230 { CRISV10F_INSN_ADDO_M_W_M, && case_sem_INSN_ADDO_M_W_M },
231 { CRISV10F_INSN_ADDO_M_D_M, && case_sem_INSN_ADDO_M_D_M },
232 { CRISV10F_INSN_ADDO_CB, && case_sem_INSN_ADDO_CB },
233 { CRISV10F_INSN_ADDO_CW, && case_sem_INSN_ADDO_CW },
234 { CRISV10F_INSN_ADDO_CD, && case_sem_INSN_ADDO_CD },
235 { CRISV10F_INSN_DIP_M, && case_sem_INSN_DIP_M },
236 { CRISV10F_INSN_DIP_C, && case_sem_INSN_DIP_C },
237 { CRISV10F_INSN_ADDI_ACR_B_R, && case_sem_INSN_ADDI_ACR_B_R },
238 { CRISV10F_INSN_ADDI_ACR_W_R, && case_sem_INSN_ADDI_ACR_W_R },
239 { CRISV10F_INSN_ADDI_ACR_D_R, && case_sem_INSN_ADDI_ACR_D_R },
240 { CRISV10F_INSN_BIAP_PC_B_R, && case_sem_INSN_BIAP_PC_B_R },
241 { CRISV10F_INSN_BIAP_PC_W_R, && case_sem_INSN_BIAP_PC_W_R },
242 { CRISV10F_INSN_BIAP_PC_D_R, && case_sem_INSN_BIAP_PC_D_R },
247 for (i = 0; labels[i].label != 0; ++i)
250 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
252 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
257 #endif /* DEFINE_LABELS */
261 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
262 off frills like tracing and profiling. */
263 /* FIXME: A better way would be to have CGEN_TRACE_RESULT check for something
264 that can cause it to be optimized out. Another way would be to emit
265 special handlers into the instruction "stream". */
268 #undef CGEN_TRACE_RESULT
269 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
273 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
279 /* Branch to next handler without going around main loop. */
280 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
281 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
283 #else /* ! WITH_SCACHE_PBB */
285 #define NEXT(vpc) BREAK (sem)
288 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
290 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
293 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
296 #endif /* ! WITH_SCACHE_PBB */
300 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
302 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
303 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
304 #define FLD(f) abuf->fields.sfmt_empty.f
305 int UNUSED written = 0;
306 IADDR UNUSED pc = abuf->addr;
307 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
310 /* Update the recorded pc in the cpu state struct.
311 Only necessary for WITH_SCACHE case, but to avoid the
312 conditional compilation .... */
314 /* Virtual insns have zero size. Overwrite vpc with address of next insn
315 using the default-insn-bitsize spec. When executing insns in parallel
316 we may want to queue the fault and continue execution. */
317 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
318 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
325 CASE (sem, INSN_X_AFTER) : /* --after-- */
327 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
328 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
329 #define FLD(f) abuf->fields.sfmt_empty.f
330 int UNUSED written = 0;
331 IADDR UNUSED pc = abuf->addr;
332 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
335 #if WITH_SCACHE_PBB_CRISV10F
336 crisv10f_pbb_after (current_cpu, sem_arg);
344 CASE (sem, INSN_X_BEFORE) : /* --before-- */
346 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
347 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
348 #define FLD(f) abuf->fields.sfmt_empty.f
349 int UNUSED written = 0;
350 IADDR UNUSED pc = abuf->addr;
351 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
354 #if WITH_SCACHE_PBB_CRISV10F
355 crisv10f_pbb_before (current_cpu, sem_arg);
363 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
365 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
366 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
367 #define FLD(f) abuf->fields.sfmt_empty.f
368 int UNUSED written = 0;
369 IADDR UNUSED pc = abuf->addr;
370 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
373 #if WITH_SCACHE_PBB_CRISV10F
375 vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
376 pbb_br_type, pbb_br_npc);
379 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
380 vpc = crisv10f_pbb_cti_chain (current_cpu, sem_arg,
381 CPU_PBB_BR_TYPE (current_cpu),
382 CPU_PBB_BR_NPC (current_cpu));
391 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
393 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
394 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
395 #define FLD(f) abuf->fields.sfmt_empty.f
396 int UNUSED written = 0;
397 IADDR UNUSED pc = abuf->addr;
398 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
401 #if WITH_SCACHE_PBB_CRISV10F
402 vpc = crisv10f_pbb_chain (current_cpu, sem_arg);
413 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
415 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
416 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
417 #define FLD(f) abuf->fields.sfmt_empty.f
418 int UNUSED written = 0;
419 IADDR UNUSED pc = abuf->addr;
420 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
423 #if WITH_SCACHE_PBB_CRISV10F
424 #if defined DEFINE_SWITCH || defined FAST_P
425 /* In the switch case FAST_P is a constant, allowing several optimizations
426 in any called inline functions. */
427 vpc = crisv10f_pbb_begin (current_cpu, FAST_P);
429 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
430 vpc = crisv10f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
432 vpc = crisv10f_pbb_begin (current_cpu, 0);
442 CASE (sem, INSN_NOP) : /* nop */
444 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
445 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
446 #define FLD(f) abuf->fields.sfmt_empty.f
447 int UNUSED written = 0;
448 IADDR UNUSED pc = abuf->addr;
449 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
454 CPU (h_xbit) = opval;
455 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
459 SET_H_INSN_PREFIXED_P (opval);
460 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
468 CASE (sem, INSN_MOVE_B_R) : /* move.b move.m ${Rs},${Rd} */
470 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
471 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
472 #define FLD(f) abuf->fields.sfmt_add_b_r.f
473 int UNUSED written = 0;
474 IADDR UNUSED pc = abuf->addr;
475 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
479 tmp_newval = GET_H_GR (FLD (f_operand1));
482 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
484 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
485 SET_H_GR (FLD (f_operand2), opval);
486 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
491 BI opval = LTQI (tmp_newval, 0);
492 CPU (h_nbit) = opval;
493 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
496 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
497 CPU (h_zbit) = opval;
498 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
505 CPU (h_xbit) = opval;
506 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
510 SET_H_INSN_PREFIXED_P (opval);
511 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
521 CASE (sem, INSN_MOVE_W_R) : /* move.w move.m ${Rs},${Rd} */
523 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
524 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
525 #define FLD(f) abuf->fields.sfmt_add_b_r.f
526 int UNUSED written = 0;
527 IADDR UNUSED pc = abuf->addr;
528 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
532 tmp_newval = GET_H_GR (FLD (f_operand1));
535 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
537 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
538 SET_H_GR (FLD (f_operand2), opval);
539 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
544 BI opval = LTHI (tmp_newval, 0);
545 CPU (h_nbit) = opval;
546 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
549 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
550 CPU (h_zbit) = opval;
551 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
558 CPU (h_xbit) = opval;
559 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
563 SET_H_INSN_PREFIXED_P (opval);
564 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
574 CASE (sem, INSN_MOVE_D_R) : /* move.d move.m ${Rs},${Rd} */
576 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
577 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
578 #define FLD(f) abuf->fields.sfmt_add_b_r.f
579 int UNUSED written = 0;
580 IADDR UNUSED pc = abuf->addr;
581 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
585 tmp_newval = GET_H_GR (FLD (f_operand1));
587 SI opval = tmp_newval;
588 SET_H_GR (FLD (f_operand2), opval);
589 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
593 BI opval = LTSI (tmp_newval, 0);
594 CPU (h_nbit) = opval;
595 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
598 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
599 CPU (h_zbit) = opval;
600 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
607 CPU (h_xbit) = opval;
608 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
612 SET_H_INSN_PREFIXED_P (opval);
613 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
623 CASE (sem, INSN_MOVEPCR) : /* move.d PC,${Rd} */
625 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
626 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
627 #define FLD(f) abuf->fields.sfmt_moveq.f
628 int UNUSED written = 0;
629 IADDR UNUSED pc = abuf->addr;
631 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
635 tmp_pcval = ADDSI (pc, 2);
637 SI opval = tmp_pcval;
638 SET_H_GR (FLD (f_operand2), opval);
639 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
643 BI opval = LTSI (tmp_pcval, 0);
644 CPU (h_nbit) = opval;
645 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
648 BI opval = ANDIF (EQSI (tmp_pcval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
649 CPU (h_zbit) = opval;
650 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
657 CPU (h_xbit) = opval;
658 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
662 SET_H_INSN_PREFIXED_P (opval);
663 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
669 SEM_BRANCH_FINI (vpc);
674 CASE (sem, INSN_MOVEQ) : /* moveq $i,$Rd */
676 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
677 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
678 #define FLD(f) abuf->fields.sfmt_moveq.f
679 int UNUSED written = 0;
680 IADDR UNUSED pc = abuf->addr;
681 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
685 tmp_newval = FLD (f_s6);
687 SI opval = tmp_newval;
688 SET_H_GR (FLD (f_operand2), opval);
689 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
692 SET_H_NBIT_MOVE (LTSI (tmp_newval, 0));
693 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1))));
699 CPU (h_xbit) = opval;
700 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
704 SET_H_INSN_PREFIXED_P (opval);
705 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
715 CASE (sem, INSN_MOVS_B_R) : /* movs.b movs.m ${Rs},${Rd} */
717 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
718 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
719 #define FLD(f) abuf->fields.sfmt_muls_b.f
720 int UNUSED written = 0;
721 IADDR UNUSED pc = abuf->addr;
722 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
727 tmp_tmpops = GET_H_GR (FLD (f_operand1));
728 tmp_newval = EXTQISI (tmp_tmpops);
730 SI opval = tmp_newval;
731 SET_H_GR (FLD (f_operand2), opval);
732 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
736 BI opval = LTSI (tmp_newval, 0);
737 CPU (h_nbit) = opval;
738 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
741 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
742 CPU (h_zbit) = opval;
743 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
750 CPU (h_xbit) = opval;
751 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
755 SET_H_INSN_PREFIXED_P (opval);
756 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
766 CASE (sem, INSN_MOVS_W_R) : /* movs.w movs.m ${Rs},${Rd} */
768 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
769 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
770 #define FLD(f) abuf->fields.sfmt_muls_b.f
771 int UNUSED written = 0;
772 IADDR UNUSED pc = abuf->addr;
773 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
778 tmp_tmpops = GET_H_GR (FLD (f_operand1));
779 tmp_newval = EXTHISI (tmp_tmpops);
781 SI opval = tmp_newval;
782 SET_H_GR (FLD (f_operand2), opval);
783 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
787 BI opval = LTSI (tmp_newval, 0);
788 CPU (h_nbit) = opval;
789 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
792 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
793 CPU (h_zbit) = opval;
794 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
801 CPU (h_xbit) = opval;
802 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
806 SET_H_INSN_PREFIXED_P (opval);
807 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
817 CASE (sem, INSN_MOVU_B_R) : /* movu.b movu.m ${Rs},${Rd} */
819 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
820 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
821 #define FLD(f) abuf->fields.sfmt_muls_b.f
822 int UNUSED written = 0;
823 IADDR UNUSED pc = abuf->addr;
824 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
829 tmp_tmpops = GET_H_GR (FLD (f_operand1));
830 tmp_newval = ZEXTQISI (tmp_tmpops);
832 SI opval = tmp_newval;
833 SET_H_GR (FLD (f_operand2), opval);
834 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
838 BI opval = LTSI (tmp_newval, 0);
839 CPU (h_nbit) = opval;
840 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
843 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
844 CPU (h_zbit) = opval;
845 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
852 CPU (h_xbit) = opval;
853 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
857 SET_H_INSN_PREFIXED_P (opval);
858 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
868 CASE (sem, INSN_MOVU_W_R) : /* movu.w movu.m ${Rs},${Rd} */
870 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
871 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
872 #define FLD(f) abuf->fields.sfmt_muls_b.f
873 int UNUSED written = 0;
874 IADDR UNUSED pc = abuf->addr;
875 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
880 tmp_tmpops = GET_H_GR (FLD (f_operand1));
881 tmp_newval = ZEXTHISI (tmp_tmpops);
883 SI opval = tmp_newval;
884 SET_H_GR (FLD (f_operand2), opval);
885 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
889 BI opval = LTSI (tmp_newval, 0);
890 CPU (h_nbit) = opval;
891 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
894 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
895 CPU (h_zbit) = opval;
896 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
903 CPU (h_xbit) = opval;
904 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
908 SET_H_INSN_PREFIXED_P (opval);
909 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
919 CASE (sem, INSN_MOVECBR) : /* move.b ${sconst8},${Rd} */
921 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
922 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
923 #define FLD(f) abuf->fields.sfmt_addcbr.f
924 int UNUSED written = 0;
925 IADDR UNUSED pc = abuf->addr;
926 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
930 tmp_newval = FLD (f_indir_pc__byte);
933 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
935 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
936 SET_H_GR (FLD (f_operand2), opval);
937 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
942 BI opval = LTQI (tmp_newval, 0);
943 CPU (h_nbit) = opval;
944 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
947 BI opval = ANDIF (EQQI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
948 CPU (h_zbit) = opval;
949 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
956 CPU (h_xbit) = opval;
957 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
961 SET_H_INSN_PREFIXED_P (opval);
962 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
972 CASE (sem, INSN_MOVECWR) : /* move.w ${sconst16},${Rd} */
974 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
975 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
976 #define FLD(f) abuf->fields.sfmt_addcwr.f
977 int UNUSED written = 0;
978 IADDR UNUSED pc = abuf->addr;
979 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
983 tmp_newval = FLD (f_indir_pc__word);
986 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
988 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
989 SET_H_GR (FLD (f_operand2), opval);
990 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
995 BI opval = LTHI (tmp_newval, 0);
996 CPU (h_nbit) = opval;
997 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1000 BI opval = ANDIF (EQHI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1001 CPU (h_zbit) = opval;
1002 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1004 SET_H_CBIT_MOVE (0);
1005 SET_H_VBIT_MOVE (0);
1009 CPU (h_xbit) = opval;
1010 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1014 SET_H_INSN_PREFIXED_P (opval);
1015 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1025 CASE (sem, INSN_MOVECDR) : /* move.d ${const32},${Rd} */
1027 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1028 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1029 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1030 int UNUSED written = 0;
1031 IADDR UNUSED pc = abuf->addr;
1032 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1036 tmp_newval = FLD (f_indir_pc__dword);
1038 SI opval = tmp_newval;
1039 SET_H_GR (FLD (f_operand2), opval);
1040 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1044 BI opval = LTSI (tmp_newval, 0);
1045 CPU (h_nbit) = opval;
1046 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1049 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1050 CPU (h_zbit) = opval;
1051 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1053 SET_H_CBIT_MOVE (0);
1054 SET_H_VBIT_MOVE (0);
1058 CPU (h_xbit) = opval;
1059 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1063 SET_H_INSN_PREFIXED_P (opval);
1064 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1074 CASE (sem, INSN_MOVSCBR) : /* movs.b ${sconst8},${Rd} */
1076 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1077 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1078 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1079 int UNUSED written = 0;
1080 IADDR UNUSED pc = abuf->addr;
1081 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1085 tmp_newval = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1087 SI opval = tmp_newval;
1088 SET_H_GR (FLD (f_operand2), opval);
1089 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1093 BI opval = LTSI (tmp_newval, 0);
1094 CPU (h_nbit) = opval;
1095 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1098 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1099 CPU (h_zbit) = opval;
1100 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1102 SET_H_CBIT_MOVE (0);
1103 SET_H_VBIT_MOVE (0);
1107 CPU (h_xbit) = opval;
1108 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1112 SET_H_INSN_PREFIXED_P (opval);
1113 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1123 CASE (sem, INSN_MOVSCWR) : /* movs.w ${sconst16},${Rd} */
1125 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1126 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1127 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1128 int UNUSED written = 0;
1129 IADDR UNUSED pc = abuf->addr;
1130 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1134 tmp_newval = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1136 SI opval = tmp_newval;
1137 SET_H_GR (FLD (f_operand2), opval);
1138 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1142 BI opval = LTSI (tmp_newval, 0);
1143 CPU (h_nbit) = opval;
1144 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1147 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1148 CPU (h_zbit) = opval;
1149 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1151 SET_H_CBIT_MOVE (0);
1152 SET_H_VBIT_MOVE (0);
1156 CPU (h_xbit) = opval;
1157 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1161 SET_H_INSN_PREFIXED_P (opval);
1162 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1172 CASE (sem, INSN_MOVUCBR) : /* movu.b ${uconst8},${Rd} */
1174 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1175 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1176 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1177 int UNUSED written = 0;
1178 IADDR UNUSED pc = abuf->addr;
1179 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1183 tmp_newval = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
1185 SI opval = tmp_newval;
1186 SET_H_GR (FLD (f_operand2), opval);
1187 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1191 BI opval = LTSI (tmp_newval, 0);
1192 CPU (h_nbit) = opval;
1193 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1196 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1197 CPU (h_zbit) = opval;
1198 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1200 SET_H_CBIT_MOVE (0);
1201 SET_H_VBIT_MOVE (0);
1205 CPU (h_xbit) = opval;
1206 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1210 SET_H_INSN_PREFIXED_P (opval);
1211 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1221 CASE (sem, INSN_MOVUCWR) : /* movu.w ${uconst16},${Rd} */
1223 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1224 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1225 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1226 int UNUSED written = 0;
1227 IADDR UNUSED pc = abuf->addr;
1228 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1232 tmp_newval = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
1234 SI opval = tmp_newval;
1235 SET_H_GR (FLD (f_operand2), opval);
1236 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1240 BI opval = LTSI (tmp_newval, 0);
1241 CPU (h_nbit) = opval;
1242 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1245 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
1246 CPU (h_zbit) = opval;
1247 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1249 SET_H_CBIT_MOVE (0);
1250 SET_H_VBIT_MOVE (0);
1254 CPU (h_xbit) = opval;
1255 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1259 SET_H_INSN_PREFIXED_P (opval);
1260 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1270 CASE (sem, INSN_ADDQ) : /* addq $j,$Rd */
1272 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1273 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1274 #define FLD(f) abuf->fields.sfmt_addq.f
1275 int UNUSED written = 0;
1276 IADDR UNUSED pc = abuf->addr;
1277 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1284 tmp_tmpops = FLD (f_u6);
1285 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1286 tmp_carry = CPU (h_cbit);
1287 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1289 SI opval = tmp_newval;
1290 SET_H_GR (FLD (f_operand2), opval);
1291 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1295 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))));
1296 CPU (h_cbit) = opval;
1297 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1300 BI opval = LTSI (tmp_newval, 0);
1301 CPU (h_nbit) = opval;
1302 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1305 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1306 CPU (h_zbit) = opval;
1307 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1310 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)));
1311 CPU (h_vbit) = opval;
1312 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1317 CPU (h_xbit) = opval;
1318 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1322 SET_H_INSN_PREFIXED_P (opval);
1323 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1333 CASE (sem, INSN_SUBQ) : /* subq $j,$Rd */
1335 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1336 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1337 #define FLD(f) abuf->fields.sfmt_addq.f
1338 int UNUSED written = 0;
1339 IADDR UNUSED pc = abuf->addr;
1340 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1347 tmp_tmpops = FLD (f_u6);
1348 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1349 tmp_carry = CPU (h_cbit);
1350 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1352 SI opval = tmp_newval;
1353 SET_H_GR (FLD (f_operand2), opval);
1354 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1358 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))));
1359 CPU (h_cbit) = opval;
1360 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1363 BI opval = LTSI (tmp_newval, 0);
1364 CPU (h_nbit) = opval;
1365 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1368 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1369 CPU (h_zbit) = opval;
1370 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1373 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)));
1374 CPU (h_vbit) = opval;
1375 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1380 CPU (h_xbit) = opval;
1381 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1385 SET_H_INSN_PREFIXED_P (opval);
1386 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1396 CASE (sem, INSN_CMP_R_B_R) : /* cmp-r.b $Rs,$Rd */
1398 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1399 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1400 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1401 int UNUSED written = 0;
1402 IADDR UNUSED pc = abuf->addr;
1403 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1410 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1411 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1412 tmp_carry = CPU (h_cbit);
1413 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1417 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))));
1418 CPU (h_cbit) = opval;
1419 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1422 BI opval = LTQI (tmp_newval, 0);
1423 CPU (h_nbit) = opval;
1424 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1427 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1428 CPU (h_zbit) = opval;
1429 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1432 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)));
1433 CPU (h_vbit) = opval;
1434 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1439 CPU (h_xbit) = opval;
1440 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1444 SET_H_INSN_PREFIXED_P (opval);
1445 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1455 CASE (sem, INSN_CMP_R_W_R) : /* cmp-r.w $Rs,$Rd */
1457 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1458 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1459 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1460 int UNUSED written = 0;
1461 IADDR UNUSED pc = abuf->addr;
1462 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1469 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1470 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1471 tmp_carry = CPU (h_cbit);
1472 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1476 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))));
1477 CPU (h_cbit) = opval;
1478 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1481 BI opval = LTHI (tmp_newval, 0);
1482 CPU (h_nbit) = opval;
1483 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1486 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1487 CPU (h_zbit) = opval;
1488 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1491 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)));
1492 CPU (h_vbit) = opval;
1493 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1498 CPU (h_xbit) = opval;
1499 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1503 SET_H_INSN_PREFIXED_P (opval);
1504 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1514 CASE (sem, INSN_CMP_R_D_R) : /* cmp-r.d $Rs,$Rd */
1516 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1517 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1518 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1519 int UNUSED written = 0;
1520 IADDR UNUSED pc = abuf->addr;
1521 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1528 tmp_tmpops = GET_H_GR (FLD (f_operand1));
1529 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1530 tmp_carry = CPU (h_cbit);
1531 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1535 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))));
1536 CPU (h_cbit) = opval;
1537 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1540 BI opval = LTSI (tmp_newval, 0);
1541 CPU (h_nbit) = opval;
1542 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1545 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1546 CPU (h_zbit) = opval;
1547 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1550 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)));
1551 CPU (h_vbit) = opval;
1552 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1557 CPU (h_xbit) = opval;
1558 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1562 SET_H_INSN_PREFIXED_P (opval);
1563 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1573 CASE (sem, INSN_CMP_M_B_M) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1575 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1576 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1577 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1578 int UNUSED written = 0;
1579 IADDR UNUSED pc = abuf->addr;
1580 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1587 tmp_tmpops = ({ SI tmp_addr;
1590 tmp_postinc = FLD (f_memmode);
1591 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1592 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
1593 ; if (NEBI (tmp_postinc, 0)) {
1595 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1596 tmp_addr = ADDSI (tmp_addr, 1);
1599 SI opval = tmp_addr;
1600 SET_H_GR (FLD (f_operand1), opval);
1601 written |= (1 << 9);
1602 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1607 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1608 tmp_carry = CPU (h_cbit);
1609 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1613 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))));
1614 CPU (h_cbit) = opval;
1615 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1618 BI opval = LTQI (tmp_newval, 0);
1619 CPU (h_nbit) = opval;
1620 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1623 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1624 CPU (h_zbit) = opval;
1625 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1628 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)));
1629 CPU (h_vbit) = opval;
1630 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1635 CPU (h_xbit) = opval;
1636 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1640 SET_H_INSN_PREFIXED_P (opval);
1641 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1647 abuf->written = written;
1652 CASE (sem, INSN_CMP_M_W_M) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1654 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1655 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1656 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1657 int UNUSED written = 0;
1658 IADDR UNUSED pc = abuf->addr;
1659 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1666 tmp_tmpops = ({ SI tmp_addr;
1669 tmp_postinc = FLD (f_memmode);
1670 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1671 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
1672 ; if (NEBI (tmp_postinc, 0)) {
1674 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1675 tmp_addr = ADDSI (tmp_addr, 2);
1678 SI opval = tmp_addr;
1679 SET_H_GR (FLD (f_operand1), opval);
1680 written |= (1 << 9);
1681 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1686 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1687 tmp_carry = CPU (h_cbit);
1688 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1692 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))));
1693 CPU (h_cbit) = opval;
1694 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1697 BI opval = LTHI (tmp_newval, 0);
1698 CPU (h_nbit) = opval;
1699 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1702 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1703 CPU (h_zbit) = opval;
1704 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1707 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)));
1708 CPU (h_vbit) = opval;
1709 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1714 CPU (h_xbit) = opval;
1715 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1719 SET_H_INSN_PREFIXED_P (opval);
1720 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1726 abuf->written = written;
1731 CASE (sem, INSN_CMP_M_D_M) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1733 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1734 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1735 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1736 int UNUSED written = 0;
1737 IADDR UNUSED pc = abuf->addr;
1738 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1745 tmp_tmpops = ({ SI tmp_addr;
1748 tmp_postinc = FLD (f_memmode);
1749 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
1750 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
1751 ; if (NEBI (tmp_postinc, 0)) {
1753 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1754 tmp_addr = ADDSI (tmp_addr, 4);
1757 SI opval = tmp_addr;
1758 SET_H_GR (FLD (f_operand1), opval);
1759 written |= (1 << 9);
1760 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1765 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1766 tmp_carry = CPU (h_cbit);
1767 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1771 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))));
1772 CPU (h_cbit) = opval;
1773 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1776 BI opval = LTSI (tmp_newval, 0);
1777 CPU (h_nbit) = opval;
1778 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1781 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1782 CPU (h_zbit) = opval;
1783 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1786 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)));
1787 CPU (h_vbit) = opval;
1788 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1793 CPU (h_xbit) = opval;
1794 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1798 SET_H_INSN_PREFIXED_P (opval);
1799 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1805 abuf->written = written;
1810 CASE (sem, INSN_CMPCBR) : /* cmp.b $sconst8,$Rd */
1812 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1813 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1814 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1815 int UNUSED written = 0;
1816 IADDR UNUSED pc = abuf->addr;
1817 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1824 tmp_tmpops = TRUNCSIQI (FLD (f_indir_pc__byte));
1825 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1826 tmp_carry = CPU (h_cbit);
1827 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1831 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))));
1832 CPU (h_cbit) = opval;
1833 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1836 BI opval = LTQI (tmp_newval, 0);
1837 CPU (h_nbit) = opval;
1838 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1841 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1842 CPU (h_zbit) = opval;
1843 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1846 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)));
1847 CPU (h_vbit) = opval;
1848 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1853 CPU (h_xbit) = opval;
1854 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1858 SET_H_INSN_PREFIXED_P (opval);
1859 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1869 CASE (sem, INSN_CMPCWR) : /* cmp.w $sconst16,$Rd */
1871 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1872 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1873 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1874 int UNUSED written = 0;
1875 IADDR UNUSED pc = abuf->addr;
1876 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1883 tmp_tmpops = TRUNCSIHI (FLD (f_indir_pc__word));
1884 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1885 tmp_carry = CPU (h_cbit);
1886 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1890 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))));
1891 CPU (h_cbit) = opval;
1892 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1895 BI opval = LTHI (tmp_newval, 0);
1896 CPU (h_nbit) = opval;
1897 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1900 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1901 CPU (h_zbit) = opval;
1902 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1905 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)));
1906 CPU (h_vbit) = opval;
1907 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1912 CPU (h_xbit) = opval;
1913 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1917 SET_H_INSN_PREFIXED_P (opval);
1918 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1928 CASE (sem, INSN_CMPCDR) : /* cmp.d $const32,$Rd */
1930 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1931 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1932 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1933 int UNUSED written = 0;
1934 IADDR UNUSED pc = abuf->addr;
1935 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
1942 tmp_tmpops = FLD (f_indir_pc__dword);
1943 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
1944 tmp_carry = CPU (h_cbit);
1945 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
1949 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))));
1950 CPU (h_cbit) = opval;
1951 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1954 BI opval = LTSI (tmp_newval, 0);
1955 CPU (h_nbit) = opval;
1956 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1959 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
1960 CPU (h_zbit) = opval;
1961 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1964 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)));
1965 CPU (h_vbit) = opval;
1966 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1971 CPU (h_xbit) = opval;
1972 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
1976 SET_H_INSN_PREFIXED_P (opval);
1977 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
1987 CASE (sem, INSN_CMPQ) : /* cmpq $i,$Rd */
1989 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1990 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1991 #define FLD(f) abuf->fields.sfmt_andq.f
1992 int UNUSED written = 0;
1993 IADDR UNUSED pc = abuf->addr;
1994 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2001 tmp_tmpops = FLD (f_s6);
2002 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2003 tmp_carry = CPU (h_cbit);
2004 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2008 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))));
2009 CPU (h_cbit) = opval;
2010 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2013 BI opval = LTSI (tmp_newval, 0);
2014 CPU (h_nbit) = opval;
2015 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2018 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2019 CPU (h_zbit) = opval;
2020 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2023 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)));
2024 CPU (h_vbit) = opval;
2025 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2030 CPU (h_xbit) = opval;
2031 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2035 SET_H_INSN_PREFIXED_P (opval);
2036 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2046 CASE (sem, INSN_CMPS_M_B_M) : /* cmps-m.b [${Rs}${inc}],$Rd */
2048 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2049 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2050 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2051 int UNUSED written = 0;
2052 IADDR UNUSED pc = abuf->addr;
2053 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2060 tmp_tmpops = EXTQISI (({ SI tmp_addr;
2063 tmp_postinc = FLD (f_memmode);
2064 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2065 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2066 ; if (NEBI (tmp_postinc, 0)) {
2068 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2069 tmp_addr = ADDSI (tmp_addr, 1);
2072 SI opval = tmp_addr;
2073 SET_H_GR (FLD (f_operand1), opval);
2074 written |= (1 << 9);
2075 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2080 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2081 tmp_carry = CPU (h_cbit);
2082 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2086 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))));
2087 CPU (h_cbit) = opval;
2088 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2091 BI opval = LTSI (tmp_newval, 0);
2092 CPU (h_nbit) = opval;
2093 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2096 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2097 CPU (h_zbit) = opval;
2098 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2101 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)));
2102 CPU (h_vbit) = opval;
2103 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2108 CPU (h_xbit) = opval;
2109 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2113 SET_H_INSN_PREFIXED_P (opval);
2114 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2120 abuf->written = written;
2125 CASE (sem, INSN_CMPS_M_W_M) : /* cmps-m.w [${Rs}${inc}],$Rd */
2127 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2128 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2129 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2130 int UNUSED written = 0;
2131 IADDR UNUSED pc = abuf->addr;
2132 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2139 tmp_tmpops = EXTHISI (({ SI tmp_addr;
2142 tmp_postinc = FLD (f_memmode);
2143 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2144 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2145 ; if (NEBI (tmp_postinc, 0)) {
2147 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2148 tmp_addr = ADDSI (tmp_addr, 2);
2151 SI opval = tmp_addr;
2152 SET_H_GR (FLD (f_operand1), opval);
2153 written |= (1 << 9);
2154 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2159 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2160 tmp_carry = CPU (h_cbit);
2161 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2165 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))));
2166 CPU (h_cbit) = opval;
2167 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2170 BI opval = LTSI (tmp_newval, 0);
2171 CPU (h_nbit) = opval;
2172 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2175 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2176 CPU (h_zbit) = opval;
2177 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2180 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)));
2181 CPU (h_vbit) = opval;
2182 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2187 CPU (h_xbit) = opval;
2188 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2192 SET_H_INSN_PREFIXED_P (opval);
2193 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2199 abuf->written = written;
2204 CASE (sem, INSN_CMPSCBR) : /* [${Rs}${inc}],$Rd */
2206 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2207 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2208 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2209 int UNUSED written = 0;
2210 IADDR UNUSED pc = abuf->addr;
2211 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2218 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2219 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2220 tmp_carry = CPU (h_cbit);
2221 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2225 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))));
2226 CPU (h_cbit) = opval;
2227 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2230 BI opval = LTSI (tmp_newval, 0);
2231 CPU (h_nbit) = opval;
2232 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2235 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2236 CPU (h_zbit) = opval;
2237 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2240 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)));
2241 CPU (h_vbit) = opval;
2242 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2247 CPU (h_xbit) = opval;
2248 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2252 SET_H_INSN_PREFIXED_P (opval);
2253 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2263 CASE (sem, INSN_CMPSCWR) : /* [${Rs}${inc}],$Rd */
2265 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2266 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2267 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2268 int UNUSED written = 0;
2269 IADDR UNUSED pc = abuf->addr;
2270 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2277 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2278 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2279 tmp_carry = CPU (h_cbit);
2280 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2284 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))));
2285 CPU (h_cbit) = opval;
2286 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2289 BI opval = LTSI (tmp_newval, 0);
2290 CPU (h_nbit) = opval;
2291 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2294 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2295 CPU (h_zbit) = opval;
2296 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2299 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)));
2300 CPU (h_vbit) = opval;
2301 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2306 CPU (h_xbit) = opval;
2307 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2311 SET_H_INSN_PREFIXED_P (opval);
2312 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2322 CASE (sem, INSN_CMPU_M_B_M) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2324 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2325 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2326 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2327 int UNUSED written = 0;
2328 IADDR UNUSED pc = abuf->addr;
2329 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2336 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
2339 tmp_postinc = FLD (f_memmode);
2340 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2341 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2342 ; if (NEBI (tmp_postinc, 0)) {
2344 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2345 tmp_addr = ADDSI (tmp_addr, 1);
2348 SI opval = tmp_addr;
2349 SET_H_GR (FLD (f_operand1), opval);
2350 written |= (1 << 9);
2351 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2356 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2357 tmp_carry = CPU (h_cbit);
2358 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2362 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))));
2363 CPU (h_cbit) = opval;
2364 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2367 BI opval = LTSI (tmp_newval, 0);
2368 CPU (h_nbit) = opval;
2369 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2372 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2373 CPU (h_zbit) = opval;
2374 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2377 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)));
2378 CPU (h_vbit) = opval;
2379 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2384 CPU (h_xbit) = opval;
2385 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2389 SET_H_INSN_PREFIXED_P (opval);
2390 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2396 abuf->written = written;
2401 CASE (sem, INSN_CMPU_M_W_M) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2403 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2404 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2405 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2406 int UNUSED written = 0;
2407 IADDR UNUSED pc = abuf->addr;
2408 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2415 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
2418 tmp_postinc = FLD (f_memmode);
2419 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2420 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2421 ; if (NEBI (tmp_postinc, 0)) {
2423 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2424 tmp_addr = ADDSI (tmp_addr, 2);
2427 SI opval = tmp_addr;
2428 SET_H_GR (FLD (f_operand1), opval);
2429 written |= (1 << 9);
2430 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2435 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2436 tmp_carry = CPU (h_cbit);
2437 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2441 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))));
2442 CPU (h_cbit) = opval;
2443 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2446 BI opval = LTSI (tmp_newval, 0);
2447 CPU (h_nbit) = opval;
2448 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2451 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2452 CPU (h_zbit) = opval;
2453 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2456 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)));
2457 CPU (h_vbit) = opval;
2458 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2463 CPU (h_xbit) = opval;
2464 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2468 SET_H_INSN_PREFIXED_P (opval);
2469 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2475 abuf->written = written;
2480 CASE (sem, INSN_CMPUCBR) : /* [${Rs}${inc}],$Rd */
2482 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2483 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2484 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2485 int UNUSED written = 0;
2486 IADDR UNUSED pc = abuf->addr;
2487 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2494 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
2495 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2496 tmp_carry = CPU (h_cbit);
2497 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2501 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))));
2502 CPU (h_cbit) = opval;
2503 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2506 BI opval = LTSI (tmp_newval, 0);
2507 CPU (h_nbit) = opval;
2508 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2511 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2512 CPU (h_zbit) = opval;
2513 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2516 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)));
2517 CPU (h_vbit) = opval;
2518 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2523 CPU (h_xbit) = opval;
2524 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2528 SET_H_INSN_PREFIXED_P (opval);
2529 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2539 CASE (sem, INSN_CMPUCWR) : /* [${Rs}${inc}],$Rd */
2541 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2542 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2543 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2544 int UNUSED written = 0;
2545 IADDR UNUSED pc = abuf->addr;
2546 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2553 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
2554 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
2555 tmp_carry = CPU (h_cbit);
2556 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
2560 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))));
2561 CPU (h_cbit) = opval;
2562 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2565 BI opval = LTSI (tmp_newval, 0);
2566 CPU (h_nbit) = opval;
2567 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2570 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
2571 CPU (h_zbit) = opval;
2572 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2575 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)));
2576 CPU (h_vbit) = opval;
2577 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
2582 CPU (h_xbit) = opval;
2583 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2587 SET_H_INSN_PREFIXED_P (opval);
2588 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2598 CASE (sem, INSN_MOVE_M_B_M) : /* move-m.b [${Rs}${inc}],${Rd} */
2600 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2601 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2602 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2603 int UNUSED written = 0;
2604 IADDR UNUSED pc = abuf->addr;
2605 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2609 tmp_tmp = ({ SI tmp_addr;
2612 tmp_postinc = FLD (f_memmode);
2613 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2614 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2615 ; if (NEBI (tmp_postinc, 0)) {
2617 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2618 tmp_addr = ADDSI (tmp_addr, 1);
2621 SI opval = tmp_addr;
2622 SET_H_GR (FLD (f_operand1), opval);
2623 written |= (1 << 10);
2624 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2631 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2633 SI opval = ORSI (ANDSI (tmp_tmp, 255), ANDSI (tmp_oldregval, 0xffffff00));
2634 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2635 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2640 BI opval = LTQI (tmp_tmp, 0);
2641 CPU (h_nbit) = opval;
2642 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2645 BI opval = ANDIF (EQQI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2646 CPU (h_zbit) = opval;
2647 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2649 SET_H_CBIT_MOVE (0);
2650 SET_H_VBIT_MOVE (0);
2654 CPU (h_xbit) = opval;
2655 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2659 SET_H_INSN_PREFIXED_P (opval);
2660 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2666 abuf->written = written;
2671 CASE (sem, INSN_MOVE_M_W_M) : /* move-m.w [${Rs}${inc}],${Rd} */
2673 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2674 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2675 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2676 int UNUSED written = 0;
2677 IADDR UNUSED pc = abuf->addr;
2678 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2682 tmp_tmp = ({ SI tmp_addr;
2685 tmp_postinc = FLD (f_memmode);
2686 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2687 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2688 ; if (NEBI (tmp_postinc, 0)) {
2690 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2691 tmp_addr = ADDSI (tmp_addr, 2);
2694 SI opval = tmp_addr;
2695 SET_H_GR (FLD (f_operand1), opval);
2696 written |= (1 << 10);
2697 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2704 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
2706 SI opval = ORSI (ANDSI (tmp_tmp, 65535), ANDSI (tmp_oldregval, 0xffff0000));
2707 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2708 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2713 BI opval = LTHI (tmp_tmp, 0);
2714 CPU (h_nbit) = opval;
2715 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2718 BI opval = ANDIF (EQHI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2719 CPU (h_zbit) = opval;
2720 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2722 SET_H_CBIT_MOVE (0);
2723 SET_H_VBIT_MOVE (0);
2727 CPU (h_xbit) = opval;
2728 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2732 SET_H_INSN_PREFIXED_P (opval);
2733 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2739 abuf->written = written;
2744 CASE (sem, INSN_MOVE_M_D_M) : /* move-m.d [${Rs}${inc}],${Rd} */
2746 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2747 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2748 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2749 int UNUSED written = 0;
2750 IADDR UNUSED pc = abuf->addr;
2751 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2755 tmp_tmp = ({ SI tmp_addr;
2758 tmp_postinc = FLD (f_memmode);
2759 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2760 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
2761 ; if (NEBI (tmp_postinc, 0)) {
2763 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2764 tmp_addr = ADDSI (tmp_addr, 4);
2767 SI opval = tmp_addr;
2768 SET_H_GR (FLD (f_operand1), opval);
2769 written |= (1 << 9);
2770 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2777 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
2778 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2782 BI opval = LTSI (tmp_tmp, 0);
2783 CPU (h_nbit) = opval;
2784 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2787 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2788 CPU (h_zbit) = opval;
2789 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2791 SET_H_CBIT_MOVE (0);
2792 SET_H_VBIT_MOVE (0);
2796 CPU (h_xbit) = opval;
2797 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2801 SET_H_INSN_PREFIXED_P (opval);
2802 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2808 abuf->written = written;
2813 CASE (sem, INSN_MOVS_M_B_M) : /* movs-m.b [${Rs}${inc}],${Rd} */
2815 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2816 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2817 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2818 int UNUSED written = 0;
2819 IADDR UNUSED pc = abuf->addr;
2820 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2824 tmp_tmp = EXTQISI (({ SI tmp_addr;
2827 tmp_postinc = FLD (f_memmode);
2828 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2829 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2830 ; if (NEBI (tmp_postinc, 0)) {
2832 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2833 tmp_addr = ADDSI (tmp_addr, 1);
2836 SI opval = tmp_addr;
2837 SET_H_GR (FLD (f_operand1), opval);
2838 written |= (1 << 8);
2839 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2844 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2847 SET_H_GR (FLD (f_operand1), opval);
2848 written |= (1 << 8);
2849 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2854 SET_H_GR (FLD (f_operand2), opval);
2855 written |= (1 << 7);
2856 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2861 BI opval = LTSI (tmp_tmp, 0);
2862 CPU (h_nbit) = opval;
2863 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2866 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2867 CPU (h_zbit) = opval;
2868 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2870 SET_H_CBIT_MOVE (0);
2871 SET_H_VBIT_MOVE (0);
2875 CPU (h_xbit) = opval;
2876 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2880 SET_H_INSN_PREFIXED_P (opval);
2881 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2887 abuf->written = written;
2892 CASE (sem, INSN_MOVS_M_W_M) : /* movs-m.w [${Rs}${inc}],${Rd} */
2894 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2895 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2896 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2897 int UNUSED written = 0;
2898 IADDR UNUSED pc = abuf->addr;
2899 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2903 tmp_tmp = EXTHISI (({ SI tmp_addr;
2906 tmp_postinc = FLD (f_memmode);
2907 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2908 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
2909 ; if (NEBI (tmp_postinc, 0)) {
2911 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2912 tmp_addr = ADDSI (tmp_addr, 2);
2915 SI opval = tmp_addr;
2916 SET_H_GR (FLD (f_operand1), opval);
2917 written |= (1 << 8);
2918 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2923 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
2926 SET_H_GR (FLD (f_operand1), opval);
2927 written |= (1 << 8);
2928 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2933 SET_H_GR (FLD (f_operand2), opval);
2934 written |= (1 << 7);
2935 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2940 BI opval = LTSI (tmp_tmp, 0);
2941 CPU (h_nbit) = opval;
2942 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2945 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
2946 CPU (h_zbit) = opval;
2947 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2949 SET_H_CBIT_MOVE (0);
2950 SET_H_VBIT_MOVE (0);
2954 CPU (h_xbit) = opval;
2955 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
2959 SET_H_INSN_PREFIXED_P (opval);
2960 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
2966 abuf->written = written;
2971 CASE (sem, INSN_MOVU_M_B_M) : /* movu-m.b [${Rs}${inc}],${Rd} */
2973 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2974 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2975 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2976 int UNUSED written = 0;
2977 IADDR UNUSED pc = abuf->addr;
2978 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2982 tmp_tmp = ZEXTQISI (({ SI tmp_addr;
2985 tmp_postinc = FLD (f_memmode);
2986 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
2987 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
2988 ; if (NEBI (tmp_postinc, 0)) {
2990 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2991 tmp_addr = ADDSI (tmp_addr, 1);
2994 SI opval = tmp_addr;
2995 SET_H_GR (FLD (f_operand1), opval);
2996 written |= (1 << 8);
2997 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3002 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3005 SET_H_GR (FLD (f_operand1), opval);
3006 written |= (1 << 8);
3007 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3012 SET_H_GR (FLD (f_operand2), opval);
3013 written |= (1 << 7);
3014 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3019 BI opval = LTSI (tmp_tmp, 0);
3020 CPU (h_nbit) = opval;
3021 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3024 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3025 CPU (h_zbit) = opval;
3026 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3028 SET_H_CBIT_MOVE (0);
3029 SET_H_VBIT_MOVE (0);
3033 CPU (h_xbit) = opval;
3034 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3038 SET_H_INSN_PREFIXED_P (opval);
3039 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3045 abuf->written = written;
3050 CASE (sem, INSN_MOVU_M_W_M) : /* movu-m.w [${Rs}${inc}],${Rd} */
3052 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3053 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3054 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
3055 int UNUSED written = 0;
3056 IADDR UNUSED pc = abuf->addr;
3057 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3061 tmp_tmp = ZEXTHISI (({ SI tmp_addr;
3064 tmp_postinc = FLD (f_memmode);
3065 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3066 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
3067 ; if (NEBI (tmp_postinc, 0)) {
3069 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3070 tmp_addr = ADDSI (tmp_addr, 2);
3073 SI opval = tmp_addr;
3074 SET_H_GR (FLD (f_operand1), opval);
3075 written |= (1 << 8);
3076 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3081 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
3084 SET_H_GR (FLD (f_operand1), opval);
3085 written |= (1 << 8);
3086 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3091 SET_H_GR (FLD (f_operand2), opval);
3092 written |= (1 << 7);
3093 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3098 BI opval = LTSI (tmp_tmp, 0);
3099 CPU (h_nbit) = opval;
3100 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
3103 BI opval = ANDIF (EQSI (tmp_tmp, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
3104 CPU (h_zbit) = opval;
3105 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
3107 SET_H_CBIT_MOVE (0);
3108 SET_H_VBIT_MOVE (0);
3112 CPU (h_xbit) = opval;
3113 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3117 SET_H_INSN_PREFIXED_P (opval);
3118 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3124 abuf->written = written;
3129 CASE (sem, INSN_MOVE_R_SPRV10) : /* move ${Rs},${Pd} */
3131 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3132 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3133 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3134 int UNUSED written = 0;
3135 IADDR UNUSED pc = abuf->addr;
3136 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3141 tmp_tmp = GET_H_GR (FLD (f_operand1));
3142 tmp_rno = FLD (f_operand2);
3143 if (ORIF (ORIF (EQSI (tmp_rno, 0), EQSI (tmp_rno, 1)), ORIF (EQSI (tmp_rno, 4), EQSI (tmp_rno, 8)))) {
3144 cgen_rtx_error (current_cpu, "move-r-spr: trying to set a read-only special register");
3149 SET_H_SR (FLD (f_operand2), opval);
3150 written |= (1 << 2);
3151 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3157 CPU (h_xbit) = opval;
3158 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3162 SET_H_INSN_PREFIXED_P (opval);
3163 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3168 abuf->written = written;
3173 CASE (sem, INSN_MOVE_SPR_RV10) : /* move ${Ps},${Rd-sfield} */
3175 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3176 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3177 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3178 int UNUSED written = 0;
3179 IADDR UNUSED pc = abuf->addr;
3180 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3186 tmp_prno = FLD (f_operand2);
3187 tmp_newval = GET_H_SR (FLD (f_operand2));
3188 if (EQSI (tmp_prno, 5)) {
3191 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3193 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3194 SET_H_GR (FLD (f_operand1), opval);
3195 written |= (1 << 4);
3196 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3200 else if (EQSI (tmp_prno, 9)) {
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, 10)) {
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, 11)) {
3218 SI opval = tmp_newval;
3219 SET_H_GR (FLD (f_operand1), opval);
3220 written |= (1 << 4);
3221 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3224 else if (EQSI (tmp_prno, 12)) {
3226 SI opval = tmp_newval;
3227 SET_H_GR (FLD (f_operand1), opval);
3228 written |= (1 << 4);
3229 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3232 else if (EQSI (tmp_prno, 13)) {
3234 SI opval = tmp_newval;
3235 SET_H_GR (FLD (f_operand1), opval);
3236 written |= (1 << 4);
3237 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3240 else if (EQSI (tmp_prno, 0)) {
3243 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3245 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
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, 1)) {
3255 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3257 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
3258 SET_H_GR (FLD (f_operand1), opval);
3259 written |= (1 << 4);
3260 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3264 else if (EQSI (tmp_prno, 4)) {
3267 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand1));
3269 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
3270 SET_H_GR (FLD (f_operand1), opval);
3271 written |= (1 << 4);
3272 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3276 else if (EQSI (tmp_prno, 8)) {
3278 SI opval = tmp_newval;
3279 SET_H_GR (FLD (f_operand1), opval);
3280 written |= (1 << 4);
3281 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3284 else if (EQSI (tmp_prno, 7)) {
3286 SI opval = tmp_newval;
3287 SET_H_GR (FLD (f_operand1), opval);
3288 written |= (1 << 4);
3289 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3292 else if (EQSI (tmp_prno, 14)) {
3294 SI opval = tmp_newval;
3295 SET_H_GR (FLD (f_operand1), opval);
3296 written |= (1 << 4);
3297 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3300 else if (EQSI (tmp_prno, 15)) {
3302 SI opval = tmp_newval;
3303 SET_H_GR (FLD (f_operand1), opval);
3304 written |= (1 << 4);
3305 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3309 cgen_rtx_error (current_cpu, "move-spr-r from unimplemented register");
3314 CPU (h_xbit) = opval;
3315 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3319 SET_H_INSN_PREFIXED_P (opval);
3320 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3325 abuf->written = written;
3330 CASE (sem, INSN_RET_TYPE) : /* ret/reti/retb */
3332 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3333 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3334 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3335 int UNUSED written = 0;
3336 IADDR UNUSED pc = abuf->addr;
3338 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3342 tmp_retaddr = GET_H_SR (FLD (f_operand2));
3346 CPU (h_xbit) = opval;
3347 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3351 SET_H_INSN_PREFIXED_P (opval);
3352 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3357 USI opval = tmp_retaddr;
3358 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3359 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3364 SEM_BRANCH_FINI (vpc);
3369 CASE (sem, INSN_MOVE_M_SPRV10) : /* move [${Rs}${inc}],${Pd} */
3371 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3372 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3373 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3374 int UNUSED written = 0;
3375 IADDR UNUSED pc = abuf->addr;
3376 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3381 tmp_rno = FLD (f_operand2);
3382 if (EQSI (tmp_rno, 5)) {
3383 tmp_newval = EXTHISI (({ SI tmp_addr;
3386 tmp_postinc = FLD (f_memmode);
3387 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3388 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
3389 ; if (NEBI (tmp_postinc, 0)) {
3391 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3392 tmp_addr = ADDSI (tmp_addr, 2);
3395 SI opval = tmp_addr;
3396 SET_H_GR (FLD (f_operand1), opval);
3397 written |= (1 << 8);
3398 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3404 else if (EQSI (tmp_rno, 9)) {
3405 tmp_newval = ({ SI tmp_addr;
3408 tmp_postinc = FLD (f_memmode);
3409 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3410 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3411 ; if (NEBI (tmp_postinc, 0)) {
3413 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3414 tmp_addr = ADDSI (tmp_addr, 4);
3417 SI opval = tmp_addr;
3418 SET_H_GR (FLD (f_operand1), opval);
3419 written |= (1 << 8);
3420 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3426 else if (EQSI (tmp_rno, 10)) {
3427 tmp_newval = ({ SI tmp_addr;
3430 tmp_postinc = FLD (f_memmode);
3431 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3432 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3433 ; if (NEBI (tmp_postinc, 0)) {
3435 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3436 tmp_addr = ADDSI (tmp_addr, 4);
3439 SI opval = tmp_addr;
3440 SET_H_GR (FLD (f_operand1), opval);
3441 written |= (1 << 8);
3442 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3448 else if (EQSI (tmp_rno, 11)) {
3449 tmp_newval = ({ SI tmp_addr;
3452 tmp_postinc = FLD (f_memmode);
3453 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3454 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3455 ; if (NEBI (tmp_postinc, 0)) {
3457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3458 tmp_addr = ADDSI (tmp_addr, 4);
3461 SI opval = tmp_addr;
3462 SET_H_GR (FLD (f_operand1), opval);
3463 written |= (1 << 8);
3464 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3470 else if (EQSI (tmp_rno, 12)) {
3471 tmp_newval = ({ SI tmp_addr;
3474 tmp_postinc = FLD (f_memmode);
3475 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3476 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3477 ; if (NEBI (tmp_postinc, 0)) {
3479 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3480 tmp_addr = ADDSI (tmp_addr, 4);
3483 SI opval = tmp_addr;
3484 SET_H_GR (FLD (f_operand1), opval);
3485 written |= (1 << 8);
3486 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3492 else if (EQSI (tmp_rno, 13)) {
3493 tmp_newval = ({ SI tmp_addr;
3496 tmp_postinc = FLD (f_memmode);
3497 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3498 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3499 ; if (NEBI (tmp_postinc, 0)) {
3501 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3502 tmp_addr = ADDSI (tmp_addr, 4);
3505 SI opval = tmp_addr;
3506 SET_H_GR (FLD (f_operand1), opval);
3507 written |= (1 << 8);
3508 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3514 else if (EQSI (tmp_rno, 7)) {
3515 tmp_newval = ({ SI tmp_addr;
3518 tmp_postinc = FLD (f_memmode);
3519 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3520 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3521 ; if (NEBI (tmp_postinc, 0)) {
3523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3524 tmp_addr = ADDSI (tmp_addr, 4);
3527 SI opval = tmp_addr;
3528 SET_H_GR (FLD (f_operand1), opval);
3529 written |= (1 << 8);
3530 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3536 else if (EQSI (tmp_rno, 14)) {
3537 tmp_newval = ({ SI tmp_addr;
3540 tmp_postinc = FLD (f_memmode);
3541 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3542 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3543 ; if (NEBI (tmp_postinc, 0)) {
3545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3546 tmp_addr = ADDSI (tmp_addr, 4);
3549 SI opval = tmp_addr;
3550 SET_H_GR (FLD (f_operand1), opval);
3551 written |= (1 << 8);
3552 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3558 else if (EQSI (tmp_rno, 15)) {
3559 tmp_newval = ({ SI tmp_addr;
3562 tmp_postinc = FLD (f_memmode);
3563 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3564 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
3565 ; if (NEBI (tmp_postinc, 0)) {
3567 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3568 tmp_addr = ADDSI (tmp_addr, 4);
3571 SI opval = tmp_addr;
3572 SET_H_GR (FLD (f_operand1), opval);
3573 written |= (1 << 8);
3574 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3581 cgen_rtx_error (current_cpu, "Trying to set unimplemented special register");
3584 SI opval = tmp_newval;
3585 SET_H_SR (FLD (f_operand2), opval);
3586 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3591 CPU (h_xbit) = opval;
3592 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3596 SET_H_INSN_PREFIXED_P (opval);
3597 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3602 abuf->written = written;
3607 CASE (sem, INSN_MOVE_C_SPRV10_P5) : /* move ${sconst16},${Pd} */
3609 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3610 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3611 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p5.f
3612 int UNUSED written = 0;
3613 IADDR UNUSED pc = abuf->addr;
3614 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3618 SI opval = FLD (f_indir_pc__word);
3619 SET_H_SR (FLD (f_operand2), opval);
3620 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3625 CPU (h_xbit) = opval;
3626 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3630 SET_H_INSN_PREFIXED_P (opval);
3631 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3640 CASE (sem, INSN_MOVE_C_SPRV10_P9) : /* move ${const32},${Pd} */
3642 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3643 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3644 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3645 int UNUSED written = 0;
3646 IADDR UNUSED pc = abuf->addr;
3647 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3651 SI opval = FLD (f_indir_pc__dword);
3652 SET_H_SR (FLD (f_operand2), opval);
3653 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3658 CPU (h_xbit) = opval;
3659 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3663 SET_H_INSN_PREFIXED_P (opval);
3664 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3673 CASE (sem, INSN_MOVE_C_SPRV10_P10) : /* move ${const32},${Pd} */
3675 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3676 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3677 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3678 int UNUSED written = 0;
3679 IADDR UNUSED pc = abuf->addr;
3680 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3684 SI opval = FLD (f_indir_pc__dword);
3685 SET_H_SR (FLD (f_operand2), opval);
3686 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3691 CPU (h_xbit) = opval;
3692 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3696 SET_H_INSN_PREFIXED_P (opval);
3697 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3706 CASE (sem, INSN_MOVE_C_SPRV10_P11) : /* move ${const32},${Pd} */
3708 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3709 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3710 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3711 int UNUSED written = 0;
3712 IADDR UNUSED pc = abuf->addr;
3713 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3717 SI opval = FLD (f_indir_pc__dword);
3718 SET_H_SR (FLD (f_operand2), opval);
3719 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3724 CPU (h_xbit) = opval;
3725 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3729 SET_H_INSN_PREFIXED_P (opval);
3730 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3739 CASE (sem, INSN_MOVE_C_SPRV10_P12) : /* move ${const32},${Pd} */
3741 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3742 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3743 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3744 int UNUSED written = 0;
3745 IADDR UNUSED pc = abuf->addr;
3746 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3750 SI opval = FLD (f_indir_pc__dword);
3751 SET_H_SR (FLD (f_operand2), opval);
3752 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3757 CPU (h_xbit) = opval;
3758 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3762 SET_H_INSN_PREFIXED_P (opval);
3763 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3772 CASE (sem, INSN_MOVE_C_SPRV10_P13) : /* move ${const32},${Pd} */
3774 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3775 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3776 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3777 int UNUSED written = 0;
3778 IADDR UNUSED pc = abuf->addr;
3779 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3783 SI opval = FLD (f_indir_pc__dword);
3784 SET_H_SR (FLD (f_operand2), opval);
3785 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3790 CPU (h_xbit) = opval;
3791 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3795 SET_H_INSN_PREFIXED_P (opval);
3796 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3805 CASE (sem, INSN_MOVE_C_SPRV10_P7) : /* move ${const32},${Pd} */
3807 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3808 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3809 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3810 int UNUSED written = 0;
3811 IADDR UNUSED pc = abuf->addr;
3812 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3816 SI opval = FLD (f_indir_pc__dword);
3817 SET_H_SR (FLD (f_operand2), opval);
3818 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3823 CPU (h_xbit) = opval;
3824 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3828 SET_H_INSN_PREFIXED_P (opval);
3829 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3838 CASE (sem, INSN_MOVE_C_SPRV10_P14) : /* move ${const32},${Pd} */
3840 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3841 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3842 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3843 int UNUSED written = 0;
3844 IADDR UNUSED pc = abuf->addr;
3845 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3849 SI opval = FLD (f_indir_pc__dword);
3850 SET_H_SR (FLD (f_operand2), opval);
3851 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3856 CPU (h_xbit) = opval;
3857 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3861 SET_H_INSN_PREFIXED_P (opval);
3862 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3871 CASE (sem, INSN_MOVE_C_SPRV10_P15) : /* move ${const32},${Pd} */
3873 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3874 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3875 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3876 int UNUSED written = 0;
3877 IADDR UNUSED pc = abuf->addr;
3878 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
3882 SI opval = FLD (f_indir_pc__dword);
3883 SET_H_SR (FLD (f_operand2), opval);
3884 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
3889 CPU (h_xbit) = opval;
3890 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
3894 SET_H_INSN_PREFIXED_P (opval);
3895 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
3904 CASE (sem, INSN_MOVE_SPR_MV10) : /* move ${Ps},[${Rd-sfield}${inc}] */
3906 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3907 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3908 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
3909 int UNUSED written = 0;
3910 IADDR UNUSED pc = abuf->addr;
3911 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3915 tmp_rno = FLD (f_operand2);
3916 if (EQSI (tmp_rno, 5)) {
3920 tmp_postinc = FLD (f_memmode);
3921 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3922 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
3923 if (EQBI (CPU (h_pbit), 0)) {
3926 HI opval = GET_H_SR (FLD (f_operand2));
3927 SETMEMHI (current_cpu, pc, tmp_addr, opval);
3928 written |= (1 << 11);
3929 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3932 BI opval = CPU (h_pbit);
3933 CPU (h_cbit) = opval;
3934 written |= (1 << 10);
3935 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3941 CPU (h_cbit) = opval;
3942 written |= (1 << 10);
3943 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3948 HI opval = GET_H_SR (FLD (f_operand2));
3949 SETMEMHI (current_cpu, pc, tmp_addr, opval);
3950 written |= (1 << 11);
3951 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3954 if (NEBI (tmp_postinc, 0)) {
3956 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3957 tmp_addr = ADDSI (tmp_addr, 2);
3960 SI opval = tmp_addr;
3961 SET_H_GR (FLD (f_operand1), opval);
3962 written |= (1 << 9);
3963 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3969 else if (EQSI (tmp_rno, 9)) {
3973 tmp_postinc = FLD (f_memmode);
3974 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
3975 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
3976 if (EQBI (CPU (h_pbit), 0)) {
3979 SI opval = GET_H_SR (FLD (f_operand2));
3980 SETMEMSI (current_cpu, pc, tmp_addr, opval);
3981 written |= (1 << 13);
3982 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3985 BI opval = CPU (h_pbit);
3986 CPU (h_cbit) = opval;
3987 written |= (1 << 10);
3988 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
3994 CPU (h_cbit) = opval;
3995 written |= (1 << 10);
3996 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4001 SI opval = GET_H_SR (FLD (f_operand2));
4002 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4003 written |= (1 << 13);
4004 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4007 if (NEBI (tmp_postinc, 0)) {
4009 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4010 tmp_addr = ADDSI (tmp_addr, 4);
4013 SI opval = tmp_addr;
4014 SET_H_GR (FLD (f_operand1), opval);
4015 written |= (1 << 9);
4016 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4022 else if (EQSI (tmp_rno, 10)) {
4026 tmp_postinc = FLD (f_memmode);
4027 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4028 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4029 if (EQBI (CPU (h_pbit), 0)) {
4032 SI opval = GET_H_SR (FLD (f_operand2));
4033 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4034 written |= (1 << 13);
4035 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4038 BI opval = CPU (h_pbit);
4039 CPU (h_cbit) = opval;
4040 written |= (1 << 10);
4041 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4047 CPU (h_cbit) = opval;
4048 written |= (1 << 10);
4049 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4054 SI opval = GET_H_SR (FLD (f_operand2));
4055 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4056 written |= (1 << 13);
4057 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4060 if (NEBI (tmp_postinc, 0)) {
4062 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4063 tmp_addr = ADDSI (tmp_addr, 4);
4066 SI opval = tmp_addr;
4067 SET_H_GR (FLD (f_operand1), opval);
4068 written |= (1 << 9);
4069 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4075 else if (EQSI (tmp_rno, 11)) {
4079 tmp_postinc = FLD (f_memmode);
4080 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4081 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4082 if (EQBI (CPU (h_pbit), 0)) {
4085 SI opval = GET_H_SR (FLD (f_operand2));
4086 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4087 written |= (1 << 13);
4088 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4091 BI opval = CPU (h_pbit);
4092 CPU (h_cbit) = opval;
4093 written |= (1 << 10);
4094 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4100 CPU (h_cbit) = opval;
4101 written |= (1 << 10);
4102 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4107 SI opval = GET_H_SR (FLD (f_operand2));
4108 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4109 written |= (1 << 13);
4110 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4113 if (NEBI (tmp_postinc, 0)) {
4115 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4116 tmp_addr = ADDSI (tmp_addr, 4);
4119 SI opval = tmp_addr;
4120 SET_H_GR (FLD (f_operand1), opval);
4121 written |= (1 << 9);
4122 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4128 else if (EQSI (tmp_rno, 12)) {
4132 tmp_postinc = FLD (f_memmode);
4133 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4134 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4135 if (EQBI (CPU (h_pbit), 0)) {
4138 SI opval = GET_H_SR (FLD (f_operand2));
4139 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4140 written |= (1 << 13);
4141 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4144 BI opval = CPU (h_pbit);
4145 CPU (h_cbit) = opval;
4146 written |= (1 << 10);
4147 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4153 CPU (h_cbit) = opval;
4154 written |= (1 << 10);
4155 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4160 SI opval = GET_H_SR (FLD (f_operand2));
4161 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4162 written |= (1 << 13);
4163 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4166 if (NEBI (tmp_postinc, 0)) {
4168 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4169 tmp_addr = ADDSI (tmp_addr, 4);
4172 SI opval = tmp_addr;
4173 SET_H_GR (FLD (f_operand1), opval);
4174 written |= (1 << 9);
4175 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4181 else if (EQSI (tmp_rno, 13)) {
4185 tmp_postinc = FLD (f_memmode);
4186 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4187 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4188 if (EQBI (CPU (h_pbit), 0)) {
4191 SI opval = GET_H_SR (FLD (f_operand2));
4192 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4193 written |= (1 << 13);
4194 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4197 BI opval = CPU (h_pbit);
4198 CPU (h_cbit) = opval;
4199 written |= (1 << 10);
4200 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4206 CPU (h_cbit) = opval;
4207 written |= (1 << 10);
4208 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4213 SI opval = GET_H_SR (FLD (f_operand2));
4214 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4215 written |= (1 << 13);
4216 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4219 if (NEBI (tmp_postinc, 0)) {
4221 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4222 tmp_addr = ADDSI (tmp_addr, 4);
4225 SI opval = tmp_addr;
4226 SET_H_GR (FLD (f_operand1), opval);
4227 written |= (1 << 9);
4228 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4234 else if (EQSI (tmp_rno, 0)) {
4238 tmp_postinc = FLD (f_memmode);
4239 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4240 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4241 if (EQBI (CPU (h_pbit), 0)) {
4244 QI opval = GET_H_SR (FLD (f_operand2));
4245 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4246 written |= (1 << 12);
4247 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4250 BI opval = CPU (h_pbit);
4251 CPU (h_cbit) = opval;
4252 written |= (1 << 10);
4253 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4259 CPU (h_cbit) = opval;
4260 written |= (1 << 10);
4261 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4266 QI opval = GET_H_SR (FLD (f_operand2));
4267 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4268 written |= (1 << 12);
4269 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4272 if (NEBI (tmp_postinc, 0)) {
4274 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4275 tmp_addr = ADDSI (tmp_addr, 1);
4278 SI opval = tmp_addr;
4279 SET_H_GR (FLD (f_operand1), opval);
4280 written |= (1 << 9);
4281 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4287 else if (EQSI (tmp_rno, 1)) {
4291 tmp_postinc = FLD (f_memmode);
4292 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4293 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4294 if (EQBI (CPU (h_pbit), 0)) {
4297 QI opval = GET_H_SR (FLD (f_operand2));
4298 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4299 written |= (1 << 12);
4300 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4303 BI opval = CPU (h_pbit);
4304 CPU (h_cbit) = opval;
4305 written |= (1 << 10);
4306 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4312 CPU (h_cbit) = opval;
4313 written |= (1 << 10);
4314 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4319 QI opval = GET_H_SR (FLD (f_operand2));
4320 SETMEMQI (current_cpu, pc, tmp_addr, opval);
4321 written |= (1 << 12);
4322 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4325 if (NEBI (tmp_postinc, 0)) {
4327 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4328 tmp_addr = ADDSI (tmp_addr, 1);
4331 SI opval = tmp_addr;
4332 SET_H_GR (FLD (f_operand1), opval);
4333 written |= (1 << 9);
4334 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4340 else if (EQSI (tmp_rno, 4)) {
4344 tmp_postinc = FLD (f_memmode);
4345 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4346 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4347 if (EQBI (CPU (h_pbit), 0)) {
4350 HI opval = GET_H_SR (FLD (f_operand2));
4351 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4352 written |= (1 << 11);
4353 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4356 BI opval = CPU (h_pbit);
4357 CPU (h_cbit) = opval;
4358 written |= (1 << 10);
4359 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4365 CPU (h_cbit) = opval;
4366 written |= (1 << 10);
4367 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4372 HI opval = GET_H_SR (FLD (f_operand2));
4373 SETMEMHI (current_cpu, pc, tmp_addr, opval);
4374 written |= (1 << 11);
4375 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4378 if (NEBI (tmp_postinc, 0)) {
4380 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4381 tmp_addr = ADDSI (tmp_addr, 2);
4384 SI opval = tmp_addr;
4385 SET_H_GR (FLD (f_operand1), opval);
4386 written |= (1 << 9);
4387 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4393 else if (EQSI (tmp_rno, 8)) {
4397 tmp_postinc = FLD (f_memmode);
4398 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4399 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4400 if (EQBI (CPU (h_pbit), 0)) {
4403 SI opval = GET_H_SR (FLD (f_operand2));
4404 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4405 written |= (1 << 13);
4406 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4409 BI opval = CPU (h_pbit);
4410 CPU (h_cbit) = opval;
4411 written |= (1 << 10);
4412 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4418 CPU (h_cbit) = opval;
4419 written |= (1 << 10);
4420 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4425 SI opval = GET_H_SR (FLD (f_operand2));
4426 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4427 written |= (1 << 13);
4428 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4431 if (NEBI (tmp_postinc, 0)) {
4433 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4434 tmp_addr = ADDSI (tmp_addr, 4);
4437 SI opval = tmp_addr;
4438 SET_H_GR (FLD (f_operand1), opval);
4439 written |= (1 << 9);
4440 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4446 else if (EQSI (tmp_rno, 7)) {
4450 tmp_postinc = FLD (f_memmode);
4451 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4452 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4453 if (EQBI (CPU (h_pbit), 0)) {
4456 SI opval = GET_H_SR (FLD (f_operand2));
4457 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4458 written |= (1 << 13);
4459 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4462 BI opval = CPU (h_pbit);
4463 CPU (h_cbit) = opval;
4464 written |= (1 << 10);
4465 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4471 CPU (h_cbit) = opval;
4472 written |= (1 << 10);
4473 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4478 SI opval = GET_H_SR (FLD (f_operand2));
4479 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4480 written |= (1 << 13);
4481 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4484 if (NEBI (tmp_postinc, 0)) {
4486 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4487 tmp_addr = ADDSI (tmp_addr, 4);
4490 SI opval = tmp_addr;
4491 SET_H_GR (FLD (f_operand1), opval);
4492 written |= (1 << 9);
4493 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4499 else if (EQSI (tmp_rno, 14)) {
4503 tmp_postinc = FLD (f_memmode);
4504 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4505 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4506 if (EQBI (CPU (h_pbit), 0)) {
4509 SI opval = GET_H_SR (FLD (f_operand2));
4510 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4511 written |= (1 << 13);
4512 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4515 BI opval = CPU (h_pbit);
4516 CPU (h_cbit) = opval;
4517 written |= (1 << 10);
4518 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4524 CPU (h_cbit) = opval;
4525 written |= (1 << 10);
4526 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4531 SI opval = GET_H_SR (FLD (f_operand2));
4532 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4533 written |= (1 << 13);
4534 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4537 if (NEBI (tmp_postinc, 0)) {
4539 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4540 tmp_addr = ADDSI (tmp_addr, 4);
4543 SI opval = tmp_addr;
4544 SET_H_GR (FLD (f_operand1), opval);
4545 written |= (1 << 9);
4546 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4552 else if (EQSI (tmp_rno, 15)) {
4556 tmp_postinc = FLD (f_memmode);
4557 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4558 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
4559 if (EQBI (CPU (h_pbit), 0)) {
4562 SI opval = GET_H_SR (FLD (f_operand2));
4563 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4564 written |= (1 << 13);
4565 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4568 BI opval = CPU (h_pbit);
4569 CPU (h_cbit) = opval;
4570 written |= (1 << 10);
4571 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4577 CPU (h_cbit) = opval;
4578 written |= (1 << 10);
4579 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
4584 SI opval = GET_H_SR (FLD (f_operand2));
4585 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4586 written |= (1 << 13);
4587 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4590 if (NEBI (tmp_postinc, 0)) {
4592 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4593 tmp_addr = ADDSI (tmp_addr, 4);
4596 SI opval = tmp_addr;
4597 SET_H_GR (FLD (f_operand1), opval);
4598 written |= (1 << 9);
4599 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4606 cgen_rtx_error (current_cpu, "write from unimplemented special register");
4611 CPU (h_xbit) = opval;
4612 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4616 SET_H_INSN_PREFIXED_P (opval);
4617 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4622 abuf->written = written;
4627 CASE (sem, INSN_SBFS) : /* sbfs [${Rd-sfield}${inc}] */
4629 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4630 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4631 #define FLD(f) abuf->fields.sfmt_empty.f
4632 int UNUSED written = 0;
4633 IADDR UNUSED pc = abuf->addr;
4634 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4636 cgen_rtx_error (current_cpu, "SBFS isn't implemented");
4642 CASE (sem, INSN_MOVEM_R_M) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4644 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4645 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4646 #define FLD(f) abuf->fields.sfmt_movem_r_m.f
4647 int UNUSED written = 0;
4648 IADDR UNUSED pc = abuf->addr;
4649 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4654 tmp_postinc = FLD (f_memmode);
4657 tmp_dummy = GET_H_GR (FLD (f_operand2));
4659 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4661 if (GESI (FLD (f_operand2), 15)) {
4664 tmp_tmp = GET_H_GR (((UINT) 15));
4667 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4668 written |= (1 << 23);
4669 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4671 tmp_addr = ADDSI (tmp_addr, 4);
4674 if (GESI (FLD (f_operand2), 14)) {
4677 tmp_tmp = GET_H_GR (((UINT) 14));
4680 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4681 written |= (1 << 23);
4682 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4684 tmp_addr = ADDSI (tmp_addr, 4);
4687 if (GESI (FLD (f_operand2), 13)) {
4690 tmp_tmp = GET_H_GR (((UINT) 13));
4693 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4694 written |= (1 << 23);
4695 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4697 tmp_addr = ADDSI (tmp_addr, 4);
4700 if (GESI (FLD (f_operand2), 12)) {
4703 tmp_tmp = GET_H_GR (((UINT) 12));
4706 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4707 written |= (1 << 23);
4708 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4710 tmp_addr = ADDSI (tmp_addr, 4);
4713 if (GESI (FLD (f_operand2), 11)) {
4716 tmp_tmp = GET_H_GR (((UINT) 11));
4719 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4720 written |= (1 << 23);
4721 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4723 tmp_addr = ADDSI (tmp_addr, 4);
4726 if (GESI (FLD (f_operand2), 10)) {
4729 tmp_tmp = GET_H_GR (((UINT) 10));
4732 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4733 written |= (1 << 23);
4734 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4736 tmp_addr = ADDSI (tmp_addr, 4);
4739 if (GESI (FLD (f_operand2), 9)) {
4742 tmp_tmp = GET_H_GR (((UINT) 9));
4745 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4746 written |= (1 << 23);
4747 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4749 tmp_addr = ADDSI (tmp_addr, 4);
4752 if (GESI (FLD (f_operand2), 8)) {
4755 tmp_tmp = GET_H_GR (((UINT) 8));
4758 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4759 written |= (1 << 23);
4760 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4762 tmp_addr = ADDSI (tmp_addr, 4);
4765 if (GESI (FLD (f_operand2), 7)) {
4768 tmp_tmp = GET_H_GR (((UINT) 7));
4771 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4772 written |= (1 << 23);
4773 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4775 tmp_addr = ADDSI (tmp_addr, 4);
4778 if (GESI (FLD (f_operand2), 6)) {
4781 tmp_tmp = GET_H_GR (((UINT) 6));
4784 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4785 written |= (1 << 23);
4786 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4788 tmp_addr = ADDSI (tmp_addr, 4);
4791 if (GESI (FLD (f_operand2), 5)) {
4794 tmp_tmp = GET_H_GR (((UINT) 5));
4797 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4798 written |= (1 << 23);
4799 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4801 tmp_addr = ADDSI (tmp_addr, 4);
4804 if (GESI (FLD (f_operand2), 4)) {
4807 tmp_tmp = GET_H_GR (((UINT) 4));
4810 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4811 written |= (1 << 23);
4812 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4814 tmp_addr = ADDSI (tmp_addr, 4);
4817 if (GESI (FLD (f_operand2), 3)) {
4820 tmp_tmp = GET_H_GR (((UINT) 3));
4823 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4824 written |= (1 << 23);
4825 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4827 tmp_addr = ADDSI (tmp_addr, 4);
4830 if (GESI (FLD (f_operand2), 2)) {
4833 tmp_tmp = GET_H_GR (((UINT) 2));
4836 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4837 written |= (1 << 23);
4838 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4840 tmp_addr = ADDSI (tmp_addr, 4);
4843 if (GESI (FLD (f_operand2), 1)) {
4846 tmp_tmp = GET_H_GR (((UINT) 1));
4849 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4850 written |= (1 << 23);
4851 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4853 tmp_addr = ADDSI (tmp_addr, 4);
4856 if (GESI (FLD (f_operand2), 0)) {
4859 tmp_tmp = GET_H_GR (((UINT) 0));
4862 SETMEMSI (current_cpu, pc, tmp_addr, opval);
4863 written |= (1 << 23);
4864 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4866 tmp_addr = ADDSI (tmp_addr, 4);
4870 if (NEBI (tmp_postinc, 0)) {
4872 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
4873 SET_H_GR (FLD (f_operand1), opval);
4874 written |= (1 << 22);
4875 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4881 CPU (h_xbit) = opval;
4882 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
4886 SET_H_INSN_PREFIXED_P (opval);
4887 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
4892 abuf->written = written;
4897 CASE (sem, INSN_MOVEM_M_R) : /* movem [${Rs}${inc}],${Rd} */
4899 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4900 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4901 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
4902 int UNUSED written = 0;
4903 IADDR UNUSED pc = abuf->addr;
4904 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4909 tmp_postinc = FLD (f_memmode);
4910 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
4913 tmp_dummy = GET_H_GR (FLD (f_operand2));
4916 if (GESI (FLD (f_operand2), 14)) {
4919 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4922 SET_H_GR (((UINT) 14), opval);
4923 written |= (1 << 14);
4924 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4926 tmp_addr = ADDSI (tmp_addr, 4);
4929 if (GESI (FLD (f_operand2), 13)) {
4932 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4935 SET_H_GR (((UINT) 13), opval);
4936 written |= (1 << 13);
4937 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4939 tmp_addr = ADDSI (tmp_addr, 4);
4942 if (GESI (FLD (f_operand2), 12)) {
4945 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4948 SET_H_GR (((UINT) 12), opval);
4949 written |= (1 << 12);
4950 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4952 tmp_addr = ADDSI (tmp_addr, 4);
4955 if (GESI (FLD (f_operand2), 11)) {
4958 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4961 SET_H_GR (((UINT) 11), opval);
4962 written |= (1 << 11);
4963 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4965 tmp_addr = ADDSI (tmp_addr, 4);
4968 if (GESI (FLD (f_operand2), 10)) {
4971 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4974 SET_H_GR (((UINT) 10), opval);
4975 written |= (1 << 10);
4976 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4978 tmp_addr = ADDSI (tmp_addr, 4);
4981 if (GESI (FLD (f_operand2), 9)) {
4984 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
4987 SET_H_GR (((UINT) 9), opval);
4988 written |= (1 << 22);
4989 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4991 tmp_addr = ADDSI (tmp_addr, 4);
4994 if (GESI (FLD (f_operand2), 8)) {
4997 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5000 SET_H_GR (((UINT) 8), opval);
5001 written |= (1 << 21);
5002 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5004 tmp_addr = ADDSI (tmp_addr, 4);
5007 if (GESI (FLD (f_operand2), 7)) {
5010 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5013 SET_H_GR (((UINT) 7), opval);
5014 written |= (1 << 20);
5015 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5017 tmp_addr = ADDSI (tmp_addr, 4);
5020 if (GESI (FLD (f_operand2), 6)) {
5023 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5026 SET_H_GR (((UINT) 6), opval);
5027 written |= (1 << 19);
5028 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5030 tmp_addr = ADDSI (tmp_addr, 4);
5033 if (GESI (FLD (f_operand2), 5)) {
5036 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5039 SET_H_GR (((UINT) 5), opval);
5040 written |= (1 << 18);
5041 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5043 tmp_addr = ADDSI (tmp_addr, 4);
5046 if (GESI (FLD (f_operand2), 4)) {
5049 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5052 SET_H_GR (((UINT) 4), opval);
5053 written |= (1 << 17);
5054 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5056 tmp_addr = ADDSI (tmp_addr, 4);
5059 if (GESI (FLD (f_operand2), 3)) {
5062 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5065 SET_H_GR (((UINT) 3), opval);
5066 written |= (1 << 16);
5067 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5069 tmp_addr = ADDSI (tmp_addr, 4);
5072 if (GESI (FLD (f_operand2), 2)) {
5075 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5078 SET_H_GR (((UINT) 2), opval);
5079 written |= (1 << 15);
5080 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5082 tmp_addr = ADDSI (tmp_addr, 4);
5085 if (GESI (FLD (f_operand2), 1)) {
5088 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5091 SET_H_GR (((UINT) 1), opval);
5092 written |= (1 << 9);
5093 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5095 tmp_addr = ADDSI (tmp_addr, 4);
5098 if (GESI (FLD (f_operand2), 0)) {
5101 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5104 SET_H_GR (((UINT) 0), opval);
5105 written |= (1 << 8);
5106 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5108 tmp_addr = ADDSI (tmp_addr, 4);
5112 if (NEBI (tmp_postinc, 0)) {
5114 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
5115 SET_H_GR (FLD (f_operand1), opval);
5116 written |= (1 << 7);
5117 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5123 CPU (h_xbit) = opval;
5124 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5128 SET_H_INSN_PREFIXED_P (opval);
5129 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5134 abuf->written = written;
5139 CASE (sem, INSN_MOVEM_M_PC) : /* movem [${Rs}${inc}],${Rd} */
5141 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5142 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5143 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
5144 int UNUSED written = 0;
5145 IADDR UNUSED pc = abuf->addr;
5147 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5152 tmp_postinc = FLD (f_memmode);
5153 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5156 USI opval = GETMEMSI (current_cpu, pc, tmp_addr);
5157 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
5158 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
5160 tmp_addr = ADDSI (tmp_addr, 4);
5163 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5166 SET_H_GR (((UINT) 14), opval);
5167 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5169 tmp_addr = ADDSI (tmp_addr, 4);
5173 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5176 SET_H_GR (((UINT) 13), opval);
5177 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5179 tmp_addr = ADDSI (tmp_addr, 4);
5183 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5186 SET_H_GR (((UINT) 12), opval);
5187 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5189 tmp_addr = ADDSI (tmp_addr, 4);
5193 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5196 SET_H_GR (((UINT) 11), opval);
5197 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5199 tmp_addr = ADDSI (tmp_addr, 4);
5203 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5206 SET_H_GR (((UINT) 10), opval);
5207 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5209 tmp_addr = ADDSI (tmp_addr, 4);
5213 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5216 SET_H_GR (((UINT) 9), opval);
5217 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5219 tmp_addr = ADDSI (tmp_addr, 4);
5223 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5226 SET_H_GR (((UINT) 8), opval);
5227 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5229 tmp_addr = ADDSI (tmp_addr, 4);
5233 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5236 SET_H_GR (((UINT) 7), opval);
5237 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5239 tmp_addr = ADDSI (tmp_addr, 4);
5243 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5246 SET_H_GR (((UINT) 6), opval);
5247 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5249 tmp_addr = ADDSI (tmp_addr, 4);
5253 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5256 SET_H_GR (((UINT) 5), opval);
5257 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5259 tmp_addr = ADDSI (tmp_addr, 4);
5263 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5266 SET_H_GR (((UINT) 4), opval);
5267 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5269 tmp_addr = ADDSI (tmp_addr, 4);
5273 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5276 SET_H_GR (((UINT) 3), opval);
5277 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5279 tmp_addr = ADDSI (tmp_addr, 4);
5283 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5286 SET_H_GR (((UINT) 2), opval);
5287 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5289 tmp_addr = ADDSI (tmp_addr, 4);
5293 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5296 SET_H_GR (((UINT) 1), opval);
5297 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5299 tmp_addr = ADDSI (tmp_addr, 4);
5303 tmp_tmp = GETMEMSI (current_cpu, pc, tmp_addr);
5306 SET_H_GR (((UINT) 0), opval);
5307 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5309 tmp_addr = ADDSI (tmp_addr, 4);
5312 if (NEBI (tmp_postinc, 0)) {
5314 SI opval = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr) : (CPU (h_prefixreg_pre_v32)));
5315 SET_H_GR (FLD (f_operand1), opval);
5316 written |= (1 << 5);
5317 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5323 CPU (h_xbit) = opval;
5324 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5328 SET_H_INSN_PREFIXED_P (opval);
5329 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5334 abuf->written = written;
5335 SEM_BRANCH_FINI (vpc);
5340 CASE (sem, INSN_ADD_B_R) : /* add.b $Rs,$Rd */
5342 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5343 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5344 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5345 int UNUSED written = 0;
5346 IADDR UNUSED pc = abuf->addr;
5347 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5354 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5355 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5356 tmp_carry = CPU (h_cbit);
5357 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5360 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5362 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5363 SET_H_GR (FLD (f_operand2), opval);
5364 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5369 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))));
5370 CPU (h_cbit) = opval;
5371 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5374 BI opval = LTQI (tmp_newval, 0);
5375 CPU (h_nbit) = opval;
5376 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5379 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5380 CPU (h_zbit) = opval;
5381 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5384 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)));
5385 CPU (h_vbit) = opval;
5386 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5391 CPU (h_xbit) = opval;
5392 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5396 SET_H_INSN_PREFIXED_P (opval);
5397 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5407 CASE (sem, INSN_ADD_W_R) : /* add.w $Rs,$Rd */
5409 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5410 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5411 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5412 int UNUSED written = 0;
5413 IADDR UNUSED pc = abuf->addr;
5414 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5421 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5422 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5423 tmp_carry = CPU (h_cbit);
5424 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5427 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5429 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5430 SET_H_GR (FLD (f_operand2), opval);
5431 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5436 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))));
5437 CPU (h_cbit) = opval;
5438 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5441 BI opval = LTHI (tmp_newval, 0);
5442 CPU (h_nbit) = opval;
5443 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5446 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5447 CPU (h_zbit) = opval;
5448 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5451 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)));
5452 CPU (h_vbit) = opval;
5453 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5458 CPU (h_xbit) = opval;
5459 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5463 SET_H_INSN_PREFIXED_P (opval);
5464 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5474 CASE (sem, INSN_ADD_D_R) : /* add.d $Rs,$Rd */
5476 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5477 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5478 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5479 int UNUSED written = 0;
5480 IADDR UNUSED pc = abuf->addr;
5481 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5488 tmp_tmpops = GET_H_GR (FLD (f_operand1));
5489 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5490 tmp_carry = CPU (h_cbit);
5491 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5493 SI opval = tmp_newval;
5494 SET_H_GR (FLD (f_operand2), opval);
5495 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5499 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))));
5500 CPU (h_cbit) = opval;
5501 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5504 BI opval = LTSI (tmp_newval, 0);
5505 CPU (h_nbit) = opval;
5506 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5509 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5510 CPU (h_zbit) = opval;
5511 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5514 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)));
5515 CPU (h_vbit) = opval;
5516 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5521 CPU (h_xbit) = opval;
5522 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5526 SET_H_INSN_PREFIXED_P (opval);
5527 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5537 CASE (sem, INSN_ADD_M_B_M) : /* add-m.b [${Rs}${inc}],${Rd} */
5539 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5540 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5541 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5542 int UNUSED written = 0;
5543 IADDR UNUSED pc = abuf->addr;
5544 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5551 tmp_tmpops = ({ SI tmp_addr;
5554 tmp_postinc = FLD (f_memmode);
5555 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5556 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
5557 ; if (NEBI (tmp_postinc, 0)) {
5559 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5560 tmp_addr = ADDSI (tmp_addr, 1);
5563 SI opval = tmp_addr;
5564 SET_H_GR (FLD (f_operand1), opval);
5565 written |= (1 << 12);
5566 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5571 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5572 tmp_carry = CPU (h_cbit);
5573 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5576 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5578 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5579 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5580 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5585 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))));
5586 CPU (h_cbit) = opval;
5587 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5590 BI opval = LTQI (tmp_newval, 0);
5591 CPU (h_nbit) = opval;
5592 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5595 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5596 CPU (h_zbit) = opval;
5597 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5600 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)));
5601 CPU (h_vbit) = opval;
5602 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5607 CPU (h_xbit) = opval;
5608 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5612 SET_H_INSN_PREFIXED_P (opval);
5613 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5619 abuf->written = written;
5624 CASE (sem, INSN_ADD_M_W_M) : /* add-m.w [${Rs}${inc}],${Rd} */
5626 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5627 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5628 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5629 int UNUSED written = 0;
5630 IADDR UNUSED pc = abuf->addr;
5631 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5638 tmp_tmpops = ({ SI tmp_addr;
5641 tmp_postinc = FLD (f_memmode);
5642 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5643 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
5644 ; if (NEBI (tmp_postinc, 0)) {
5646 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5647 tmp_addr = ADDSI (tmp_addr, 2);
5650 SI opval = tmp_addr;
5651 SET_H_GR (FLD (f_operand1), opval);
5652 written |= (1 << 12);
5653 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5658 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5659 tmp_carry = CPU (h_cbit);
5660 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5663 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
5665 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5666 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5667 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5672 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))));
5673 CPU (h_cbit) = opval;
5674 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5677 BI opval = LTHI (tmp_newval, 0);
5678 CPU (h_nbit) = opval;
5679 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5682 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5683 CPU (h_zbit) = opval;
5684 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5687 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)));
5688 CPU (h_vbit) = opval;
5689 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5694 CPU (h_xbit) = opval;
5695 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5699 SET_H_INSN_PREFIXED_P (opval);
5700 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5706 abuf->written = written;
5711 CASE (sem, INSN_ADD_M_D_M) : /* add-m.d [${Rs}${inc}],${Rd} */
5713 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5714 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5715 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5716 int UNUSED written = 0;
5717 IADDR UNUSED pc = abuf->addr;
5718 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5725 tmp_tmpops = ({ SI tmp_addr;
5728 tmp_postinc = FLD (f_memmode);
5729 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
5730 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
5731 ; if (NEBI (tmp_postinc, 0)) {
5733 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5734 tmp_addr = ADDSI (tmp_addr, 4);
5737 SI opval = tmp_addr;
5738 SET_H_GR (FLD (f_operand1), opval);
5739 written |= (1 << 11);
5740 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5745 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5746 tmp_carry = CPU (h_cbit);
5747 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5749 SI opval = tmp_newval;
5750 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
5751 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5755 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))));
5756 CPU (h_cbit) = opval;
5757 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5760 BI opval = LTSI (tmp_newval, 0);
5761 CPU (h_nbit) = opval;
5762 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5765 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5766 CPU (h_zbit) = opval;
5767 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5770 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)));
5771 CPU (h_vbit) = opval;
5772 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5777 CPU (h_xbit) = opval;
5778 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5782 SET_H_INSN_PREFIXED_P (opval);
5783 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5789 abuf->written = written;
5794 CASE (sem, INSN_ADDCBR) : /* add.b ${sconst8}],${Rd} */
5796 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5797 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5798 #define FLD(f) abuf->fields.sfmt_addcbr.f
5799 int UNUSED written = 0;
5800 IADDR UNUSED pc = abuf->addr;
5801 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5808 tmp_tmpops = FLD (f_indir_pc__byte);
5809 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5810 tmp_carry = CPU (h_cbit);
5811 tmp_newval = ADDCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5814 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5816 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
5817 SET_H_GR (FLD (f_operand2), opval);
5818 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5823 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))));
5824 CPU (h_cbit) = opval;
5825 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5828 BI opval = LTQI (tmp_newval, 0);
5829 CPU (h_nbit) = opval;
5830 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5833 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5834 CPU (h_zbit) = opval;
5835 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5838 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)));
5839 CPU (h_vbit) = opval;
5840 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5845 CPU (h_xbit) = opval;
5846 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5850 SET_H_INSN_PREFIXED_P (opval);
5851 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5861 CASE (sem, INSN_ADDCWR) : /* add.w ${sconst16}],${Rd} */
5863 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5864 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5865 #define FLD(f) abuf->fields.sfmt_addcwr.f
5866 int UNUSED written = 0;
5867 IADDR UNUSED pc = abuf->addr;
5868 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5875 tmp_tmpops = FLD (f_indir_pc__word);
5876 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5877 tmp_carry = CPU (h_cbit);
5878 tmp_newval = ADDCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5881 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
5883 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
5884 SET_H_GR (FLD (f_operand2), opval);
5885 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5890 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))));
5891 CPU (h_cbit) = opval;
5892 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5895 BI opval = LTHI (tmp_newval, 0);
5896 CPU (h_nbit) = opval;
5897 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5900 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5901 CPU (h_zbit) = opval;
5902 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5905 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)));
5906 CPU (h_vbit) = opval;
5907 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5912 CPU (h_xbit) = opval;
5913 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5917 SET_H_INSN_PREFIXED_P (opval);
5918 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5928 CASE (sem, INSN_ADDCDR) : /* add.d ${const32}],${Rd} */
5930 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5931 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5932 #define FLD(f) abuf->fields.sfmt_addcdr.f
5933 int UNUSED written = 0;
5934 IADDR UNUSED pc = abuf->addr;
5935 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
5942 tmp_tmpops = FLD (f_indir_pc__dword);
5943 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
5944 tmp_carry = CPU (h_cbit);
5945 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
5947 SI opval = tmp_newval;
5948 SET_H_GR (FLD (f_operand2), opval);
5949 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5953 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))));
5954 CPU (h_cbit) = opval;
5955 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
5958 BI opval = LTSI (tmp_newval, 0);
5959 CPU (h_nbit) = opval;
5960 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
5963 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
5964 CPU (h_zbit) = opval;
5965 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
5968 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)));
5969 CPU (h_vbit) = opval;
5970 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
5975 CPU (h_xbit) = opval;
5976 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
5980 SET_H_INSN_PREFIXED_P (opval);
5981 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
5991 CASE (sem, INSN_ADDCPC) : /* add.d ${sconst32},PC */
5993 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5994 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5995 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
5996 int UNUSED written = 0;
5997 IADDR UNUSED pc = abuf->addr;
5999 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
6005 tmp_offs = FLD (f_indir_pc__dword);
6006 tmp_oldpc = ADDSI (pc, 6);
6007 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
6009 USI opval = tmp_newpc;
6010 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
6011 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6015 BI opval = ORIF (ANDIF (LTSI (tmp_offs, 0), LTSI (tmp_oldpc, 0)), ORIF (ANDIF (LTSI (tmp_oldpc, 0), GESI (tmp_newpc, 0)), ANDIF (LTSI (tmp_offs, 0), GESI (tmp_newpc, 0))));
6016 CPU (h_cbit) = opval;
6017 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6020 BI opval = LTSI (tmp_newpc, 0);
6021 CPU (h_nbit) = opval;
6022 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6025 BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6026 CPU (h_zbit) = opval;
6027 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6030 BI opval = ORIF (ANDIF (ANDIF (LTSI (tmp_offs, 0), LTSI (tmp_oldpc, 0)), GESI (tmp_newpc, 0)), ANDIF (ANDIF (GESI (tmp_offs, 0), GESI (tmp_oldpc, 0)), LTSI (tmp_newpc, 0)));
6031 CPU (h_vbit) = opval;
6032 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6037 CPU (h_xbit) = opval;
6038 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6042 SET_H_INSN_PREFIXED_P (opval);
6043 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6049 SEM_BRANCH_FINI (vpc);
6054 CASE (sem, INSN_ADDS_B_R) : /* adds.b $Rs,$Rd */
6056 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6057 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6058 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6059 int UNUSED written = 0;
6060 IADDR UNUSED pc = abuf->addr;
6061 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6068 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6069 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6070 tmp_carry = CPU (h_cbit);
6071 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6073 SI opval = tmp_newval;
6074 SET_H_GR (FLD (f_operand2), opval);
6075 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6079 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))));
6080 CPU (h_cbit) = opval;
6081 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6084 BI opval = LTSI (tmp_newval, 0);
6085 CPU (h_nbit) = opval;
6086 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6089 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6090 CPU (h_zbit) = opval;
6091 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6094 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)));
6095 CPU (h_vbit) = opval;
6096 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6101 CPU (h_xbit) = opval;
6102 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6106 SET_H_INSN_PREFIXED_P (opval);
6107 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6117 CASE (sem, INSN_ADDS_W_R) : /* adds.w $Rs,$Rd */
6119 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6120 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6121 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6122 int UNUSED written = 0;
6123 IADDR UNUSED pc = abuf->addr;
6124 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6131 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6132 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6133 tmp_carry = CPU (h_cbit);
6134 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6136 SI opval = tmp_newval;
6137 SET_H_GR (FLD (f_operand2), opval);
6138 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6142 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))));
6143 CPU (h_cbit) = opval;
6144 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6147 BI opval = LTSI (tmp_newval, 0);
6148 CPU (h_nbit) = opval;
6149 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6152 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6153 CPU (h_zbit) = opval;
6154 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6157 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)));
6158 CPU (h_vbit) = opval;
6159 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6164 CPU (h_xbit) = opval;
6165 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6169 SET_H_INSN_PREFIXED_P (opval);
6170 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6180 CASE (sem, INSN_ADDS_M_B_M) : /* adds-m.b [${Rs}${inc}],$Rd */
6182 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6183 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6184 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6185 int UNUSED written = 0;
6186 IADDR UNUSED pc = abuf->addr;
6187 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6194 tmp_tmpops = EXTQISI (({ SI tmp_addr;
6197 tmp_postinc = FLD (f_memmode);
6198 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6199 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6200 ; if (NEBI (tmp_postinc, 0)) {
6202 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6203 tmp_addr = ADDSI (tmp_addr, 1);
6206 SI opval = tmp_addr;
6207 SET_H_GR (FLD (f_operand1), opval);
6208 written |= (1 << 11);
6209 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6214 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6215 tmp_carry = CPU (h_cbit);
6216 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6218 SI opval = tmp_newval;
6219 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6220 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6224 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))));
6225 CPU (h_cbit) = opval;
6226 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6229 BI opval = LTSI (tmp_newval, 0);
6230 CPU (h_nbit) = opval;
6231 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6234 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6235 CPU (h_zbit) = opval;
6236 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6239 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)));
6240 CPU (h_vbit) = opval;
6241 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6246 CPU (h_xbit) = opval;
6247 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6251 SET_H_INSN_PREFIXED_P (opval);
6252 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6258 abuf->written = written;
6263 CASE (sem, INSN_ADDS_M_W_M) : /* adds-m.w [${Rs}${inc}],$Rd */
6265 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6266 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6267 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6268 int UNUSED written = 0;
6269 IADDR UNUSED pc = abuf->addr;
6270 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6277 tmp_tmpops = EXTHISI (({ SI tmp_addr;
6280 tmp_postinc = FLD (f_memmode);
6281 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6282 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6283 ; if (NEBI (tmp_postinc, 0)) {
6285 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6286 tmp_addr = ADDSI (tmp_addr, 2);
6289 SI opval = tmp_addr;
6290 SET_H_GR (FLD (f_operand1), opval);
6291 written |= (1 << 11);
6292 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6297 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6298 tmp_carry = CPU (h_cbit);
6299 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6301 SI opval = tmp_newval;
6302 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6303 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6307 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))));
6308 CPU (h_cbit) = opval;
6309 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6312 BI opval = LTSI (tmp_newval, 0);
6313 CPU (h_nbit) = opval;
6314 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6317 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6318 CPU (h_zbit) = opval;
6319 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6322 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)));
6323 CPU (h_vbit) = opval;
6324 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6329 CPU (h_xbit) = opval;
6330 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6334 SET_H_INSN_PREFIXED_P (opval);
6335 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6341 abuf->written = written;
6346 CASE (sem, INSN_ADDSCBR) : /* [${Rs}${inc}],$Rd */
6348 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6349 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6350 #define FLD(f) abuf->fields.sfmt_addcbr.f
6351 int UNUSED written = 0;
6352 IADDR UNUSED pc = abuf->addr;
6353 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6360 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6361 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6362 tmp_carry = CPU (h_cbit);
6363 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6365 SI opval = tmp_newval;
6366 SET_H_GR (FLD (f_operand2), opval);
6367 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6371 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))));
6372 CPU (h_cbit) = opval;
6373 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6376 BI opval = LTSI (tmp_newval, 0);
6377 CPU (h_nbit) = opval;
6378 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6381 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6382 CPU (h_zbit) = opval;
6383 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6386 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)));
6387 CPU (h_vbit) = opval;
6388 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6393 CPU (h_xbit) = opval;
6394 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6398 SET_H_INSN_PREFIXED_P (opval);
6399 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6409 CASE (sem, INSN_ADDSCWR) : /* [${Rs}${inc}],$Rd */
6411 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6412 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6413 #define FLD(f) abuf->fields.sfmt_addcwr.f
6414 int UNUSED written = 0;
6415 IADDR UNUSED pc = abuf->addr;
6416 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6423 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6424 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6425 tmp_carry = CPU (h_cbit);
6426 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6428 SI opval = tmp_newval;
6429 SET_H_GR (FLD (f_operand2), opval);
6430 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6434 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))));
6435 CPU (h_cbit) = opval;
6436 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6439 BI opval = LTSI (tmp_newval, 0);
6440 CPU (h_nbit) = opval;
6441 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6444 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6445 CPU (h_zbit) = opval;
6446 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6449 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)));
6450 CPU (h_vbit) = opval;
6451 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6456 CPU (h_xbit) = opval;
6457 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6461 SET_H_INSN_PREFIXED_P (opval);
6462 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6472 CASE (sem, INSN_ADDSPCPC) : /* adds.w [PC],PC */
6474 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6475 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6476 #define FLD(f) abuf->fields.sfmt_empty.f
6477 int UNUSED written = 0;
6478 IADDR UNUSED pc = abuf->addr;
6480 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6486 if (NOTBI (GET_H_INSN_PREFIXED_P ())) {
6487 cgen_rtx_error (current_cpu, "Unexpected adds.w [PC],PC without prefix");
6489 tmp_offs = GETMEMHI (current_cpu, pc, CPU (h_prefixreg_pre_v32));
6490 tmp_oldpc = ADDSI (pc, 2);
6491 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
6493 USI opval = tmp_newpc;
6494 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
6495 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6499 BI opval = ORIF (ANDIF (LTSI (EXTHISI (tmp_offs), 0), LTSI (tmp_oldpc, 0)), ORIF (ANDIF (LTSI (tmp_oldpc, 0), GESI (tmp_newpc, 0)), ANDIF (LTSI (EXTHISI (tmp_offs), 0), GESI (tmp_newpc, 0))));
6500 CPU (h_cbit) = opval;
6501 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6504 BI opval = LTSI (tmp_newpc, 0);
6505 CPU (h_nbit) = opval;
6506 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6509 BI opval = ANDIF (EQSI (tmp_newpc, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6510 CPU (h_zbit) = opval;
6511 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6514 BI opval = ORIF (ANDIF (ANDIF (LTSI (EXTHISI (tmp_offs), 0), LTSI (tmp_oldpc, 0)), GESI (tmp_newpc, 0)), ANDIF (ANDIF (GESI (EXTHISI (tmp_offs), 0), GESI (tmp_oldpc, 0)), LTSI (tmp_newpc, 0)));
6515 CPU (h_vbit) = opval;
6516 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6521 CPU (h_xbit) = opval;
6522 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6526 SET_H_INSN_PREFIXED_P (opval);
6527 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6533 SEM_BRANCH_FINI (vpc);
6538 CASE (sem, INSN_ADDU_B_R) : /* addu.b $Rs,$Rd */
6540 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6541 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6542 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6543 int UNUSED written = 0;
6544 IADDR UNUSED pc = abuf->addr;
6545 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6552 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
6553 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6554 tmp_carry = CPU (h_cbit);
6555 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6557 SI opval = tmp_newval;
6558 SET_H_GR (FLD (f_operand2), opval);
6559 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6563 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))));
6564 CPU (h_cbit) = opval;
6565 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6568 BI opval = LTSI (tmp_newval, 0);
6569 CPU (h_nbit) = opval;
6570 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6573 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6574 CPU (h_zbit) = opval;
6575 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6578 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)));
6579 CPU (h_vbit) = opval;
6580 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6585 CPU (h_xbit) = opval;
6586 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6590 SET_H_INSN_PREFIXED_P (opval);
6591 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6601 CASE (sem, INSN_ADDU_W_R) : /* addu.w $Rs,$Rd */
6603 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6604 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6605 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6606 int UNUSED written = 0;
6607 IADDR UNUSED pc = abuf->addr;
6608 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6615 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
6616 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6617 tmp_carry = CPU (h_cbit);
6618 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6620 SI opval = tmp_newval;
6621 SET_H_GR (FLD (f_operand2), opval);
6622 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6626 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))));
6627 CPU (h_cbit) = opval;
6628 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6631 BI opval = LTSI (tmp_newval, 0);
6632 CPU (h_nbit) = opval;
6633 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6636 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6637 CPU (h_zbit) = opval;
6638 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6641 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)));
6642 CPU (h_vbit) = opval;
6643 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6648 CPU (h_xbit) = opval;
6649 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6653 SET_H_INSN_PREFIXED_P (opval);
6654 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6664 CASE (sem, INSN_ADDU_M_B_M) : /* addu-m.b [${Rs}${inc}],$Rd */
6666 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6667 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6668 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6669 int UNUSED written = 0;
6670 IADDR UNUSED pc = abuf->addr;
6671 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6678 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
6681 tmp_postinc = FLD (f_memmode);
6682 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6683 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
6684 ; if (NEBI (tmp_postinc, 0)) {
6686 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6687 tmp_addr = ADDSI (tmp_addr, 1);
6690 SI opval = tmp_addr;
6691 SET_H_GR (FLD (f_operand1), opval);
6692 written |= (1 << 11);
6693 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6698 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6699 tmp_carry = CPU (h_cbit);
6700 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6702 SI opval = tmp_newval;
6703 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6704 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6708 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))));
6709 CPU (h_cbit) = opval;
6710 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6713 BI opval = LTSI (tmp_newval, 0);
6714 CPU (h_nbit) = opval;
6715 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6718 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6719 CPU (h_zbit) = opval;
6720 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6723 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)));
6724 CPU (h_vbit) = opval;
6725 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6730 CPU (h_xbit) = opval;
6731 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6735 SET_H_INSN_PREFIXED_P (opval);
6736 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6742 abuf->written = written;
6747 CASE (sem, INSN_ADDU_M_W_M) : /* addu-m.w [${Rs}${inc}],$Rd */
6749 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6750 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6751 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6752 int UNUSED written = 0;
6753 IADDR UNUSED pc = abuf->addr;
6754 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6761 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
6764 tmp_postinc = FLD (f_memmode);
6765 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
6766 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
6767 ; if (NEBI (tmp_postinc, 0)) {
6769 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6770 tmp_addr = ADDSI (tmp_addr, 2);
6773 SI opval = tmp_addr;
6774 SET_H_GR (FLD (f_operand1), opval);
6775 written |= (1 << 11);
6776 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6781 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6782 tmp_carry = CPU (h_cbit);
6783 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6785 SI opval = tmp_newval;
6786 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
6787 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6791 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))));
6792 CPU (h_cbit) = opval;
6793 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6796 BI opval = LTSI (tmp_newval, 0);
6797 CPU (h_nbit) = opval;
6798 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6801 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6802 CPU (h_zbit) = opval;
6803 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6806 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)));
6807 CPU (h_vbit) = opval;
6808 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6813 CPU (h_xbit) = opval;
6814 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6818 SET_H_INSN_PREFIXED_P (opval);
6819 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6825 abuf->written = written;
6830 CASE (sem, INSN_ADDUCBR) : /* [${Rs}${inc}],$Rd */
6832 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6833 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6834 #define FLD(f) abuf->fields.sfmt_addcbr.f
6835 int UNUSED written = 0;
6836 IADDR UNUSED pc = abuf->addr;
6837 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6844 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
6845 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6846 tmp_carry = CPU (h_cbit);
6847 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6849 SI opval = tmp_newval;
6850 SET_H_GR (FLD (f_operand2), opval);
6851 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6855 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))));
6856 CPU (h_cbit) = opval;
6857 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6860 BI opval = LTSI (tmp_newval, 0);
6861 CPU (h_nbit) = opval;
6862 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6865 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6866 CPU (h_zbit) = opval;
6867 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6870 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)));
6871 CPU (h_vbit) = opval;
6872 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6877 CPU (h_xbit) = opval;
6878 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6882 SET_H_INSN_PREFIXED_P (opval);
6883 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6893 CASE (sem, INSN_ADDUCWR) : /* [${Rs}${inc}],$Rd */
6895 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6896 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6897 #define FLD(f) abuf->fields.sfmt_addcwr.f
6898 int UNUSED written = 0;
6899 IADDR UNUSED pc = abuf->addr;
6900 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6907 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
6908 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6909 tmp_carry = CPU (h_cbit);
6910 tmp_newval = ADDCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6912 SI opval = tmp_newval;
6913 SET_H_GR (FLD (f_operand2), opval);
6914 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6918 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))));
6919 CPU (h_cbit) = opval;
6920 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6923 BI opval = LTSI (tmp_newval, 0);
6924 CPU (h_nbit) = opval;
6925 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6928 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6929 CPU (h_zbit) = opval;
6930 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
6933 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)));
6934 CPU (h_vbit) = opval;
6935 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
6940 CPU (h_xbit) = opval;
6941 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
6945 SET_H_INSN_PREFIXED_P (opval);
6946 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
6956 CASE (sem, INSN_SUB_B_R) : /* sub.b $Rs,$Rd */
6958 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6959 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6960 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6961 int UNUSED written = 0;
6962 IADDR UNUSED pc = abuf->addr;
6963 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6970 tmp_tmpops = GET_H_GR (FLD (f_operand1));
6971 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
6972 tmp_carry = CPU (h_cbit);
6973 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
6976 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
6978 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
6979 SET_H_GR (FLD (f_operand2), opval);
6980 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6985 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))));
6986 CPU (h_cbit) = opval;
6987 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
6990 BI opval = LTQI (tmp_newval, 0);
6991 CPU (h_nbit) = opval;
6992 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
6995 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
6996 CPU (h_zbit) = opval;
6997 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7000 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)));
7001 CPU (h_vbit) = opval;
7002 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7007 CPU (h_xbit) = opval;
7008 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7012 SET_H_INSN_PREFIXED_P (opval);
7013 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7023 CASE (sem, INSN_SUB_W_R) : /* sub.w $Rs,$Rd */
7025 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7026 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7027 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7028 int UNUSED written = 0;
7029 IADDR UNUSED pc = abuf->addr;
7030 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7037 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7038 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7039 tmp_carry = CPU (h_cbit);
7040 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7043 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7045 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7046 SET_H_GR (FLD (f_operand2), opval);
7047 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7052 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))));
7053 CPU (h_cbit) = opval;
7054 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7057 BI opval = LTHI (tmp_newval, 0);
7058 CPU (h_nbit) = opval;
7059 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7062 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7063 CPU (h_zbit) = opval;
7064 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7067 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)));
7068 CPU (h_vbit) = opval;
7069 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7074 CPU (h_xbit) = opval;
7075 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7079 SET_H_INSN_PREFIXED_P (opval);
7080 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7090 CASE (sem, INSN_SUB_D_R) : /* sub.d $Rs,$Rd */
7092 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7093 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7094 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7095 int UNUSED written = 0;
7096 IADDR UNUSED pc = abuf->addr;
7097 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7104 tmp_tmpops = GET_H_GR (FLD (f_operand1));
7105 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7106 tmp_carry = CPU (h_cbit);
7107 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7109 SI opval = tmp_newval;
7110 SET_H_GR (FLD (f_operand2), opval);
7111 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7115 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))));
7116 CPU (h_cbit) = opval;
7117 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7120 BI opval = LTSI (tmp_newval, 0);
7121 CPU (h_nbit) = opval;
7122 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7125 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7126 CPU (h_zbit) = opval;
7127 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7130 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)));
7131 CPU (h_vbit) = opval;
7132 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7137 CPU (h_xbit) = opval;
7138 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7142 SET_H_INSN_PREFIXED_P (opval);
7143 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7153 CASE (sem, INSN_SUB_M_B_M) : /* sub-m.b [${Rs}${inc}],${Rd} */
7155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7157 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7158 int UNUSED written = 0;
7159 IADDR UNUSED pc = abuf->addr;
7160 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7167 tmp_tmpops = ({ SI tmp_addr;
7170 tmp_postinc = FLD (f_memmode);
7171 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7172 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7173 ; if (NEBI (tmp_postinc, 0)) {
7175 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7176 tmp_addr = ADDSI (tmp_addr, 1);
7179 SI opval = tmp_addr;
7180 SET_H_GR (FLD (f_operand1), opval);
7181 written |= (1 << 12);
7182 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7187 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7188 tmp_carry = CPU (h_cbit);
7189 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7192 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7194 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7195 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7196 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7201 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))));
7202 CPU (h_cbit) = opval;
7203 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7206 BI opval = LTQI (tmp_newval, 0);
7207 CPU (h_nbit) = opval;
7208 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7211 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7212 CPU (h_zbit) = opval;
7213 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7216 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)));
7217 CPU (h_vbit) = opval;
7218 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7223 CPU (h_xbit) = opval;
7224 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7228 SET_H_INSN_PREFIXED_P (opval);
7229 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7235 abuf->written = written;
7240 CASE (sem, INSN_SUB_M_W_M) : /* sub-m.w [${Rs}${inc}],${Rd} */
7242 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7243 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7244 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7245 int UNUSED written = 0;
7246 IADDR UNUSED pc = abuf->addr;
7247 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7254 tmp_tmpops = ({ SI tmp_addr;
7257 tmp_postinc = FLD (f_memmode);
7258 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7259 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7260 ; if (NEBI (tmp_postinc, 0)) {
7262 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7263 tmp_addr = ADDSI (tmp_addr, 2);
7266 SI opval = tmp_addr;
7267 SET_H_GR (FLD (f_operand1), opval);
7268 written |= (1 << 12);
7269 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7274 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7275 tmp_carry = CPU (h_cbit);
7276 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7279 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
7281 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7282 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7283 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7288 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))));
7289 CPU (h_cbit) = opval;
7290 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7293 BI opval = LTHI (tmp_newval, 0);
7294 CPU (h_nbit) = opval;
7295 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7298 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7299 CPU (h_zbit) = opval;
7300 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7303 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)));
7304 CPU (h_vbit) = opval;
7305 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7310 CPU (h_xbit) = opval;
7311 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7315 SET_H_INSN_PREFIXED_P (opval);
7316 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7322 abuf->written = written;
7327 CASE (sem, INSN_SUB_M_D_M) : /* sub-m.d [${Rs}${inc}],${Rd} */
7329 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7330 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7331 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7332 int UNUSED written = 0;
7333 IADDR UNUSED pc = abuf->addr;
7334 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7341 tmp_tmpops = ({ SI tmp_addr;
7344 tmp_postinc = FLD (f_memmode);
7345 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7346 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
7347 ; if (NEBI (tmp_postinc, 0)) {
7349 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7350 tmp_addr = ADDSI (tmp_addr, 4);
7353 SI opval = tmp_addr;
7354 SET_H_GR (FLD (f_operand1), opval);
7355 written |= (1 << 11);
7356 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7361 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7362 tmp_carry = CPU (h_cbit);
7363 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7365 SI opval = tmp_newval;
7366 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7367 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7371 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))));
7372 CPU (h_cbit) = opval;
7373 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7376 BI opval = LTSI (tmp_newval, 0);
7377 CPU (h_nbit) = opval;
7378 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7381 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7382 CPU (h_zbit) = opval;
7383 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7386 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)));
7387 CPU (h_vbit) = opval;
7388 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7393 CPU (h_xbit) = opval;
7394 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7398 SET_H_INSN_PREFIXED_P (opval);
7399 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7405 abuf->written = written;
7410 CASE (sem, INSN_SUBCBR) : /* sub.b ${sconst8}],${Rd} */
7412 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7413 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7414 #define FLD(f) abuf->fields.sfmt_addcbr.f
7415 int UNUSED written = 0;
7416 IADDR UNUSED pc = abuf->addr;
7417 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7424 tmp_tmpops = FLD (f_indir_pc__byte);
7425 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7426 tmp_carry = CPU (h_cbit);
7427 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7430 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7432 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
7433 SET_H_GR (FLD (f_operand2), opval);
7434 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7439 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))));
7440 CPU (h_cbit) = opval;
7441 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7444 BI opval = LTQI (tmp_newval, 0);
7445 CPU (h_nbit) = opval;
7446 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7449 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7450 CPU (h_zbit) = opval;
7451 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7454 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)));
7455 CPU (h_vbit) = opval;
7456 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7461 CPU (h_xbit) = opval;
7462 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7466 SET_H_INSN_PREFIXED_P (opval);
7467 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7477 CASE (sem, INSN_SUBCWR) : /* sub.w ${sconst16}],${Rd} */
7479 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7480 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7481 #define FLD(f) abuf->fields.sfmt_addcwr.f
7482 int UNUSED written = 0;
7483 IADDR UNUSED pc = abuf->addr;
7484 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7491 tmp_tmpops = FLD (f_indir_pc__word);
7492 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7493 tmp_carry = CPU (h_cbit);
7494 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7497 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
7499 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
7500 SET_H_GR (FLD (f_operand2), opval);
7501 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7506 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))));
7507 CPU (h_cbit) = opval;
7508 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7511 BI opval = LTHI (tmp_newval, 0);
7512 CPU (h_nbit) = opval;
7513 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7516 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7517 CPU (h_zbit) = opval;
7518 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7521 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)));
7522 CPU (h_vbit) = opval;
7523 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7528 CPU (h_xbit) = opval;
7529 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7533 SET_H_INSN_PREFIXED_P (opval);
7534 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7544 CASE (sem, INSN_SUBCDR) : /* sub.d ${const32}],${Rd} */
7546 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7547 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7548 #define FLD(f) abuf->fields.sfmt_addcdr.f
7549 int UNUSED written = 0;
7550 IADDR UNUSED pc = abuf->addr;
7551 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
7558 tmp_tmpops = FLD (f_indir_pc__dword);
7559 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7560 tmp_carry = CPU (h_cbit);
7561 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7563 SI opval = tmp_newval;
7564 SET_H_GR (FLD (f_operand2), opval);
7565 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7569 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))));
7570 CPU (h_cbit) = opval;
7571 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7574 BI opval = LTSI (tmp_newval, 0);
7575 CPU (h_nbit) = opval;
7576 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7579 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7580 CPU (h_zbit) = opval;
7581 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7584 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)));
7585 CPU (h_vbit) = opval;
7586 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7591 CPU (h_xbit) = opval;
7592 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7596 SET_H_INSN_PREFIXED_P (opval);
7597 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7607 CASE (sem, INSN_SUBS_B_R) : /* subs.b $Rs,$Rd */
7609 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7610 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7611 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7612 int UNUSED written = 0;
7613 IADDR UNUSED pc = abuf->addr;
7614 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7621 tmp_tmpops = EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
7622 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7623 tmp_carry = CPU (h_cbit);
7624 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7626 SI opval = tmp_newval;
7627 SET_H_GR (FLD (f_operand2), opval);
7628 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7632 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))));
7633 CPU (h_cbit) = opval;
7634 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7637 BI opval = LTSI (tmp_newval, 0);
7638 CPU (h_nbit) = opval;
7639 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7642 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7643 CPU (h_zbit) = opval;
7644 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7647 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)));
7648 CPU (h_vbit) = opval;
7649 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7654 CPU (h_xbit) = opval;
7655 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7659 SET_H_INSN_PREFIXED_P (opval);
7660 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7670 CASE (sem, INSN_SUBS_W_R) : /* subs.w $Rs,$Rd */
7672 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7673 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7674 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7675 int UNUSED written = 0;
7676 IADDR UNUSED pc = abuf->addr;
7677 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7684 tmp_tmpops = EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
7685 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7686 tmp_carry = CPU (h_cbit);
7687 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7689 SI opval = tmp_newval;
7690 SET_H_GR (FLD (f_operand2), opval);
7691 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7695 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))));
7696 CPU (h_cbit) = opval;
7697 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7700 BI opval = LTSI (tmp_newval, 0);
7701 CPU (h_nbit) = opval;
7702 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7705 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7706 CPU (h_zbit) = opval;
7707 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7710 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)));
7711 CPU (h_vbit) = opval;
7712 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7717 CPU (h_xbit) = opval;
7718 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7722 SET_H_INSN_PREFIXED_P (opval);
7723 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7733 CASE (sem, INSN_SUBS_M_B_M) : /* subs-m.b [${Rs}${inc}],$Rd */
7735 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7736 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7737 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7738 int UNUSED written = 0;
7739 IADDR UNUSED pc = abuf->addr;
7740 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7747 tmp_tmpops = EXTQISI (({ SI tmp_addr;
7750 tmp_postinc = FLD (f_memmode);
7751 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7752 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
7753 ; if (NEBI (tmp_postinc, 0)) {
7755 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7756 tmp_addr = ADDSI (tmp_addr, 1);
7759 SI opval = tmp_addr;
7760 SET_H_GR (FLD (f_operand1), opval);
7761 written |= (1 << 11);
7762 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7767 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7768 tmp_carry = CPU (h_cbit);
7769 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7771 SI opval = tmp_newval;
7772 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7773 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7777 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))));
7778 CPU (h_cbit) = opval;
7779 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7782 BI opval = LTSI (tmp_newval, 0);
7783 CPU (h_nbit) = opval;
7784 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7787 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7788 CPU (h_zbit) = opval;
7789 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7792 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)));
7793 CPU (h_vbit) = opval;
7794 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7799 CPU (h_xbit) = opval;
7800 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7804 SET_H_INSN_PREFIXED_P (opval);
7805 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7811 abuf->written = written;
7816 CASE (sem, INSN_SUBS_M_W_M) : /* subs-m.w [${Rs}${inc}],$Rd */
7818 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7819 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7820 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7821 int UNUSED written = 0;
7822 IADDR UNUSED pc = abuf->addr;
7823 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
7830 tmp_tmpops = EXTHISI (({ SI tmp_addr;
7833 tmp_postinc = FLD (f_memmode);
7834 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
7835 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
7836 ; if (NEBI (tmp_postinc, 0)) {
7838 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7839 tmp_addr = ADDSI (tmp_addr, 2);
7842 SI opval = tmp_addr;
7843 SET_H_GR (FLD (f_operand1), opval);
7844 written |= (1 << 11);
7845 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7850 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7851 tmp_carry = CPU (h_cbit);
7852 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7854 SI opval = tmp_newval;
7855 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
7856 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7860 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))));
7861 CPU (h_cbit) = opval;
7862 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7865 BI opval = LTSI (tmp_newval, 0);
7866 CPU (h_nbit) = opval;
7867 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7870 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7871 CPU (h_zbit) = opval;
7872 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7875 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)));
7876 CPU (h_vbit) = opval;
7877 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7882 CPU (h_xbit) = opval;
7883 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7887 SET_H_INSN_PREFIXED_P (opval);
7888 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7894 abuf->written = written;
7899 CASE (sem, INSN_SUBSCBR) : /* [${Rs}${inc}],$Rd */
7901 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7902 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7903 #define FLD(f) abuf->fields.sfmt_addcbr.f
7904 int UNUSED written = 0;
7905 IADDR UNUSED pc = abuf->addr;
7906 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7913 tmp_tmpops = EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
7914 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7915 tmp_carry = CPU (h_cbit);
7916 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7918 SI opval = tmp_newval;
7919 SET_H_GR (FLD (f_operand2), opval);
7920 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7924 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))));
7925 CPU (h_cbit) = opval;
7926 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7929 BI opval = LTSI (tmp_newval, 0);
7930 CPU (h_nbit) = opval;
7931 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7934 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7935 CPU (h_zbit) = opval;
7936 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
7939 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)));
7940 CPU (h_vbit) = opval;
7941 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
7946 CPU (h_xbit) = opval;
7947 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
7951 SET_H_INSN_PREFIXED_P (opval);
7952 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
7962 CASE (sem, INSN_SUBSCWR) : /* [${Rs}${inc}],$Rd */
7964 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
7965 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7966 #define FLD(f) abuf->fields.sfmt_addcwr.f
7967 int UNUSED written = 0;
7968 IADDR UNUSED pc = abuf->addr;
7969 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7976 tmp_tmpops = EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
7977 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
7978 tmp_carry = CPU (h_cbit);
7979 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
7981 SI opval = tmp_newval;
7982 SET_H_GR (FLD (f_operand2), opval);
7983 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
7987 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))));
7988 CPU (h_cbit) = opval;
7989 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
7992 BI opval = LTSI (tmp_newval, 0);
7993 CPU (h_nbit) = opval;
7994 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
7997 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
7998 CPU (h_zbit) = opval;
7999 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8002 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)));
8003 CPU (h_vbit) = opval;
8004 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8009 CPU (h_xbit) = opval;
8010 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8014 SET_H_INSN_PREFIXED_P (opval);
8015 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8025 CASE (sem, INSN_SUBU_B_R) : /* subu.b $Rs,$Rd */
8027 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8028 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8029 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8030 int UNUSED written = 0;
8031 IADDR UNUSED pc = abuf->addr;
8032 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8039 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
8040 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8041 tmp_carry = CPU (h_cbit);
8042 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8044 SI opval = tmp_newval;
8045 SET_H_GR (FLD (f_operand2), opval);
8046 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8050 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))));
8051 CPU (h_cbit) = opval;
8052 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8055 BI opval = LTSI (tmp_newval, 0);
8056 CPU (h_nbit) = opval;
8057 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8060 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8061 CPU (h_zbit) = opval;
8062 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8065 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)));
8066 CPU (h_vbit) = opval;
8067 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8072 CPU (h_xbit) = opval;
8073 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8077 SET_H_INSN_PREFIXED_P (opval);
8078 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8088 CASE (sem, INSN_SUBU_W_R) : /* subu.w $Rs,$Rd */
8090 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8091 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8092 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8093 int UNUSED written = 0;
8094 IADDR UNUSED pc = abuf->addr;
8095 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8102 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
8103 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8104 tmp_carry = CPU (h_cbit);
8105 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8107 SI opval = tmp_newval;
8108 SET_H_GR (FLD (f_operand2), opval);
8109 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8113 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))));
8114 CPU (h_cbit) = opval;
8115 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8118 BI opval = LTSI (tmp_newval, 0);
8119 CPU (h_nbit) = opval;
8120 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8123 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8124 CPU (h_zbit) = opval;
8125 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8128 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)));
8129 CPU (h_vbit) = opval;
8130 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8135 CPU (h_xbit) = opval;
8136 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8140 SET_H_INSN_PREFIXED_P (opval);
8141 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8151 CASE (sem, INSN_SUBU_M_B_M) : /* subu-m.b [${Rs}${inc}],$Rd */
8153 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8154 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8155 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8156 int UNUSED written = 0;
8157 IADDR UNUSED pc = abuf->addr;
8158 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8165 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
8168 tmp_postinc = FLD (f_memmode);
8169 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8170 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8171 ; if (NEBI (tmp_postinc, 0)) {
8173 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8174 tmp_addr = ADDSI (tmp_addr, 1);
8177 SI opval = tmp_addr;
8178 SET_H_GR (FLD (f_operand1), opval);
8179 written |= (1 << 11);
8180 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8185 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8186 tmp_carry = CPU (h_cbit);
8187 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8189 SI opval = tmp_newval;
8190 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8191 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8195 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))));
8196 CPU (h_cbit) = opval;
8197 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8200 BI opval = LTSI (tmp_newval, 0);
8201 CPU (h_nbit) = opval;
8202 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8205 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8206 CPU (h_zbit) = opval;
8207 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8210 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)));
8211 CPU (h_vbit) = opval;
8212 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8217 CPU (h_xbit) = opval;
8218 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8222 SET_H_INSN_PREFIXED_P (opval);
8223 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8229 abuf->written = written;
8234 CASE (sem, INSN_SUBU_M_W_M) : /* subu-m.w [${Rs}${inc}],$Rd */
8236 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8237 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8238 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8239 int UNUSED written = 0;
8240 IADDR UNUSED pc = abuf->addr;
8241 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8248 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
8251 tmp_postinc = FLD (f_memmode);
8252 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8253 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8254 ; if (NEBI (tmp_postinc, 0)) {
8256 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8257 tmp_addr = ADDSI (tmp_addr, 2);
8260 SI opval = tmp_addr;
8261 SET_H_GR (FLD (f_operand1), opval);
8262 written |= (1 << 11);
8263 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8268 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8269 tmp_carry = CPU (h_cbit);
8270 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8272 SI opval = tmp_newval;
8273 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
8274 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8278 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))));
8279 CPU (h_cbit) = opval;
8280 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8283 BI opval = LTSI (tmp_newval, 0);
8284 CPU (h_nbit) = opval;
8285 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8288 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8289 CPU (h_zbit) = opval;
8290 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8293 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)));
8294 CPU (h_vbit) = opval;
8295 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8300 CPU (h_xbit) = opval;
8301 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8305 SET_H_INSN_PREFIXED_P (opval);
8306 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8312 abuf->written = written;
8317 CASE (sem, INSN_SUBUCBR) : /* [${Rs}${inc}],$Rd */
8319 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8320 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8321 #define FLD(f) abuf->fields.sfmt_addcbr.f
8322 int UNUSED written = 0;
8323 IADDR UNUSED pc = abuf->addr;
8324 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8331 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
8332 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8333 tmp_carry = CPU (h_cbit);
8334 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8336 SI opval = tmp_newval;
8337 SET_H_GR (FLD (f_operand2), opval);
8338 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8342 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))));
8343 CPU (h_cbit) = opval;
8344 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8347 BI opval = LTSI (tmp_newval, 0);
8348 CPU (h_nbit) = opval;
8349 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8352 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8353 CPU (h_zbit) = opval;
8354 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8357 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)));
8358 CPU (h_vbit) = opval;
8359 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8364 CPU (h_xbit) = opval;
8365 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8369 SET_H_INSN_PREFIXED_P (opval);
8370 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8380 CASE (sem, INSN_SUBUCWR) : /* [${Rs}${inc}],$Rd */
8382 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8383 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8384 #define FLD(f) abuf->fields.sfmt_addcwr.f
8385 int UNUSED written = 0;
8386 IADDR UNUSED pc = abuf->addr;
8387 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8394 tmp_tmpops = ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word)));
8395 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
8396 tmp_carry = CPU (h_cbit);
8397 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8399 SI opval = tmp_newval;
8400 SET_H_GR (FLD (f_operand2), opval);
8401 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8405 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))));
8406 CPU (h_cbit) = opval;
8407 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8410 BI opval = LTSI (tmp_newval, 0);
8411 CPU (h_nbit) = opval;
8412 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8415 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8416 CPU (h_zbit) = opval;
8417 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8420 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)));
8421 CPU (h_vbit) = opval;
8422 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8427 CPU (h_xbit) = opval;
8428 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8432 SET_H_INSN_PREFIXED_P (opval);
8433 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8443 CASE (sem, INSN_ADDI_B_R) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8445 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8446 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8447 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8448 int UNUSED written = 0;
8449 IADDR UNUSED pc = abuf->addr;
8450 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8454 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
8455 SET_H_GR (FLD (f_operand1), opval);
8456 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8461 CPU (h_xbit) = opval;
8462 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8466 SET_H_INSN_PREFIXED_P (opval);
8467 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8476 CASE (sem, INSN_ADDI_W_R) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8478 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8479 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8480 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8481 int UNUSED written = 0;
8482 IADDR UNUSED pc = abuf->addr;
8483 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8487 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
8488 SET_H_GR (FLD (f_operand1), opval);
8489 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8494 CPU (h_xbit) = opval;
8495 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8499 SET_H_INSN_PREFIXED_P (opval);
8500 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8509 CASE (sem, INSN_ADDI_D_R) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8513 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8514 int UNUSED written = 0;
8515 IADDR UNUSED pc = abuf->addr;
8516 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8520 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
8521 SET_H_GR (FLD (f_operand1), opval);
8522 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8527 CPU (h_xbit) = opval;
8528 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8532 SET_H_INSN_PREFIXED_P (opval);
8533 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8542 CASE (sem, INSN_NEG_B_R) : /* neg.b $Rs,$Rd */
8544 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8545 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8546 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8547 int UNUSED written = 0;
8548 IADDR UNUSED pc = abuf->addr;
8549 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8556 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8558 tmp_carry = CPU (h_cbit);
8559 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8562 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
8564 SI opval = ORSI (ANDSI (tmp_newval, 255), ANDSI (tmp_oldregval, 0xffffff00));
8565 SET_H_GR (FLD (f_operand2), opval);
8566 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8571 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))));
8572 CPU (h_cbit) = opval;
8573 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8576 BI opval = LTQI (tmp_newval, 0);
8577 CPU (h_nbit) = opval;
8578 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8581 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8582 CPU (h_zbit) = opval;
8583 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8586 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)));
8587 CPU (h_vbit) = opval;
8588 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8593 CPU (h_xbit) = opval;
8594 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8598 SET_H_INSN_PREFIXED_P (opval);
8599 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8609 CASE (sem, INSN_NEG_W_R) : /* neg.w $Rs,$Rd */
8611 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8612 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8613 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8614 int UNUSED written = 0;
8615 IADDR UNUSED pc = abuf->addr;
8616 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8623 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8625 tmp_carry = CPU (h_cbit);
8626 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8629 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
8631 SI opval = ORSI (ANDSI (tmp_newval, 65535), ANDSI (tmp_oldregval, 0xffff0000));
8632 SET_H_GR (FLD (f_operand2), opval);
8633 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8638 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))));
8639 CPU (h_cbit) = opval;
8640 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8643 BI opval = LTHI (tmp_newval, 0);
8644 CPU (h_nbit) = opval;
8645 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8648 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8649 CPU (h_zbit) = opval;
8650 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8653 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)));
8654 CPU (h_vbit) = opval;
8655 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8660 CPU (h_xbit) = opval;
8661 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8665 SET_H_INSN_PREFIXED_P (opval);
8666 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8676 CASE (sem, INSN_NEG_D_R) : /* neg.d $Rs,$Rd */
8678 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8679 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8680 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8681 int UNUSED written = 0;
8682 IADDR UNUSED pc = abuf->addr;
8683 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8690 tmp_tmpops = GET_H_GR (FLD (f_operand1));
8692 tmp_carry = CPU (h_cbit);
8693 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8695 SI opval = tmp_newval;
8696 SET_H_GR (FLD (f_operand2), opval);
8697 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8701 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))));
8702 CPU (h_cbit) = opval;
8703 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8706 BI opval = LTSI (tmp_newval, 0);
8707 CPU (h_nbit) = opval;
8708 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8711 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8712 CPU (h_zbit) = opval;
8713 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8716 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)));
8717 CPU (h_vbit) = opval;
8718 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8723 CPU (h_xbit) = opval;
8724 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8728 SET_H_INSN_PREFIXED_P (opval);
8729 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8739 CASE (sem, INSN_TEST_M_B_M) : /* test-m.b [${Rs}${inc}] */
8741 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8742 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8743 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8744 int UNUSED written = 0;
8745 IADDR UNUSED pc = abuf->addr;
8746 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8750 tmp_tmpd = ({ SI tmp_addr;
8753 tmp_postinc = FLD (f_memmode);
8754 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8755 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
8756 ; if (NEBI (tmp_postinc, 0)) {
8758 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8759 tmp_addr = ADDSI (tmp_addr, 1);
8762 SI opval = tmp_addr;
8763 SET_H_GR (FLD (f_operand1), opval);
8764 written |= (1 << 8);
8765 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8776 tmp_tmpopd = tmp_tmpd;
8777 tmp_carry = CPU (h_cbit);
8778 tmp_newval = SUBCQI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8782 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))));
8783 CPU (h_cbit) = opval;
8784 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8787 BI opval = LTQI (tmp_newval, 0);
8788 CPU (h_nbit) = opval;
8789 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8792 BI opval = ANDIF (EQQI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8793 CPU (h_zbit) = opval;
8794 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8797 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)));
8798 CPU (h_vbit) = opval;
8799 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8804 CPU (h_xbit) = opval;
8805 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8809 SET_H_INSN_PREFIXED_P (opval);
8810 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8817 abuf->written = written;
8822 CASE (sem, INSN_TEST_M_W_M) : /* test-m.w [${Rs}${inc}] */
8824 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8825 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8826 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8827 int UNUSED written = 0;
8828 IADDR UNUSED pc = abuf->addr;
8829 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8833 tmp_tmpd = ({ SI tmp_addr;
8836 tmp_postinc = FLD (f_memmode);
8837 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8838 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
8839 ; if (NEBI (tmp_postinc, 0)) {
8841 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8842 tmp_addr = ADDSI (tmp_addr, 2);
8845 SI opval = tmp_addr;
8846 SET_H_GR (FLD (f_operand1), opval);
8847 written |= (1 << 8);
8848 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8859 tmp_tmpopd = tmp_tmpd;
8860 tmp_carry = CPU (h_cbit);
8861 tmp_newval = SUBCHI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8865 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))));
8866 CPU (h_cbit) = opval;
8867 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8870 BI opval = LTHI (tmp_newval, 0);
8871 CPU (h_nbit) = opval;
8872 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8875 BI opval = ANDIF (EQHI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8876 CPU (h_zbit) = opval;
8877 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8880 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)));
8881 CPU (h_vbit) = opval;
8882 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8887 CPU (h_xbit) = opval;
8888 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8892 SET_H_INSN_PREFIXED_P (opval);
8893 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8900 abuf->written = written;
8905 CASE (sem, INSN_TEST_M_D_M) : /* test-m.d [${Rs}${inc}] */
8907 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8908 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8909 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8910 int UNUSED written = 0;
8911 IADDR UNUSED pc = abuf->addr;
8912 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8916 tmp_tmpd = ({ SI tmp_addr;
8919 tmp_postinc = FLD (f_memmode);
8920 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
8921 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
8922 ; if (NEBI (tmp_postinc, 0)) {
8924 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8925 tmp_addr = ADDSI (tmp_addr, 4);
8928 SI opval = tmp_addr;
8929 SET_H_GR (FLD (f_operand1), opval);
8930 written |= (1 << 8);
8931 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
8942 tmp_tmpopd = tmp_tmpd;
8943 tmp_carry = CPU (h_cbit);
8944 tmp_newval = SUBCSI (tmp_tmpopd, tmp_tmpops, ((EQBI (CPU (h_xbit), 0)) ? (0) : (tmp_carry)));
8948 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))));
8949 CPU (h_cbit) = opval;
8950 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
8953 BI opval = LTSI (tmp_newval, 0);
8954 CPU (h_nbit) = opval;
8955 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
8958 BI opval = ANDIF (EQSI (tmp_newval, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
8959 CPU (h_zbit) = opval;
8960 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
8963 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)));
8964 CPU (h_vbit) = opval;
8965 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
8970 CPU (h_xbit) = opval;
8971 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
8975 SET_H_INSN_PREFIXED_P (opval);
8976 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
8983 abuf->written = written;
8988 CASE (sem, INSN_MOVE_R_M_B_M) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
8990 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
8991 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8992 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8993 int UNUSED written = 0;
8994 IADDR UNUSED pc = abuf->addr;
8995 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
8999 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9003 tmp_postinc = FLD (f_memmode);
9004 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9005 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9006 if (EQBI (CPU (h_pbit), 0)) {
9009 QI opval = tmp_tmpd;
9010 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9011 written |= (1 << 10);
9012 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9015 BI opval = CPU (h_pbit);
9016 CPU (h_cbit) = opval;
9017 written |= (1 << 9);
9018 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9024 CPU (h_cbit) = opval;
9025 written |= (1 << 9);
9026 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9031 QI opval = tmp_tmpd;
9032 SETMEMQI (current_cpu, pc, tmp_addr, opval);
9033 written |= (1 << 10);
9034 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9037 if (NEBI (tmp_postinc, 0)) {
9039 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9040 tmp_addr = ADDSI (tmp_addr, 1);
9043 SI opval = tmp_addr;
9044 SET_H_GR (FLD (f_operand1), opval);
9045 written |= (1 << 8);
9046 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9054 CPU (h_xbit) = opval;
9055 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9059 SET_H_INSN_PREFIXED_P (opval);
9060 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9065 abuf->written = written;
9070 CASE (sem, INSN_MOVE_R_M_W_M) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9072 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9073 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9074 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9075 int UNUSED written = 0;
9076 IADDR UNUSED pc = abuf->addr;
9077 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9081 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9085 tmp_postinc = FLD (f_memmode);
9086 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9087 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9088 if (EQBI (CPU (h_pbit), 0)) {
9091 HI opval = tmp_tmpd;
9092 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9093 written |= (1 << 10);
9094 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9097 BI opval = CPU (h_pbit);
9098 CPU (h_cbit) = opval;
9099 written |= (1 << 9);
9100 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9106 CPU (h_cbit) = opval;
9107 written |= (1 << 9);
9108 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9113 HI opval = tmp_tmpd;
9114 SETMEMHI (current_cpu, pc, tmp_addr, opval);
9115 written |= (1 << 10);
9116 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9119 if (NEBI (tmp_postinc, 0)) {
9121 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9122 tmp_addr = ADDSI (tmp_addr, 2);
9125 SI opval = tmp_addr;
9126 SET_H_GR (FLD (f_operand1), opval);
9127 written |= (1 << 8);
9128 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9136 CPU (h_xbit) = opval;
9137 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9141 SET_H_INSN_PREFIXED_P (opval);
9142 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9147 abuf->written = written;
9152 CASE (sem, INSN_MOVE_R_M_D_M) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9154 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9155 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9156 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9157 int UNUSED written = 0;
9158 IADDR UNUSED pc = abuf->addr;
9159 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9163 tmp_tmpd = GET_H_GR (FLD (f_operand2));
9167 tmp_postinc = FLD (f_memmode);
9168 tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9169 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit), 0))) {
9170 if (EQBI (CPU (h_pbit), 0)) {
9173 SI opval = tmp_tmpd;
9174 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9175 written |= (1 << 10);
9176 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9179 BI opval = CPU (h_pbit);
9180 CPU (h_cbit) = opval;
9181 written |= (1 << 9);
9182 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9188 CPU (h_cbit) = opval;
9189 written |= (1 << 9);
9190 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9195 SI opval = tmp_tmpd;
9196 SETMEMSI (current_cpu, pc, tmp_addr, opval);
9197 written |= (1 << 10);
9198 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9201 if (NEBI (tmp_postinc, 0)) {
9203 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9204 tmp_addr = ADDSI (tmp_addr, 4);
9207 SI opval = tmp_addr;
9208 SET_H_GR (FLD (f_operand1), opval);
9209 written |= (1 << 8);
9210 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9218 CPU (h_xbit) = opval;
9219 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9223 SET_H_INSN_PREFIXED_P (opval);
9224 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9229 abuf->written = written;
9234 CASE (sem, INSN_MULS_B) : /* muls.b $Rs,$Rd */
9236 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9237 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9238 #define FLD(f) abuf->fields.sfmt_muls_b.f
9239 int UNUSED written = 0;
9240 IADDR UNUSED pc = abuf->addr;
9241 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9247 tmp_src1 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9248 tmp_src2 = EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9249 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9251 SI opval = TRUNCDISI (tmp_tmpr);
9252 SET_H_GR (FLD (f_operand2), opval);
9253 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9256 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9257 SET_H_SR (((UINT) 7), opval);
9258 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9262 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9263 CPU (h_cbit) = opval;
9264 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9267 BI opval = LTDI (tmp_tmpr, 0);
9268 CPU (h_nbit) = opval;
9269 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9272 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9273 CPU (h_zbit) = opval;
9274 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9277 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9278 CPU (h_vbit) = opval;
9279 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9284 CPU (h_xbit) = opval;
9285 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9289 SET_H_INSN_PREFIXED_P (opval);
9290 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9300 CASE (sem, INSN_MULS_W) : /* muls.w $Rs,$Rd */
9302 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9303 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9304 #define FLD(f) abuf->fields.sfmt_muls_b.f
9305 int UNUSED written = 0;
9306 IADDR UNUSED pc = abuf->addr;
9307 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9313 tmp_src1 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9314 tmp_src2 = EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9315 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9317 SI opval = TRUNCDISI (tmp_tmpr);
9318 SET_H_GR (FLD (f_operand2), opval);
9319 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9322 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9323 SET_H_SR (((UINT) 7), opval);
9324 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9328 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9329 CPU (h_cbit) = opval;
9330 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9333 BI opval = LTDI (tmp_tmpr, 0);
9334 CPU (h_nbit) = opval;
9335 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9338 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9339 CPU (h_zbit) = opval;
9340 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9343 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9344 CPU (h_vbit) = opval;
9345 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9350 CPU (h_xbit) = opval;
9351 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9355 SET_H_INSN_PREFIXED_P (opval);
9356 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9366 CASE (sem, INSN_MULS_D) : /* muls.d $Rs,$Rd */
9368 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9369 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9370 #define FLD(f) abuf->fields.sfmt_muls_b.f
9371 int UNUSED written = 0;
9372 IADDR UNUSED pc = abuf->addr;
9373 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9379 tmp_src1 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9380 tmp_src2 = EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9381 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9383 SI opval = TRUNCDISI (tmp_tmpr);
9384 SET_H_GR (FLD (f_operand2), opval);
9385 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9388 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9389 SET_H_SR (((UINT) 7), opval);
9390 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9394 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9395 CPU (h_cbit) = opval;
9396 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9399 BI opval = LTDI (tmp_tmpr, 0);
9400 CPU (h_nbit) = opval;
9401 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9404 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9405 CPU (h_zbit) = opval;
9406 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9409 BI opval = NEDI (tmp_tmpr, EXTSIDI (TRUNCDISI (tmp_tmpr)));
9410 CPU (h_vbit) = opval;
9411 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9416 CPU (h_xbit) = opval;
9417 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9421 SET_H_INSN_PREFIXED_P (opval);
9422 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9432 CASE (sem, INSN_MULU_B) : /* mulu.b $Rs,$Rd */
9434 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9435 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9436 #define FLD(f) abuf->fields.sfmt_muls_b.f
9437 int UNUSED written = 0;
9438 IADDR UNUSED pc = abuf->addr;
9439 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9445 tmp_src1 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
9446 tmp_src2 = ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2))));
9447 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9449 SI opval = TRUNCDISI (tmp_tmpr);
9450 SET_H_GR (FLD (f_operand2), opval);
9451 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9454 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9455 SET_H_SR (((UINT) 7), opval);
9456 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9460 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9461 CPU (h_cbit) = opval;
9462 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9465 BI opval = LTDI (tmp_tmpr, 0);
9466 CPU (h_nbit) = opval;
9467 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9470 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9471 CPU (h_zbit) = opval;
9472 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9475 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9476 CPU (h_vbit) = opval;
9477 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9482 CPU (h_xbit) = opval;
9483 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9487 SET_H_INSN_PREFIXED_P (opval);
9488 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9498 CASE (sem, INSN_MULU_W) : /* mulu.w $Rs,$Rd */
9500 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9501 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9502 #define FLD(f) abuf->fields.sfmt_muls_b.f
9503 int UNUSED written = 0;
9504 IADDR UNUSED pc = abuf->addr;
9505 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9511 tmp_src1 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
9512 tmp_src2 = ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2))));
9513 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9515 SI opval = TRUNCDISI (tmp_tmpr);
9516 SET_H_GR (FLD (f_operand2), opval);
9517 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9520 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9521 SET_H_SR (((UINT) 7), opval);
9522 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9526 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9527 CPU (h_cbit) = opval;
9528 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9531 BI opval = LTDI (tmp_tmpr, 0);
9532 CPU (h_nbit) = opval;
9533 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9536 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9537 CPU (h_zbit) = opval;
9538 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9541 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9542 CPU (h_vbit) = opval;
9543 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9548 CPU (h_xbit) = opval;
9549 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9553 SET_H_INSN_PREFIXED_P (opval);
9554 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9564 CASE (sem, INSN_MULU_D) : /* mulu.d $Rs,$Rd */
9566 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9567 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9568 #define FLD(f) abuf->fields.sfmt_muls_b.f
9569 int UNUSED written = 0;
9570 IADDR UNUSED pc = abuf->addr;
9571 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9577 tmp_src1 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1))));
9578 tmp_src2 = ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2))));
9579 tmp_tmpr = MULDI (tmp_src1, tmp_src2);
9581 SI opval = TRUNCDISI (tmp_tmpr);
9582 SET_H_GR (FLD (f_operand2), opval);
9583 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9586 SI opval = TRUNCDISI (SRLDI (tmp_tmpr, 32));
9587 SET_H_SR (((UINT) 7), opval);
9588 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
9592 BI opval = ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit));
9593 CPU (h_cbit) = opval;
9594 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
9597 BI opval = LTDI (tmp_tmpr, 0);
9598 CPU (h_nbit) = opval;
9599 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9602 BI opval = ANDIF (EQDI (tmp_tmpr, 0), ORIF (CPU (h_zbit), NOTBI (CPU (h_xbit))));
9603 CPU (h_zbit) = opval;
9604 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9607 BI opval = NEDI (tmp_tmpr, ZEXTSIDI (TRUNCDISI (tmp_tmpr)));
9608 CPU (h_vbit) = opval;
9609 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
9614 CPU (h_xbit) = opval;
9615 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9619 SET_H_INSN_PREFIXED_P (opval);
9620 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9630 CASE (sem, INSN_MSTEP) : /* mstep $Rs,$Rd */
9632 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9633 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9634 #define FLD(f) abuf->fields.sfmt_muls_b.f
9635 int UNUSED written = 0;
9636 IADDR UNUSED pc = abuf->addr;
9637 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9642 tmp_tmps = GET_H_GR (FLD (f_operand1));
9643 tmp_tmpd = ADDSI (SLLSI (GET_H_GR (FLD (f_operand2)), 1), ((CPU (h_nbit)) ? (tmp_tmps) : (0)));
9645 SI opval = tmp_tmpd;
9646 SET_H_GR (FLD (f_operand2), opval);
9647 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9651 BI opval = LTSI (tmp_tmpd, 0);
9652 CPU (h_nbit) = opval;
9653 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9656 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9657 CPU (h_zbit) = opval;
9658 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9660 SET_H_CBIT_MOVE (0);
9661 SET_H_VBIT_MOVE (0);
9665 CPU (h_xbit) = opval;
9666 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9670 SET_H_INSN_PREFIXED_P (opval);
9671 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9681 CASE (sem, INSN_DSTEP) : /* dstep $Rs,$Rd */
9683 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9684 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9685 #define FLD(f) abuf->fields.sfmt_muls_b.f
9686 int UNUSED written = 0;
9687 IADDR UNUSED pc = abuf->addr;
9688 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9694 tmp_tmps = GET_H_GR (FLD (f_operand1));
9695 tmp_tmp = SLLSI (GET_H_GR (FLD (f_operand2)), 1);
9696 tmp_tmpd = ((GEUSI (tmp_tmp, tmp_tmps)) ? (SUBSI (tmp_tmp, tmp_tmps)) : (tmp_tmp));
9698 SI opval = tmp_tmpd;
9699 SET_H_GR (FLD (f_operand2), opval);
9700 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9704 BI opval = LTSI (tmp_tmpd, 0);
9705 CPU (h_nbit) = opval;
9706 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9709 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9710 CPU (h_zbit) = opval;
9711 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9713 SET_H_CBIT_MOVE (0);
9714 SET_H_VBIT_MOVE (0);
9718 CPU (h_xbit) = opval;
9719 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9723 SET_H_INSN_PREFIXED_P (opval);
9724 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9734 CASE (sem, INSN_ABS) : /* abs $Rs,$Rd */
9736 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9737 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9738 #define FLD(f) abuf->fields.sfmt_muls_b.f
9739 int UNUSED written = 0;
9740 IADDR UNUSED pc = abuf->addr;
9741 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9745 tmp_tmpd = ABSSI (GET_H_GR (FLD (f_operand1)));
9747 SI opval = tmp_tmpd;
9748 SET_H_GR (FLD (f_operand2), opval);
9749 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9753 BI opval = LTSI (tmp_tmpd, 0);
9754 CPU (h_nbit) = opval;
9755 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9758 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9759 CPU (h_zbit) = opval;
9760 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9762 SET_H_CBIT_MOVE (0);
9763 SET_H_VBIT_MOVE (0);
9767 CPU (h_xbit) = opval;
9768 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9772 SET_H_INSN_PREFIXED_P (opval);
9773 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9783 CASE (sem, INSN_AND_B_R) : /* and.b $Rs,$Rd */
9785 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9786 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9787 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9788 int UNUSED written = 0;
9789 IADDR UNUSED pc = abuf->addr;
9790 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9794 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9797 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
9799 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
9800 SET_H_GR (FLD (f_operand2), opval);
9801 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9806 BI opval = LTQI (tmp_tmpd, 0);
9807 CPU (h_nbit) = opval;
9808 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9811 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9812 CPU (h_zbit) = opval;
9813 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9815 SET_H_CBIT_MOVE (0);
9816 SET_H_VBIT_MOVE (0);
9820 CPU (h_xbit) = opval;
9821 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9825 SET_H_INSN_PREFIXED_P (opval);
9826 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9836 CASE (sem, INSN_AND_W_R) : /* and.w $Rs,$Rd */
9838 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9839 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9840 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9841 int UNUSED written = 0;
9842 IADDR UNUSED pc = abuf->addr;
9843 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9847 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9850 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
9852 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
9853 SET_H_GR (FLD (f_operand2), opval);
9854 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9859 BI opval = LTHI (tmp_tmpd, 0);
9860 CPU (h_nbit) = opval;
9861 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9864 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9865 CPU (h_zbit) = opval;
9866 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9868 SET_H_CBIT_MOVE (0);
9869 SET_H_VBIT_MOVE (0);
9873 CPU (h_xbit) = opval;
9874 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9878 SET_H_INSN_PREFIXED_P (opval);
9879 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9889 CASE (sem, INSN_AND_D_R) : /* and.d $Rs,$Rd */
9891 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9892 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9893 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9894 int UNUSED written = 0;
9895 IADDR UNUSED pc = abuf->addr;
9896 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9900 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
9902 SI opval = tmp_tmpd;
9903 SET_H_GR (FLD (f_operand2), opval);
9904 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9908 BI opval = LTSI (tmp_tmpd, 0);
9909 CPU (h_nbit) = opval;
9910 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9913 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9914 CPU (h_zbit) = opval;
9915 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9917 SET_H_CBIT_MOVE (0);
9918 SET_H_VBIT_MOVE (0);
9922 CPU (h_xbit) = opval;
9923 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9927 SET_H_INSN_PREFIXED_P (opval);
9928 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
9938 CASE (sem, INSN_AND_M_B_M) : /* and-m.b [${Rs}${inc}],${Rd} */
9940 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
9941 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9942 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
9943 int UNUSED written = 0;
9944 IADDR UNUSED pc = abuf->addr;
9945 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
9949 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
9952 tmp_postinc = FLD (f_memmode);
9953 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
9954 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
9955 ; if (NEBI (tmp_postinc, 0)) {
9957 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9958 tmp_addr = ADDSI (tmp_addr, 1);
9961 SI opval = tmp_addr;
9962 SET_H_GR (FLD (f_operand1), opval);
9963 written |= (1 << 11);
9964 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9971 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
9973 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
9974 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
9975 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
9980 BI opval = LTQI (tmp_tmpd, 0);
9981 CPU (h_nbit) = opval;
9982 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
9985 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
9986 CPU (h_zbit) = opval;
9987 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
9989 SET_H_CBIT_MOVE (0);
9990 SET_H_VBIT_MOVE (0);
9994 CPU (h_xbit) = opval;
9995 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
9999 SET_H_INSN_PREFIXED_P (opval);
10000 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10006 abuf->written = written;
10011 CASE (sem, INSN_AND_M_W_M) : /* and-m.w [${Rs}${inc}],${Rd} */
10013 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10014 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10015 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10016 int UNUSED written = 0;
10017 IADDR UNUSED pc = abuf->addr;
10018 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10022 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10025 tmp_postinc = FLD (f_memmode);
10026 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10027 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10028 ; if (NEBI (tmp_postinc, 0)) {
10030 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10031 tmp_addr = ADDSI (tmp_addr, 2);
10034 SI opval = tmp_addr;
10035 SET_H_GR (FLD (f_operand1), opval);
10036 written |= (1 << 11);
10037 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10041 ; tmp_tmp_mem; }));
10044 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10046 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10047 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10048 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10053 BI opval = LTHI (tmp_tmpd, 0);
10054 CPU (h_nbit) = opval;
10055 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10058 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10059 CPU (h_zbit) = opval;
10060 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10062 SET_H_CBIT_MOVE (0);
10063 SET_H_VBIT_MOVE (0);
10067 CPU (h_xbit) = opval;
10068 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10072 SET_H_INSN_PREFIXED_P (opval);
10073 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10079 abuf->written = written;
10084 CASE (sem, INSN_AND_M_D_M) : /* and-m.d [${Rs}${inc}],${Rd} */
10086 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10087 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10088 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10089 int UNUSED written = 0;
10090 IADDR UNUSED pc = abuf->addr;
10091 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10095 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10098 tmp_postinc = FLD (f_memmode);
10099 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10100 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10101 ; if (NEBI (tmp_postinc, 0)) {
10103 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10104 tmp_addr = ADDSI (tmp_addr, 4);
10107 SI opval = tmp_addr;
10108 SET_H_GR (FLD (f_operand1), opval);
10109 written |= (1 << 10);
10110 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10114 ; tmp_tmp_mem; }));
10116 SI opval = tmp_tmpd;
10117 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10118 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10122 BI opval = LTSI (tmp_tmpd, 0);
10123 CPU (h_nbit) = opval;
10124 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10127 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10128 CPU (h_zbit) = opval;
10129 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10131 SET_H_CBIT_MOVE (0);
10132 SET_H_VBIT_MOVE (0);
10136 CPU (h_xbit) = opval;
10137 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10141 SET_H_INSN_PREFIXED_P (opval);
10142 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10148 abuf->written = written;
10153 CASE (sem, INSN_ANDCBR) : /* and.b ${sconst8}],${Rd} */
10155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10157 #define FLD(f) abuf->fields.sfmt_addcbr.f
10158 int UNUSED written = 0;
10159 IADDR UNUSED pc = abuf->addr;
10160 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10164 tmp_tmpd = ANDQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10167 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10169 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10170 SET_H_GR (FLD (f_operand2), opval);
10171 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10176 BI opval = LTQI (tmp_tmpd, 0);
10177 CPU (h_nbit) = opval;
10178 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10181 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10182 CPU (h_zbit) = opval;
10183 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10185 SET_H_CBIT_MOVE (0);
10186 SET_H_VBIT_MOVE (0);
10190 CPU (h_xbit) = opval;
10191 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10195 SET_H_INSN_PREFIXED_P (opval);
10196 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10206 CASE (sem, INSN_ANDCWR) : /* and.w ${sconst16}],${Rd} */
10208 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10209 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10210 #define FLD(f) abuf->fields.sfmt_addcwr.f
10211 int UNUSED written = 0;
10212 IADDR UNUSED pc = abuf->addr;
10213 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10217 tmp_tmpd = ANDHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10220 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10222 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10223 SET_H_GR (FLD (f_operand2), opval);
10224 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10229 BI opval = LTHI (tmp_tmpd, 0);
10230 CPU (h_nbit) = opval;
10231 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10234 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10235 CPU (h_zbit) = opval;
10236 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10238 SET_H_CBIT_MOVE (0);
10239 SET_H_VBIT_MOVE (0);
10243 CPU (h_xbit) = opval;
10244 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10248 SET_H_INSN_PREFIXED_P (opval);
10249 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10259 CASE (sem, INSN_ANDCDR) : /* and.d ${const32}],${Rd} */
10261 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10262 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10263 #define FLD(f) abuf->fields.sfmt_addcdr.f
10264 int UNUSED written = 0;
10265 IADDR UNUSED pc = abuf->addr;
10266 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10270 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10272 SI opval = tmp_tmpd;
10273 SET_H_GR (FLD (f_operand2), opval);
10274 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10278 BI opval = LTSI (tmp_tmpd, 0);
10279 CPU (h_nbit) = opval;
10280 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10283 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10284 CPU (h_zbit) = opval;
10285 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10287 SET_H_CBIT_MOVE (0);
10288 SET_H_VBIT_MOVE (0);
10292 CPU (h_xbit) = opval;
10293 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10297 SET_H_INSN_PREFIXED_P (opval);
10298 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10308 CASE (sem, INSN_ANDQ) : /* andq $i,$Rd */
10310 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10311 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10312 #define FLD(f) abuf->fields.sfmt_andq.f
10313 int UNUSED written = 0;
10314 IADDR UNUSED pc = abuf->addr;
10315 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10319 tmp_tmpd = ANDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10321 SI opval = tmp_tmpd;
10322 SET_H_GR (FLD (f_operand2), opval);
10323 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10327 BI opval = LTSI (tmp_tmpd, 0);
10328 CPU (h_nbit) = opval;
10329 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10332 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10333 CPU (h_zbit) = opval;
10334 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10336 SET_H_CBIT_MOVE (0);
10337 SET_H_VBIT_MOVE (0);
10341 CPU (h_xbit) = opval;
10342 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10346 SET_H_INSN_PREFIXED_P (opval);
10347 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10357 CASE (sem, INSN_ORR_B_R) : /* orr.b $Rs,$Rd */
10359 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10360 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10361 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10362 int UNUSED written = 0;
10363 IADDR UNUSED pc = abuf->addr;
10364 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10368 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10371 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10373 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10374 SET_H_GR (FLD (f_operand2), opval);
10375 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10380 BI opval = LTQI (tmp_tmpd, 0);
10381 CPU (h_nbit) = opval;
10382 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10385 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10386 CPU (h_zbit) = opval;
10387 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10389 SET_H_CBIT_MOVE (0);
10390 SET_H_VBIT_MOVE (0);
10394 CPU (h_xbit) = opval;
10395 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10399 SET_H_INSN_PREFIXED_P (opval);
10400 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10410 CASE (sem, INSN_ORR_W_R) : /* orr.w $Rs,$Rd */
10412 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10413 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10414 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10415 int UNUSED written = 0;
10416 IADDR UNUSED pc = abuf->addr;
10417 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10421 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10424 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10426 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10427 SET_H_GR (FLD (f_operand2), opval);
10428 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10433 BI opval = LTHI (tmp_tmpd, 0);
10434 CPU (h_nbit) = opval;
10435 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10438 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10439 CPU (h_zbit) = opval;
10440 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10442 SET_H_CBIT_MOVE (0);
10443 SET_H_VBIT_MOVE (0);
10447 CPU (h_xbit) = opval;
10448 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10452 SET_H_INSN_PREFIXED_P (opval);
10453 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10463 CASE (sem, INSN_ORR_D_R) : /* orr.d $Rs,$Rd */
10465 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10466 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10467 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10468 int UNUSED written = 0;
10469 IADDR UNUSED pc = abuf->addr;
10470 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10474 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10476 SI opval = tmp_tmpd;
10477 SET_H_GR (FLD (f_operand2), opval);
10478 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10482 BI opval = LTSI (tmp_tmpd, 0);
10483 CPU (h_nbit) = opval;
10484 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10487 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10488 CPU (h_zbit) = opval;
10489 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10491 SET_H_CBIT_MOVE (0);
10492 SET_H_VBIT_MOVE (0);
10496 CPU (h_xbit) = opval;
10497 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10501 SET_H_INSN_PREFIXED_P (opval);
10502 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10512 CASE (sem, INSN_OR_M_B_M) : /* or-m.b [${Rs}${inc}],${Rd} */
10514 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10515 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10516 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10517 int UNUSED written = 0;
10518 IADDR UNUSED pc = abuf->addr;
10519 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10523 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10526 tmp_postinc = FLD (f_memmode);
10527 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10528 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
10529 ; if (NEBI (tmp_postinc, 0)) {
10531 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10532 tmp_addr = ADDSI (tmp_addr, 1);
10535 SI opval = tmp_addr;
10536 SET_H_GR (FLD (f_operand1), opval);
10537 written |= (1 << 11);
10538 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10542 ; tmp_tmp_mem; }));
10545 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10547 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10548 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10549 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10554 BI opval = LTQI (tmp_tmpd, 0);
10555 CPU (h_nbit) = opval;
10556 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10559 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10560 CPU (h_zbit) = opval;
10561 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10563 SET_H_CBIT_MOVE (0);
10564 SET_H_VBIT_MOVE (0);
10568 CPU (h_xbit) = opval;
10569 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10573 SET_H_INSN_PREFIXED_P (opval);
10574 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10580 abuf->written = written;
10585 CASE (sem, INSN_OR_M_W_M) : /* or-m.w [${Rs}${inc}],${Rd} */
10587 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10588 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10589 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10590 int UNUSED written = 0;
10591 IADDR UNUSED pc = abuf->addr;
10592 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10596 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10599 tmp_postinc = FLD (f_memmode);
10600 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10601 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
10602 ; if (NEBI (tmp_postinc, 0)) {
10604 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10605 tmp_addr = ADDSI (tmp_addr, 2);
10608 SI opval = tmp_addr;
10609 SET_H_GR (FLD (f_operand1), opval);
10610 written |= (1 << 11);
10611 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10615 ; tmp_tmp_mem; }));
10618 tmp_oldregval = GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))));
10620 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10621 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10622 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10627 BI opval = LTHI (tmp_tmpd, 0);
10628 CPU (h_nbit) = opval;
10629 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10632 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10633 CPU (h_zbit) = opval;
10634 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10636 SET_H_CBIT_MOVE (0);
10637 SET_H_VBIT_MOVE (0);
10641 CPU (h_xbit) = opval;
10642 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10646 SET_H_INSN_PREFIXED_P (opval);
10647 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10653 abuf->written = written;
10658 CASE (sem, INSN_OR_M_D_M) : /* or-m.d [${Rs}${inc}],${Rd} */
10660 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10661 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10662 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10663 int UNUSED written = 0;
10664 IADDR UNUSED pc = abuf->addr;
10665 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10669 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), ({ SI tmp_addr;
10672 tmp_postinc = FLD (f_memmode);
10673 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
10674 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
10675 ; if (NEBI (tmp_postinc, 0)) {
10677 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10678 tmp_addr = ADDSI (tmp_addr, 4);
10681 SI opval = tmp_addr;
10682 SET_H_GR (FLD (f_operand1), opval);
10683 written |= (1 << 10);
10684 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10688 ; tmp_tmp_mem; }));
10690 SI opval = tmp_tmpd;
10691 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) ? (FLD (f_operand1)) : (FLD (f_operand2))), opval);
10692 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10696 BI opval = LTSI (tmp_tmpd, 0);
10697 CPU (h_nbit) = opval;
10698 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10701 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10702 CPU (h_zbit) = opval;
10703 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10705 SET_H_CBIT_MOVE (0);
10706 SET_H_VBIT_MOVE (0);
10710 CPU (h_xbit) = opval;
10711 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10715 SET_H_INSN_PREFIXED_P (opval);
10716 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10722 abuf->written = written;
10727 CASE (sem, INSN_ORCBR) : /* or.b ${sconst8}],${Rd} */
10729 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10730 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10731 #define FLD(f) abuf->fields.sfmt_addcbr.f
10732 int UNUSED written = 0;
10733 IADDR UNUSED pc = abuf->addr;
10734 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10738 tmp_tmpd = ORQI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__byte));
10741 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10743 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
10744 SET_H_GR (FLD (f_operand2), opval);
10745 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10750 BI opval = LTQI (tmp_tmpd, 0);
10751 CPU (h_nbit) = opval;
10752 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10755 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10756 CPU (h_zbit) = opval;
10757 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10759 SET_H_CBIT_MOVE (0);
10760 SET_H_VBIT_MOVE (0);
10764 CPU (h_xbit) = opval;
10765 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10769 SET_H_INSN_PREFIXED_P (opval);
10770 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10780 CASE (sem, INSN_ORCWR) : /* or.w ${sconst16}],${Rd} */
10782 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10783 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10784 #define FLD(f) abuf->fields.sfmt_addcwr.f
10785 int UNUSED written = 0;
10786 IADDR UNUSED pc = abuf->addr;
10787 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10791 tmp_tmpd = ORHI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__word));
10794 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
10796 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
10797 SET_H_GR (FLD (f_operand2), opval);
10798 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10803 BI opval = LTHI (tmp_tmpd, 0);
10804 CPU (h_nbit) = opval;
10805 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10808 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10809 CPU (h_zbit) = opval;
10810 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10812 SET_H_CBIT_MOVE (0);
10813 SET_H_VBIT_MOVE (0);
10817 CPU (h_xbit) = opval;
10818 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10822 SET_H_INSN_PREFIXED_P (opval);
10823 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10833 CASE (sem, INSN_ORCDR) : /* or.d ${const32}],${Rd} */
10835 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10836 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10837 #define FLD(f) abuf->fields.sfmt_addcdr.f
10838 int UNUSED written = 0;
10839 IADDR UNUSED pc = abuf->addr;
10840 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
10844 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
10846 SI opval = tmp_tmpd;
10847 SET_H_GR (FLD (f_operand2), opval);
10848 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10852 BI opval = LTSI (tmp_tmpd, 0);
10853 CPU (h_nbit) = opval;
10854 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10857 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10858 CPU (h_zbit) = opval;
10859 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10861 SET_H_CBIT_MOVE (0);
10862 SET_H_VBIT_MOVE (0);
10866 CPU (h_xbit) = opval;
10867 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10871 SET_H_INSN_PREFIXED_P (opval);
10872 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10882 CASE (sem, INSN_ORQ) : /* orq $i,$Rd */
10884 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10885 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10886 #define FLD(f) abuf->fields.sfmt_andq.f
10887 int UNUSED written = 0;
10888 IADDR UNUSED pc = abuf->addr;
10889 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10893 tmp_tmpd = ORSI (GET_H_GR (FLD (f_operand2)), FLD (f_s6));
10895 SI opval = tmp_tmpd;
10896 SET_H_GR (FLD (f_operand2), opval);
10897 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10901 BI opval = LTSI (tmp_tmpd, 0);
10902 CPU (h_nbit) = opval;
10903 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10906 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10907 CPU (h_zbit) = opval;
10908 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10910 SET_H_CBIT_MOVE (0);
10911 SET_H_VBIT_MOVE (0);
10915 CPU (h_xbit) = opval;
10916 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10920 SET_H_INSN_PREFIXED_P (opval);
10921 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10931 CASE (sem, INSN_XOR) : /* xor $Rs,$Rd */
10933 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10934 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10935 #define FLD(f) abuf->fields.sfmt_muls_b.f
10936 int UNUSED written = 0;
10937 IADDR UNUSED pc = abuf->addr;
10938 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10942 tmp_tmpd = XORSI (GET_H_GR (FLD (f_operand2)), GET_H_GR (FLD (f_operand1)));
10944 SI opval = tmp_tmpd;
10945 SET_H_GR (FLD (f_operand2), opval);
10946 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
10950 BI opval = LTSI (tmp_tmpd, 0);
10951 CPU (h_nbit) = opval;
10952 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
10955 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
10956 CPU (h_zbit) = opval;
10957 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
10959 SET_H_CBIT_MOVE (0);
10960 SET_H_VBIT_MOVE (0);
10964 CPU (h_xbit) = opval;
10965 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
10969 SET_H_INSN_PREFIXED_P (opval);
10970 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
10980 CASE (sem, INSN_SWAP) : /* swap${swapoption} ${Rs} */
10982 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
10983 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10984 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
10985 int UNUSED written = 0;
10986 IADDR UNUSED pc = abuf->addr;
10987 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
10992 tmp_tmps = GET_H_GR (FLD (f_operand1));
10993 tmp_tmpd = ({ SI tmp_tmpcode;
10996 tmp_tmpcode = FLD (f_operand2);
10997 ; tmp_tmpval = tmp_tmps;
10998 ; if (EQSI (tmp_tmpcode, 0)) {
10999 tmp_tmpres = (cgen_rtx_error (current_cpu, "SWAP without swap modifier isn't implemented"), 0);
11001 else if (EQSI (tmp_tmpcode, 1)) {
11002 tmp_tmpres = ({ SI tmp_tmpr;
11003 tmp_tmpr = tmp_tmpval;
11004 ; 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)))))))); });
11006 else if (EQSI (tmp_tmpcode, 2)) {
11007 tmp_tmpres = ({ SI tmp_tmpb;
11008 tmp_tmpb = tmp_tmpval;
11009 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11011 else if (EQSI (tmp_tmpcode, 3)) {
11012 tmp_tmpres = ({ SI tmp_tmpr;
11013 tmp_tmpr = ({ SI tmp_tmpb;
11014 tmp_tmpb = tmp_tmpval;
11015 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11016 ; 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)))))))); });
11018 else if (EQSI (tmp_tmpcode, 4)) {
11019 tmp_tmpres = ({ SI tmp_tmpb;
11020 tmp_tmpb = tmp_tmpval;
11021 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11023 else if (EQSI (tmp_tmpcode, 5)) {
11024 tmp_tmpres = ({ SI tmp_tmpr;
11025 tmp_tmpr = ({ SI tmp_tmpb;
11026 tmp_tmpb = tmp_tmpval;
11027 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11028 ; 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)))))))); });
11030 else if (EQSI (tmp_tmpcode, 6)) {
11031 tmp_tmpres = ({ SI tmp_tmpb;
11032 tmp_tmpb = ({ SI tmp_tmpb;
11033 tmp_tmpb = tmp_tmpval;
11034 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11035 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11037 else if (EQSI (tmp_tmpcode, 7)) {
11038 tmp_tmpres = ({ SI tmp_tmpr;
11039 tmp_tmpr = ({ SI tmp_tmpb;
11040 tmp_tmpb = ({ SI tmp_tmpb;
11041 tmp_tmpb = tmp_tmpval;
11042 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11043 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11044 ; 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)))))))); });
11046 else if (EQSI (tmp_tmpcode, 8)) {
11047 tmp_tmpres = INVSI (tmp_tmpval);
11049 else if (EQSI (tmp_tmpcode, 9)) {
11050 tmp_tmpres = ({ SI tmp_tmpr;
11051 tmp_tmpr = INVSI (tmp_tmpval);
11052 ; 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)))))))); });
11054 else if (EQSI (tmp_tmpcode, 10)) {
11055 tmp_tmpres = ({ SI tmp_tmpb;
11056 tmp_tmpb = INVSI (tmp_tmpval);
11057 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11059 else if (EQSI (tmp_tmpcode, 11)) {
11060 tmp_tmpres = ({ SI tmp_tmpr;
11061 tmp_tmpr = ({ SI tmp_tmpb;
11062 tmp_tmpb = INVSI (tmp_tmpval);
11063 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11064 ; 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)))))))); });
11066 else if (EQSI (tmp_tmpcode, 12)) {
11067 tmp_tmpres = ({ SI tmp_tmpb;
11068 tmp_tmpb = INVSI (tmp_tmpval);
11069 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11071 else if (EQSI (tmp_tmpcode, 13)) {
11072 tmp_tmpres = ({ SI tmp_tmpr;
11073 tmp_tmpr = ({ SI tmp_tmpb;
11074 tmp_tmpb = INVSI (tmp_tmpval);
11075 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11076 ; 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)))))))); });
11078 else if (EQSI (tmp_tmpcode, 14)) {
11079 tmp_tmpres = ({ SI tmp_tmpb;
11080 tmp_tmpb = ({ SI tmp_tmpb;
11081 tmp_tmpb = INVSI (tmp_tmpval);
11082 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11083 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11085 else if (EQSI (tmp_tmpcode, 15)) {
11086 tmp_tmpres = ({ SI tmp_tmpr;
11087 tmp_tmpr = ({ SI tmp_tmpb;
11088 tmp_tmpb = ({ SI tmp_tmpb;
11089 tmp_tmpb = INVSI (tmp_tmpval);
11090 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb, 16), 65535)); });
11091 ; ORSI (ANDSI (SLLSI (tmp_tmpb, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb, 8), 16711935)); });
11092 ; 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)))))))); });
11096 SI opval = tmp_tmpd;
11097 SET_H_GR (FLD (f_operand1), opval);
11098 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11102 BI opval = LTSI (tmp_tmpd, 0);
11103 CPU (h_nbit) = opval;
11104 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11107 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11108 CPU (h_zbit) = opval;
11109 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11111 SET_H_CBIT_MOVE (0);
11112 SET_H_VBIT_MOVE (0);
11116 CPU (h_xbit) = opval;
11117 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11121 SET_H_INSN_PREFIXED_P (opval);
11122 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11132 CASE (sem, INSN_ASRR_B_R) : /* asrr.b $Rs,$Rd */
11134 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11135 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11136 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11137 int UNUSED written = 0;
11138 IADDR UNUSED pc = abuf->addr;
11139 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11145 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11146 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11147 tmp_tmpd = SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11150 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11152 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11153 SET_H_GR (FLD (f_operand2), opval);
11154 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11159 BI opval = LTQI (tmp_tmpd, 0);
11160 CPU (h_nbit) = opval;
11161 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11164 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11165 CPU (h_zbit) = opval;
11166 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11168 SET_H_CBIT_MOVE (0);
11169 SET_H_VBIT_MOVE (0);
11173 CPU (h_xbit) = opval;
11174 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11178 SET_H_INSN_PREFIXED_P (opval);
11179 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11189 CASE (sem, INSN_ASRR_W_R) : /* asrr.w $Rs,$Rd */
11191 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11192 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11193 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11194 int UNUSED written = 0;
11195 IADDR UNUSED pc = abuf->addr;
11196 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11202 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11203 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11204 tmp_tmpd = SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11207 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11209 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11210 SET_H_GR (FLD (f_operand2), opval);
11211 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11216 BI opval = LTHI (tmp_tmpd, 0);
11217 CPU (h_nbit) = opval;
11218 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11221 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11222 CPU (h_zbit) = opval;
11223 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11225 SET_H_CBIT_MOVE (0);
11226 SET_H_VBIT_MOVE (0);
11230 CPU (h_xbit) = opval;
11231 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11235 SET_H_INSN_PREFIXED_P (opval);
11236 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11246 CASE (sem, INSN_ASRR_D_R) : /* asrr.d $Rs,$Rd */
11248 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11249 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11250 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11251 int UNUSED written = 0;
11252 IADDR UNUSED pc = abuf->addr;
11253 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11259 tmp_cnt1 = GET_H_GR (FLD (f_operand1));
11260 tmp_cnt2 = ((NESI (ANDSI (tmp_cnt1, 32), 0)) ? (31) : (ANDSI (tmp_cnt1, 31)));
11261 tmp_tmpd = SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), tmp_cnt2);
11263 SI opval = tmp_tmpd;
11264 SET_H_GR (FLD (f_operand2), opval);
11265 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11269 BI opval = LTSI (tmp_tmpd, 0);
11270 CPU (h_nbit) = opval;
11271 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11274 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11275 CPU (h_zbit) = opval;
11276 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11278 SET_H_CBIT_MOVE (0);
11279 SET_H_VBIT_MOVE (0);
11283 CPU (h_xbit) = opval;
11284 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11288 SET_H_INSN_PREFIXED_P (opval);
11289 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11299 CASE (sem, INSN_ASRQ) : /* asrq $c,${Rd} */
11301 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11302 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11303 #define FLD(f) abuf->fields.sfmt_asrq.f
11304 int UNUSED written = 0;
11305 IADDR UNUSED pc = abuf->addr;
11306 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11310 tmp_tmpd = SRASI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11312 SI opval = tmp_tmpd;
11313 SET_H_GR (FLD (f_operand2), opval);
11314 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11318 BI opval = LTSI (tmp_tmpd, 0);
11319 CPU (h_nbit) = opval;
11320 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11323 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11324 CPU (h_zbit) = opval;
11325 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11327 SET_H_CBIT_MOVE (0);
11328 SET_H_VBIT_MOVE (0);
11332 CPU (h_xbit) = opval;
11333 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11337 SET_H_INSN_PREFIXED_P (opval);
11338 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11348 CASE (sem, INSN_LSRR_B_R) : /* lsrr.b $Rs,$Rd */
11350 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11351 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11352 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11353 int UNUSED written = 0;
11354 IADDR UNUSED pc = abuf->addr;
11355 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11360 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11361 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11364 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11366 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11367 SET_H_GR (FLD (f_operand2), opval);
11368 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11373 BI opval = LTQI (tmp_tmpd, 0);
11374 CPU (h_nbit) = opval;
11375 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11378 BI opval = ANDIF (EQQI (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);
11387 CPU (h_xbit) = opval;
11388 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11392 SET_H_INSN_PREFIXED_P (opval);
11393 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11403 CASE (sem, INSN_LSRR_W_R) : /* lsrr.w $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_add_b_r.f
11408 int UNUSED written = 0;
11409 IADDR UNUSED pc = abuf->addr;
11410 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11415 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11416 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11419 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11421 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11422 SET_H_GR (FLD (f_operand2), opval);
11423 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11428 BI opval = LTHI (tmp_tmpd, 0);
11429 CPU (h_nbit) = opval;
11430 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11433 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11434 CPU (h_zbit) = opval;
11435 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11437 SET_H_CBIT_MOVE (0);
11438 SET_H_VBIT_MOVE (0);
11442 CPU (h_xbit) = opval;
11443 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11447 SET_H_INSN_PREFIXED_P (opval);
11448 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11458 CASE (sem, INSN_LSRR_D_R) : /* lsrr.d $Rs,$Rd */
11460 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11461 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11462 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11463 int UNUSED written = 0;
11464 IADDR UNUSED pc = abuf->addr;
11465 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11470 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11471 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11473 SI opval = tmp_tmpd;
11474 SET_H_GR (FLD (f_operand2), opval);
11475 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11479 BI opval = LTSI (tmp_tmpd, 0);
11480 CPU (h_nbit) = opval;
11481 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11484 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11485 CPU (h_zbit) = opval;
11486 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11488 SET_H_CBIT_MOVE (0);
11489 SET_H_VBIT_MOVE (0);
11493 CPU (h_xbit) = opval;
11494 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11498 SET_H_INSN_PREFIXED_P (opval);
11499 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11509 CASE (sem, INSN_LSRQ) : /* lsrq $c,${Rd} */
11511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11513 #define FLD(f) abuf->fields.sfmt_asrq.f
11514 int UNUSED written = 0;
11515 IADDR UNUSED pc = abuf->addr;
11516 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11520 tmp_tmpd = SRLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11522 SI opval = tmp_tmpd;
11523 SET_H_GR (FLD (f_operand2), opval);
11524 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11528 BI opval = LTSI (tmp_tmpd, 0);
11529 CPU (h_nbit) = opval;
11530 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11533 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11534 CPU (h_zbit) = opval;
11535 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11537 SET_H_CBIT_MOVE (0);
11538 SET_H_VBIT_MOVE (0);
11542 CPU (h_xbit) = opval;
11543 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11547 SET_H_INSN_PREFIXED_P (opval);
11548 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11558 CASE (sem, INSN_LSLR_B_R) : /* lslr.b $Rs,$Rd */
11560 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11561 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11562 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11563 int UNUSED written = 0;
11564 IADDR UNUSED pc = abuf->addr;
11565 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11570 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11571 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11574 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11576 SI opval = ORSI (ANDSI (tmp_tmpd, 255), ANDSI (tmp_oldregval, 0xffffff00));
11577 SET_H_GR (FLD (f_operand2), opval);
11578 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11583 BI opval = LTQI (tmp_tmpd, 0);
11584 CPU (h_nbit) = opval;
11585 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11588 BI opval = ANDIF (EQQI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11589 CPU (h_zbit) = opval;
11590 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11592 SET_H_CBIT_MOVE (0);
11593 SET_H_VBIT_MOVE (0);
11597 CPU (h_xbit) = opval;
11598 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11602 SET_H_INSN_PREFIXED_P (opval);
11603 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11613 CASE (sem, INSN_LSLR_W_R) : /* lslr.w $Rs,$Rd */
11615 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11616 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11617 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11618 int UNUSED written = 0;
11619 IADDR UNUSED pc = abuf->addr;
11620 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11625 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11626 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11629 tmp_oldregval = GET_H_RAW_GR_PC (FLD (f_operand2));
11631 SI opval = ORSI (ANDSI (tmp_tmpd, 65535), ANDSI (tmp_oldregval, 0xffff0000));
11632 SET_H_GR (FLD (f_operand2), opval);
11633 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11638 BI opval = LTHI (tmp_tmpd, 0);
11639 CPU (h_nbit) = opval;
11640 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11643 BI opval = ANDIF (EQHI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11644 CPU (h_zbit) = opval;
11645 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11647 SET_H_CBIT_MOVE (0);
11648 SET_H_VBIT_MOVE (0);
11652 CPU (h_xbit) = opval;
11653 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11657 SET_H_INSN_PREFIXED_P (opval);
11658 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11668 CASE (sem, INSN_LSLR_D_R) : /* lslr.d $Rs,$Rd */
11670 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11671 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11672 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11673 int UNUSED written = 0;
11674 IADDR UNUSED pc = abuf->addr;
11675 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11680 tmp_cnt = ANDSI (GET_H_GR (FLD (f_operand1)), 63);
11681 tmp_tmpd = ((NESI (ANDSI (tmp_cnt, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2)))), ANDSI (tmp_cnt, 31))));
11683 SI opval = tmp_tmpd;
11684 SET_H_GR (FLD (f_operand2), opval);
11685 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11689 BI opval = LTSI (tmp_tmpd, 0);
11690 CPU (h_nbit) = opval;
11691 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11694 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11695 CPU (h_zbit) = opval;
11696 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11698 SET_H_CBIT_MOVE (0);
11699 SET_H_VBIT_MOVE (0);
11703 CPU (h_xbit) = opval;
11704 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11708 SET_H_INSN_PREFIXED_P (opval);
11709 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11719 CASE (sem, INSN_LSLQ) : /* lslq $c,${Rd} */
11721 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11722 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11723 #define FLD(f) abuf->fields.sfmt_asrq.f
11724 int UNUSED written = 0;
11725 IADDR UNUSED pc = abuf->addr;
11726 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11730 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), FLD (f_u5));
11732 SI opval = tmp_tmpd;
11733 SET_H_GR (FLD (f_operand2), opval);
11734 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
11738 BI opval = LTSI (tmp_tmpd, 0);
11739 CPU (h_nbit) = opval;
11740 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11743 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11744 CPU (h_zbit) = opval;
11745 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11747 SET_H_CBIT_MOVE (0);
11748 SET_H_VBIT_MOVE (0);
11752 CPU (h_xbit) = opval;
11753 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11757 SET_H_INSN_PREFIXED_P (opval);
11758 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11768 CASE (sem, INSN_BTST) : /* $Rs,$Rd */
11770 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11771 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11772 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11773 int UNUSED written = 0;
11774 IADDR UNUSED pc = abuf->addr;
11775 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11780 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1)), 31)));
11783 BI opval = LTSI (tmp_tmpd, 0);
11784 CPU (h_nbit) = opval;
11785 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11788 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11789 CPU (h_zbit) = opval;
11790 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11792 SET_H_CBIT_MOVE (0);
11793 SET_H_VBIT_MOVE (0);
11797 CPU (h_xbit) = opval;
11798 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11802 SET_H_INSN_PREFIXED_P (opval);
11803 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11813 CASE (sem, INSN_BTSTQ) : /* btstq $c,${Rd} */
11815 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11816 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11817 #define FLD(f) abuf->fields.sfmt_asrq.f
11818 int UNUSED written = 0;
11819 IADDR UNUSED pc = abuf->addr;
11820 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11824 tmp_tmpd = SLLSI (GET_H_GR (FLD (f_operand2)), SUBSI (31, FLD (f_u5)));
11827 BI opval = LTSI (tmp_tmpd, 0);
11828 CPU (h_nbit) = opval;
11829 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11832 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
11833 CPU (h_zbit) = opval;
11834 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11836 SET_H_CBIT_MOVE (0);
11837 SET_H_VBIT_MOVE (0);
11841 CPU (h_xbit) = opval;
11842 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11846 SET_H_INSN_PREFIXED_P (opval);
11847 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11857 CASE (sem, INSN_SETF) : /* setf ${list-of-flags} */
11859 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11860 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11861 #define FLD(f) abuf->fields.sfmt_setf.f
11862 int UNUSED written = 0;
11863 IADDR UNUSED pc = abuf->addr;
11864 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11868 tmp_tmp = FLD (f_dstsrc);
11869 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
11872 CPU (h_cbit) = opval;
11873 written |= (1 << 1);
11874 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
11877 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
11880 CPU (h_vbit) = opval;
11881 written |= (1 << 7);
11882 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
11885 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
11888 CPU (h_zbit) = opval;
11889 written |= (1 << 9);
11890 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11893 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
11896 CPU (h_nbit) = opval;
11897 written |= (1 << 3);
11898 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11901 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11904 CPU (h_xbit) = opval;
11905 written |= (1 << 8);
11906 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11909 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
11912 SET_H_IBIT (opval);
11913 written |= (1 << 2);
11914 CGEN_TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
11917 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
11920 SET_H_UBIT (opval);
11921 written |= (1 << 6);
11922 CGEN_TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
11925 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
11928 CPU (h_pbit) = opval;
11929 written |= (1 << 4);
11930 CGEN_TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
11935 SET_H_INSN_PREFIXED_P (opval);
11936 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
11938 if (EQSI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
11941 CPU (h_xbit) = opval;
11942 written |= (1 << 8);
11943 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
11948 abuf->written = written;
11953 CASE (sem, INSN_CLEARF) : /* clearf ${list-of-flags} */
11955 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
11956 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11957 #define FLD(f) abuf->fields.sfmt_setf.f
11958 int UNUSED written = 0;
11959 IADDR UNUSED pc = abuf->addr;
11960 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
11964 tmp_tmp = FLD (f_dstsrc);
11965 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 0)), 0)) {
11968 CPU (h_cbit) = opval;
11969 written |= (1 << 1);
11970 CGEN_TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
11973 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 1)), 0)) {
11976 CPU (h_vbit) = opval;
11977 written |= (1 << 7);
11978 CGEN_TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
11981 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 2)), 0)) {
11984 CPU (h_zbit) = opval;
11985 written |= (1 << 9);
11986 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
11989 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 3)), 0)) {
11992 CPU (h_nbit) = opval;
11993 written |= (1 << 3);
11994 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
11997 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 4)), 0)) {
12000 CPU (h_xbit) = opval;
12001 written |= (1 << 8);
12002 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12005 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 5)), 0)) {
12008 SET_H_IBIT (opval);
12009 written |= (1 << 2);
12010 CGEN_TRACE_RESULT (current_cpu, abuf, "ibit", 'x', opval);
12013 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 6)), 0)) {
12016 SET_H_UBIT (opval);
12017 written |= (1 << 6);
12018 CGEN_TRACE_RESULT (current_cpu, abuf, "ubit", 'x', opval);
12021 if (NESI (ANDSI (tmp_tmp, SLLSI (1, 7)), 0)) {
12024 CPU (h_pbit) = opval;
12025 written |= (1 << 4);
12026 CGEN_TRACE_RESULT (current_cpu, abuf, "pbit", 'x', opval);
12032 CPU (h_xbit) = opval;
12033 written |= (1 << 8);
12034 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12038 SET_H_INSN_PREFIXED_P (opval);
12039 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12044 abuf->written = written;
12049 CASE (sem, INSN_BCC_B) : /* b${cc} ${o-pcrel} */
12051 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12052 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12053 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12054 int UNUSED written = 0;
12055 IADDR UNUSED pc = abuf->addr;
12057 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12061 tmp_truthval = ({ SI tmp_tmpcond;
12063 tmp_tmpcond = FLD (f_operand2);
12064 ; if (EQSI (tmp_tmpcond, 0)) {
12065 tmp_condres = NOTBI (CPU (h_cbit));
12067 else if (EQSI (tmp_tmpcond, 1)) {
12068 tmp_condres = CPU (h_cbit);
12070 else if (EQSI (tmp_tmpcond, 2)) {
12071 tmp_condres = NOTBI (CPU (h_zbit));
12073 else if (EQSI (tmp_tmpcond, 3)) {
12074 tmp_condres = CPU (h_zbit);
12076 else if (EQSI (tmp_tmpcond, 4)) {
12077 tmp_condres = NOTBI (CPU (h_vbit));
12079 else if (EQSI (tmp_tmpcond, 5)) {
12080 tmp_condres = CPU (h_vbit);
12082 else if (EQSI (tmp_tmpcond, 6)) {
12083 tmp_condres = NOTBI (CPU (h_nbit));
12085 else if (EQSI (tmp_tmpcond, 7)) {
12086 tmp_condres = CPU (h_nbit);
12088 else if (EQSI (tmp_tmpcond, 8)) {
12089 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12091 else if (EQSI (tmp_tmpcond, 9)) {
12092 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12094 else if (EQSI (tmp_tmpcond, 10)) {
12095 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12097 else if (EQSI (tmp_tmpcond, 11)) {
12098 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12100 else if (EQSI (tmp_tmpcond, 12)) {
12101 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12103 else if (EQSI (tmp_tmpcond, 13)) {
12104 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12106 else if (EQSI (tmp_tmpcond, 14)) {
12109 else if (EQSI (tmp_tmpcond, 15)) {
12110 tmp_condres = CPU (h_pbit);
12113 crisv10f_branch_taken (current_cpu, pc, FLD (i_o_pcrel), tmp_truthval);
12117 CPU (h_xbit) = opval;
12118 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12122 SET_H_INSN_PREFIXED_P (opval);
12123 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12126 if (tmp_truthval) {
12129 USI opval = FLD (i_o_pcrel);
12130 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12131 written |= (1 << 8);
12132 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12138 abuf->written = written;
12139 SEM_BRANCH_FINI (vpc);
12144 CASE (sem, INSN_BA_B) : /* ba ${o-pcrel} */
12146 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12147 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12148 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12149 int UNUSED written = 0;
12150 IADDR UNUSED pc = abuf->addr;
12152 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12158 CPU (h_xbit) = opval;
12159 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12163 SET_H_INSN_PREFIXED_P (opval);
12164 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12169 USI opval = FLD (i_o_pcrel);
12170 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12171 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12176 SEM_BRANCH_FINI (vpc);
12181 CASE (sem, INSN_BCC_W) : /* b${cc} ${o-word-pcrel} */
12183 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12184 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12185 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12186 int UNUSED written = 0;
12187 IADDR UNUSED pc = abuf->addr;
12189 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12193 tmp_truthval = ({ SI tmp_tmpcond;
12195 tmp_tmpcond = FLD (f_operand2);
12196 ; if (EQSI (tmp_tmpcond, 0)) {
12197 tmp_condres = NOTBI (CPU (h_cbit));
12199 else if (EQSI (tmp_tmpcond, 1)) {
12200 tmp_condres = CPU (h_cbit);
12202 else if (EQSI (tmp_tmpcond, 2)) {
12203 tmp_condres = NOTBI (CPU (h_zbit));
12205 else if (EQSI (tmp_tmpcond, 3)) {
12206 tmp_condres = CPU (h_zbit);
12208 else if (EQSI (tmp_tmpcond, 4)) {
12209 tmp_condres = NOTBI (CPU (h_vbit));
12211 else if (EQSI (tmp_tmpcond, 5)) {
12212 tmp_condres = CPU (h_vbit);
12214 else if (EQSI (tmp_tmpcond, 6)) {
12215 tmp_condres = NOTBI (CPU (h_nbit));
12217 else if (EQSI (tmp_tmpcond, 7)) {
12218 tmp_condres = CPU (h_nbit);
12220 else if (EQSI (tmp_tmpcond, 8)) {
12221 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
12223 else if (EQSI (tmp_tmpcond, 9)) {
12224 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
12226 else if (EQSI (tmp_tmpcond, 10)) {
12227 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
12229 else if (EQSI (tmp_tmpcond, 11)) {
12230 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
12232 else if (EQSI (tmp_tmpcond, 12)) {
12233 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
12235 else if (EQSI (tmp_tmpcond, 13)) {
12236 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
12238 else if (EQSI (tmp_tmpcond, 14)) {
12241 else if (EQSI (tmp_tmpcond, 15)) {
12242 tmp_condres = CPU (h_pbit);
12245 crisv10f_branch_taken (current_cpu, pc, FLD (i_o_word_pcrel), tmp_truthval);
12249 CPU (h_xbit) = opval;
12250 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12254 SET_H_INSN_PREFIXED_P (opval);
12255 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12258 if (tmp_truthval) {
12261 USI opval = FLD (i_o_word_pcrel);
12262 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12263 written |= (1 << 8);
12264 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12270 abuf->written = written;
12271 SEM_BRANCH_FINI (vpc);
12276 CASE (sem, INSN_BA_W) : /* ba ${o-word-pcrel} */
12278 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12279 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12280 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12281 int UNUSED written = 0;
12282 IADDR UNUSED pc = abuf->addr;
12284 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12290 CPU (h_xbit) = opval;
12291 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12295 SET_H_INSN_PREFIXED_P (opval);
12296 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12301 USI opval = FLD (i_o_word_pcrel);
12302 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12303 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12308 SEM_BRANCH_FINI (vpc);
12313 CASE (sem, INSN_JUMP_R) : /* jump/jsr/jir ${Rs} */
12315 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12316 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12317 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12318 int UNUSED written = 0;
12319 IADDR UNUSED pc = abuf->addr;
12321 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12325 SI opval = ADDSI (pc, 2);
12326 SET_H_SR (FLD (f_operand2), opval);
12327 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12330 USI opval = GET_H_GR (FLD (f_operand1));
12331 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12332 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12337 CPU (h_xbit) = opval;
12338 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12342 SET_H_INSN_PREFIXED_P (opval);
12343 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12348 SEM_BRANCH_FINI (vpc);
12353 CASE (sem, INSN_JUMP_M) : /* jump/jsr/jir [${Rs}${inc}] */
12355 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12356 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12357 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12358 int UNUSED written = 0;
12359 IADDR UNUSED pc = abuf->addr;
12361 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12365 SI opval = ADDSI (pc, 2);
12366 SET_H_SR (FLD (f_operand2), opval);
12367 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12370 USI opval = ({ SI tmp_addr;
12373 tmp_postinc = FLD (f_memmode);
12374 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12375 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
12376 ; if (NEBI (tmp_postinc, 0)) {
12378 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12379 tmp_addr = ADDSI (tmp_addr, 4);
12382 SI opval = tmp_addr;
12383 SET_H_GR (FLD (f_operand1), opval);
12384 written |= (1 << 7);
12385 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12390 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12391 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12396 CPU (h_xbit) = opval;
12397 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12401 SET_H_INSN_PREFIXED_P (opval);
12402 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12407 abuf->written = written;
12408 SEM_BRANCH_FINI (vpc);
12413 CASE (sem, INSN_JUMP_C) : /* jump/jsr/jir ${const32} */
12415 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12416 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12417 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
12418 int UNUSED written = 0;
12419 IADDR UNUSED pc = abuf->addr;
12421 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
12425 SI opval = ADDSI (pc, 6);
12426 SET_H_SR (FLD (f_operand2), opval);
12427 CGEN_TRACE_RESULT (current_cpu, abuf, "sr", 'x', opval);
12430 USI opval = FLD (f_indir_pc__dword);
12431 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
12432 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12437 CPU (h_xbit) = opval;
12438 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12442 SET_H_INSN_PREFIXED_P (opval);
12443 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12448 SEM_BRANCH_FINI (vpc);
12453 CASE (sem, INSN_BREAK) : /* break $n */
12455 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12456 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12457 #define FLD(f) abuf->fields.sfmt_break.f
12458 int UNUSED written = 0;
12459 IADDR UNUSED pc = abuf->addr;
12461 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12467 CPU (h_xbit) = opval;
12468 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12472 SET_H_INSN_PREFIXED_P (opval);
12473 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12477 USI opval = crisv10f_break_handler (current_cpu, FLD (f_u4), pc);
12478 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
12479 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
12483 SEM_BRANCH_FINI (vpc);
12488 CASE (sem, INSN_BOUND_R_B_R) : /* bound-r.b ${Rs},${Rd} */
12490 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12491 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12492 #define FLD(f) abuf->fields.sfmt_muls_b.f
12493 int UNUSED written = 0;
12494 IADDR UNUSED pc = abuf->addr;
12495 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12501 tmp_tmpops = ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1))));
12502 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12503 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12505 SI opval = tmp_newval;
12506 SET_H_GR (FLD (f_operand2), opval);
12507 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12511 BI opval = LTSI (tmp_newval, 0);
12512 CPU (h_nbit) = opval;
12513 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12516 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12517 CPU (h_zbit) = opval;
12518 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12520 SET_H_CBIT_MOVE (0);
12521 SET_H_VBIT_MOVE (0);
12525 CPU (h_xbit) = opval;
12526 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12530 SET_H_INSN_PREFIXED_P (opval);
12531 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12541 CASE (sem, INSN_BOUND_R_W_R) : /* bound-r.w ${Rs},${Rd} */
12543 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12544 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12545 #define FLD(f) abuf->fields.sfmt_muls_b.f
12546 int UNUSED written = 0;
12547 IADDR UNUSED pc = abuf->addr;
12548 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12554 tmp_tmpops = ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1))));
12555 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12556 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12558 SI opval = tmp_newval;
12559 SET_H_GR (FLD (f_operand2), opval);
12560 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12564 BI opval = LTSI (tmp_newval, 0);
12565 CPU (h_nbit) = opval;
12566 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12569 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12570 CPU (h_zbit) = opval;
12571 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12573 SET_H_CBIT_MOVE (0);
12574 SET_H_VBIT_MOVE (0);
12578 CPU (h_xbit) = opval;
12579 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12583 SET_H_INSN_PREFIXED_P (opval);
12584 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12594 CASE (sem, INSN_BOUND_R_D_R) : /* bound-r.d ${Rs},${Rd} */
12596 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12597 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12598 #define FLD(f) abuf->fields.sfmt_muls_b.f
12599 int UNUSED written = 0;
12600 IADDR UNUSED pc = abuf->addr;
12601 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12607 tmp_tmpops = TRUNCSISI (GET_H_GR (FLD (f_operand1)));
12608 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12609 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12611 SI opval = tmp_newval;
12612 SET_H_GR (FLD (f_operand2), opval);
12613 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12617 BI opval = LTSI (tmp_newval, 0);
12618 CPU (h_nbit) = opval;
12619 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12622 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12623 CPU (h_zbit) = opval;
12624 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12626 SET_H_CBIT_MOVE (0);
12627 SET_H_VBIT_MOVE (0);
12631 CPU (h_xbit) = opval;
12632 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12636 SET_H_INSN_PREFIXED_P (opval);
12637 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12647 CASE (sem, INSN_BOUND_M_B_M) : /* bound-m.b [${Rs}${inc}],${Rd} */
12649 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12650 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12651 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12652 int UNUSED written = 0;
12653 IADDR UNUSED pc = abuf->addr;
12654 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12660 tmp_tmpops = ZEXTQISI (({ SI tmp_addr;
12663 tmp_postinc = FLD (f_memmode);
12664 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12665 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
12666 ; if (NEBI (tmp_postinc, 0)) {
12668 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12669 tmp_addr = ADDSI (tmp_addr, 1);
12672 SI opval = tmp_addr;
12673 SET_H_GR (FLD (f_operand1), opval);
12674 written |= (1 << 9);
12675 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12679 ; tmp_tmp_mem; }));
12680 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12681 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12682 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12684 SI opval = tmp_newval;
12685 SET_H_GR (FLD (f_operand1), opval);
12686 written |= (1 << 9);
12687 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12691 SI opval = tmp_newval;
12692 SET_H_GR (FLD (f_operand2), opval);
12693 written |= (1 << 8);
12694 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12699 BI opval = LTSI (tmp_newval, 0);
12700 CPU (h_nbit) = opval;
12701 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12704 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12705 CPU (h_zbit) = opval;
12706 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12708 SET_H_CBIT_MOVE (0);
12709 SET_H_VBIT_MOVE (0);
12713 CPU (h_xbit) = opval;
12714 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12718 SET_H_INSN_PREFIXED_P (opval);
12719 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12725 abuf->written = written;
12730 CASE (sem, INSN_BOUND_M_W_M) : /* bound-m.w [${Rs}${inc}],${Rd} */
12732 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12733 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12734 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12735 int UNUSED written = 0;
12736 IADDR UNUSED pc = abuf->addr;
12737 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12743 tmp_tmpops = ZEXTHISI (({ SI tmp_addr;
12746 tmp_postinc = FLD (f_memmode);
12747 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12748 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
12749 ; if (NEBI (tmp_postinc, 0)) {
12751 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12752 tmp_addr = ADDSI (tmp_addr, 2);
12755 SI opval = tmp_addr;
12756 SET_H_GR (FLD (f_operand1), opval);
12757 written |= (1 << 9);
12758 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12762 ; tmp_tmp_mem; }));
12763 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12764 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12765 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12767 SI opval = tmp_newval;
12768 SET_H_GR (FLD (f_operand1), opval);
12769 written |= (1 << 9);
12770 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12774 SI opval = tmp_newval;
12775 SET_H_GR (FLD (f_operand2), opval);
12776 written |= (1 << 8);
12777 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12782 BI opval = LTSI (tmp_newval, 0);
12783 CPU (h_nbit) = opval;
12784 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12787 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12788 CPU (h_zbit) = opval;
12789 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12791 SET_H_CBIT_MOVE (0);
12792 SET_H_VBIT_MOVE (0);
12796 CPU (h_xbit) = opval;
12797 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12801 SET_H_INSN_PREFIXED_P (opval);
12802 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12808 abuf->written = written;
12813 CASE (sem, INSN_BOUND_M_D_M) : /* bound-m.d [${Rs}${inc}],${Rd} */
12815 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12816 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12817 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12818 int UNUSED written = 0;
12819 IADDR UNUSED pc = abuf->addr;
12820 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
12826 tmp_tmpops = ({ SI tmp_addr;
12829 tmp_postinc = FLD (f_memmode);
12830 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
12831 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
12832 ; if (NEBI (tmp_postinc, 0)) {
12834 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12835 tmp_addr = ADDSI (tmp_addr, 4);
12838 SI opval = tmp_addr;
12839 SET_H_GR (FLD (f_operand1), opval);
12840 written |= (1 << 9);
12841 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12846 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12847 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12848 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode)))) {
12850 SI opval = tmp_newval;
12851 SET_H_GR (FLD (f_operand1), opval);
12852 written |= (1 << 9);
12853 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12857 SI opval = tmp_newval;
12858 SET_H_GR (FLD (f_operand2), opval);
12859 written |= (1 << 8);
12860 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12865 BI opval = LTSI (tmp_newval, 0);
12866 CPU (h_nbit) = opval;
12867 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12870 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12871 CPU (h_zbit) = opval;
12872 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12874 SET_H_CBIT_MOVE (0);
12875 SET_H_VBIT_MOVE (0);
12879 CPU (h_xbit) = opval;
12880 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12884 SET_H_INSN_PREFIXED_P (opval);
12885 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12891 abuf->written = written;
12896 CASE (sem, INSN_BOUND_CB) : /* bound.b [PC+],${Rd} */
12898 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12899 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12900 #define FLD(f) abuf->fields.sfmt_bound_cb.f
12901 int UNUSED written = 0;
12902 IADDR UNUSED pc = abuf->addr;
12903 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12909 tmp_tmpops = ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte)));
12910 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12911 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12913 SI opval = tmp_newval;
12914 SET_H_GR (FLD (f_operand2), opval);
12915 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12919 BI opval = LTSI (tmp_newval, 0);
12920 CPU (h_nbit) = opval;
12921 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12924 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12925 CPU (h_zbit) = opval;
12926 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12928 SET_H_CBIT_MOVE (0);
12929 SET_H_VBIT_MOVE (0);
12933 CPU (h_xbit) = opval;
12934 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12938 SET_H_INSN_PREFIXED_P (opval);
12939 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
12949 CASE (sem, INSN_BOUND_CW) : /* bound.w [PC+],${Rd} */
12951 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
12952 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12953 #define FLD(f) abuf->fields.sfmt_bound_cw.f
12954 int UNUSED written = 0;
12955 IADDR UNUSED pc = abuf->addr;
12956 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12962 tmp_tmpops = ZEXTSISI (FLD (f_indir_pc__word));
12963 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
12964 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
12966 SI opval = tmp_newval;
12967 SET_H_GR (FLD (f_operand2), opval);
12968 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
12972 BI opval = LTSI (tmp_newval, 0);
12973 CPU (h_nbit) = opval;
12974 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
12977 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
12978 CPU (h_zbit) = opval;
12979 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
12981 SET_H_CBIT_MOVE (0);
12982 SET_H_VBIT_MOVE (0);
12986 CPU (h_xbit) = opval;
12987 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
12991 SET_H_INSN_PREFIXED_P (opval);
12992 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13002 CASE (sem, INSN_BOUND_CD) : /* bound.d [PC+],${Rd} */
13004 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13005 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13006 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13007 int UNUSED written = 0;
13008 IADDR UNUSED pc = abuf->addr;
13009 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13015 tmp_tmpops = FLD (f_indir_pc__dword);
13016 tmp_tmpopd = GET_H_GR (FLD (f_operand2));
13017 tmp_newval = ((LTUSI (tmp_tmpops, tmp_tmpopd)) ? (tmp_tmpops) : (tmp_tmpopd));
13019 SI opval = tmp_newval;
13020 SET_H_GR (FLD (f_operand2), opval);
13021 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13025 BI opval = LTSI (tmp_newval, 0);
13026 CPU (h_nbit) = opval;
13027 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13030 BI opval = ANDIF (EQSI (tmp_newval, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13031 CPU (h_zbit) = opval;
13032 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13034 SET_H_CBIT_MOVE (0);
13035 SET_H_VBIT_MOVE (0);
13039 CPU (h_xbit) = opval;
13040 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13044 SET_H_INSN_PREFIXED_P (opval);
13045 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13055 CASE (sem, INSN_SCC) : /* s${cc} ${Rd-sfield} */
13057 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13058 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13059 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13060 int UNUSED written = 0;
13061 IADDR UNUSED pc = abuf->addr;
13062 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13066 tmp_truthval = ({ SI tmp_tmpcond;
13068 tmp_tmpcond = FLD (f_operand2);
13069 ; if (EQSI (tmp_tmpcond, 0)) {
13070 tmp_condres = NOTBI (CPU (h_cbit));
13072 else if (EQSI (tmp_tmpcond, 1)) {
13073 tmp_condres = CPU (h_cbit);
13075 else if (EQSI (tmp_tmpcond, 2)) {
13076 tmp_condres = NOTBI (CPU (h_zbit));
13078 else if (EQSI (tmp_tmpcond, 3)) {
13079 tmp_condres = CPU (h_zbit);
13081 else if (EQSI (tmp_tmpcond, 4)) {
13082 tmp_condres = NOTBI (CPU (h_vbit));
13084 else if (EQSI (tmp_tmpcond, 5)) {
13085 tmp_condres = CPU (h_vbit);
13087 else if (EQSI (tmp_tmpcond, 6)) {
13088 tmp_condres = NOTBI (CPU (h_nbit));
13090 else if (EQSI (tmp_tmpcond, 7)) {
13091 tmp_condres = CPU (h_nbit);
13093 else if (EQSI (tmp_tmpcond, 8)) {
13094 tmp_condres = ORBI (CPU (h_cbit), CPU (h_zbit));
13096 else if (EQSI (tmp_tmpcond, 9)) {
13097 tmp_condres = NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)));
13099 else if (EQSI (tmp_tmpcond, 10)) {
13100 tmp_condres = NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)));
13102 else if (EQSI (tmp_tmpcond, 11)) {
13103 tmp_condres = XORBI (CPU (h_vbit), CPU (h_nbit));
13105 else if (EQSI (tmp_tmpcond, 12)) {
13106 tmp_condres = NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)));
13108 else if (EQSI (tmp_tmpcond, 13)) {
13109 tmp_condres = ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit));
13111 else if (EQSI (tmp_tmpcond, 14)) {
13114 else if (EQSI (tmp_tmpcond, 15)) {
13115 tmp_condres = CPU (h_pbit);
13119 SI opval = ZEXTBISI (tmp_truthval);
13120 SET_H_GR (FLD (f_operand1), opval);
13121 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13126 CPU (h_xbit) = opval;
13127 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13131 SET_H_INSN_PREFIXED_P (opval);
13132 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13141 CASE (sem, INSN_LZ) : /* lz ${Rs},${Rd} */
13143 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13144 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13145 #define FLD(f) abuf->fields.sfmt_muls_b.f
13146 int UNUSED written = 0;
13147 IADDR UNUSED pc = abuf->addr;
13148 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13153 tmp_tmp = GET_H_GR (FLD (f_operand1));
13156 if (GESI (tmp_tmp, 0)) {
13158 tmp_tmp = SLLSI (tmp_tmp, 1);
13159 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13162 if (GESI (tmp_tmp, 0)) {
13164 tmp_tmp = SLLSI (tmp_tmp, 1);
13165 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13168 if (GESI (tmp_tmp, 0)) {
13170 tmp_tmp = SLLSI (tmp_tmp, 1);
13171 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13174 if (GESI (tmp_tmp, 0)) {
13176 tmp_tmp = SLLSI (tmp_tmp, 1);
13177 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13180 if (GESI (tmp_tmp, 0)) {
13182 tmp_tmp = SLLSI (tmp_tmp, 1);
13183 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13186 if (GESI (tmp_tmp, 0)) {
13188 tmp_tmp = SLLSI (tmp_tmp, 1);
13189 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13192 if (GESI (tmp_tmp, 0)) {
13194 tmp_tmp = SLLSI (tmp_tmp, 1);
13195 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13198 if (GESI (tmp_tmp, 0)) {
13200 tmp_tmp = SLLSI (tmp_tmp, 1);
13201 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13204 if (GESI (tmp_tmp, 0)) {
13206 tmp_tmp = SLLSI (tmp_tmp, 1);
13207 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13210 if (GESI (tmp_tmp, 0)) {
13212 tmp_tmp = SLLSI (tmp_tmp, 1);
13213 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13216 if (GESI (tmp_tmp, 0)) {
13218 tmp_tmp = SLLSI (tmp_tmp, 1);
13219 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13222 if (GESI (tmp_tmp, 0)) {
13224 tmp_tmp = SLLSI (tmp_tmp, 1);
13225 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13228 if (GESI (tmp_tmp, 0)) {
13230 tmp_tmp = SLLSI (tmp_tmp, 1);
13231 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13234 if (GESI (tmp_tmp, 0)) {
13236 tmp_tmp = SLLSI (tmp_tmp, 1);
13237 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13240 if (GESI (tmp_tmp, 0)) {
13242 tmp_tmp = SLLSI (tmp_tmp, 1);
13243 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13246 if (GESI (tmp_tmp, 0)) {
13248 tmp_tmp = SLLSI (tmp_tmp, 1);
13249 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13252 if (GESI (tmp_tmp, 0)) {
13254 tmp_tmp = SLLSI (tmp_tmp, 1);
13255 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13258 if (GESI (tmp_tmp, 0)) {
13260 tmp_tmp = SLLSI (tmp_tmp, 1);
13261 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13264 if (GESI (tmp_tmp, 0)) {
13266 tmp_tmp = SLLSI (tmp_tmp, 1);
13267 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13270 if (GESI (tmp_tmp, 0)) {
13272 tmp_tmp = SLLSI (tmp_tmp, 1);
13273 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13276 if (GESI (tmp_tmp, 0)) {
13278 tmp_tmp = SLLSI (tmp_tmp, 1);
13279 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13282 if (GESI (tmp_tmp, 0)) {
13284 tmp_tmp = SLLSI (tmp_tmp, 1);
13285 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13288 if (GESI (tmp_tmp, 0)) {
13290 tmp_tmp = SLLSI (tmp_tmp, 1);
13291 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13294 if (GESI (tmp_tmp, 0)) {
13296 tmp_tmp = SLLSI (tmp_tmp, 1);
13297 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13300 if (GESI (tmp_tmp, 0)) {
13302 tmp_tmp = SLLSI (tmp_tmp, 1);
13303 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13306 if (GESI (tmp_tmp, 0)) {
13308 tmp_tmp = SLLSI (tmp_tmp, 1);
13309 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13312 if (GESI (tmp_tmp, 0)) {
13314 tmp_tmp = SLLSI (tmp_tmp, 1);
13315 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13318 if (GESI (tmp_tmp, 0)) {
13320 tmp_tmp = SLLSI (tmp_tmp, 1);
13321 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13324 if (GESI (tmp_tmp, 0)) {
13326 tmp_tmp = SLLSI (tmp_tmp, 1);
13327 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13330 if (GESI (tmp_tmp, 0)) {
13332 tmp_tmp = SLLSI (tmp_tmp, 1);
13333 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13336 if (GESI (tmp_tmp, 0)) {
13338 tmp_tmp = SLLSI (tmp_tmp, 1);
13339 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13342 if (GESI (tmp_tmp, 0)) {
13344 tmp_tmp = SLLSI (tmp_tmp, 1);
13345 tmp_tmpd = ADDSI (tmp_tmpd, 1);
13350 SI opval = tmp_tmpd;
13351 SET_H_GR (FLD (f_operand2), opval);
13352 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13356 BI opval = LTSI (tmp_tmpd, 0);
13357 CPU (h_nbit) = opval;
13358 CGEN_TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
13361 BI opval = ANDIF (EQSI (tmp_tmpd, 0), ((CPU (h_xbit)) ? (CPU (h_zbit)) : (1)));
13362 CPU (h_zbit) = opval;
13363 CGEN_TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
13365 SET_H_CBIT_MOVE (0);
13366 SET_H_VBIT_MOVE (0);
13370 CPU (h_xbit) = opval;
13371 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13375 SET_H_INSN_PREFIXED_P (opval);
13376 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13386 CASE (sem, INSN_ADDOQ) : /* addoq $o,$Rs,ACR */
13388 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13389 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13390 #define FLD(f) abuf->fields.sfmt_addoq.f
13391 int UNUSED written = 0;
13392 IADDR UNUSED pc = abuf->addr;
13393 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13397 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_s8));
13398 CPU (h_prefixreg_pre_v32) = opval;
13399 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13403 SET_H_INSN_PREFIXED_P (opval);
13404 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13412 CASE (sem, INSN_BDAPQPC) : /* bdapq $o,PC */
13414 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13415 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13416 #define FLD(f) abuf->fields.sfmt_addoq.f
13417 int UNUSED written = 0;
13418 IADDR UNUSED pc = abuf->addr;
13420 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13424 SI opval = ADDSI (ADDSI (pc, 2), FLD (f_s8));
13425 CPU (h_prefixreg_pre_v32) = opval;
13426 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13430 SET_H_INSN_PREFIXED_P (opval);
13431 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13433 cris_flush_simulator_decode_cache (current_cpu, pc);
13436 SEM_BRANCH_FINI (vpc);
13441 CASE (sem, INSN_BDAP_32_PC) : /* bdap ${sconst32},PC */
13443 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13444 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13445 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13446 int UNUSED written = 0;
13447 IADDR UNUSED pc = abuf->addr;
13448 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13454 tmp_offs = FLD (f_indir_pc__dword);
13455 tmp_oldpc = ADDSI (pc, 6);
13456 tmp_newpc = ADDSI (tmp_oldpc, tmp_offs);
13458 SI opval = tmp_newpc;
13459 CPU (h_prefixreg_pre_v32) = opval;
13460 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13464 SET_H_INSN_PREFIXED_P (opval);
13465 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13473 CASE (sem, INSN_MOVE_M_PCPLUS_P0) : /* move [PC+],P0 */
13475 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13476 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13477 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13478 int UNUSED written = 0;
13479 IADDR UNUSED pc = abuf->addr;
13481 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13483 if (GET_H_INSN_PREFIXED_P ()) {
13486 tmp_dummy = ({ SI tmp_addr;
13489 tmp_postinc = FLD (f_memmode);
13490 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (pc) : (CPU (h_prefixreg_pre_v32)));
13491 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13492 ; if (NEBI (tmp_postinc, 0)) {
13494 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13495 tmp_addr = ADDSI (tmp_addr, 1);
13498 USI opval = tmp_addr;
13499 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
13500 written |= (1 << 5);
13501 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
13509 CPU (h_xbit) = opval;
13510 written |= (1 << 7);
13511 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13515 SET_H_INSN_PREFIXED_P (opval);
13516 written |= (1 << 6);
13517 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13522 cgen_rtx_error (current_cpu, "move [PC+],P0 without prefix is not implemented");
13525 abuf->written = written;
13526 SEM_BRANCH_FINI (vpc);
13531 CASE (sem, INSN_MOVE_M_SPPLUS_P8) : /* move [SP+],P8 */
13533 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13534 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13535 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13536 int UNUSED written = 0;
13537 IADDR UNUSED pc = abuf->addr;
13538 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13540 if (GET_H_INSN_PREFIXED_P ()) {
13543 tmp_dummy = ({ SI tmp_addr;
13546 tmp_postinc = FLD (f_memmode);
13547 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (((UINT) 14))) : (CPU (h_prefixreg_pre_v32)));
13548 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13549 ; if (NEBI (tmp_postinc, 0)) {
13551 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13552 tmp_addr = ADDSI (tmp_addr, 4);
13555 SI opval = tmp_addr;
13556 SET_H_GR (((UINT) 14), opval);
13557 written |= (1 << 5);
13558 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13566 CPU (h_xbit) = opval;
13567 written |= (1 << 7);
13568 CGEN_TRACE_RESULT (current_cpu, abuf, "xbit", 'x', opval);
13572 SET_H_INSN_PREFIXED_P (opval);
13573 written |= (1 << 6);
13574 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13579 cgen_rtx_error (current_cpu, "move [SP+],P8 without prefix is not implemented");
13582 abuf->written = written;
13587 CASE (sem, INSN_ADDO_M_B_M) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13589 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13590 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13591 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13592 int UNUSED written = 0;
13593 IADDR UNUSED pc = abuf->addr;
13594 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13598 tmp_tmps = ({ SI tmp_addr;
13601 tmp_postinc = FLD (f_memmode);
13602 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13603 ; tmp_tmp_mem = GETMEMQI (current_cpu, pc, tmp_addr);
13604 ; if (NEBI (tmp_postinc, 0)) {
13606 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13607 tmp_addr = ADDSI (tmp_addr, 1);
13610 SI opval = tmp_addr;
13611 SET_H_GR (FLD (f_operand1), opval);
13612 written |= (1 << 6);
13613 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13619 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (tmp_tmps));
13620 CPU (h_prefixreg_pre_v32) = opval;
13621 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13625 SET_H_INSN_PREFIXED_P (opval);
13626 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13630 abuf->written = written;
13635 CASE (sem, INSN_ADDO_M_W_M) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13637 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13638 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13639 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13640 int UNUSED written = 0;
13641 IADDR UNUSED pc = abuf->addr;
13642 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13646 tmp_tmps = ({ SI tmp_addr;
13649 tmp_postinc = FLD (f_memmode);
13650 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13651 ; tmp_tmp_mem = GETMEMHI (current_cpu, pc, tmp_addr);
13652 ; if (NEBI (tmp_postinc, 0)) {
13654 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13655 tmp_addr = ADDSI (tmp_addr, 2);
13658 SI opval = tmp_addr;
13659 SET_H_GR (FLD (f_operand1), opval);
13660 written |= (1 << 6);
13661 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13667 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (tmp_tmps));
13668 CPU (h_prefixreg_pre_v32) = opval;
13669 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13673 SET_H_INSN_PREFIXED_P (opval);
13674 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13678 abuf->written = written;
13683 CASE (sem, INSN_ADDO_M_D_M) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13685 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13686 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13687 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13688 int UNUSED written = 0;
13689 IADDR UNUSED pc = abuf->addr;
13690 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13694 tmp_tmps = ({ SI tmp_addr;
13697 tmp_postinc = FLD (f_memmode);
13698 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13699 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13700 ; if (NEBI (tmp_postinc, 0)) {
13702 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13703 tmp_addr = ADDSI (tmp_addr, 4);
13706 SI opval = tmp_addr;
13707 SET_H_GR (FLD (f_operand1), opval);
13708 written |= (1 << 6);
13709 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13715 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), tmp_tmps);
13716 CPU (h_prefixreg_pre_v32) = opval;
13717 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13721 SET_H_INSN_PREFIXED_P (opval);
13722 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13726 abuf->written = written;
13731 CASE (sem, INSN_ADDO_CB) : /* addo.b [PC+],$Rd,ACR */
13733 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13734 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13735 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13736 int UNUSED written = 0;
13737 IADDR UNUSED pc = abuf->addr;
13738 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13742 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte))));
13743 CPU (h_prefixreg_pre_v32) = opval;
13744 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13748 SET_H_INSN_PREFIXED_P (opval);
13749 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13757 CASE (sem, INSN_ADDO_CW) : /* addo.w [PC+],$Rd,ACR */
13759 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13760 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13761 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13762 int UNUSED written = 0;
13763 IADDR UNUSED pc = abuf->addr;
13764 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13768 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word))));
13769 CPU (h_prefixreg_pre_v32) = opval;
13770 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13774 SET_H_INSN_PREFIXED_P (opval);
13775 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13783 CASE (sem, INSN_ADDO_CD) : /* addo.d [PC+],$Rd,ACR */
13785 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13786 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13787 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13788 int UNUSED written = 0;
13789 IADDR UNUSED pc = abuf->addr;
13790 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13794 SI opval = ADDSI (GET_H_GR (FLD (f_operand2)), FLD (f_indir_pc__dword));
13795 CPU (h_prefixreg_pre_v32) = opval;
13796 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13800 SET_H_INSN_PREFIXED_P (opval);
13801 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13809 CASE (sem, INSN_DIP_M) : /* dip [${Rs}${inc}] */
13811 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13812 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13813 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13814 int UNUSED written = 0;
13815 IADDR UNUSED pc = abuf->addr;
13816 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13820 tmp_tmps = ({ SI tmp_addr;
13823 tmp_postinc = FLD (f_memmode);
13824 ; tmp_addr = ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1))) : (CPU (h_prefixreg_pre_v32)));
13825 ; tmp_tmp_mem = GETMEMSI (current_cpu, pc, tmp_addr);
13826 ; if (NEBI (tmp_postinc, 0)) {
13828 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13829 tmp_addr = ADDSI (tmp_addr, 4);
13832 SI opval = tmp_addr;
13833 SET_H_GR (FLD (f_operand1), opval);
13834 written |= (1 << 5);
13835 CGEN_TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
13841 SI opval = tmp_tmps;
13842 CPU (h_prefixreg_pre_v32) = opval;
13843 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13847 SET_H_INSN_PREFIXED_P (opval);
13848 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13852 abuf->written = written;
13857 CASE (sem, INSN_DIP_C) : /* dip [PC+] */
13859 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13860 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13861 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13862 int UNUSED written = 0;
13863 IADDR UNUSED pc = abuf->addr;
13864 vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
13868 SI opval = FLD (f_indir_pc__dword);
13869 CPU (h_prefixreg_pre_v32) = opval;
13870 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13874 SET_H_INSN_PREFIXED_P (opval);
13875 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13883 CASE (sem, INSN_ADDI_ACR_B_R) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13885 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13886 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13887 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13888 int UNUSED written = 0;
13889 IADDR UNUSED pc = abuf->addr;
13890 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13894 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13895 CPU (h_prefixreg_pre_v32) = opval;
13896 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13900 SET_H_INSN_PREFIXED_P (opval);
13901 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13909 CASE (sem, INSN_ADDI_ACR_W_R) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13911 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13912 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13913 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13914 int UNUSED written = 0;
13915 IADDR UNUSED pc = abuf->addr;
13916 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13920 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13921 CPU (h_prefixreg_pre_v32) = opval;
13922 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13926 SET_H_INSN_PREFIXED_P (opval);
13927 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13935 CASE (sem, INSN_ADDI_ACR_D_R) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
13937 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13938 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13939 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13940 int UNUSED written = 0;
13941 IADDR UNUSED pc = abuf->addr;
13942 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13946 SI opval = ADDSI (GET_H_GR (FLD (f_operand1)), MULSI (GET_H_GR (FLD (f_operand2)), 4));
13947 CPU (h_prefixreg_pre_v32) = opval;
13948 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13952 SET_H_INSN_PREFIXED_P (opval);
13953 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13961 CASE (sem, INSN_BIAP_PC_B_R) : /* biap-pc.b ${Rs-dfield}.m,PC */
13963 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13964 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13965 #define FLD(f) abuf->fields.sfmt_addoq.f
13966 int UNUSED written = 0;
13967 IADDR UNUSED pc = abuf->addr;
13968 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13972 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 1));
13973 CPU (h_prefixreg_pre_v32) = opval;
13974 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
13978 SET_H_INSN_PREFIXED_P (opval);
13979 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
13987 CASE (sem, INSN_BIAP_PC_W_R) : /* biap-pc.w ${Rs-dfield}.m,PC */
13989 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
13990 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13991 #define FLD(f) abuf->fields.sfmt_addoq.f
13992 int UNUSED written = 0;
13993 IADDR UNUSED pc = abuf->addr;
13994 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
13998 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 2));
13999 CPU (h_prefixreg_pre_v32) = opval;
14000 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14004 SET_H_INSN_PREFIXED_P (opval);
14005 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14013 CASE (sem, INSN_BIAP_PC_D_R) : /* biap-pc.d ${Rs-dfield}.m,PC */
14015 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
14016 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14017 #define FLD(f) abuf->fields.sfmt_addoq.f
14018 int UNUSED written = 0;
14019 IADDR UNUSED pc = abuf->addr;
14020 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
14024 SI opval = ADDSI (ADDSI (pc, 4), MULSI (GET_H_GR (FLD (f_operand2)), 4));
14025 CPU (h_prefixreg_pre_v32) = opval;
14026 CGEN_TRACE_RESULT (current_cpu, abuf, "prefixreg", 'x', opval);
14030 SET_H_INSN_PREFIXED_P (opval);
14031 CGEN_TRACE_RESULT (current_cpu, abuf, "insn-prefixed-p", 'x', opval);
14041 ENDSWITCH (sem) /* End of semantic switch. */
14043 /* At this point `vpc' contains the next insn to execute. */
14046 #undef DEFINE_SWITCH
14047 #endif /* DEFINE_SWITCH */