1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2007 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { CRISV32F_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
36 { CRISV32F_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
37 { CRISV32F_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
38 { CRISV32F_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
39 { CRISV32F_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
40 { CRISV32F_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
41 { CRISV32F_INSN_MOVE_B_R
, && case_sem_INSN_MOVE_B_R
},
42 { CRISV32F_INSN_MOVE_W_R
, && case_sem_INSN_MOVE_W_R
},
43 { CRISV32F_INSN_MOVE_D_R
, && case_sem_INSN_MOVE_D_R
},
44 { CRISV32F_INSN_MOVEQ
, && case_sem_INSN_MOVEQ
},
45 { CRISV32F_INSN_MOVS_B_R
, && case_sem_INSN_MOVS_B_R
},
46 { CRISV32F_INSN_MOVS_W_R
, && case_sem_INSN_MOVS_W_R
},
47 { CRISV32F_INSN_MOVU_B_R
, && case_sem_INSN_MOVU_B_R
},
48 { CRISV32F_INSN_MOVU_W_R
, && case_sem_INSN_MOVU_W_R
},
49 { CRISV32F_INSN_MOVECBR
, && case_sem_INSN_MOVECBR
},
50 { CRISV32F_INSN_MOVECWR
, && case_sem_INSN_MOVECWR
},
51 { CRISV32F_INSN_MOVECDR
, && case_sem_INSN_MOVECDR
},
52 { CRISV32F_INSN_MOVSCBR
, && case_sem_INSN_MOVSCBR
},
53 { CRISV32F_INSN_MOVSCWR
, && case_sem_INSN_MOVSCWR
},
54 { CRISV32F_INSN_MOVUCBR
, && case_sem_INSN_MOVUCBR
},
55 { CRISV32F_INSN_MOVUCWR
, && case_sem_INSN_MOVUCWR
},
56 { CRISV32F_INSN_ADDQ
, && case_sem_INSN_ADDQ
},
57 { CRISV32F_INSN_SUBQ
, && case_sem_INSN_SUBQ
},
58 { CRISV32F_INSN_CMP_R_B_R
, && case_sem_INSN_CMP_R_B_R
},
59 { CRISV32F_INSN_CMP_R_W_R
, && case_sem_INSN_CMP_R_W_R
},
60 { CRISV32F_INSN_CMP_R_D_R
, && case_sem_INSN_CMP_R_D_R
},
61 { CRISV32F_INSN_CMP_M_B_M
, && case_sem_INSN_CMP_M_B_M
},
62 { CRISV32F_INSN_CMP_M_W_M
, && case_sem_INSN_CMP_M_W_M
},
63 { CRISV32F_INSN_CMP_M_D_M
, && case_sem_INSN_CMP_M_D_M
},
64 { CRISV32F_INSN_CMPCBR
, && case_sem_INSN_CMPCBR
},
65 { CRISV32F_INSN_CMPCWR
, && case_sem_INSN_CMPCWR
},
66 { CRISV32F_INSN_CMPCDR
, && case_sem_INSN_CMPCDR
},
67 { CRISV32F_INSN_CMPQ
, && case_sem_INSN_CMPQ
},
68 { CRISV32F_INSN_CMPS_M_B_M
, && case_sem_INSN_CMPS_M_B_M
},
69 { CRISV32F_INSN_CMPS_M_W_M
, && case_sem_INSN_CMPS_M_W_M
},
70 { CRISV32F_INSN_CMPSCBR
, && case_sem_INSN_CMPSCBR
},
71 { CRISV32F_INSN_CMPSCWR
, && case_sem_INSN_CMPSCWR
},
72 { CRISV32F_INSN_CMPU_M_B_M
, && case_sem_INSN_CMPU_M_B_M
},
73 { CRISV32F_INSN_CMPU_M_W_M
, && case_sem_INSN_CMPU_M_W_M
},
74 { CRISV32F_INSN_CMPUCBR
, && case_sem_INSN_CMPUCBR
},
75 { CRISV32F_INSN_CMPUCWR
, && case_sem_INSN_CMPUCWR
},
76 { CRISV32F_INSN_MOVE_M_B_M
, && case_sem_INSN_MOVE_M_B_M
},
77 { CRISV32F_INSN_MOVE_M_W_M
, && case_sem_INSN_MOVE_M_W_M
},
78 { CRISV32F_INSN_MOVE_M_D_M
, && case_sem_INSN_MOVE_M_D_M
},
79 { CRISV32F_INSN_MOVS_M_B_M
, && case_sem_INSN_MOVS_M_B_M
},
80 { CRISV32F_INSN_MOVS_M_W_M
, && case_sem_INSN_MOVS_M_W_M
},
81 { CRISV32F_INSN_MOVU_M_B_M
, && case_sem_INSN_MOVU_M_B_M
},
82 { CRISV32F_INSN_MOVU_M_W_M
, && case_sem_INSN_MOVU_M_W_M
},
83 { CRISV32F_INSN_MOVE_R_SPRV32
, && case_sem_INSN_MOVE_R_SPRV32
},
84 { CRISV32F_INSN_MOVE_SPR_RV32
, && case_sem_INSN_MOVE_SPR_RV32
},
85 { CRISV32F_INSN_MOVE_M_SPRV32
, && case_sem_INSN_MOVE_M_SPRV32
},
86 { CRISV32F_INSN_MOVE_C_SPRV32_P2
, && case_sem_INSN_MOVE_C_SPRV32_P2
},
87 { CRISV32F_INSN_MOVE_C_SPRV32_P3
, && case_sem_INSN_MOVE_C_SPRV32_P3
},
88 { CRISV32F_INSN_MOVE_C_SPRV32_P5
, && case_sem_INSN_MOVE_C_SPRV32_P5
},
89 { CRISV32F_INSN_MOVE_C_SPRV32_P6
, && case_sem_INSN_MOVE_C_SPRV32_P6
},
90 { CRISV32F_INSN_MOVE_C_SPRV32_P7
, && case_sem_INSN_MOVE_C_SPRV32_P7
},
91 { CRISV32F_INSN_MOVE_C_SPRV32_P9
, && case_sem_INSN_MOVE_C_SPRV32_P9
},
92 { CRISV32F_INSN_MOVE_C_SPRV32_P10
, && case_sem_INSN_MOVE_C_SPRV32_P10
},
93 { CRISV32F_INSN_MOVE_C_SPRV32_P11
, && case_sem_INSN_MOVE_C_SPRV32_P11
},
94 { CRISV32F_INSN_MOVE_C_SPRV32_P12
, && case_sem_INSN_MOVE_C_SPRV32_P12
},
95 { CRISV32F_INSN_MOVE_C_SPRV32_P13
, && case_sem_INSN_MOVE_C_SPRV32_P13
},
96 { CRISV32F_INSN_MOVE_C_SPRV32_P14
, && case_sem_INSN_MOVE_C_SPRV32_P14
},
97 { CRISV32F_INSN_MOVE_C_SPRV32_P15
, && case_sem_INSN_MOVE_C_SPRV32_P15
},
98 { CRISV32F_INSN_MOVE_SPR_MV32
, && case_sem_INSN_MOVE_SPR_MV32
},
99 { CRISV32F_INSN_MOVE_SS_R
, && case_sem_INSN_MOVE_SS_R
},
100 { CRISV32F_INSN_MOVE_R_SS
, && case_sem_INSN_MOVE_R_SS
},
101 { CRISV32F_INSN_MOVEM_R_M_V32
, && case_sem_INSN_MOVEM_R_M_V32
},
102 { CRISV32F_INSN_MOVEM_M_R_V32
, && case_sem_INSN_MOVEM_M_R_V32
},
103 { CRISV32F_INSN_ADD_B_R
, && case_sem_INSN_ADD_B_R
},
104 { CRISV32F_INSN_ADD_W_R
, && case_sem_INSN_ADD_W_R
},
105 { CRISV32F_INSN_ADD_D_R
, && case_sem_INSN_ADD_D_R
},
106 { CRISV32F_INSN_ADD_M_B_M
, && case_sem_INSN_ADD_M_B_M
},
107 { CRISV32F_INSN_ADD_M_W_M
, && case_sem_INSN_ADD_M_W_M
},
108 { CRISV32F_INSN_ADD_M_D_M
, && case_sem_INSN_ADD_M_D_M
},
109 { CRISV32F_INSN_ADDCBR
, && case_sem_INSN_ADDCBR
},
110 { CRISV32F_INSN_ADDCWR
, && case_sem_INSN_ADDCWR
},
111 { CRISV32F_INSN_ADDCDR
, && case_sem_INSN_ADDCDR
},
112 { CRISV32F_INSN_ADDS_B_R
, && case_sem_INSN_ADDS_B_R
},
113 { CRISV32F_INSN_ADDS_W_R
, && case_sem_INSN_ADDS_W_R
},
114 { CRISV32F_INSN_ADDS_M_B_M
, && case_sem_INSN_ADDS_M_B_M
},
115 { CRISV32F_INSN_ADDS_M_W_M
, && case_sem_INSN_ADDS_M_W_M
},
116 { CRISV32F_INSN_ADDSCBR
, && case_sem_INSN_ADDSCBR
},
117 { CRISV32F_INSN_ADDSCWR
, && case_sem_INSN_ADDSCWR
},
118 { CRISV32F_INSN_ADDU_B_R
, && case_sem_INSN_ADDU_B_R
},
119 { CRISV32F_INSN_ADDU_W_R
, && case_sem_INSN_ADDU_W_R
},
120 { CRISV32F_INSN_ADDU_M_B_M
, && case_sem_INSN_ADDU_M_B_M
},
121 { CRISV32F_INSN_ADDU_M_W_M
, && case_sem_INSN_ADDU_M_W_M
},
122 { CRISV32F_INSN_ADDUCBR
, && case_sem_INSN_ADDUCBR
},
123 { CRISV32F_INSN_ADDUCWR
, && case_sem_INSN_ADDUCWR
},
124 { CRISV32F_INSN_SUB_B_R
, && case_sem_INSN_SUB_B_R
},
125 { CRISV32F_INSN_SUB_W_R
, && case_sem_INSN_SUB_W_R
},
126 { CRISV32F_INSN_SUB_D_R
, && case_sem_INSN_SUB_D_R
},
127 { CRISV32F_INSN_SUB_M_B_M
, && case_sem_INSN_SUB_M_B_M
},
128 { CRISV32F_INSN_SUB_M_W_M
, && case_sem_INSN_SUB_M_W_M
},
129 { CRISV32F_INSN_SUB_M_D_M
, && case_sem_INSN_SUB_M_D_M
},
130 { CRISV32F_INSN_SUBCBR
, && case_sem_INSN_SUBCBR
},
131 { CRISV32F_INSN_SUBCWR
, && case_sem_INSN_SUBCWR
},
132 { CRISV32F_INSN_SUBCDR
, && case_sem_INSN_SUBCDR
},
133 { CRISV32F_INSN_SUBS_B_R
, && case_sem_INSN_SUBS_B_R
},
134 { CRISV32F_INSN_SUBS_W_R
, && case_sem_INSN_SUBS_W_R
},
135 { CRISV32F_INSN_SUBS_M_B_M
, && case_sem_INSN_SUBS_M_B_M
},
136 { CRISV32F_INSN_SUBS_M_W_M
, && case_sem_INSN_SUBS_M_W_M
},
137 { CRISV32F_INSN_SUBSCBR
, && case_sem_INSN_SUBSCBR
},
138 { CRISV32F_INSN_SUBSCWR
, && case_sem_INSN_SUBSCWR
},
139 { CRISV32F_INSN_SUBU_B_R
, && case_sem_INSN_SUBU_B_R
},
140 { CRISV32F_INSN_SUBU_W_R
, && case_sem_INSN_SUBU_W_R
},
141 { CRISV32F_INSN_SUBU_M_B_M
, && case_sem_INSN_SUBU_M_B_M
},
142 { CRISV32F_INSN_SUBU_M_W_M
, && case_sem_INSN_SUBU_M_W_M
},
143 { CRISV32F_INSN_SUBUCBR
, && case_sem_INSN_SUBUCBR
},
144 { CRISV32F_INSN_SUBUCWR
, && case_sem_INSN_SUBUCWR
},
145 { CRISV32F_INSN_ADDC_R
, && case_sem_INSN_ADDC_R
},
146 { CRISV32F_INSN_ADDC_M
, && case_sem_INSN_ADDC_M
},
147 { CRISV32F_INSN_ADDC_C
, && case_sem_INSN_ADDC_C
},
148 { CRISV32F_INSN_LAPC_D
, && case_sem_INSN_LAPC_D
},
149 { CRISV32F_INSN_LAPCQ
, && case_sem_INSN_LAPCQ
},
150 { CRISV32F_INSN_ADDI_B_R
, && case_sem_INSN_ADDI_B_R
},
151 { CRISV32F_INSN_ADDI_W_R
, && case_sem_INSN_ADDI_W_R
},
152 { CRISV32F_INSN_ADDI_D_R
, && case_sem_INSN_ADDI_D_R
},
153 { CRISV32F_INSN_NEG_B_R
, && case_sem_INSN_NEG_B_R
},
154 { CRISV32F_INSN_NEG_W_R
, && case_sem_INSN_NEG_W_R
},
155 { CRISV32F_INSN_NEG_D_R
, && case_sem_INSN_NEG_D_R
},
156 { CRISV32F_INSN_TEST_M_B_M
, && case_sem_INSN_TEST_M_B_M
},
157 { CRISV32F_INSN_TEST_M_W_M
, && case_sem_INSN_TEST_M_W_M
},
158 { CRISV32F_INSN_TEST_M_D_M
, && case_sem_INSN_TEST_M_D_M
},
159 { CRISV32F_INSN_MOVE_R_M_B_M
, && case_sem_INSN_MOVE_R_M_B_M
},
160 { CRISV32F_INSN_MOVE_R_M_W_M
, && case_sem_INSN_MOVE_R_M_W_M
},
161 { CRISV32F_INSN_MOVE_R_M_D_M
, && case_sem_INSN_MOVE_R_M_D_M
},
162 { CRISV32F_INSN_MULS_B
, && case_sem_INSN_MULS_B
},
163 { CRISV32F_INSN_MULS_W
, && case_sem_INSN_MULS_W
},
164 { CRISV32F_INSN_MULS_D
, && case_sem_INSN_MULS_D
},
165 { CRISV32F_INSN_MULU_B
, && case_sem_INSN_MULU_B
},
166 { CRISV32F_INSN_MULU_W
, && case_sem_INSN_MULU_W
},
167 { CRISV32F_INSN_MULU_D
, && case_sem_INSN_MULU_D
},
168 { CRISV32F_INSN_MCP
, && case_sem_INSN_MCP
},
169 { CRISV32F_INSN_DSTEP
, && case_sem_INSN_DSTEP
},
170 { CRISV32F_INSN_ABS
, && case_sem_INSN_ABS
},
171 { CRISV32F_INSN_AND_B_R
, && case_sem_INSN_AND_B_R
},
172 { CRISV32F_INSN_AND_W_R
, && case_sem_INSN_AND_W_R
},
173 { CRISV32F_INSN_AND_D_R
, && case_sem_INSN_AND_D_R
},
174 { CRISV32F_INSN_AND_M_B_M
, && case_sem_INSN_AND_M_B_M
},
175 { CRISV32F_INSN_AND_M_W_M
, && case_sem_INSN_AND_M_W_M
},
176 { CRISV32F_INSN_AND_M_D_M
, && case_sem_INSN_AND_M_D_M
},
177 { CRISV32F_INSN_ANDCBR
, && case_sem_INSN_ANDCBR
},
178 { CRISV32F_INSN_ANDCWR
, && case_sem_INSN_ANDCWR
},
179 { CRISV32F_INSN_ANDCDR
, && case_sem_INSN_ANDCDR
},
180 { CRISV32F_INSN_ANDQ
, && case_sem_INSN_ANDQ
},
181 { CRISV32F_INSN_ORR_B_R
, && case_sem_INSN_ORR_B_R
},
182 { CRISV32F_INSN_ORR_W_R
, && case_sem_INSN_ORR_W_R
},
183 { CRISV32F_INSN_ORR_D_R
, && case_sem_INSN_ORR_D_R
},
184 { CRISV32F_INSN_OR_M_B_M
, && case_sem_INSN_OR_M_B_M
},
185 { CRISV32F_INSN_OR_M_W_M
, && case_sem_INSN_OR_M_W_M
},
186 { CRISV32F_INSN_OR_M_D_M
, && case_sem_INSN_OR_M_D_M
},
187 { CRISV32F_INSN_ORCBR
, && case_sem_INSN_ORCBR
},
188 { CRISV32F_INSN_ORCWR
, && case_sem_INSN_ORCWR
},
189 { CRISV32F_INSN_ORCDR
, && case_sem_INSN_ORCDR
},
190 { CRISV32F_INSN_ORQ
, && case_sem_INSN_ORQ
},
191 { CRISV32F_INSN_XOR
, && case_sem_INSN_XOR
},
192 { CRISV32F_INSN_SWAP
, && case_sem_INSN_SWAP
},
193 { CRISV32F_INSN_ASRR_B_R
, && case_sem_INSN_ASRR_B_R
},
194 { CRISV32F_INSN_ASRR_W_R
, && case_sem_INSN_ASRR_W_R
},
195 { CRISV32F_INSN_ASRR_D_R
, && case_sem_INSN_ASRR_D_R
},
196 { CRISV32F_INSN_ASRQ
, && case_sem_INSN_ASRQ
},
197 { CRISV32F_INSN_LSRR_B_R
, && case_sem_INSN_LSRR_B_R
},
198 { CRISV32F_INSN_LSRR_W_R
, && case_sem_INSN_LSRR_W_R
},
199 { CRISV32F_INSN_LSRR_D_R
, && case_sem_INSN_LSRR_D_R
},
200 { CRISV32F_INSN_LSRQ
, && case_sem_INSN_LSRQ
},
201 { CRISV32F_INSN_LSLR_B_R
, && case_sem_INSN_LSLR_B_R
},
202 { CRISV32F_INSN_LSLR_W_R
, && case_sem_INSN_LSLR_W_R
},
203 { CRISV32F_INSN_LSLR_D_R
, && case_sem_INSN_LSLR_D_R
},
204 { CRISV32F_INSN_LSLQ
, && case_sem_INSN_LSLQ
},
205 { CRISV32F_INSN_BTST
, && case_sem_INSN_BTST
},
206 { CRISV32F_INSN_BTSTQ
, && case_sem_INSN_BTSTQ
},
207 { CRISV32F_INSN_SETF
, && case_sem_INSN_SETF
},
208 { CRISV32F_INSN_CLEARF
, && case_sem_INSN_CLEARF
},
209 { CRISV32F_INSN_RFE
, && case_sem_INSN_RFE
},
210 { CRISV32F_INSN_SFE
, && case_sem_INSN_SFE
},
211 { CRISV32F_INSN_RFG
, && case_sem_INSN_RFG
},
212 { CRISV32F_INSN_RFN
, && case_sem_INSN_RFN
},
213 { CRISV32F_INSN_HALT
, && case_sem_INSN_HALT
},
214 { CRISV32F_INSN_BCC_B
, && case_sem_INSN_BCC_B
},
215 { CRISV32F_INSN_BA_B
, && case_sem_INSN_BA_B
},
216 { CRISV32F_INSN_BCC_W
, && case_sem_INSN_BCC_W
},
217 { CRISV32F_INSN_BA_W
, && case_sem_INSN_BA_W
},
218 { CRISV32F_INSN_JAS_R
, && case_sem_INSN_JAS_R
},
219 { CRISV32F_INSN_JAS_C
, && case_sem_INSN_JAS_C
},
220 { CRISV32F_INSN_JUMP_P
, && case_sem_INSN_JUMP_P
},
221 { CRISV32F_INSN_BAS_C
, && case_sem_INSN_BAS_C
},
222 { CRISV32F_INSN_JASC_R
, && case_sem_INSN_JASC_R
},
223 { CRISV32F_INSN_JASC_C
, && case_sem_INSN_JASC_C
},
224 { CRISV32F_INSN_BASC_C
, && case_sem_INSN_BASC_C
},
225 { CRISV32F_INSN_BREAK
, && case_sem_INSN_BREAK
},
226 { CRISV32F_INSN_BOUND_R_B_R
, && case_sem_INSN_BOUND_R_B_R
},
227 { CRISV32F_INSN_BOUND_R_W_R
, && case_sem_INSN_BOUND_R_W_R
},
228 { CRISV32F_INSN_BOUND_R_D_R
, && case_sem_INSN_BOUND_R_D_R
},
229 { CRISV32F_INSN_BOUND_CB
, && case_sem_INSN_BOUND_CB
},
230 { CRISV32F_INSN_BOUND_CW
, && case_sem_INSN_BOUND_CW
},
231 { CRISV32F_INSN_BOUND_CD
, && case_sem_INSN_BOUND_CD
},
232 { CRISV32F_INSN_SCC
, && case_sem_INSN_SCC
},
233 { CRISV32F_INSN_LZ
, && case_sem_INSN_LZ
},
234 { CRISV32F_INSN_ADDOQ
, && case_sem_INSN_ADDOQ
},
235 { CRISV32F_INSN_ADDO_M_B_M
, && case_sem_INSN_ADDO_M_B_M
},
236 { CRISV32F_INSN_ADDO_M_W_M
, && case_sem_INSN_ADDO_M_W_M
},
237 { CRISV32F_INSN_ADDO_M_D_M
, && case_sem_INSN_ADDO_M_D_M
},
238 { CRISV32F_INSN_ADDO_CB
, && case_sem_INSN_ADDO_CB
},
239 { CRISV32F_INSN_ADDO_CW
, && case_sem_INSN_ADDO_CW
},
240 { CRISV32F_INSN_ADDO_CD
, && case_sem_INSN_ADDO_CD
},
241 { CRISV32F_INSN_ADDI_ACR_B_R
, && case_sem_INSN_ADDI_ACR_B_R
},
242 { CRISV32F_INSN_ADDI_ACR_W_R
, && case_sem_INSN_ADDI_ACR_W_R
},
243 { CRISV32F_INSN_ADDI_ACR_D_R
, && case_sem_INSN_ADDI_ACR_D_R
},
244 { CRISV32F_INSN_FIDXI
, && case_sem_INSN_FIDXI
},
245 { CRISV32F_INSN_FTAGI
, && case_sem_INSN_FTAGI
},
246 { CRISV32F_INSN_FIDXD
, && case_sem_INSN_FIDXD
},
247 { CRISV32F_INSN_FTAGD
, && case_sem_INSN_FTAGD
},
252 for (i
= 0; labels
[i
].label
!= 0; ++i
)
255 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
257 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
262 #endif /* DEFINE_LABELS */
266 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
267 off frills like tracing and profiling. */
268 /* FIXME: A better way would be to have TRACE_RESULT check for something
269 that can cause it to be optimized out. Another way would be to emit
270 special handlers into the instruction "stream". */
274 #define TRACE_RESULT(cpu, abuf, name, type, val)
278 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
279 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
281 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
288 /* Branch to next handler without going around main loop. */
289 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
290 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
292 #else /* ! WITH_SCACHE_PBB */
294 #define NEXT(vpc) BREAK (sem)
297 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
299 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
302 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
305 #endif /* ! WITH_SCACHE_PBB */
309 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
311 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
312 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
313 #define FLD(f) abuf->fields.fmt_empty.f
314 int UNUSED written
= 0;
315 IADDR UNUSED pc
= abuf
->addr
;
316 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
319 /* Update the recorded pc in the cpu state struct.
320 Only necessary for WITH_SCACHE case, but to avoid the
321 conditional compilation .... */
323 /* Virtual insns have zero size. Overwrite vpc with address of next insn
324 using the default-insn-bitsize spec. When executing insns in parallel
325 we may want to queue the fault and continue execution. */
326 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
327 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
334 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
336 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
337 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
338 #define FLD(f) abuf->fields.fmt_empty.f
339 int UNUSED written
= 0;
340 IADDR UNUSED pc
= abuf
->addr
;
341 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
344 #if WITH_SCACHE_PBB_CRISV32F
345 crisv32f_pbb_after (current_cpu
, sem_arg
);
353 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
355 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
356 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
357 #define FLD(f) abuf->fields.fmt_empty.f
358 int UNUSED written
= 0;
359 IADDR UNUSED pc
= abuf
->addr
;
360 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
363 #if WITH_SCACHE_PBB_CRISV32F
364 crisv32f_pbb_before (current_cpu
, sem_arg
);
372 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
374 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
375 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
376 #define FLD(f) abuf->fields.fmt_empty.f
377 int UNUSED written
= 0;
378 IADDR UNUSED pc
= abuf
->addr
;
379 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
382 #if WITH_SCACHE_PBB_CRISV32F
384 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
385 pbb_br_type
, pbb_br_npc
);
388 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
389 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
390 CPU_PBB_BR_TYPE (current_cpu
),
391 CPU_PBB_BR_NPC (current_cpu
));
400 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
402 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
403 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
404 #define FLD(f) abuf->fields.fmt_empty.f
405 int UNUSED written
= 0;
406 IADDR UNUSED pc
= abuf
->addr
;
407 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
410 #if WITH_SCACHE_PBB_CRISV32F
411 vpc
= crisv32f_pbb_chain (current_cpu
, sem_arg
);
422 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
424 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
425 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
426 #define FLD(f) abuf->fields.fmt_empty.f
427 int UNUSED written
= 0;
428 IADDR UNUSED pc
= abuf
->addr
;
429 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
432 #if WITH_SCACHE_PBB_CRISV32F
433 #if defined DEFINE_SWITCH || defined FAST_P
434 /* In the switch case FAST_P is a constant, allowing several optimizations
435 in any called inline functions. */
436 vpc
= crisv32f_pbb_begin (current_cpu
, FAST_P
);
438 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
439 vpc
= crisv32f_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
441 vpc
= crisv32f_pbb_begin (current_cpu
, 0);
451 CASE (sem
, INSN_MOVE_B_R
) : /* move.b move.m ${Rs},${Rd} */
453 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
454 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
455 #define FLD(f) abuf->fields.sfmt_addc_m.f
456 int UNUSED written
= 0;
457 IADDR UNUSED pc
= abuf
->addr
;
458 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
462 tmp_newval
= GET_H_GR (FLD (f_operand1
));
465 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
467 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
468 SET_H_GR (FLD (f_operand2
), opval
);
469 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
474 BI opval
= LTQI (tmp_newval
, 0);
475 CPU (h_nbit
) = opval
;
476 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
479 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
480 CPU (h_zbit
) = opval
;
481 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
488 CPU (h_xbit
) = opval
;
489 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
493 SET_H_INSN_PREFIXED_P (opval
);
494 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
504 CASE (sem
, INSN_MOVE_W_R
) : /* move.w move.m ${Rs},${Rd} */
506 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
508 #define FLD(f) abuf->fields.sfmt_addc_m.f
509 int UNUSED written
= 0;
510 IADDR UNUSED pc
= abuf
->addr
;
511 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
515 tmp_newval
= GET_H_GR (FLD (f_operand1
));
518 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
520 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
521 SET_H_GR (FLD (f_operand2
), opval
);
522 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
527 BI opval
= LTHI (tmp_newval
, 0);
528 CPU (h_nbit
) = opval
;
529 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
532 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
533 CPU (h_zbit
) = opval
;
534 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
541 CPU (h_xbit
) = opval
;
542 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
546 SET_H_INSN_PREFIXED_P (opval
);
547 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
557 CASE (sem
, INSN_MOVE_D_R
) : /* move.d move.m ${Rs},${Rd} */
559 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
560 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
561 #define FLD(f) abuf->fields.sfmt_addc_m.f
562 int UNUSED written
= 0;
563 IADDR UNUSED pc
= abuf
->addr
;
564 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
568 tmp_newval
= GET_H_GR (FLD (f_operand1
));
570 SI opval
= tmp_newval
;
571 SET_H_GR (FLD (f_operand2
), opval
);
572 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
576 BI opval
= LTSI (tmp_newval
, 0);
577 CPU (h_nbit
) = opval
;
578 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
581 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
582 CPU (h_zbit
) = opval
;
583 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
590 CPU (h_xbit
) = opval
;
591 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
595 SET_H_INSN_PREFIXED_P (opval
);
596 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
606 CASE (sem
, INSN_MOVEQ
) : /* moveq $i,$Rd */
608 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
609 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
610 #define FLD(f) abuf->fields.sfmt_moveq.f
611 int UNUSED written
= 0;
612 IADDR UNUSED pc
= abuf
->addr
;
613 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
617 tmp_newval
= FLD (f_s6
);
619 SI opval
= tmp_newval
;
620 SET_H_GR (FLD (f_operand2
), opval
);
621 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
624 SET_H_NBIT_MOVE (LTSI (tmp_newval
, 0));
625 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1))));
631 CPU (h_xbit
) = opval
;
632 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
636 SET_H_INSN_PREFIXED_P (opval
);
637 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
647 CASE (sem
, INSN_MOVS_B_R
) : /* movs.b movs.m ${Rs},${Rd} */
649 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
650 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
651 #define FLD(f) abuf->fields.sfmt_muls_b.f
652 int UNUSED written
= 0;
653 IADDR UNUSED pc
= abuf
->addr
;
654 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
659 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
660 tmp_newval
= EXTQISI (tmp_tmpops
);
662 SI opval
= tmp_newval
;
663 SET_H_GR (FLD (f_operand2
), opval
);
664 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
668 BI opval
= LTSI (tmp_newval
, 0);
669 CPU (h_nbit
) = opval
;
670 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
673 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
674 CPU (h_zbit
) = opval
;
675 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
682 CPU (h_xbit
) = opval
;
683 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
687 SET_H_INSN_PREFIXED_P (opval
);
688 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
698 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
700 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
701 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
702 #define FLD(f) abuf->fields.sfmt_muls_b.f
703 int UNUSED written
= 0;
704 IADDR UNUSED pc
= abuf
->addr
;
705 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
710 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
711 tmp_newval
= EXTHISI (tmp_tmpops
);
713 SI opval
= tmp_newval
;
714 SET_H_GR (FLD (f_operand2
), opval
);
715 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
719 BI opval
= LTSI (tmp_newval
, 0);
720 CPU (h_nbit
) = opval
;
721 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
724 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
725 CPU (h_zbit
) = opval
;
726 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
733 CPU (h_xbit
) = opval
;
734 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
738 SET_H_INSN_PREFIXED_P (opval
);
739 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
749 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
751 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
752 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
753 #define FLD(f) abuf->fields.sfmt_muls_b.f
754 int UNUSED written
= 0;
755 IADDR UNUSED pc
= abuf
->addr
;
756 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
761 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
762 tmp_newval
= ZEXTQISI (tmp_tmpops
);
764 SI opval
= tmp_newval
;
765 SET_H_GR (FLD (f_operand2
), opval
);
766 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
770 BI opval
= LTSI (tmp_newval
, 0);
771 CPU (h_nbit
) = opval
;
772 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
775 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
776 CPU (h_zbit
) = opval
;
777 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
784 CPU (h_xbit
) = opval
;
785 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
789 SET_H_INSN_PREFIXED_P (opval
);
790 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
800 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
802 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
803 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
804 #define FLD(f) abuf->fields.sfmt_muls_b.f
805 int UNUSED written
= 0;
806 IADDR UNUSED pc
= abuf
->addr
;
807 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
812 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
813 tmp_newval
= ZEXTHISI (tmp_tmpops
);
815 SI opval
= tmp_newval
;
816 SET_H_GR (FLD (f_operand2
), opval
);
817 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
821 BI opval
= LTSI (tmp_newval
, 0);
822 CPU (h_nbit
) = opval
;
823 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
826 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
827 CPU (h_zbit
) = opval
;
828 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
835 CPU (h_xbit
) = opval
;
836 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
840 SET_H_INSN_PREFIXED_P (opval
);
841 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
851 CASE (sem
, INSN_MOVECBR
) : /* move.b ${sconst8},${Rd} */
853 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
854 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
855 #define FLD(f) abuf->fields.sfmt_addcbr.f
856 int UNUSED written
= 0;
857 IADDR UNUSED pc
= abuf
->addr
;
858 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
862 tmp_newval
= FLD (f_indir_pc__byte
);
865 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
867 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
868 SET_H_GR (FLD (f_operand2
), opval
);
869 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
874 BI opval
= LTQI (tmp_newval
, 0);
875 CPU (h_nbit
) = opval
;
876 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
879 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
880 CPU (h_zbit
) = opval
;
881 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
888 CPU (h_xbit
) = opval
;
889 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
893 SET_H_INSN_PREFIXED_P (opval
);
894 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
904 CASE (sem
, INSN_MOVECWR
) : /* move.w ${sconst16},${Rd} */
906 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
907 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
908 #define FLD(f) abuf->fields.sfmt_addcwr.f
909 int UNUSED written
= 0;
910 IADDR UNUSED pc
= abuf
->addr
;
911 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
915 tmp_newval
= FLD (f_indir_pc__word
);
918 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
920 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
921 SET_H_GR (FLD (f_operand2
), opval
);
922 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
927 BI opval
= LTHI (tmp_newval
, 0);
928 CPU (h_nbit
) = opval
;
929 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
932 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
933 CPU (h_zbit
) = opval
;
934 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
941 CPU (h_xbit
) = opval
;
942 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
946 SET_H_INSN_PREFIXED_P (opval
);
947 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
957 CASE (sem
, INSN_MOVECDR
) : /* move.d ${const32},${Rd} */
959 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
960 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
961 #define FLD(f) abuf->fields.sfmt_bound_cd.f
962 int UNUSED written
= 0;
963 IADDR UNUSED pc
= abuf
->addr
;
964 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
968 tmp_newval
= FLD (f_indir_pc__dword
);
970 SI opval
= tmp_newval
;
971 SET_H_GR (FLD (f_operand2
), opval
);
972 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
976 BI opval
= LTSI (tmp_newval
, 0);
977 CPU (h_nbit
) = opval
;
978 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
981 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
982 CPU (h_zbit
) = opval
;
983 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
990 CPU (h_xbit
) = opval
;
991 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
995 SET_H_INSN_PREFIXED_P (opval
);
996 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1006 CASE (sem
, INSN_MOVSCBR
) : /* movs.b ${sconst8},${Rd} */
1008 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1009 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1010 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1011 int UNUSED written
= 0;
1012 IADDR UNUSED pc
= abuf
->addr
;
1013 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1017 tmp_newval
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1019 SI opval
= tmp_newval
;
1020 SET_H_GR (FLD (f_operand2
), opval
);
1021 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1025 BI opval
= LTSI (tmp_newval
, 0);
1026 CPU (h_nbit
) = opval
;
1027 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1030 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1031 CPU (h_zbit
) = opval
;
1032 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1034 SET_H_CBIT_MOVE (0);
1035 SET_H_VBIT_MOVE (0);
1039 CPU (h_xbit
) = opval
;
1040 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1044 SET_H_INSN_PREFIXED_P (opval
);
1045 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1055 CASE (sem
, INSN_MOVSCWR
) : /* movs.w ${sconst16},${Rd} */
1057 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1058 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1059 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1060 int UNUSED written
= 0;
1061 IADDR UNUSED pc
= abuf
->addr
;
1062 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1066 tmp_newval
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1068 SI opval
= tmp_newval
;
1069 SET_H_GR (FLD (f_operand2
), opval
);
1070 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1074 BI opval
= LTSI (tmp_newval
, 0);
1075 CPU (h_nbit
) = opval
;
1076 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1079 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1080 CPU (h_zbit
) = opval
;
1081 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1083 SET_H_CBIT_MOVE (0);
1084 SET_H_VBIT_MOVE (0);
1088 CPU (h_xbit
) = opval
;
1089 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1093 SET_H_INSN_PREFIXED_P (opval
);
1094 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1104 CASE (sem
, INSN_MOVUCBR
) : /* movu.b ${uconst8},${Rd} */
1106 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1108 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1109 int UNUSED written
= 0;
1110 IADDR UNUSED pc
= abuf
->addr
;
1111 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1115 tmp_newval
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1117 SI opval
= tmp_newval
;
1118 SET_H_GR (FLD (f_operand2
), opval
);
1119 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1123 BI opval
= LTSI (tmp_newval
, 0);
1124 CPU (h_nbit
) = opval
;
1125 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1128 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1129 CPU (h_zbit
) = opval
;
1130 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1132 SET_H_CBIT_MOVE (0);
1133 SET_H_VBIT_MOVE (0);
1137 CPU (h_xbit
) = opval
;
1138 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1142 SET_H_INSN_PREFIXED_P (opval
);
1143 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1153 CASE (sem
, INSN_MOVUCWR
) : /* movu.w ${uconst16},${Rd} */
1155 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1156 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1157 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1158 int UNUSED written
= 0;
1159 IADDR UNUSED pc
= abuf
->addr
;
1160 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1164 tmp_newval
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1166 SI opval
= tmp_newval
;
1167 SET_H_GR (FLD (f_operand2
), opval
);
1168 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1172 BI opval
= LTSI (tmp_newval
, 0);
1173 CPU (h_nbit
) = opval
;
1174 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1177 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1178 CPU (h_zbit
) = opval
;
1179 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1181 SET_H_CBIT_MOVE (0);
1182 SET_H_VBIT_MOVE (0);
1186 CPU (h_xbit
) = opval
;
1187 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1191 SET_H_INSN_PREFIXED_P (opval
);
1192 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1202 CASE (sem
, INSN_ADDQ
) : /* addq $j,$Rd */
1204 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1206 #define FLD(f) abuf->fields.sfmt_addq.f
1207 int UNUSED written
= 0;
1208 IADDR UNUSED pc
= abuf
->addr
;
1209 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1216 tmp_tmpops
= FLD (f_u6
);
1217 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1218 tmp_carry
= CPU (h_cbit
);
1219 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1221 SI opval
= tmp_newval
;
1222 SET_H_GR (FLD (f_operand2
), opval
);
1223 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1227 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))));
1228 CPU (h_cbit
) = opval
;
1229 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1232 BI opval
= LTSI (tmp_newval
, 0);
1233 CPU (h_nbit
) = opval
;
1234 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1237 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1238 CPU (h_zbit
) = opval
;
1239 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1242 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)));
1243 CPU (h_vbit
) = opval
;
1244 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1249 CPU (h_xbit
) = opval
;
1250 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1254 SET_H_INSN_PREFIXED_P (opval
);
1255 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1265 CASE (sem
, INSN_SUBQ
) : /* subq $j,$Rd */
1267 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1269 #define FLD(f) abuf->fields.sfmt_addq.f
1270 int UNUSED written
= 0;
1271 IADDR UNUSED pc
= abuf
->addr
;
1272 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1279 tmp_tmpops
= FLD (f_u6
);
1280 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1281 tmp_carry
= CPU (h_cbit
);
1282 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1284 SI opval
= tmp_newval
;
1285 SET_H_GR (FLD (f_operand2
), opval
);
1286 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1290 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))));
1291 CPU (h_cbit
) = opval
;
1292 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1295 BI opval
= LTSI (tmp_newval
, 0);
1296 CPU (h_nbit
) = opval
;
1297 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1300 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1301 CPU (h_zbit
) = opval
;
1302 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1305 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)));
1306 CPU (h_vbit
) = opval
;
1307 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1312 CPU (h_xbit
) = opval
;
1313 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1317 SET_H_INSN_PREFIXED_P (opval
);
1318 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1328 CASE (sem
, INSN_CMP_R_B_R
) : /* cmp-r.b $Rs,$Rd */
1330 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1331 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1332 #define FLD(f) abuf->fields.sfmt_muls_b.f
1333 int UNUSED written
= 0;
1334 IADDR UNUSED pc
= abuf
->addr
;
1335 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1342 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1343 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1344 tmp_carry
= CPU (h_cbit
);
1345 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1349 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))));
1350 CPU (h_cbit
) = opval
;
1351 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1354 BI opval
= LTQI (tmp_newval
, 0);
1355 CPU (h_nbit
) = opval
;
1356 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1359 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1360 CPU (h_zbit
) = opval
;
1361 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1364 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)));
1365 CPU (h_vbit
) = opval
;
1366 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1371 CPU (h_xbit
) = opval
;
1372 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1376 SET_H_INSN_PREFIXED_P (opval
);
1377 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1387 CASE (sem
, INSN_CMP_R_W_R
) : /* cmp-r.w $Rs,$Rd */
1389 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1390 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1391 #define FLD(f) abuf->fields.sfmt_muls_b.f
1392 int UNUSED written
= 0;
1393 IADDR UNUSED pc
= abuf
->addr
;
1394 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1401 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1402 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1403 tmp_carry
= CPU (h_cbit
);
1404 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1408 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))));
1409 CPU (h_cbit
) = opval
;
1410 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1413 BI opval
= LTHI (tmp_newval
, 0);
1414 CPU (h_nbit
) = opval
;
1415 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1418 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1419 CPU (h_zbit
) = opval
;
1420 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1423 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)));
1424 CPU (h_vbit
) = opval
;
1425 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1430 CPU (h_xbit
) = opval
;
1431 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1435 SET_H_INSN_PREFIXED_P (opval
);
1436 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1446 CASE (sem
, INSN_CMP_R_D_R
) : /* cmp-r.d $Rs,$Rd */
1448 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1449 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1450 #define FLD(f) abuf->fields.sfmt_muls_b.f
1451 int UNUSED written
= 0;
1452 IADDR UNUSED pc
= abuf
->addr
;
1453 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1460 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1461 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1462 tmp_carry
= CPU (h_cbit
);
1463 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1467 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))));
1468 CPU (h_cbit
) = opval
;
1469 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1472 BI opval
= LTSI (tmp_newval
, 0);
1473 CPU (h_nbit
) = opval
;
1474 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1477 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1478 CPU (h_zbit
) = opval
;
1479 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1482 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)));
1483 CPU (h_vbit
) = opval
;
1484 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1489 CPU (h_xbit
) = opval
;
1490 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1494 SET_H_INSN_PREFIXED_P (opval
);
1495 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1505 CASE (sem
, INSN_CMP_M_B_M
) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1507 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1508 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1509 #define FLD(f) abuf->fields.sfmt_addc_m.f
1510 int UNUSED written
= 0;
1511 IADDR UNUSED pc
= abuf
->addr
;
1512 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1519 tmp_tmpops
= ({ SI tmp_addr
;
1522 tmp_postinc
= FLD (f_memmode
);
1523 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1524 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1525 ; if (NEBI (tmp_postinc
, 0)) {
1527 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1528 tmp_addr
= ADDSI (tmp_addr
, 1);
1531 SI opval
= tmp_addr
;
1532 SET_H_GR (FLD (f_operand1
), opval
);
1533 written
|= (1 << 9);
1534 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1539 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1540 tmp_carry
= CPU (h_cbit
);
1541 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1545 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))));
1546 CPU (h_cbit
) = opval
;
1547 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1550 BI opval
= LTQI (tmp_newval
, 0);
1551 CPU (h_nbit
) = opval
;
1552 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1555 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1556 CPU (h_zbit
) = opval
;
1557 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1560 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)));
1561 CPU (h_vbit
) = opval
;
1562 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1567 CPU (h_xbit
) = opval
;
1568 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1572 SET_H_INSN_PREFIXED_P (opval
);
1573 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1579 abuf
->written
= written
;
1584 CASE (sem
, INSN_CMP_M_W_M
) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1586 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1587 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1588 #define FLD(f) abuf->fields.sfmt_addc_m.f
1589 int UNUSED written
= 0;
1590 IADDR UNUSED pc
= abuf
->addr
;
1591 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1598 tmp_tmpops
= ({ SI tmp_addr
;
1601 tmp_postinc
= FLD (f_memmode
);
1602 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1603 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
1604 ; if (NEBI (tmp_postinc
, 0)) {
1606 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1607 tmp_addr
= ADDSI (tmp_addr
, 2);
1610 SI opval
= tmp_addr
;
1611 SET_H_GR (FLD (f_operand1
), opval
);
1612 written
|= (1 << 9);
1613 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1618 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1619 tmp_carry
= CPU (h_cbit
);
1620 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1624 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))));
1625 CPU (h_cbit
) = opval
;
1626 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1629 BI opval
= LTHI (tmp_newval
, 0);
1630 CPU (h_nbit
) = opval
;
1631 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1634 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1635 CPU (h_zbit
) = opval
;
1636 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1639 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)));
1640 CPU (h_vbit
) = opval
;
1641 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1646 CPU (h_xbit
) = opval
;
1647 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1651 SET_H_INSN_PREFIXED_P (opval
);
1652 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1658 abuf
->written
= written
;
1663 CASE (sem
, INSN_CMP_M_D_M
) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1665 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1666 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1667 #define FLD(f) abuf->fields.sfmt_addc_m.f
1668 int UNUSED written
= 0;
1669 IADDR UNUSED pc
= abuf
->addr
;
1670 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1677 tmp_tmpops
= ({ SI tmp_addr
;
1680 tmp_postinc
= FLD (f_memmode
);
1681 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1682 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
1683 ; if (NEBI (tmp_postinc
, 0)) {
1685 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1686 tmp_addr
= ADDSI (tmp_addr
, 4);
1689 SI opval
= tmp_addr
;
1690 SET_H_GR (FLD (f_operand1
), opval
);
1691 written
|= (1 << 9);
1692 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1697 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1698 tmp_carry
= CPU (h_cbit
);
1699 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1703 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))));
1704 CPU (h_cbit
) = opval
;
1705 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1708 BI opval
= LTSI (tmp_newval
, 0);
1709 CPU (h_nbit
) = opval
;
1710 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1713 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1714 CPU (h_zbit
) = opval
;
1715 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1718 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)));
1719 CPU (h_vbit
) = opval
;
1720 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1725 CPU (h_xbit
) = opval
;
1726 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1730 SET_H_INSN_PREFIXED_P (opval
);
1731 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1737 abuf
->written
= written
;
1742 CASE (sem
, INSN_CMPCBR
) : /* cmp.b $sconst8,$Rd */
1744 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1745 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1746 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1747 int UNUSED written
= 0;
1748 IADDR UNUSED pc
= abuf
->addr
;
1749 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1756 tmp_tmpops
= TRUNCSIQI (FLD (f_indir_pc__byte
));
1757 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1758 tmp_carry
= CPU (h_cbit
);
1759 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1763 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))));
1764 CPU (h_cbit
) = opval
;
1765 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1768 BI opval
= LTQI (tmp_newval
, 0);
1769 CPU (h_nbit
) = opval
;
1770 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1773 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1774 CPU (h_zbit
) = opval
;
1775 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1778 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)));
1779 CPU (h_vbit
) = opval
;
1780 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1785 CPU (h_xbit
) = opval
;
1786 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1790 SET_H_INSN_PREFIXED_P (opval
);
1791 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1801 CASE (sem
, INSN_CMPCWR
) : /* cmp.w $sconst16,$Rd */
1803 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1804 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1805 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1806 int UNUSED written
= 0;
1807 IADDR UNUSED pc
= abuf
->addr
;
1808 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1815 tmp_tmpops
= TRUNCSIHI (FLD (f_indir_pc__word
));
1816 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1817 tmp_carry
= CPU (h_cbit
);
1818 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1822 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))));
1823 CPU (h_cbit
) = opval
;
1824 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1827 BI opval
= LTHI (tmp_newval
, 0);
1828 CPU (h_nbit
) = opval
;
1829 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1832 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1833 CPU (h_zbit
) = opval
;
1834 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1837 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)));
1838 CPU (h_vbit
) = opval
;
1839 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1844 CPU (h_xbit
) = opval
;
1845 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1849 SET_H_INSN_PREFIXED_P (opval
);
1850 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1860 CASE (sem
, INSN_CMPCDR
) : /* cmp.d $const32,$Rd */
1862 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1863 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1864 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1865 int UNUSED written
= 0;
1866 IADDR UNUSED pc
= abuf
->addr
;
1867 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1874 tmp_tmpops
= FLD (f_indir_pc__dword
);
1875 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1876 tmp_carry
= CPU (h_cbit
);
1877 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1881 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))));
1882 CPU (h_cbit
) = opval
;
1883 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1886 BI opval
= LTSI (tmp_newval
, 0);
1887 CPU (h_nbit
) = opval
;
1888 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1891 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1892 CPU (h_zbit
) = opval
;
1893 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1896 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)));
1897 CPU (h_vbit
) = opval
;
1898 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1903 CPU (h_xbit
) = opval
;
1904 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1908 SET_H_INSN_PREFIXED_P (opval
);
1909 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1919 CASE (sem
, INSN_CMPQ
) : /* cmpq $i,$Rd */
1921 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1922 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1923 #define FLD(f) abuf->fields.sfmt_andq.f
1924 int UNUSED written
= 0;
1925 IADDR UNUSED pc
= abuf
->addr
;
1926 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1933 tmp_tmpops
= FLD (f_s6
);
1934 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1935 tmp_carry
= CPU (h_cbit
);
1936 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1940 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))));
1941 CPU (h_cbit
) = opval
;
1942 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1945 BI opval
= LTSI (tmp_newval
, 0);
1946 CPU (h_nbit
) = opval
;
1947 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1950 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1951 CPU (h_zbit
) = opval
;
1952 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1955 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)));
1956 CPU (h_vbit
) = opval
;
1957 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1962 CPU (h_xbit
) = opval
;
1963 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1967 SET_H_INSN_PREFIXED_P (opval
);
1968 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1978 CASE (sem
, INSN_CMPS_M_B_M
) : /* cmps-m.b [${Rs}${inc}],$Rd */
1980 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1981 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1982 #define FLD(f) abuf->fields.sfmt_addc_m.f
1983 int UNUSED written
= 0;
1984 IADDR UNUSED pc
= abuf
->addr
;
1985 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1992 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
1995 tmp_postinc
= FLD (f_memmode
);
1996 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1997 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1998 ; if (NEBI (tmp_postinc
, 0)) {
2000 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2001 tmp_addr
= ADDSI (tmp_addr
, 1);
2004 SI opval
= tmp_addr
;
2005 SET_H_GR (FLD (f_operand1
), opval
);
2006 written
|= (1 << 9);
2007 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2012 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2013 tmp_carry
= CPU (h_cbit
);
2014 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2018 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))));
2019 CPU (h_cbit
) = opval
;
2020 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2023 BI opval
= LTSI (tmp_newval
, 0);
2024 CPU (h_nbit
) = opval
;
2025 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2028 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2029 CPU (h_zbit
) = opval
;
2030 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2033 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)));
2034 CPU (h_vbit
) = opval
;
2035 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2040 CPU (h_xbit
) = opval
;
2041 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2045 SET_H_INSN_PREFIXED_P (opval
);
2046 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2052 abuf
->written
= written
;
2057 CASE (sem
, INSN_CMPS_M_W_M
) : /* cmps-m.w [${Rs}${inc}],$Rd */
2059 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2060 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2061 #define FLD(f) abuf->fields.sfmt_addc_m.f
2062 int UNUSED written
= 0;
2063 IADDR UNUSED pc
= abuf
->addr
;
2064 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2071 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
2074 tmp_postinc
= FLD (f_memmode
);
2075 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2076 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2077 ; if (NEBI (tmp_postinc
, 0)) {
2079 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2080 tmp_addr
= ADDSI (tmp_addr
, 2);
2083 SI opval
= tmp_addr
;
2084 SET_H_GR (FLD (f_operand1
), opval
);
2085 written
|= (1 << 9);
2086 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2091 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2092 tmp_carry
= CPU (h_cbit
);
2093 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2097 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))));
2098 CPU (h_cbit
) = opval
;
2099 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2102 BI opval
= LTSI (tmp_newval
, 0);
2103 CPU (h_nbit
) = opval
;
2104 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2107 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2108 CPU (h_zbit
) = opval
;
2109 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2112 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)));
2113 CPU (h_vbit
) = opval
;
2114 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2119 CPU (h_xbit
) = opval
;
2120 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2124 SET_H_INSN_PREFIXED_P (opval
);
2125 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2131 abuf
->written
= written
;
2136 CASE (sem
, INSN_CMPSCBR
) : /* [${Rs}${inc}],$Rd */
2138 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2139 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2140 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2141 int UNUSED written
= 0;
2142 IADDR UNUSED pc
= abuf
->addr
;
2143 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2150 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2151 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2152 tmp_carry
= CPU (h_cbit
);
2153 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2157 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))));
2158 CPU (h_cbit
) = opval
;
2159 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2162 BI opval
= LTSI (tmp_newval
, 0);
2163 CPU (h_nbit
) = opval
;
2164 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2167 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2168 CPU (h_zbit
) = opval
;
2169 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2172 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)));
2173 CPU (h_vbit
) = opval
;
2174 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2179 CPU (h_xbit
) = opval
;
2180 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2184 SET_H_INSN_PREFIXED_P (opval
);
2185 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2195 CASE (sem
, INSN_CMPSCWR
) : /* [${Rs}${inc}],$Rd */
2197 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2198 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2199 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2200 int UNUSED written
= 0;
2201 IADDR UNUSED pc
= abuf
->addr
;
2202 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2209 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2210 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2211 tmp_carry
= CPU (h_cbit
);
2212 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2216 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))));
2217 CPU (h_cbit
) = opval
;
2218 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2221 BI opval
= LTSI (tmp_newval
, 0);
2222 CPU (h_nbit
) = opval
;
2223 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2226 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2227 CPU (h_zbit
) = opval
;
2228 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2231 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)));
2232 CPU (h_vbit
) = opval
;
2233 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2238 CPU (h_xbit
) = opval
;
2239 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2243 SET_H_INSN_PREFIXED_P (opval
);
2244 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2254 CASE (sem
, INSN_CMPU_M_B_M
) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2256 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2257 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2258 #define FLD(f) abuf->fields.sfmt_addc_m.f
2259 int UNUSED written
= 0;
2260 IADDR UNUSED pc
= abuf
->addr
;
2261 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2268 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
2271 tmp_postinc
= FLD (f_memmode
);
2272 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2273 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2274 ; if (NEBI (tmp_postinc
, 0)) {
2276 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2277 tmp_addr
= ADDSI (tmp_addr
, 1);
2280 SI opval
= tmp_addr
;
2281 SET_H_GR (FLD (f_operand1
), opval
);
2282 written
|= (1 << 9);
2283 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2288 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2289 tmp_carry
= CPU (h_cbit
);
2290 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2294 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))));
2295 CPU (h_cbit
) = opval
;
2296 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2299 BI opval
= LTSI (tmp_newval
, 0);
2300 CPU (h_nbit
) = opval
;
2301 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2304 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2305 CPU (h_zbit
) = opval
;
2306 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2309 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)));
2310 CPU (h_vbit
) = opval
;
2311 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2316 CPU (h_xbit
) = opval
;
2317 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2321 SET_H_INSN_PREFIXED_P (opval
);
2322 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2328 abuf
->written
= written
;
2333 CASE (sem
, INSN_CMPU_M_W_M
) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2335 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2336 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2337 #define FLD(f) abuf->fields.sfmt_addc_m.f
2338 int UNUSED written
= 0;
2339 IADDR UNUSED pc
= abuf
->addr
;
2340 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2347 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
2350 tmp_postinc
= FLD (f_memmode
);
2351 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2352 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2353 ; if (NEBI (tmp_postinc
, 0)) {
2355 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2356 tmp_addr
= ADDSI (tmp_addr
, 2);
2359 SI opval
= tmp_addr
;
2360 SET_H_GR (FLD (f_operand1
), opval
);
2361 written
|= (1 << 9);
2362 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2367 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2368 tmp_carry
= CPU (h_cbit
);
2369 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2373 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))));
2374 CPU (h_cbit
) = opval
;
2375 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2378 BI opval
= LTSI (tmp_newval
, 0);
2379 CPU (h_nbit
) = opval
;
2380 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2383 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2384 CPU (h_zbit
) = opval
;
2385 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2388 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)));
2389 CPU (h_vbit
) = opval
;
2390 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2395 CPU (h_xbit
) = opval
;
2396 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2400 SET_H_INSN_PREFIXED_P (opval
);
2401 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2407 abuf
->written
= written
;
2412 CASE (sem
, INSN_CMPUCBR
) : /* [${Rs}${inc}],$Rd */
2414 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2415 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2416 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2417 int UNUSED written
= 0;
2418 IADDR UNUSED pc
= abuf
->addr
;
2419 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2426 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2427 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2428 tmp_carry
= CPU (h_cbit
);
2429 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2433 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))));
2434 CPU (h_cbit
) = opval
;
2435 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2438 BI opval
= LTSI (tmp_newval
, 0);
2439 CPU (h_nbit
) = opval
;
2440 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2443 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2444 CPU (h_zbit
) = opval
;
2445 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2448 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)));
2449 CPU (h_vbit
) = opval
;
2450 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2455 CPU (h_xbit
) = opval
;
2456 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2460 SET_H_INSN_PREFIXED_P (opval
);
2461 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2471 CASE (sem
, INSN_CMPUCWR
) : /* [${Rs}${inc}],$Rd */
2473 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2474 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2475 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2476 int UNUSED written
= 0;
2477 IADDR UNUSED pc
= abuf
->addr
;
2478 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2485 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2486 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2487 tmp_carry
= CPU (h_cbit
);
2488 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2492 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))));
2493 CPU (h_cbit
) = opval
;
2494 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2497 BI opval
= LTSI (tmp_newval
, 0);
2498 CPU (h_nbit
) = opval
;
2499 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2502 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2503 CPU (h_zbit
) = opval
;
2504 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2507 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)));
2508 CPU (h_vbit
) = opval
;
2509 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2514 CPU (h_xbit
) = opval
;
2515 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2519 SET_H_INSN_PREFIXED_P (opval
);
2520 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2530 CASE (sem
, INSN_MOVE_M_B_M
) : /* move-m.b [${Rs}${inc}],${Rd} */
2532 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2533 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2534 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2535 int UNUSED written
= 0;
2536 IADDR UNUSED pc
= abuf
->addr
;
2537 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2541 tmp_tmp
= ({ SI tmp_addr
;
2544 tmp_postinc
= FLD (f_memmode
);
2545 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2546 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2547 ; if (NEBI (tmp_postinc
, 0)) {
2549 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2550 tmp_addr
= ADDSI (tmp_addr
, 1);
2553 SI opval
= tmp_addr
;
2554 SET_H_GR (FLD (f_operand1
), opval
);
2555 written
|= (1 << 10);
2556 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2563 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2565 SI opval
= ORSI (ANDSI (tmp_tmp
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
2566 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2567 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2572 BI opval
= LTQI (tmp_tmp
, 0);
2573 CPU (h_nbit
) = opval
;
2574 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2577 BI opval
= ANDIF (EQQI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2578 CPU (h_zbit
) = opval
;
2579 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2581 SET_H_CBIT_MOVE (0);
2582 SET_H_VBIT_MOVE (0);
2586 CPU (h_xbit
) = opval
;
2587 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2591 SET_H_INSN_PREFIXED_P (opval
);
2592 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2598 abuf
->written
= written
;
2603 CASE (sem
, INSN_MOVE_M_W_M
) : /* move-m.w [${Rs}${inc}],${Rd} */
2605 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2606 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2607 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2608 int UNUSED written
= 0;
2609 IADDR UNUSED pc
= abuf
->addr
;
2610 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2614 tmp_tmp
= ({ SI tmp_addr
;
2617 tmp_postinc
= FLD (f_memmode
);
2618 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2619 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2620 ; if (NEBI (tmp_postinc
, 0)) {
2622 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2623 tmp_addr
= ADDSI (tmp_addr
, 2);
2626 SI opval
= tmp_addr
;
2627 SET_H_GR (FLD (f_operand1
), opval
);
2628 written
|= (1 << 10);
2629 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2636 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2638 SI opval
= ORSI (ANDSI (tmp_tmp
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
2639 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2640 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2645 BI opval
= LTHI (tmp_tmp
, 0);
2646 CPU (h_nbit
) = opval
;
2647 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2650 BI opval
= ANDIF (EQHI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2651 CPU (h_zbit
) = opval
;
2652 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2654 SET_H_CBIT_MOVE (0);
2655 SET_H_VBIT_MOVE (0);
2659 CPU (h_xbit
) = opval
;
2660 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2664 SET_H_INSN_PREFIXED_P (opval
);
2665 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2671 abuf
->written
= written
;
2676 CASE (sem
, INSN_MOVE_M_D_M
) : /* move-m.d [${Rs}${inc}],${Rd} */
2678 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2679 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2680 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2681 int UNUSED written
= 0;
2682 IADDR UNUSED pc
= abuf
->addr
;
2683 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2687 tmp_tmp
= ({ SI tmp_addr
;
2690 tmp_postinc
= FLD (f_memmode
);
2691 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2692 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
2693 ; if (NEBI (tmp_postinc
, 0)) {
2695 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2696 tmp_addr
= ADDSI (tmp_addr
, 4);
2699 SI opval
= tmp_addr
;
2700 SET_H_GR (FLD (f_operand1
), opval
);
2701 written
|= (1 << 9);
2702 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2709 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2710 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2714 BI opval
= LTSI (tmp_tmp
, 0);
2715 CPU (h_nbit
) = opval
;
2716 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2719 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2720 CPU (h_zbit
) = opval
;
2721 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2723 SET_H_CBIT_MOVE (0);
2724 SET_H_VBIT_MOVE (0);
2728 CPU (h_xbit
) = opval
;
2729 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2733 SET_H_INSN_PREFIXED_P (opval
);
2734 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2740 abuf
->written
= written
;
2745 CASE (sem
, INSN_MOVS_M_B_M
) : /* movs-m.b [${Rs}${inc}],${Rd} */
2747 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2748 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2749 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2750 int UNUSED written
= 0;
2751 IADDR UNUSED pc
= abuf
->addr
;
2752 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2756 tmp_tmp
= EXTQISI (({ SI tmp_addr
;
2759 tmp_postinc
= FLD (f_memmode
);
2760 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2761 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2762 ; if (NEBI (tmp_postinc
, 0)) {
2764 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2765 tmp_addr
= ADDSI (tmp_addr
, 1);
2768 SI opval
= tmp_addr
;
2769 SET_H_GR (FLD (f_operand1
), opval
);
2770 written
|= (1 << 8);
2771 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2776 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2779 SET_H_GR (FLD (f_operand1
), opval
);
2780 written
|= (1 << 8);
2781 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2786 SET_H_GR (FLD (f_operand2
), opval
);
2787 written
|= (1 << 7);
2788 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2793 BI opval
= LTSI (tmp_tmp
, 0);
2794 CPU (h_nbit
) = opval
;
2795 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2798 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2799 CPU (h_zbit
) = opval
;
2800 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2802 SET_H_CBIT_MOVE (0);
2803 SET_H_VBIT_MOVE (0);
2807 CPU (h_xbit
) = opval
;
2808 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2812 SET_H_INSN_PREFIXED_P (opval
);
2813 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2819 abuf
->written
= written
;
2824 CASE (sem
, INSN_MOVS_M_W_M
) : /* movs-m.w [${Rs}${inc}],${Rd} */
2826 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2827 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2828 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2829 int UNUSED written
= 0;
2830 IADDR UNUSED pc
= abuf
->addr
;
2831 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2835 tmp_tmp
= EXTHISI (({ SI tmp_addr
;
2838 tmp_postinc
= FLD (f_memmode
);
2839 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2840 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2841 ; if (NEBI (tmp_postinc
, 0)) {
2843 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2844 tmp_addr
= ADDSI (tmp_addr
, 2);
2847 SI opval
= tmp_addr
;
2848 SET_H_GR (FLD (f_operand1
), opval
);
2849 written
|= (1 << 8);
2850 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2855 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2858 SET_H_GR (FLD (f_operand1
), opval
);
2859 written
|= (1 << 8);
2860 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2865 SET_H_GR (FLD (f_operand2
), opval
);
2866 written
|= (1 << 7);
2867 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2872 BI opval
= LTSI (tmp_tmp
, 0);
2873 CPU (h_nbit
) = opval
;
2874 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2877 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2878 CPU (h_zbit
) = opval
;
2879 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2881 SET_H_CBIT_MOVE (0);
2882 SET_H_VBIT_MOVE (0);
2886 CPU (h_xbit
) = opval
;
2887 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2891 SET_H_INSN_PREFIXED_P (opval
);
2892 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2898 abuf
->written
= written
;
2903 CASE (sem
, INSN_MOVU_M_B_M
) : /* movu-m.b [${Rs}${inc}],${Rd} */
2905 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2906 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2907 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2908 int UNUSED written
= 0;
2909 IADDR UNUSED pc
= abuf
->addr
;
2910 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2914 tmp_tmp
= ZEXTQISI (({ SI tmp_addr
;
2917 tmp_postinc
= FLD (f_memmode
);
2918 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2919 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2920 ; if (NEBI (tmp_postinc
, 0)) {
2922 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2923 tmp_addr
= ADDSI (tmp_addr
, 1);
2926 SI opval
= tmp_addr
;
2927 SET_H_GR (FLD (f_operand1
), opval
);
2928 written
|= (1 << 8);
2929 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2934 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2937 SET_H_GR (FLD (f_operand1
), opval
);
2938 written
|= (1 << 8);
2939 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2944 SET_H_GR (FLD (f_operand2
), opval
);
2945 written
|= (1 << 7);
2946 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2951 BI opval
= LTSI (tmp_tmp
, 0);
2952 CPU (h_nbit
) = opval
;
2953 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2956 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2957 CPU (h_zbit
) = opval
;
2958 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2960 SET_H_CBIT_MOVE (0);
2961 SET_H_VBIT_MOVE (0);
2965 CPU (h_xbit
) = opval
;
2966 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2970 SET_H_INSN_PREFIXED_P (opval
);
2971 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2977 abuf
->written
= written
;
2982 CASE (sem
, INSN_MOVU_M_W_M
) : /* movu-m.w [${Rs}${inc}],${Rd} */
2984 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2985 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2986 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2987 int UNUSED written
= 0;
2988 IADDR UNUSED pc
= abuf
->addr
;
2989 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2993 tmp_tmp
= ZEXTHISI (({ SI tmp_addr
;
2996 tmp_postinc
= FLD (f_memmode
);
2997 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2998 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2999 ; if (NEBI (tmp_postinc
, 0)) {
3001 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3002 tmp_addr
= ADDSI (tmp_addr
, 2);
3005 SI opval
= tmp_addr
;
3006 SET_H_GR (FLD (f_operand1
), opval
);
3007 written
|= (1 << 8);
3008 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3013 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3016 SET_H_GR (FLD (f_operand1
), opval
);
3017 written
|= (1 << 8);
3018 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3023 SET_H_GR (FLD (f_operand2
), opval
);
3024 written
|= (1 << 7);
3025 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3030 BI opval
= LTSI (tmp_tmp
, 0);
3031 CPU (h_nbit
) = opval
;
3032 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3035 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3036 CPU (h_zbit
) = opval
;
3037 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3039 SET_H_CBIT_MOVE (0);
3040 SET_H_VBIT_MOVE (0);
3044 CPU (h_xbit
) = opval
;
3045 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3049 SET_H_INSN_PREFIXED_P (opval
);
3050 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3056 abuf
->written
= written
;
3061 CASE (sem
, INSN_MOVE_R_SPRV32
) : /* move ${Rs},${Pd} */
3063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3065 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3066 int UNUSED written
= 0;
3067 IADDR UNUSED pc
= abuf
->addr
;
3068 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3073 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
3074 tmp_rno
= FLD (f_operand2
);
3075 if (ORIF (ORIF (EQSI (tmp_rno
, 0), EQSI (tmp_rno
, 1)), ORIF (EQSI (tmp_rno
, 4), EQSI (tmp_rno
, 8)))) {
3076 cgen_rtx_error (current_cpu
, "move-r-spr: trying to set a read-only special register");
3081 SET_H_SR (FLD (f_operand2
), opval
);
3082 written
|= (1 << 2);
3083 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3089 CPU (h_xbit
) = opval
;
3090 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3094 SET_H_INSN_PREFIXED_P (opval
);
3095 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3100 abuf
->written
= written
;
3105 CASE (sem
, INSN_MOVE_SPR_RV32
) : /* move ${Ps},${Rd-sfield} */
3107 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3108 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3109 #define FLD(f) abuf->fields.sfmt_mcp.f
3110 int UNUSED written
= 0;
3111 IADDR UNUSED pc
= abuf
->addr
;
3112 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3118 tmp_prno
= FLD (f_operand2
);
3119 tmp_newval
= GET_H_SR (FLD (f_operand2
));
3120 if (EQSI (tmp_prno
, 2)) {
3123 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3125 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3126 SET_H_GR (FLD (f_operand1
), opval
);
3127 written
|= (1 << 4);
3128 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3132 else if (EQSI (tmp_prno
, 3)) {
3135 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3137 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3138 SET_H_GR (FLD (f_operand1
), opval
);
3139 written
|= (1 << 4);
3140 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3144 else if (EQSI (tmp_prno
, 5)) {
3146 SI opval
= tmp_newval
;
3147 SET_H_GR (FLD (f_operand1
), opval
);
3148 written
|= (1 << 4);
3149 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3152 else if (EQSI (tmp_prno
, 6)) {
3154 SI opval
= tmp_newval
;
3155 SET_H_GR (FLD (f_operand1
), opval
);
3156 written
|= (1 << 4);
3157 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3160 else if (EQSI (tmp_prno
, 7)) {
3162 SI opval
= tmp_newval
;
3163 SET_H_GR (FLD (f_operand1
), opval
);
3164 written
|= (1 << 4);
3165 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3168 else if (EQSI (tmp_prno
, 9)) {
3170 SI opval
= tmp_newval
;
3171 SET_H_GR (FLD (f_operand1
), opval
);
3172 written
|= (1 << 4);
3173 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3176 else if (EQSI (tmp_prno
, 10)) {
3178 SI opval
= tmp_newval
;
3179 SET_H_GR (FLD (f_operand1
), opval
);
3180 written
|= (1 << 4);
3181 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3184 else if (EQSI (tmp_prno
, 11)) {
3186 SI opval
= tmp_newval
;
3187 SET_H_GR (FLD (f_operand1
), opval
);
3188 written
|= (1 << 4);
3189 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3192 else if (EQSI (tmp_prno
, 12)) {
3194 SI opval
= tmp_newval
;
3195 SET_H_GR (FLD (f_operand1
), opval
);
3196 written
|= (1 << 4);
3197 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3200 else if (EQSI (tmp_prno
, 13)) {
3202 SI opval
= tmp_newval
;
3203 SET_H_GR (FLD (f_operand1
), opval
);
3204 written
|= (1 << 4);
3205 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3208 else if (EQSI (tmp_prno
, 14)) {
3210 SI opval
= tmp_newval
;
3211 SET_H_GR (FLD (f_operand1
), opval
);
3212 written
|= (1 << 4);
3213 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3216 else if (EQSI (tmp_prno
, 15)) {
3218 SI opval
= tmp_newval
;
3219 SET_H_GR (FLD (f_operand1
), opval
);
3220 written
|= (1 << 4);
3221 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3224 else if (EQSI (tmp_prno
, 0)) {
3227 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3229 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3230 SET_H_GR (FLD (f_operand1
), opval
);
3231 written
|= (1 << 4);
3232 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3236 else if (EQSI (tmp_prno
, 1)) {
3239 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3241 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3242 SET_H_GR (FLD (f_operand1
), opval
);
3243 written
|= (1 << 4);
3244 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3248 else if (EQSI (tmp_prno
, 4)) {
3251 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3253 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3254 SET_H_GR (FLD (f_operand1
), opval
);
3255 written
|= (1 << 4);
3256 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3260 else if (EQSI (tmp_prno
, 8)) {
3262 SI opval
= tmp_newval
;
3263 SET_H_GR (FLD (f_operand1
), opval
);
3264 written
|= (1 << 4);
3265 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3269 cgen_rtx_error (current_cpu
, "move-spr-r from unimplemented register");
3274 CPU (h_xbit
) = opval
;
3275 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3279 SET_H_INSN_PREFIXED_P (opval
);
3280 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3285 abuf
->written
= written
;
3290 CASE (sem
, INSN_MOVE_M_SPRV32
) : /* move [${Rs}${inc}],${Pd} */
3292 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3293 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3294 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3295 int UNUSED written
= 0;
3296 IADDR UNUSED pc
= abuf
->addr
;
3297 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3302 tmp_rno
= FLD (f_operand2
);
3303 if (EQSI (tmp_rno
, 2)) {
3304 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3307 tmp_postinc
= FLD (f_memmode
);
3308 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3309 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3310 ; if (NEBI (tmp_postinc
, 0)) {
3312 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3313 tmp_addr
= ADDSI (tmp_addr
, 1);
3316 SI opval
= tmp_addr
;
3317 SET_H_GR (FLD (f_operand1
), opval
);
3318 written
|= (1 << 8);
3319 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3325 else if (EQSI (tmp_rno
, 3)) {
3326 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3329 tmp_postinc
= FLD (f_memmode
);
3330 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3331 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3332 ; if (NEBI (tmp_postinc
, 0)) {
3334 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3335 tmp_addr
= ADDSI (tmp_addr
, 1);
3338 SI opval
= tmp_addr
;
3339 SET_H_GR (FLD (f_operand1
), opval
);
3340 written
|= (1 << 8);
3341 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3347 else if (EQSI (tmp_rno
, 5)) {
3348 tmp_newval
= ({ SI tmp_addr
;
3351 tmp_postinc
= FLD (f_memmode
);
3352 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3353 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3354 ; if (NEBI (tmp_postinc
, 0)) {
3356 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3357 tmp_addr
= ADDSI (tmp_addr
, 4);
3360 SI opval
= tmp_addr
;
3361 SET_H_GR (FLD (f_operand1
), opval
);
3362 written
|= (1 << 8);
3363 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3369 else if (EQSI (tmp_rno
, 6)) {
3370 tmp_newval
= ({ SI tmp_addr
;
3373 tmp_postinc
= FLD (f_memmode
);
3374 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3375 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3376 ; if (NEBI (tmp_postinc
, 0)) {
3378 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3379 tmp_addr
= ADDSI (tmp_addr
, 4);
3382 SI opval
= tmp_addr
;
3383 SET_H_GR (FLD (f_operand1
), opval
);
3384 written
|= (1 << 8);
3385 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3391 else if (EQSI (tmp_rno
, 7)) {
3392 tmp_newval
= ({ SI tmp_addr
;
3395 tmp_postinc
= FLD (f_memmode
);
3396 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3397 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3398 ; if (NEBI (tmp_postinc
, 0)) {
3400 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3401 tmp_addr
= ADDSI (tmp_addr
, 4);
3404 SI opval
= tmp_addr
;
3405 SET_H_GR (FLD (f_operand1
), opval
);
3406 written
|= (1 << 8);
3407 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3413 else if (EQSI (tmp_rno
, 9)) {
3414 tmp_newval
= ({ SI tmp_addr
;
3417 tmp_postinc
= FLD (f_memmode
);
3418 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3419 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3420 ; if (NEBI (tmp_postinc
, 0)) {
3422 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3423 tmp_addr
= ADDSI (tmp_addr
, 4);
3426 SI opval
= tmp_addr
;
3427 SET_H_GR (FLD (f_operand1
), opval
);
3428 written
|= (1 << 8);
3429 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3435 else if (EQSI (tmp_rno
, 10)) {
3436 tmp_newval
= ({ SI tmp_addr
;
3439 tmp_postinc
= FLD (f_memmode
);
3440 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3441 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3442 ; if (NEBI (tmp_postinc
, 0)) {
3444 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3445 tmp_addr
= ADDSI (tmp_addr
, 4);
3448 SI opval
= tmp_addr
;
3449 SET_H_GR (FLD (f_operand1
), opval
);
3450 written
|= (1 << 8);
3451 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3457 else if (EQSI (tmp_rno
, 11)) {
3458 tmp_newval
= ({ SI tmp_addr
;
3461 tmp_postinc
= FLD (f_memmode
);
3462 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3463 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3464 ; if (NEBI (tmp_postinc
, 0)) {
3466 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3467 tmp_addr
= ADDSI (tmp_addr
, 4);
3470 SI opval
= tmp_addr
;
3471 SET_H_GR (FLD (f_operand1
), opval
);
3472 written
|= (1 << 8);
3473 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3479 else if (EQSI (tmp_rno
, 12)) {
3480 tmp_newval
= ({ SI tmp_addr
;
3483 tmp_postinc
= FLD (f_memmode
);
3484 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3485 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3486 ; if (NEBI (tmp_postinc
, 0)) {
3488 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3489 tmp_addr
= ADDSI (tmp_addr
, 4);
3492 SI opval
= tmp_addr
;
3493 SET_H_GR (FLD (f_operand1
), opval
);
3494 written
|= (1 << 8);
3495 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3501 else if (EQSI (tmp_rno
, 13)) {
3502 tmp_newval
= ({ SI tmp_addr
;
3505 tmp_postinc
= FLD (f_memmode
);
3506 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3507 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3508 ; if (NEBI (tmp_postinc
, 0)) {
3510 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3511 tmp_addr
= ADDSI (tmp_addr
, 4);
3514 SI opval
= tmp_addr
;
3515 SET_H_GR (FLD (f_operand1
), opval
);
3516 written
|= (1 << 8);
3517 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3523 else if (EQSI (tmp_rno
, 14)) {
3524 tmp_newval
= ({ SI tmp_addr
;
3527 tmp_postinc
= FLD (f_memmode
);
3528 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3529 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3530 ; if (NEBI (tmp_postinc
, 0)) {
3532 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3533 tmp_addr
= ADDSI (tmp_addr
, 4);
3536 SI opval
= tmp_addr
;
3537 SET_H_GR (FLD (f_operand1
), opval
);
3538 written
|= (1 << 8);
3539 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3545 else if (EQSI (tmp_rno
, 15)) {
3546 tmp_newval
= ({ SI tmp_addr
;
3549 tmp_postinc
= FLD (f_memmode
);
3550 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3551 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3552 ; if (NEBI (tmp_postinc
, 0)) {
3554 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3555 tmp_addr
= ADDSI (tmp_addr
, 4);
3558 SI opval
= tmp_addr
;
3559 SET_H_GR (FLD (f_operand1
), opval
);
3560 written
|= (1 << 8);
3561 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3568 cgen_rtx_error (current_cpu
, "Trying to set unimplemented special register");
3571 SI opval
= tmp_newval
;
3572 SET_H_SR (FLD (f_operand2
), opval
);
3573 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3578 CPU (h_xbit
) = opval
;
3579 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3583 SET_H_INSN_PREFIXED_P (opval
);
3584 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3589 abuf
->written
= written
;
3594 CASE (sem
, INSN_MOVE_C_SPRV32_P2
) : /* move ${const32},${Pd} */
3596 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3597 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3598 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3599 int UNUSED written
= 0;
3600 IADDR UNUSED pc
= abuf
->addr
;
3601 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3605 SI opval
= FLD (f_indir_pc__dword
);
3606 SET_H_SR (FLD (f_operand2
), opval
);
3607 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3612 CPU (h_xbit
) = opval
;
3613 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3617 SET_H_INSN_PREFIXED_P (opval
);
3618 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3627 CASE (sem
, INSN_MOVE_C_SPRV32_P3
) : /* move ${const32},${Pd} */
3629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3631 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3632 int UNUSED written
= 0;
3633 IADDR UNUSED pc
= abuf
->addr
;
3634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3638 SI opval
= FLD (f_indir_pc__dword
);
3639 SET_H_SR (FLD (f_operand2
), opval
);
3640 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3645 CPU (h_xbit
) = opval
;
3646 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3650 SET_H_INSN_PREFIXED_P (opval
);
3651 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3660 CASE (sem
, INSN_MOVE_C_SPRV32_P5
) : /* move ${const32},${Pd} */
3662 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3663 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3664 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3665 int UNUSED written
= 0;
3666 IADDR UNUSED pc
= abuf
->addr
;
3667 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3671 SI opval
= FLD (f_indir_pc__dword
);
3672 SET_H_SR (FLD (f_operand2
), opval
);
3673 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3678 CPU (h_xbit
) = opval
;
3679 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3683 SET_H_INSN_PREFIXED_P (opval
);
3684 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3693 CASE (sem
, INSN_MOVE_C_SPRV32_P6
) : /* move ${const32},${Pd} */
3695 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3696 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3697 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3698 int UNUSED written
= 0;
3699 IADDR UNUSED pc
= abuf
->addr
;
3700 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3704 SI opval
= FLD (f_indir_pc__dword
);
3705 SET_H_SR (FLD (f_operand2
), opval
);
3706 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3711 CPU (h_xbit
) = opval
;
3712 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3716 SET_H_INSN_PREFIXED_P (opval
);
3717 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3726 CASE (sem
, INSN_MOVE_C_SPRV32_P7
) : /* move ${const32},${Pd} */
3728 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3730 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3731 int UNUSED written
= 0;
3732 IADDR UNUSED pc
= abuf
->addr
;
3733 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3737 SI opval
= FLD (f_indir_pc__dword
);
3738 SET_H_SR (FLD (f_operand2
), opval
);
3739 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3744 CPU (h_xbit
) = opval
;
3745 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3749 SET_H_INSN_PREFIXED_P (opval
);
3750 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3759 CASE (sem
, INSN_MOVE_C_SPRV32_P9
) : /* move ${const32},${Pd} */
3761 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3762 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3763 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3764 int UNUSED written
= 0;
3765 IADDR UNUSED pc
= abuf
->addr
;
3766 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3770 SI opval
= FLD (f_indir_pc__dword
);
3771 SET_H_SR (FLD (f_operand2
), opval
);
3772 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3777 CPU (h_xbit
) = opval
;
3778 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3782 SET_H_INSN_PREFIXED_P (opval
);
3783 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3792 CASE (sem
, INSN_MOVE_C_SPRV32_P10
) : /* move ${const32},${Pd} */
3794 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3795 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3796 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3797 int UNUSED written
= 0;
3798 IADDR UNUSED pc
= abuf
->addr
;
3799 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3803 SI opval
= FLD (f_indir_pc__dword
);
3804 SET_H_SR (FLD (f_operand2
), opval
);
3805 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3810 CPU (h_xbit
) = opval
;
3811 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3815 SET_H_INSN_PREFIXED_P (opval
);
3816 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3825 CASE (sem
, INSN_MOVE_C_SPRV32_P11
) : /* move ${const32},${Pd} */
3827 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3828 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3829 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3830 int UNUSED written
= 0;
3831 IADDR UNUSED pc
= abuf
->addr
;
3832 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3836 SI opval
= FLD (f_indir_pc__dword
);
3837 SET_H_SR (FLD (f_operand2
), opval
);
3838 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3843 CPU (h_xbit
) = opval
;
3844 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3848 SET_H_INSN_PREFIXED_P (opval
);
3849 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3858 CASE (sem
, INSN_MOVE_C_SPRV32_P12
) : /* move ${const32},${Pd} */
3860 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3861 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3862 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3863 int UNUSED written
= 0;
3864 IADDR UNUSED pc
= abuf
->addr
;
3865 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3869 SI opval
= FLD (f_indir_pc__dword
);
3870 SET_H_SR (FLD (f_operand2
), opval
);
3871 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3876 CPU (h_xbit
) = opval
;
3877 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3881 SET_H_INSN_PREFIXED_P (opval
);
3882 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3891 CASE (sem
, INSN_MOVE_C_SPRV32_P13
) : /* move ${const32},${Pd} */
3893 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3894 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3895 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3896 int UNUSED written
= 0;
3897 IADDR UNUSED pc
= abuf
->addr
;
3898 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3902 SI opval
= FLD (f_indir_pc__dword
);
3903 SET_H_SR (FLD (f_operand2
), opval
);
3904 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3909 CPU (h_xbit
) = opval
;
3910 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3914 SET_H_INSN_PREFIXED_P (opval
);
3915 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3924 CASE (sem
, INSN_MOVE_C_SPRV32_P14
) : /* move ${const32},${Pd} */
3926 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3927 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3928 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3929 int UNUSED written
= 0;
3930 IADDR UNUSED pc
= abuf
->addr
;
3931 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3935 SI opval
= FLD (f_indir_pc__dword
);
3936 SET_H_SR (FLD (f_operand2
), opval
);
3937 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3942 CPU (h_xbit
) = opval
;
3943 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3947 SET_H_INSN_PREFIXED_P (opval
);
3948 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3957 CASE (sem
, INSN_MOVE_C_SPRV32_P15
) : /* move ${const32},${Pd} */
3959 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3960 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3961 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3962 int UNUSED written
= 0;
3963 IADDR UNUSED pc
= abuf
->addr
;
3964 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3968 SI opval
= FLD (f_indir_pc__dword
);
3969 SET_H_SR (FLD (f_operand2
), opval
);
3970 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3975 CPU (h_xbit
) = opval
;
3976 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3980 SET_H_INSN_PREFIXED_P (opval
);
3981 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3990 CASE (sem
, INSN_MOVE_SPR_MV32
) : /* move ${Ps},[${Rd-sfield}${inc}] */
3992 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3993 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3994 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3995 int UNUSED written
= 0;
3996 IADDR UNUSED pc
= abuf
->addr
;
3997 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4001 tmp_rno
= FLD (f_operand2
);
4002 if (EQSI (tmp_rno
, 2)) {
4006 tmp_postinc
= FLD (f_memmode
);
4007 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4008 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4009 if (EQBI (CPU (h_pbit
), 0)) {
4012 QI opval
= GET_H_SR (FLD (f_operand2
));
4013 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4014 written
|= (1 << 12);
4015 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4018 BI opval
= CPU (h_pbit
);
4019 CPU (h_cbit
) = opval
;
4020 written
|= (1 << 10);
4021 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4027 CPU (h_cbit
) = opval
;
4028 written
|= (1 << 10);
4029 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4034 QI opval
= GET_H_SR (FLD (f_operand2
));
4035 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4036 written
|= (1 << 12);
4037 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4040 if (NEBI (tmp_postinc
, 0)) {
4042 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4043 tmp_addr
= ADDSI (tmp_addr
, 1);
4046 SI opval
= tmp_addr
;
4047 SET_H_GR (FLD (f_operand1
), opval
);
4048 written
|= (1 << 9);
4049 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4055 else if (EQSI (tmp_rno
, 3)) {
4059 tmp_postinc
= FLD (f_memmode
);
4060 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4061 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4062 if (EQBI (CPU (h_pbit
), 0)) {
4065 QI opval
= GET_H_SR (FLD (f_operand2
));
4066 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4067 written
|= (1 << 12);
4068 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4071 BI opval
= CPU (h_pbit
);
4072 CPU (h_cbit
) = opval
;
4073 written
|= (1 << 10);
4074 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4080 CPU (h_cbit
) = opval
;
4081 written
|= (1 << 10);
4082 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4087 QI opval
= GET_H_SR (FLD (f_operand2
));
4088 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4089 written
|= (1 << 12);
4090 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4093 if (NEBI (tmp_postinc
, 0)) {
4095 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4096 tmp_addr
= ADDSI (tmp_addr
, 1);
4099 SI opval
= tmp_addr
;
4100 SET_H_GR (FLD (f_operand1
), opval
);
4101 written
|= (1 << 9);
4102 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4108 else if (EQSI (tmp_rno
, 5)) {
4112 tmp_postinc
= FLD (f_memmode
);
4113 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4114 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4115 if (EQBI (CPU (h_pbit
), 0)) {
4118 SI opval
= GET_H_SR (FLD (f_operand2
));
4119 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4120 written
|= (1 << 13);
4121 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4124 BI opval
= CPU (h_pbit
);
4125 CPU (h_cbit
) = opval
;
4126 written
|= (1 << 10);
4127 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4133 CPU (h_cbit
) = opval
;
4134 written
|= (1 << 10);
4135 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4140 SI opval
= GET_H_SR (FLD (f_operand2
));
4141 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4142 written
|= (1 << 13);
4143 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4146 if (NEBI (tmp_postinc
, 0)) {
4148 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4149 tmp_addr
= ADDSI (tmp_addr
, 4);
4152 SI opval
= tmp_addr
;
4153 SET_H_GR (FLD (f_operand1
), opval
);
4154 written
|= (1 << 9);
4155 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4161 else if (EQSI (tmp_rno
, 6)) {
4165 tmp_postinc
= FLD (f_memmode
);
4166 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4167 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4168 if (EQBI (CPU (h_pbit
), 0)) {
4171 SI opval
= GET_H_SR (FLD (f_operand2
));
4172 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4173 written
|= (1 << 13);
4174 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4177 BI opval
= CPU (h_pbit
);
4178 CPU (h_cbit
) = opval
;
4179 written
|= (1 << 10);
4180 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4186 CPU (h_cbit
) = opval
;
4187 written
|= (1 << 10);
4188 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4193 SI opval
= GET_H_SR (FLD (f_operand2
));
4194 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4195 written
|= (1 << 13);
4196 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4199 if (NEBI (tmp_postinc
, 0)) {
4201 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4202 tmp_addr
= ADDSI (tmp_addr
, 4);
4205 SI opval
= tmp_addr
;
4206 SET_H_GR (FLD (f_operand1
), opval
);
4207 written
|= (1 << 9);
4208 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4214 else if (EQSI (tmp_rno
, 7)) {
4218 tmp_postinc
= FLD (f_memmode
);
4219 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4220 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4221 if (EQBI (CPU (h_pbit
), 0)) {
4224 SI opval
= GET_H_SR (FLD (f_operand2
));
4225 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4226 written
|= (1 << 13);
4227 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4230 BI opval
= CPU (h_pbit
);
4231 CPU (h_cbit
) = opval
;
4232 written
|= (1 << 10);
4233 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4239 CPU (h_cbit
) = opval
;
4240 written
|= (1 << 10);
4241 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4246 SI opval
= GET_H_SR (FLD (f_operand2
));
4247 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4248 written
|= (1 << 13);
4249 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4252 if (NEBI (tmp_postinc
, 0)) {
4254 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4255 tmp_addr
= ADDSI (tmp_addr
, 4);
4258 SI opval
= tmp_addr
;
4259 SET_H_GR (FLD (f_operand1
), opval
);
4260 written
|= (1 << 9);
4261 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4267 else if (EQSI (tmp_rno
, 9)) {
4271 tmp_postinc
= FLD (f_memmode
);
4272 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4273 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4274 if (EQBI (CPU (h_pbit
), 0)) {
4277 SI opval
= GET_H_SR (FLD (f_operand2
));
4278 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4279 written
|= (1 << 13);
4280 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4283 BI opval
= CPU (h_pbit
);
4284 CPU (h_cbit
) = opval
;
4285 written
|= (1 << 10);
4286 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4292 CPU (h_cbit
) = opval
;
4293 written
|= (1 << 10);
4294 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4299 SI opval
= GET_H_SR (FLD (f_operand2
));
4300 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4301 written
|= (1 << 13);
4302 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4305 if (NEBI (tmp_postinc
, 0)) {
4307 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4308 tmp_addr
= ADDSI (tmp_addr
, 4);
4311 SI opval
= tmp_addr
;
4312 SET_H_GR (FLD (f_operand1
), opval
);
4313 written
|= (1 << 9);
4314 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4320 else if (EQSI (tmp_rno
, 10)) {
4324 tmp_postinc
= FLD (f_memmode
);
4325 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4326 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4327 if (EQBI (CPU (h_pbit
), 0)) {
4330 SI opval
= GET_H_SR (FLD (f_operand2
));
4331 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4332 written
|= (1 << 13);
4333 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4336 BI opval
= CPU (h_pbit
);
4337 CPU (h_cbit
) = opval
;
4338 written
|= (1 << 10);
4339 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4345 CPU (h_cbit
) = opval
;
4346 written
|= (1 << 10);
4347 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4352 SI opval
= GET_H_SR (FLD (f_operand2
));
4353 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4354 written
|= (1 << 13);
4355 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4358 if (NEBI (tmp_postinc
, 0)) {
4360 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4361 tmp_addr
= ADDSI (tmp_addr
, 4);
4364 SI opval
= tmp_addr
;
4365 SET_H_GR (FLD (f_operand1
), opval
);
4366 written
|= (1 << 9);
4367 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4373 else if (EQSI (tmp_rno
, 11)) {
4377 tmp_postinc
= FLD (f_memmode
);
4378 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4379 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4380 if (EQBI (CPU (h_pbit
), 0)) {
4383 SI opval
= GET_H_SR (FLD (f_operand2
));
4384 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4385 written
|= (1 << 13);
4386 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4389 BI opval
= CPU (h_pbit
);
4390 CPU (h_cbit
) = opval
;
4391 written
|= (1 << 10);
4392 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4398 CPU (h_cbit
) = opval
;
4399 written
|= (1 << 10);
4400 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4405 SI opval
= GET_H_SR (FLD (f_operand2
));
4406 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4407 written
|= (1 << 13);
4408 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4411 if (NEBI (tmp_postinc
, 0)) {
4413 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4414 tmp_addr
= ADDSI (tmp_addr
, 4);
4417 SI opval
= tmp_addr
;
4418 SET_H_GR (FLD (f_operand1
), opval
);
4419 written
|= (1 << 9);
4420 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4426 else if (EQSI (tmp_rno
, 12)) {
4430 tmp_postinc
= FLD (f_memmode
);
4431 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4432 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4433 if (EQBI (CPU (h_pbit
), 0)) {
4436 SI opval
= GET_H_SR (FLD (f_operand2
));
4437 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4438 written
|= (1 << 13);
4439 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4442 BI opval
= CPU (h_pbit
);
4443 CPU (h_cbit
) = opval
;
4444 written
|= (1 << 10);
4445 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4451 CPU (h_cbit
) = opval
;
4452 written
|= (1 << 10);
4453 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4458 SI opval
= GET_H_SR (FLD (f_operand2
));
4459 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4460 written
|= (1 << 13);
4461 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4464 if (NEBI (tmp_postinc
, 0)) {
4466 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4467 tmp_addr
= ADDSI (tmp_addr
, 4);
4470 SI opval
= tmp_addr
;
4471 SET_H_GR (FLD (f_operand1
), opval
);
4472 written
|= (1 << 9);
4473 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4479 else if (EQSI (tmp_rno
, 13)) {
4483 tmp_postinc
= FLD (f_memmode
);
4484 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4485 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4486 if (EQBI (CPU (h_pbit
), 0)) {
4489 SI opval
= GET_H_SR (FLD (f_operand2
));
4490 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4491 written
|= (1 << 13);
4492 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4495 BI opval
= CPU (h_pbit
);
4496 CPU (h_cbit
) = opval
;
4497 written
|= (1 << 10);
4498 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4504 CPU (h_cbit
) = opval
;
4505 written
|= (1 << 10);
4506 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4511 SI opval
= GET_H_SR (FLD (f_operand2
));
4512 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4513 written
|= (1 << 13);
4514 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4517 if (NEBI (tmp_postinc
, 0)) {
4519 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4520 tmp_addr
= ADDSI (tmp_addr
, 4);
4523 SI opval
= tmp_addr
;
4524 SET_H_GR (FLD (f_operand1
), opval
);
4525 written
|= (1 << 9);
4526 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4532 else if (EQSI (tmp_rno
, 14)) {
4536 tmp_postinc
= FLD (f_memmode
);
4537 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4538 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4539 if (EQBI (CPU (h_pbit
), 0)) {
4542 SI opval
= GET_H_SR (FLD (f_operand2
));
4543 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4544 written
|= (1 << 13);
4545 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4548 BI opval
= CPU (h_pbit
);
4549 CPU (h_cbit
) = opval
;
4550 written
|= (1 << 10);
4551 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4557 CPU (h_cbit
) = opval
;
4558 written
|= (1 << 10);
4559 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4564 SI opval
= GET_H_SR (FLD (f_operand2
));
4565 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4566 written
|= (1 << 13);
4567 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4570 if (NEBI (tmp_postinc
, 0)) {
4572 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4573 tmp_addr
= ADDSI (tmp_addr
, 4);
4576 SI opval
= tmp_addr
;
4577 SET_H_GR (FLD (f_operand1
), opval
);
4578 written
|= (1 << 9);
4579 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4585 else if (EQSI (tmp_rno
, 15)) {
4589 tmp_postinc
= FLD (f_memmode
);
4590 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4591 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4592 if (EQBI (CPU (h_pbit
), 0)) {
4595 SI opval
= GET_H_SR (FLD (f_operand2
));
4596 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4597 written
|= (1 << 13);
4598 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4601 BI opval
= CPU (h_pbit
);
4602 CPU (h_cbit
) = opval
;
4603 written
|= (1 << 10);
4604 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4610 CPU (h_cbit
) = opval
;
4611 written
|= (1 << 10);
4612 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4617 SI opval
= GET_H_SR (FLD (f_operand2
));
4618 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4619 written
|= (1 << 13);
4620 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4623 if (NEBI (tmp_postinc
, 0)) {
4625 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4626 tmp_addr
= ADDSI (tmp_addr
, 4);
4629 SI opval
= tmp_addr
;
4630 SET_H_GR (FLD (f_operand1
), opval
);
4631 written
|= (1 << 9);
4632 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4638 else if (EQSI (tmp_rno
, 0)) {
4642 tmp_postinc
= FLD (f_memmode
);
4643 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4644 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4645 if (EQBI (CPU (h_pbit
), 0)) {
4648 QI opval
= GET_H_SR (FLD (f_operand2
));
4649 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4650 written
|= (1 << 12);
4651 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4654 BI opval
= CPU (h_pbit
);
4655 CPU (h_cbit
) = opval
;
4656 written
|= (1 << 10);
4657 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4663 CPU (h_cbit
) = opval
;
4664 written
|= (1 << 10);
4665 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4670 QI opval
= GET_H_SR (FLD (f_operand2
));
4671 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4672 written
|= (1 << 12);
4673 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4676 if (NEBI (tmp_postinc
, 0)) {
4678 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4679 tmp_addr
= ADDSI (tmp_addr
, 1);
4682 SI opval
= tmp_addr
;
4683 SET_H_GR (FLD (f_operand1
), opval
);
4684 written
|= (1 << 9);
4685 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4691 else if (EQSI (tmp_rno
, 1)) {
4695 tmp_postinc
= FLD (f_memmode
);
4696 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4697 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4698 if (EQBI (CPU (h_pbit
), 0)) {
4701 QI opval
= GET_H_SR (FLD (f_operand2
));
4702 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4703 written
|= (1 << 12);
4704 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4707 BI opval
= CPU (h_pbit
);
4708 CPU (h_cbit
) = opval
;
4709 written
|= (1 << 10);
4710 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4716 CPU (h_cbit
) = opval
;
4717 written
|= (1 << 10);
4718 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4723 QI opval
= GET_H_SR (FLD (f_operand2
));
4724 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4725 written
|= (1 << 12);
4726 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4729 if (NEBI (tmp_postinc
, 0)) {
4731 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4732 tmp_addr
= ADDSI (tmp_addr
, 1);
4735 SI opval
= tmp_addr
;
4736 SET_H_GR (FLD (f_operand1
), opval
);
4737 written
|= (1 << 9);
4738 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4744 else if (EQSI (tmp_rno
, 4)) {
4748 tmp_postinc
= FLD (f_memmode
);
4749 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4750 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4751 if (EQBI (CPU (h_pbit
), 0)) {
4754 HI opval
= GET_H_SR (FLD (f_operand2
));
4755 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4756 written
|= (1 << 11);
4757 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4760 BI opval
= CPU (h_pbit
);
4761 CPU (h_cbit
) = opval
;
4762 written
|= (1 << 10);
4763 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4769 CPU (h_cbit
) = opval
;
4770 written
|= (1 << 10);
4771 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4776 HI opval
= GET_H_SR (FLD (f_operand2
));
4777 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4778 written
|= (1 << 11);
4779 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4782 if (NEBI (tmp_postinc
, 0)) {
4784 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4785 tmp_addr
= ADDSI (tmp_addr
, 2);
4788 SI opval
= tmp_addr
;
4789 SET_H_GR (FLD (f_operand1
), opval
);
4790 written
|= (1 << 9);
4791 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4797 else if (EQSI (tmp_rno
, 8)) {
4801 tmp_postinc
= FLD (f_memmode
);
4802 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4803 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4804 if (EQBI (CPU (h_pbit
), 0)) {
4807 SI opval
= GET_H_SR (FLD (f_operand2
));
4808 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4809 written
|= (1 << 13);
4810 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4813 BI opval
= CPU (h_pbit
);
4814 CPU (h_cbit
) = opval
;
4815 written
|= (1 << 10);
4816 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4822 CPU (h_cbit
) = opval
;
4823 written
|= (1 << 10);
4824 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4829 SI opval
= GET_H_SR (FLD (f_operand2
));
4830 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4831 written
|= (1 << 13);
4832 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4835 if (NEBI (tmp_postinc
, 0)) {
4837 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4838 tmp_addr
= ADDSI (tmp_addr
, 4);
4841 SI opval
= tmp_addr
;
4842 SET_H_GR (FLD (f_operand1
), opval
);
4843 written
|= (1 << 9);
4844 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4851 cgen_rtx_error (current_cpu
, "write from unimplemented special register");
4856 CPU (h_xbit
) = opval
;
4857 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4861 SET_H_INSN_PREFIXED_P (opval
);
4862 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4867 abuf
->written
= written
;
4872 CASE (sem
, INSN_MOVE_SS_R
) : /* move ${Ss},${Rd-sfield} */
4874 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4875 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4876 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4877 int UNUSED written
= 0;
4878 IADDR UNUSED pc
= abuf
->addr
;
4879 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4883 SI opval
= GET_H_SUPR (FLD (f_operand2
));
4884 SET_H_GR (FLD (f_operand1
), opval
);
4885 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4890 CPU (h_xbit
) = opval
;
4891 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4895 SET_H_INSN_PREFIXED_P (opval
);
4896 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4905 CASE (sem
, INSN_MOVE_R_SS
) : /* move ${Rs},${Sd} */
4907 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4908 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4909 #define FLD(f) abuf->fields.sfmt_mcp.f
4910 int UNUSED written
= 0;
4911 IADDR UNUSED pc
= abuf
->addr
;
4912 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4916 SI opval
= GET_H_GR (FLD (f_operand1
));
4917 SET_H_SUPR (FLD (f_operand2
), opval
);
4918 TRACE_RESULT (current_cpu
, abuf
, "supr", 'x', opval
);
4923 CPU (h_xbit
) = opval
;
4924 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4928 SET_H_INSN_PREFIXED_P (opval
);
4929 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4938 CASE (sem
, INSN_MOVEM_R_M_V32
) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4940 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4941 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4942 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
4943 int UNUSED written
= 0;
4944 IADDR UNUSED pc
= abuf
->addr
;
4945 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4950 tmp_postinc
= FLD (f_memmode
);
4953 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
4955 tmp_addr
= GET_H_GR (FLD (f_operand1
));
4957 if (GESI (FLD (f_operand2
), 0)) {
4960 tmp_tmp
= GET_H_GR (((UINT
) 0));
4963 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4964 written
|= (1 << 21);
4965 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4967 tmp_addr
= ADDSI (tmp_addr
, 4);
4970 if (GESI (FLD (f_operand2
), 1)) {
4973 tmp_tmp
= GET_H_GR (((UINT
) 1));
4976 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4977 written
|= (1 << 21);
4978 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4980 tmp_addr
= ADDSI (tmp_addr
, 4);
4983 if (GESI (FLD (f_operand2
), 2)) {
4986 tmp_tmp
= GET_H_GR (((UINT
) 2));
4989 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4990 written
|= (1 << 21);
4991 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4993 tmp_addr
= ADDSI (tmp_addr
, 4);
4996 if (GESI (FLD (f_operand2
), 3)) {
4999 tmp_tmp
= GET_H_GR (((UINT
) 3));
5002 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5003 written
|= (1 << 21);
5004 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5006 tmp_addr
= ADDSI (tmp_addr
, 4);
5009 if (GESI (FLD (f_operand2
), 4)) {
5012 tmp_tmp
= GET_H_GR (((UINT
) 4));
5015 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5016 written
|= (1 << 21);
5017 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5019 tmp_addr
= ADDSI (tmp_addr
, 4);
5022 if (GESI (FLD (f_operand2
), 5)) {
5025 tmp_tmp
= GET_H_GR (((UINT
) 5));
5028 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5029 written
|= (1 << 21);
5030 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5032 tmp_addr
= ADDSI (tmp_addr
, 4);
5035 if (GESI (FLD (f_operand2
), 6)) {
5038 tmp_tmp
= GET_H_GR (((UINT
) 6));
5041 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5042 written
|= (1 << 21);
5043 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5045 tmp_addr
= ADDSI (tmp_addr
, 4);
5048 if (GESI (FLD (f_operand2
), 7)) {
5051 tmp_tmp
= GET_H_GR (((UINT
) 7));
5054 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5055 written
|= (1 << 21);
5056 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5058 tmp_addr
= ADDSI (tmp_addr
, 4);
5061 if (GESI (FLD (f_operand2
), 8)) {
5064 tmp_tmp
= GET_H_GR (((UINT
) 8));
5067 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5068 written
|= (1 << 21);
5069 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5071 tmp_addr
= ADDSI (tmp_addr
, 4);
5074 if (GESI (FLD (f_operand2
), 9)) {
5077 tmp_tmp
= GET_H_GR (((UINT
) 9));
5080 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5081 written
|= (1 << 21);
5082 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5084 tmp_addr
= ADDSI (tmp_addr
, 4);
5087 if (GESI (FLD (f_operand2
), 10)) {
5090 tmp_tmp
= GET_H_GR (((UINT
) 10));
5093 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5094 written
|= (1 << 21);
5095 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5097 tmp_addr
= ADDSI (tmp_addr
, 4);
5100 if (GESI (FLD (f_operand2
), 11)) {
5103 tmp_tmp
= GET_H_GR (((UINT
) 11));
5106 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5107 written
|= (1 << 21);
5108 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5110 tmp_addr
= ADDSI (tmp_addr
, 4);
5113 if (GESI (FLD (f_operand2
), 12)) {
5116 tmp_tmp
= GET_H_GR (((UINT
) 12));
5119 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5120 written
|= (1 << 21);
5121 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5123 tmp_addr
= ADDSI (tmp_addr
, 4);
5126 if (GESI (FLD (f_operand2
), 13)) {
5129 tmp_tmp
= GET_H_GR (((UINT
) 13));
5132 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5133 written
|= (1 << 21);
5134 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5136 tmp_addr
= ADDSI (tmp_addr
, 4);
5139 if (GESI (FLD (f_operand2
), 14)) {
5142 tmp_tmp
= GET_H_GR (((UINT
) 14));
5145 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5146 written
|= (1 << 21);
5147 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5149 tmp_addr
= ADDSI (tmp_addr
, 4);
5152 if (GESI (FLD (f_operand2
), 15)) {
5155 tmp_tmp
= GET_H_GR (((UINT
) 15));
5158 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5159 written
|= (1 << 21);
5160 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5162 tmp_addr
= ADDSI (tmp_addr
, 4);
5166 if (NEBI (tmp_postinc
, 0)) {
5168 SI opval
= tmp_addr
;
5169 SET_H_GR (FLD (f_operand1
), opval
);
5170 written
|= (1 << 20);
5171 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5177 CPU (h_xbit
) = opval
;
5178 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5182 SET_H_INSN_PREFIXED_P (opval
);
5183 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5188 abuf
->written
= written
;
5193 CASE (sem
, INSN_MOVEM_M_R_V32
) : /* movem [${Rs}${inc}],${Rd} */
5195 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5196 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5197 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5198 int UNUSED written
= 0;
5199 IADDR UNUSED pc
= abuf
->addr
;
5200 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5205 tmp_postinc
= FLD (f_memmode
);
5206 tmp_addr
= GET_H_GR (FLD (f_operand1
));
5209 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
5212 if (GESI (FLD (f_operand2
), 0)) {
5215 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5218 SET_H_GR (((UINT
) 0), opval
);
5219 written
|= (1 << 6);
5220 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5222 tmp_addr
= ADDSI (tmp_addr
, 4);
5225 if (GESI (FLD (f_operand2
), 1)) {
5228 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5231 SET_H_GR (((UINT
) 1), opval
);
5232 written
|= (1 << 7);
5233 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5235 tmp_addr
= ADDSI (tmp_addr
, 4);
5238 if (GESI (FLD (f_operand2
), 2)) {
5241 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5244 SET_H_GR (((UINT
) 2), opval
);
5245 written
|= (1 << 14);
5246 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5248 tmp_addr
= ADDSI (tmp_addr
, 4);
5251 if (GESI (FLD (f_operand2
), 3)) {
5254 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5257 SET_H_GR (((UINT
) 3), opval
);
5258 written
|= (1 << 15);
5259 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5261 tmp_addr
= ADDSI (tmp_addr
, 4);
5264 if (GESI (FLD (f_operand2
), 4)) {
5267 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5270 SET_H_GR (((UINT
) 4), opval
);
5271 written
|= (1 << 16);
5272 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5274 tmp_addr
= ADDSI (tmp_addr
, 4);
5277 if (GESI (FLD (f_operand2
), 5)) {
5280 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5283 SET_H_GR (((UINT
) 5), opval
);
5284 written
|= (1 << 17);
5285 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5287 tmp_addr
= ADDSI (tmp_addr
, 4);
5290 if (GESI (FLD (f_operand2
), 6)) {
5293 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5296 SET_H_GR (((UINT
) 6), opval
);
5297 written
|= (1 << 18);
5298 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5300 tmp_addr
= ADDSI (tmp_addr
, 4);
5303 if (GESI (FLD (f_operand2
), 7)) {
5306 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5309 SET_H_GR (((UINT
) 7), opval
);
5310 written
|= (1 << 19);
5311 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5313 tmp_addr
= ADDSI (tmp_addr
, 4);
5316 if (GESI (FLD (f_operand2
), 8)) {
5319 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5322 SET_H_GR (((UINT
) 8), opval
);
5323 written
|= (1 << 20);
5324 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5326 tmp_addr
= ADDSI (tmp_addr
, 4);
5329 if (GESI (FLD (f_operand2
), 9)) {
5332 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5335 SET_H_GR (((UINT
) 9), opval
);
5336 written
|= (1 << 21);
5337 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5339 tmp_addr
= ADDSI (tmp_addr
, 4);
5342 if (GESI (FLD (f_operand2
), 10)) {
5345 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5348 SET_H_GR (((UINT
) 10), opval
);
5349 written
|= (1 << 8);
5350 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5352 tmp_addr
= ADDSI (tmp_addr
, 4);
5355 if (GESI (FLD (f_operand2
), 11)) {
5358 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5361 SET_H_GR (((UINT
) 11), opval
);
5362 written
|= (1 << 9);
5363 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5365 tmp_addr
= ADDSI (tmp_addr
, 4);
5368 if (GESI (FLD (f_operand2
), 12)) {
5371 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5374 SET_H_GR (((UINT
) 12), opval
);
5375 written
|= (1 << 10);
5376 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5378 tmp_addr
= ADDSI (tmp_addr
, 4);
5381 if (GESI (FLD (f_operand2
), 13)) {
5384 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5387 SET_H_GR (((UINT
) 13), opval
);
5388 written
|= (1 << 11);
5389 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5391 tmp_addr
= ADDSI (tmp_addr
, 4);
5394 if (GESI (FLD (f_operand2
), 14)) {
5397 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5400 SET_H_GR (((UINT
) 14), opval
);
5401 written
|= (1 << 12);
5402 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5404 tmp_addr
= ADDSI (tmp_addr
, 4);
5407 if (GESI (FLD (f_operand2
), 15)) {
5410 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5413 SET_H_GR (((UINT
) 15), opval
);
5414 written
|= (1 << 13);
5415 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5417 tmp_addr
= ADDSI (tmp_addr
, 4);
5421 if (NEBI (tmp_postinc
, 0)) {
5423 SI opval
= tmp_addr
;
5424 SET_H_GR (FLD (f_operand1
), opval
);
5425 written
|= (1 << 5);
5426 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5432 CPU (h_xbit
) = opval
;
5433 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5437 SET_H_INSN_PREFIXED_P (opval
);
5438 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5443 abuf
->written
= written
;
5448 CASE (sem
, INSN_ADD_B_R
) : /* add.b $Rs,$Rd */
5450 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5452 #define FLD(f) abuf->fields.sfmt_addc_m.f
5453 int UNUSED written
= 0;
5454 IADDR UNUSED pc
= abuf
->addr
;
5455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5462 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5463 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5464 tmp_carry
= CPU (h_cbit
);
5465 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5468 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5470 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5471 SET_H_GR (FLD (f_operand2
), opval
);
5472 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5477 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))));
5478 CPU (h_cbit
) = opval
;
5479 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5482 BI opval
= LTQI (tmp_newval
, 0);
5483 CPU (h_nbit
) = opval
;
5484 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5487 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5488 CPU (h_zbit
) = opval
;
5489 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5492 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)));
5493 CPU (h_vbit
) = opval
;
5494 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5499 CPU (h_xbit
) = opval
;
5500 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5504 SET_H_INSN_PREFIXED_P (opval
);
5505 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5515 CASE (sem
, INSN_ADD_W_R
) : /* add.w $Rs,$Rd */
5517 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5518 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5519 #define FLD(f) abuf->fields.sfmt_addc_m.f
5520 int UNUSED written
= 0;
5521 IADDR UNUSED pc
= abuf
->addr
;
5522 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5529 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5530 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5531 tmp_carry
= CPU (h_cbit
);
5532 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5535 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5537 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5538 SET_H_GR (FLD (f_operand2
), opval
);
5539 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5544 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))));
5545 CPU (h_cbit
) = opval
;
5546 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5549 BI opval
= LTHI (tmp_newval
, 0);
5550 CPU (h_nbit
) = opval
;
5551 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5554 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5555 CPU (h_zbit
) = opval
;
5556 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5559 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)));
5560 CPU (h_vbit
) = opval
;
5561 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5566 CPU (h_xbit
) = opval
;
5567 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5571 SET_H_INSN_PREFIXED_P (opval
);
5572 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5582 CASE (sem
, INSN_ADD_D_R
) : /* add.d $Rs,$Rd */
5584 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5585 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5586 #define FLD(f) abuf->fields.sfmt_addc_m.f
5587 int UNUSED written
= 0;
5588 IADDR UNUSED pc
= abuf
->addr
;
5589 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5596 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5597 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5598 tmp_carry
= CPU (h_cbit
);
5599 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5601 SI opval
= tmp_newval
;
5602 SET_H_GR (FLD (f_operand2
), opval
);
5603 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5607 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))));
5608 CPU (h_cbit
) = opval
;
5609 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5612 BI opval
= LTSI (tmp_newval
, 0);
5613 CPU (h_nbit
) = opval
;
5614 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5617 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5618 CPU (h_zbit
) = opval
;
5619 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5622 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)));
5623 CPU (h_vbit
) = opval
;
5624 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5629 CPU (h_xbit
) = opval
;
5630 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5634 SET_H_INSN_PREFIXED_P (opval
);
5635 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5645 CASE (sem
, INSN_ADD_M_B_M
) : /* add-m.b [${Rs}${inc}],${Rd} */
5647 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5648 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5649 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5650 int UNUSED written
= 0;
5651 IADDR UNUSED pc
= abuf
->addr
;
5652 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5659 tmp_tmpops
= ({ SI tmp_addr
;
5662 tmp_postinc
= FLD (f_memmode
);
5663 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5664 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
5665 ; if (NEBI (tmp_postinc
, 0)) {
5667 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5668 tmp_addr
= ADDSI (tmp_addr
, 1);
5671 SI opval
= tmp_addr
;
5672 SET_H_GR (FLD (f_operand1
), opval
);
5673 written
|= (1 << 12);
5674 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5679 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5680 tmp_carry
= CPU (h_cbit
);
5681 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5684 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5686 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5687 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5688 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5693 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))));
5694 CPU (h_cbit
) = opval
;
5695 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5698 BI opval
= LTQI (tmp_newval
, 0);
5699 CPU (h_nbit
) = opval
;
5700 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5703 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5704 CPU (h_zbit
) = opval
;
5705 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5708 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)));
5709 CPU (h_vbit
) = opval
;
5710 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5715 CPU (h_xbit
) = opval
;
5716 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5720 SET_H_INSN_PREFIXED_P (opval
);
5721 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5727 abuf
->written
= written
;
5732 CASE (sem
, INSN_ADD_M_W_M
) : /* add-m.w [${Rs}${inc}],${Rd} */
5734 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5735 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5736 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5737 int UNUSED written
= 0;
5738 IADDR UNUSED pc
= abuf
->addr
;
5739 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5746 tmp_tmpops
= ({ SI tmp_addr
;
5749 tmp_postinc
= FLD (f_memmode
);
5750 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5751 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
5752 ; if (NEBI (tmp_postinc
, 0)) {
5754 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5755 tmp_addr
= ADDSI (tmp_addr
, 2);
5758 SI opval
= tmp_addr
;
5759 SET_H_GR (FLD (f_operand1
), opval
);
5760 written
|= (1 << 12);
5761 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5766 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5767 tmp_carry
= CPU (h_cbit
);
5768 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5771 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5773 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5774 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5775 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5780 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))));
5781 CPU (h_cbit
) = opval
;
5782 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5785 BI opval
= LTHI (tmp_newval
, 0);
5786 CPU (h_nbit
) = opval
;
5787 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5790 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5791 CPU (h_zbit
) = opval
;
5792 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5795 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)));
5796 CPU (h_vbit
) = opval
;
5797 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5802 CPU (h_xbit
) = opval
;
5803 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5807 SET_H_INSN_PREFIXED_P (opval
);
5808 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5814 abuf
->written
= written
;
5819 CASE (sem
, INSN_ADD_M_D_M
) : /* add-m.d [${Rs}${inc}],${Rd} */
5821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5823 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5824 int UNUSED written
= 0;
5825 IADDR UNUSED pc
= abuf
->addr
;
5826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5833 tmp_tmpops
= ({ SI tmp_addr
;
5836 tmp_postinc
= FLD (f_memmode
);
5837 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5838 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5839 ; if (NEBI (tmp_postinc
, 0)) {
5841 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5842 tmp_addr
= ADDSI (tmp_addr
, 4);
5845 SI opval
= tmp_addr
;
5846 SET_H_GR (FLD (f_operand1
), opval
);
5847 written
|= (1 << 11);
5848 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5853 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5854 tmp_carry
= CPU (h_cbit
);
5855 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5857 SI opval
= tmp_newval
;
5858 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5859 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5863 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))));
5864 CPU (h_cbit
) = opval
;
5865 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5868 BI opval
= LTSI (tmp_newval
, 0);
5869 CPU (h_nbit
) = opval
;
5870 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5873 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5874 CPU (h_zbit
) = opval
;
5875 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5878 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)));
5879 CPU (h_vbit
) = opval
;
5880 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5885 CPU (h_xbit
) = opval
;
5886 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5890 SET_H_INSN_PREFIXED_P (opval
);
5891 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5897 abuf
->written
= written
;
5902 CASE (sem
, INSN_ADDCBR
) : /* add.b ${sconst8}],${Rd} */
5904 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5905 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5906 #define FLD(f) abuf->fields.sfmt_addcbr.f
5907 int UNUSED written
= 0;
5908 IADDR UNUSED pc
= abuf
->addr
;
5909 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5916 tmp_tmpops
= FLD (f_indir_pc__byte
);
5917 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5918 tmp_carry
= CPU (h_cbit
);
5919 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5922 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5924 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5925 SET_H_GR (FLD (f_operand2
), opval
);
5926 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5931 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))));
5932 CPU (h_cbit
) = opval
;
5933 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5936 BI opval
= LTQI (tmp_newval
, 0);
5937 CPU (h_nbit
) = opval
;
5938 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5941 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5942 CPU (h_zbit
) = opval
;
5943 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5946 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)));
5947 CPU (h_vbit
) = opval
;
5948 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5953 CPU (h_xbit
) = opval
;
5954 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5958 SET_H_INSN_PREFIXED_P (opval
);
5959 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5969 CASE (sem
, INSN_ADDCWR
) : /* add.w ${sconst16}],${Rd} */
5971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5972 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5973 #define FLD(f) abuf->fields.sfmt_addcwr.f
5974 int UNUSED written
= 0;
5975 IADDR UNUSED pc
= abuf
->addr
;
5976 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5983 tmp_tmpops
= FLD (f_indir_pc__word
);
5984 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5985 tmp_carry
= CPU (h_cbit
);
5986 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5989 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5991 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5992 SET_H_GR (FLD (f_operand2
), opval
);
5993 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5998 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))));
5999 CPU (h_cbit
) = opval
;
6000 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6003 BI opval
= LTHI (tmp_newval
, 0);
6004 CPU (h_nbit
) = opval
;
6005 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6008 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6009 CPU (h_zbit
) = opval
;
6010 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6013 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)));
6014 CPU (h_vbit
) = opval
;
6015 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6020 CPU (h_xbit
) = opval
;
6021 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6025 SET_H_INSN_PREFIXED_P (opval
);
6026 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6036 CASE (sem
, INSN_ADDCDR
) : /* add.d ${const32}],${Rd} */
6038 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6039 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6040 #define FLD(f) abuf->fields.sfmt_addcdr.f
6041 int UNUSED written
= 0;
6042 IADDR UNUSED pc
= abuf
->addr
;
6043 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6050 tmp_tmpops
= FLD (f_indir_pc__dword
);
6051 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6052 tmp_carry
= CPU (h_cbit
);
6053 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6055 SI opval
= tmp_newval
;
6056 SET_H_GR (FLD (f_operand2
), opval
);
6057 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6061 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))));
6062 CPU (h_cbit
) = opval
;
6063 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6066 BI opval
= LTSI (tmp_newval
, 0);
6067 CPU (h_nbit
) = opval
;
6068 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6071 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6072 CPU (h_zbit
) = opval
;
6073 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6076 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)));
6077 CPU (h_vbit
) = opval
;
6078 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6083 CPU (h_xbit
) = opval
;
6084 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6088 SET_H_INSN_PREFIXED_P (opval
);
6089 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6099 CASE (sem
, INSN_ADDS_B_R
) : /* adds.b $Rs,$Rd */
6101 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6102 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6103 #define FLD(f) abuf->fields.sfmt_addc_m.f
6104 int UNUSED written
= 0;
6105 IADDR UNUSED pc
= abuf
->addr
;
6106 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6113 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6114 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6115 tmp_carry
= CPU (h_cbit
);
6116 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6118 SI opval
= tmp_newval
;
6119 SET_H_GR (FLD (f_operand2
), opval
);
6120 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6124 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))));
6125 CPU (h_cbit
) = opval
;
6126 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6129 BI opval
= LTSI (tmp_newval
, 0);
6130 CPU (h_nbit
) = opval
;
6131 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6134 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6135 CPU (h_zbit
) = opval
;
6136 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6139 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)));
6140 CPU (h_vbit
) = opval
;
6141 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6146 CPU (h_xbit
) = opval
;
6147 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6151 SET_H_INSN_PREFIXED_P (opval
);
6152 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6162 CASE (sem
, INSN_ADDS_W_R
) : /* adds.w $Rs,$Rd */
6164 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6165 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6166 #define FLD(f) abuf->fields.sfmt_addc_m.f
6167 int UNUSED written
= 0;
6168 IADDR UNUSED pc
= abuf
->addr
;
6169 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6176 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6177 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6178 tmp_carry
= CPU (h_cbit
);
6179 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6181 SI opval
= tmp_newval
;
6182 SET_H_GR (FLD (f_operand2
), opval
);
6183 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6187 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))));
6188 CPU (h_cbit
) = opval
;
6189 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6192 BI opval
= LTSI (tmp_newval
, 0);
6193 CPU (h_nbit
) = opval
;
6194 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6197 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6198 CPU (h_zbit
) = opval
;
6199 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6202 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)));
6203 CPU (h_vbit
) = opval
;
6204 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6209 CPU (h_xbit
) = opval
;
6210 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6214 SET_H_INSN_PREFIXED_P (opval
);
6215 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6225 CASE (sem
, INSN_ADDS_M_B_M
) : /* adds-m.b [${Rs}${inc}],$Rd */
6227 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6228 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6229 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6230 int UNUSED written
= 0;
6231 IADDR UNUSED pc
= abuf
->addr
;
6232 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6239 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
6242 tmp_postinc
= FLD (f_memmode
);
6243 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6244 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6245 ; if (NEBI (tmp_postinc
, 0)) {
6247 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6248 tmp_addr
= ADDSI (tmp_addr
, 1);
6251 SI opval
= tmp_addr
;
6252 SET_H_GR (FLD (f_operand1
), opval
);
6253 written
|= (1 << 11);
6254 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6259 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6260 tmp_carry
= CPU (h_cbit
);
6261 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6263 SI opval
= tmp_newval
;
6264 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6265 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6269 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))));
6270 CPU (h_cbit
) = opval
;
6271 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6274 BI opval
= LTSI (tmp_newval
, 0);
6275 CPU (h_nbit
) = opval
;
6276 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6279 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6280 CPU (h_zbit
) = opval
;
6281 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6284 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)));
6285 CPU (h_vbit
) = opval
;
6286 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6291 CPU (h_xbit
) = opval
;
6292 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6296 SET_H_INSN_PREFIXED_P (opval
);
6297 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6303 abuf
->written
= written
;
6308 CASE (sem
, INSN_ADDS_M_W_M
) : /* adds-m.w [${Rs}${inc}],$Rd */
6310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6312 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6313 int UNUSED written
= 0;
6314 IADDR UNUSED pc
= abuf
->addr
;
6315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6322 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
6325 tmp_postinc
= FLD (f_memmode
);
6326 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6327 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6328 ; if (NEBI (tmp_postinc
, 0)) {
6330 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6331 tmp_addr
= ADDSI (tmp_addr
, 2);
6334 SI opval
= tmp_addr
;
6335 SET_H_GR (FLD (f_operand1
), opval
);
6336 written
|= (1 << 11);
6337 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6342 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6343 tmp_carry
= CPU (h_cbit
);
6344 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6346 SI opval
= tmp_newval
;
6347 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6348 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6352 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))));
6353 CPU (h_cbit
) = opval
;
6354 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6357 BI opval
= LTSI (tmp_newval
, 0);
6358 CPU (h_nbit
) = opval
;
6359 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6362 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6363 CPU (h_zbit
) = opval
;
6364 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6367 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)));
6368 CPU (h_vbit
) = opval
;
6369 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6374 CPU (h_xbit
) = opval
;
6375 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6379 SET_H_INSN_PREFIXED_P (opval
);
6380 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6386 abuf
->written
= written
;
6391 CASE (sem
, INSN_ADDSCBR
) : /* [${Rs}${inc}],$Rd */
6393 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6394 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6395 #define FLD(f) abuf->fields.sfmt_addcbr.f
6396 int UNUSED written
= 0;
6397 IADDR UNUSED pc
= abuf
->addr
;
6398 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6405 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6406 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6407 tmp_carry
= CPU (h_cbit
);
6408 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6410 SI opval
= tmp_newval
;
6411 SET_H_GR (FLD (f_operand2
), opval
);
6412 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6416 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))));
6417 CPU (h_cbit
) = opval
;
6418 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6421 BI opval
= LTSI (tmp_newval
, 0);
6422 CPU (h_nbit
) = opval
;
6423 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6426 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6427 CPU (h_zbit
) = opval
;
6428 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6431 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)));
6432 CPU (h_vbit
) = opval
;
6433 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6438 CPU (h_xbit
) = opval
;
6439 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6443 SET_H_INSN_PREFIXED_P (opval
);
6444 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6454 CASE (sem
, INSN_ADDSCWR
) : /* [${Rs}${inc}],$Rd */
6456 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6457 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6458 #define FLD(f) abuf->fields.sfmt_addcwr.f
6459 int UNUSED written
= 0;
6460 IADDR UNUSED pc
= abuf
->addr
;
6461 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6468 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6469 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6470 tmp_carry
= CPU (h_cbit
);
6471 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6473 SI opval
= tmp_newval
;
6474 SET_H_GR (FLD (f_operand2
), opval
);
6475 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6479 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))));
6480 CPU (h_cbit
) = opval
;
6481 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6484 BI opval
= LTSI (tmp_newval
, 0);
6485 CPU (h_nbit
) = opval
;
6486 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6489 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6490 CPU (h_zbit
) = opval
;
6491 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6494 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)));
6495 CPU (h_vbit
) = opval
;
6496 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6501 CPU (h_xbit
) = opval
;
6502 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6506 SET_H_INSN_PREFIXED_P (opval
);
6507 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6517 CASE (sem
, INSN_ADDU_B_R
) : /* addu.b $Rs,$Rd */
6519 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6520 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6521 #define FLD(f) abuf->fields.sfmt_addc_m.f
6522 int UNUSED written
= 0;
6523 IADDR UNUSED pc
= abuf
->addr
;
6524 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6531 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6532 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6533 tmp_carry
= CPU (h_cbit
);
6534 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6536 SI opval
= tmp_newval
;
6537 SET_H_GR (FLD (f_operand2
), opval
);
6538 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6542 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))));
6543 CPU (h_cbit
) = opval
;
6544 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6547 BI opval
= LTSI (tmp_newval
, 0);
6548 CPU (h_nbit
) = opval
;
6549 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6552 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6553 CPU (h_zbit
) = opval
;
6554 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6557 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)));
6558 CPU (h_vbit
) = opval
;
6559 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6564 CPU (h_xbit
) = opval
;
6565 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6569 SET_H_INSN_PREFIXED_P (opval
);
6570 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6580 CASE (sem
, INSN_ADDU_W_R
) : /* addu.w $Rs,$Rd */
6582 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6583 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6584 #define FLD(f) abuf->fields.sfmt_addc_m.f
6585 int UNUSED written
= 0;
6586 IADDR UNUSED pc
= abuf
->addr
;
6587 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6594 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6595 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6596 tmp_carry
= CPU (h_cbit
);
6597 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6599 SI opval
= tmp_newval
;
6600 SET_H_GR (FLD (f_operand2
), opval
);
6601 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6605 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))));
6606 CPU (h_cbit
) = opval
;
6607 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6610 BI opval
= LTSI (tmp_newval
, 0);
6611 CPU (h_nbit
) = opval
;
6612 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6615 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6616 CPU (h_zbit
) = opval
;
6617 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6620 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)));
6621 CPU (h_vbit
) = opval
;
6622 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6627 CPU (h_xbit
) = opval
;
6628 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6632 SET_H_INSN_PREFIXED_P (opval
);
6633 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6643 CASE (sem
, INSN_ADDU_M_B_M
) : /* addu-m.b [${Rs}${inc}],$Rd */
6645 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6646 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6647 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6648 int UNUSED written
= 0;
6649 IADDR UNUSED pc
= abuf
->addr
;
6650 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6657 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
6660 tmp_postinc
= FLD (f_memmode
);
6661 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6662 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6663 ; if (NEBI (tmp_postinc
, 0)) {
6665 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6666 tmp_addr
= ADDSI (tmp_addr
, 1);
6669 SI opval
= tmp_addr
;
6670 SET_H_GR (FLD (f_operand1
), opval
);
6671 written
|= (1 << 11);
6672 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6677 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6678 tmp_carry
= CPU (h_cbit
);
6679 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6681 SI opval
= tmp_newval
;
6682 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6683 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6687 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))));
6688 CPU (h_cbit
) = opval
;
6689 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6692 BI opval
= LTSI (tmp_newval
, 0);
6693 CPU (h_nbit
) = opval
;
6694 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6697 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6698 CPU (h_zbit
) = opval
;
6699 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6702 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)));
6703 CPU (h_vbit
) = opval
;
6704 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6709 CPU (h_xbit
) = opval
;
6710 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6714 SET_H_INSN_PREFIXED_P (opval
);
6715 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6721 abuf
->written
= written
;
6726 CASE (sem
, INSN_ADDU_M_W_M
) : /* addu-m.w [${Rs}${inc}],$Rd */
6728 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6730 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6731 int UNUSED written
= 0;
6732 IADDR UNUSED pc
= abuf
->addr
;
6733 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6740 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
6743 tmp_postinc
= FLD (f_memmode
);
6744 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6745 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6746 ; if (NEBI (tmp_postinc
, 0)) {
6748 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6749 tmp_addr
= ADDSI (tmp_addr
, 2);
6752 SI opval
= tmp_addr
;
6753 SET_H_GR (FLD (f_operand1
), opval
);
6754 written
|= (1 << 11);
6755 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6760 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6761 tmp_carry
= CPU (h_cbit
);
6762 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6764 SI opval
= tmp_newval
;
6765 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6766 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6770 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))));
6771 CPU (h_cbit
) = opval
;
6772 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6775 BI opval
= LTSI (tmp_newval
, 0);
6776 CPU (h_nbit
) = opval
;
6777 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6780 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6781 CPU (h_zbit
) = opval
;
6782 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6785 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)));
6786 CPU (h_vbit
) = opval
;
6787 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6792 CPU (h_xbit
) = opval
;
6793 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6797 SET_H_INSN_PREFIXED_P (opval
);
6798 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6804 abuf
->written
= written
;
6809 CASE (sem
, INSN_ADDUCBR
) : /* [${Rs}${inc}],$Rd */
6811 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6812 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6813 #define FLD(f) abuf->fields.sfmt_addcbr.f
6814 int UNUSED written
= 0;
6815 IADDR UNUSED pc
= abuf
->addr
;
6816 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6823 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6824 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6825 tmp_carry
= CPU (h_cbit
);
6826 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6828 SI opval
= tmp_newval
;
6829 SET_H_GR (FLD (f_operand2
), opval
);
6830 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6834 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))));
6835 CPU (h_cbit
) = opval
;
6836 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6839 BI opval
= LTSI (tmp_newval
, 0);
6840 CPU (h_nbit
) = opval
;
6841 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6844 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6845 CPU (h_zbit
) = opval
;
6846 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6849 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)));
6850 CPU (h_vbit
) = opval
;
6851 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6856 CPU (h_xbit
) = opval
;
6857 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6861 SET_H_INSN_PREFIXED_P (opval
);
6862 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6872 CASE (sem
, INSN_ADDUCWR
) : /* [${Rs}${inc}],$Rd */
6874 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6875 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6876 #define FLD(f) abuf->fields.sfmt_addcwr.f
6877 int UNUSED written
= 0;
6878 IADDR UNUSED pc
= abuf
->addr
;
6879 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6886 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6887 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6888 tmp_carry
= CPU (h_cbit
);
6889 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6891 SI opval
= tmp_newval
;
6892 SET_H_GR (FLD (f_operand2
), opval
);
6893 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6897 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))));
6898 CPU (h_cbit
) = opval
;
6899 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6902 BI opval
= LTSI (tmp_newval
, 0);
6903 CPU (h_nbit
) = opval
;
6904 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6907 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6908 CPU (h_zbit
) = opval
;
6909 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6912 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)));
6913 CPU (h_vbit
) = opval
;
6914 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6919 CPU (h_xbit
) = opval
;
6920 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6924 SET_H_INSN_PREFIXED_P (opval
);
6925 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6935 CASE (sem
, INSN_SUB_B_R
) : /* sub.b $Rs,$Rd */
6937 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6938 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6939 #define FLD(f) abuf->fields.sfmt_addc_m.f
6940 int UNUSED written
= 0;
6941 IADDR UNUSED pc
= abuf
->addr
;
6942 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6949 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
6950 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6951 tmp_carry
= CPU (h_cbit
);
6952 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6955 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
6957 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
6958 SET_H_GR (FLD (f_operand2
), opval
);
6959 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6964 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))));
6965 CPU (h_cbit
) = opval
;
6966 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6969 BI opval
= LTQI (tmp_newval
, 0);
6970 CPU (h_nbit
) = opval
;
6971 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6974 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6975 CPU (h_zbit
) = opval
;
6976 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6979 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)));
6980 CPU (h_vbit
) = opval
;
6981 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6986 CPU (h_xbit
) = opval
;
6987 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6991 SET_H_INSN_PREFIXED_P (opval
);
6992 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7002 CASE (sem
, INSN_SUB_W_R
) : /* sub.w $Rs,$Rd */
7004 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7005 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7006 #define FLD(f) abuf->fields.sfmt_addc_m.f
7007 int UNUSED written
= 0;
7008 IADDR UNUSED pc
= abuf
->addr
;
7009 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7016 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7017 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7018 tmp_carry
= CPU (h_cbit
);
7019 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7022 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7024 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7025 SET_H_GR (FLD (f_operand2
), opval
);
7026 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7031 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))));
7032 CPU (h_cbit
) = opval
;
7033 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7036 BI opval
= LTHI (tmp_newval
, 0);
7037 CPU (h_nbit
) = opval
;
7038 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7041 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7042 CPU (h_zbit
) = opval
;
7043 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7046 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)));
7047 CPU (h_vbit
) = opval
;
7048 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7053 CPU (h_xbit
) = opval
;
7054 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7058 SET_H_INSN_PREFIXED_P (opval
);
7059 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7069 CASE (sem
, INSN_SUB_D_R
) : /* sub.d $Rs,$Rd */
7071 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7072 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7073 #define FLD(f) abuf->fields.sfmt_addc_m.f
7074 int UNUSED written
= 0;
7075 IADDR UNUSED pc
= abuf
->addr
;
7076 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7083 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7084 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7085 tmp_carry
= CPU (h_cbit
);
7086 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7088 SI opval
= tmp_newval
;
7089 SET_H_GR (FLD (f_operand2
), opval
);
7090 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7094 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))));
7095 CPU (h_cbit
) = opval
;
7096 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7099 BI opval
= LTSI (tmp_newval
, 0);
7100 CPU (h_nbit
) = opval
;
7101 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7104 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7105 CPU (h_zbit
) = opval
;
7106 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7109 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)));
7110 CPU (h_vbit
) = opval
;
7111 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7116 CPU (h_xbit
) = opval
;
7117 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7121 SET_H_INSN_PREFIXED_P (opval
);
7122 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7132 CASE (sem
, INSN_SUB_M_B_M
) : /* sub-m.b [${Rs}${inc}],${Rd} */
7134 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7135 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7136 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7137 int UNUSED written
= 0;
7138 IADDR UNUSED pc
= abuf
->addr
;
7139 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7146 tmp_tmpops
= ({ SI tmp_addr
;
7149 tmp_postinc
= FLD (f_memmode
);
7150 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7151 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7152 ; if (NEBI (tmp_postinc
, 0)) {
7154 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7155 tmp_addr
= ADDSI (tmp_addr
, 1);
7158 SI opval
= tmp_addr
;
7159 SET_H_GR (FLD (f_operand1
), opval
);
7160 written
|= (1 << 12);
7161 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7166 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7167 tmp_carry
= CPU (h_cbit
);
7168 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7171 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7173 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7174 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7175 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7180 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))));
7181 CPU (h_cbit
) = opval
;
7182 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7185 BI opval
= LTQI (tmp_newval
, 0);
7186 CPU (h_nbit
) = opval
;
7187 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7190 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7191 CPU (h_zbit
) = opval
;
7192 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7195 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)));
7196 CPU (h_vbit
) = opval
;
7197 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7202 CPU (h_xbit
) = opval
;
7203 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7207 SET_H_INSN_PREFIXED_P (opval
);
7208 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7214 abuf
->written
= written
;
7219 CASE (sem
, INSN_SUB_M_W_M
) : /* sub-m.w [${Rs}${inc}],${Rd} */
7221 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7222 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7223 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7224 int UNUSED written
= 0;
7225 IADDR UNUSED pc
= abuf
->addr
;
7226 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7233 tmp_tmpops
= ({ SI tmp_addr
;
7236 tmp_postinc
= FLD (f_memmode
);
7237 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7238 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7239 ; if (NEBI (tmp_postinc
, 0)) {
7241 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7242 tmp_addr
= ADDSI (tmp_addr
, 2);
7245 SI opval
= tmp_addr
;
7246 SET_H_GR (FLD (f_operand1
), opval
);
7247 written
|= (1 << 12);
7248 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7253 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7254 tmp_carry
= CPU (h_cbit
);
7255 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7258 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7260 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7261 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7262 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7267 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))));
7268 CPU (h_cbit
) = opval
;
7269 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7272 BI opval
= LTHI (tmp_newval
, 0);
7273 CPU (h_nbit
) = opval
;
7274 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7277 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7278 CPU (h_zbit
) = opval
;
7279 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7282 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)));
7283 CPU (h_vbit
) = opval
;
7284 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7289 CPU (h_xbit
) = opval
;
7290 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7294 SET_H_INSN_PREFIXED_P (opval
);
7295 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7301 abuf
->written
= written
;
7306 CASE (sem
, INSN_SUB_M_D_M
) : /* sub-m.d [${Rs}${inc}],${Rd} */
7308 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7309 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7310 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7311 int UNUSED written
= 0;
7312 IADDR UNUSED pc
= abuf
->addr
;
7313 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7320 tmp_tmpops
= ({ SI tmp_addr
;
7323 tmp_postinc
= FLD (f_memmode
);
7324 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7325 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
7326 ; if (NEBI (tmp_postinc
, 0)) {
7328 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7329 tmp_addr
= ADDSI (tmp_addr
, 4);
7332 SI opval
= tmp_addr
;
7333 SET_H_GR (FLD (f_operand1
), opval
);
7334 written
|= (1 << 11);
7335 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7340 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7341 tmp_carry
= CPU (h_cbit
);
7342 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7344 SI opval
= tmp_newval
;
7345 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7346 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7350 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))));
7351 CPU (h_cbit
) = opval
;
7352 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7355 BI opval
= LTSI (tmp_newval
, 0);
7356 CPU (h_nbit
) = opval
;
7357 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7360 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7361 CPU (h_zbit
) = opval
;
7362 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7365 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)));
7366 CPU (h_vbit
) = opval
;
7367 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7372 CPU (h_xbit
) = opval
;
7373 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7377 SET_H_INSN_PREFIXED_P (opval
);
7378 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7384 abuf
->written
= written
;
7389 CASE (sem
, INSN_SUBCBR
) : /* sub.b ${sconst8}],${Rd} */
7391 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7392 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7393 #define FLD(f) abuf->fields.sfmt_addcbr.f
7394 int UNUSED written
= 0;
7395 IADDR UNUSED pc
= abuf
->addr
;
7396 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7403 tmp_tmpops
= FLD (f_indir_pc__byte
);
7404 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7405 tmp_carry
= CPU (h_cbit
);
7406 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7409 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7411 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7412 SET_H_GR (FLD (f_operand2
), opval
);
7413 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7418 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))));
7419 CPU (h_cbit
) = opval
;
7420 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7423 BI opval
= LTQI (tmp_newval
, 0);
7424 CPU (h_nbit
) = opval
;
7425 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7428 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7429 CPU (h_zbit
) = opval
;
7430 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7433 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)));
7434 CPU (h_vbit
) = opval
;
7435 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7440 CPU (h_xbit
) = opval
;
7441 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7445 SET_H_INSN_PREFIXED_P (opval
);
7446 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7456 CASE (sem
, INSN_SUBCWR
) : /* sub.w ${sconst16}],${Rd} */
7458 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7459 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7460 #define FLD(f) abuf->fields.sfmt_addcwr.f
7461 int UNUSED written
= 0;
7462 IADDR UNUSED pc
= abuf
->addr
;
7463 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7470 tmp_tmpops
= FLD (f_indir_pc__word
);
7471 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7472 tmp_carry
= CPU (h_cbit
);
7473 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7476 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7478 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7479 SET_H_GR (FLD (f_operand2
), opval
);
7480 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7485 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))));
7486 CPU (h_cbit
) = opval
;
7487 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7490 BI opval
= LTHI (tmp_newval
, 0);
7491 CPU (h_nbit
) = opval
;
7492 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7495 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7496 CPU (h_zbit
) = opval
;
7497 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7500 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)));
7501 CPU (h_vbit
) = opval
;
7502 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7507 CPU (h_xbit
) = opval
;
7508 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7512 SET_H_INSN_PREFIXED_P (opval
);
7513 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7523 CASE (sem
, INSN_SUBCDR
) : /* sub.d ${const32}],${Rd} */
7525 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7526 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7527 #define FLD(f) abuf->fields.sfmt_addcdr.f
7528 int UNUSED written
= 0;
7529 IADDR UNUSED pc
= abuf
->addr
;
7530 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
7537 tmp_tmpops
= FLD (f_indir_pc__dword
);
7538 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7539 tmp_carry
= CPU (h_cbit
);
7540 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7542 SI opval
= tmp_newval
;
7543 SET_H_GR (FLD (f_operand2
), opval
);
7544 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7548 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))));
7549 CPU (h_cbit
) = opval
;
7550 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7553 BI opval
= LTSI (tmp_newval
, 0);
7554 CPU (h_nbit
) = opval
;
7555 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7558 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7559 CPU (h_zbit
) = opval
;
7560 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7563 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)));
7564 CPU (h_vbit
) = opval
;
7565 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7570 CPU (h_xbit
) = opval
;
7571 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7575 SET_H_INSN_PREFIXED_P (opval
);
7576 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7586 CASE (sem
, INSN_SUBS_B_R
) : /* subs.b $Rs,$Rd */
7588 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7589 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7590 #define FLD(f) abuf->fields.sfmt_addc_m.f
7591 int UNUSED written
= 0;
7592 IADDR UNUSED pc
= abuf
->addr
;
7593 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7600 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
7601 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7602 tmp_carry
= CPU (h_cbit
);
7603 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7605 SI opval
= tmp_newval
;
7606 SET_H_GR (FLD (f_operand2
), opval
);
7607 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7611 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))));
7612 CPU (h_cbit
) = opval
;
7613 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7616 BI opval
= LTSI (tmp_newval
, 0);
7617 CPU (h_nbit
) = opval
;
7618 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7621 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7622 CPU (h_zbit
) = opval
;
7623 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7626 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)));
7627 CPU (h_vbit
) = opval
;
7628 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7633 CPU (h_xbit
) = opval
;
7634 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7638 SET_H_INSN_PREFIXED_P (opval
);
7639 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7649 CASE (sem
, INSN_SUBS_W_R
) : /* subs.w $Rs,$Rd */
7651 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7652 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7653 #define FLD(f) abuf->fields.sfmt_addc_m.f
7654 int UNUSED written
= 0;
7655 IADDR UNUSED pc
= abuf
->addr
;
7656 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7663 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
7664 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7665 tmp_carry
= CPU (h_cbit
);
7666 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7668 SI opval
= tmp_newval
;
7669 SET_H_GR (FLD (f_operand2
), opval
);
7670 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7674 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))));
7675 CPU (h_cbit
) = opval
;
7676 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7679 BI opval
= LTSI (tmp_newval
, 0);
7680 CPU (h_nbit
) = opval
;
7681 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7684 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7685 CPU (h_zbit
) = opval
;
7686 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7689 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)));
7690 CPU (h_vbit
) = opval
;
7691 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7696 CPU (h_xbit
) = opval
;
7697 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7701 SET_H_INSN_PREFIXED_P (opval
);
7702 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7712 CASE (sem
, INSN_SUBS_M_B_M
) : /* subs-m.b [${Rs}${inc}],$Rd */
7714 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7715 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7716 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7717 int UNUSED written
= 0;
7718 IADDR UNUSED pc
= abuf
->addr
;
7719 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7726 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
7729 tmp_postinc
= FLD (f_memmode
);
7730 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7731 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7732 ; if (NEBI (tmp_postinc
, 0)) {
7734 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7735 tmp_addr
= ADDSI (tmp_addr
, 1);
7738 SI opval
= tmp_addr
;
7739 SET_H_GR (FLD (f_operand1
), opval
);
7740 written
|= (1 << 11);
7741 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7746 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7747 tmp_carry
= CPU (h_cbit
);
7748 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7750 SI opval
= tmp_newval
;
7751 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7752 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7756 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))));
7757 CPU (h_cbit
) = opval
;
7758 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7761 BI opval
= LTSI (tmp_newval
, 0);
7762 CPU (h_nbit
) = opval
;
7763 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7766 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7767 CPU (h_zbit
) = opval
;
7768 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7771 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)));
7772 CPU (h_vbit
) = opval
;
7773 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7778 CPU (h_xbit
) = opval
;
7779 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7783 SET_H_INSN_PREFIXED_P (opval
);
7784 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7790 abuf
->written
= written
;
7795 CASE (sem
, INSN_SUBS_M_W_M
) : /* subs-m.w [${Rs}${inc}],$Rd */
7797 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7798 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7799 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7800 int UNUSED written
= 0;
7801 IADDR UNUSED pc
= abuf
->addr
;
7802 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7809 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
7812 tmp_postinc
= FLD (f_memmode
);
7813 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7814 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7815 ; if (NEBI (tmp_postinc
, 0)) {
7817 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7818 tmp_addr
= ADDSI (tmp_addr
, 2);
7821 SI opval
= tmp_addr
;
7822 SET_H_GR (FLD (f_operand1
), opval
);
7823 written
|= (1 << 11);
7824 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7829 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7830 tmp_carry
= CPU (h_cbit
);
7831 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7833 SI opval
= tmp_newval
;
7834 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7835 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7839 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))));
7840 CPU (h_cbit
) = opval
;
7841 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7844 BI opval
= LTSI (tmp_newval
, 0);
7845 CPU (h_nbit
) = opval
;
7846 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7849 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7850 CPU (h_zbit
) = opval
;
7851 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7854 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)));
7855 CPU (h_vbit
) = opval
;
7856 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7861 CPU (h_xbit
) = opval
;
7862 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7866 SET_H_INSN_PREFIXED_P (opval
);
7867 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7873 abuf
->written
= written
;
7878 CASE (sem
, INSN_SUBSCBR
) : /* [${Rs}${inc}],$Rd */
7880 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7881 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7882 #define FLD(f) abuf->fields.sfmt_addcbr.f
7883 int UNUSED written
= 0;
7884 IADDR UNUSED pc
= abuf
->addr
;
7885 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7892 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
7893 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7894 tmp_carry
= CPU (h_cbit
);
7895 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7897 SI opval
= tmp_newval
;
7898 SET_H_GR (FLD (f_operand2
), opval
);
7899 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7903 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))));
7904 CPU (h_cbit
) = opval
;
7905 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7908 BI opval
= LTSI (tmp_newval
, 0);
7909 CPU (h_nbit
) = opval
;
7910 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7913 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7914 CPU (h_zbit
) = opval
;
7915 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7918 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)));
7919 CPU (h_vbit
) = opval
;
7920 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7925 CPU (h_xbit
) = opval
;
7926 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7930 SET_H_INSN_PREFIXED_P (opval
);
7931 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7941 CASE (sem
, INSN_SUBSCWR
) : /* [${Rs}${inc}],$Rd */
7943 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7944 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7945 #define FLD(f) abuf->fields.sfmt_addcwr.f
7946 int UNUSED written
= 0;
7947 IADDR UNUSED pc
= abuf
->addr
;
7948 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7955 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
7956 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7957 tmp_carry
= CPU (h_cbit
);
7958 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7960 SI opval
= tmp_newval
;
7961 SET_H_GR (FLD (f_operand2
), opval
);
7962 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7966 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))));
7967 CPU (h_cbit
) = opval
;
7968 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7971 BI opval
= LTSI (tmp_newval
, 0);
7972 CPU (h_nbit
) = opval
;
7973 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7976 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7977 CPU (h_zbit
) = opval
;
7978 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7981 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)));
7982 CPU (h_vbit
) = opval
;
7983 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7988 CPU (h_xbit
) = opval
;
7989 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7993 SET_H_INSN_PREFIXED_P (opval
);
7994 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8004 CASE (sem
, INSN_SUBU_B_R
) : /* subu.b $Rs,$Rd */
8006 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8007 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8008 #define FLD(f) abuf->fields.sfmt_addc_m.f
8009 int UNUSED written
= 0;
8010 IADDR UNUSED pc
= abuf
->addr
;
8011 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8018 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
8019 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8020 tmp_carry
= CPU (h_cbit
);
8021 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8023 SI opval
= tmp_newval
;
8024 SET_H_GR (FLD (f_operand2
), opval
);
8025 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8029 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))));
8030 CPU (h_cbit
) = opval
;
8031 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8034 BI opval
= LTSI (tmp_newval
, 0);
8035 CPU (h_nbit
) = opval
;
8036 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8039 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8040 CPU (h_zbit
) = opval
;
8041 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8044 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)));
8045 CPU (h_vbit
) = opval
;
8046 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8051 CPU (h_xbit
) = opval
;
8052 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8056 SET_H_INSN_PREFIXED_P (opval
);
8057 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8067 CASE (sem
, INSN_SUBU_W_R
) : /* subu.w $Rs,$Rd */
8069 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8070 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8071 #define FLD(f) abuf->fields.sfmt_addc_m.f
8072 int UNUSED written
= 0;
8073 IADDR UNUSED pc
= abuf
->addr
;
8074 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8081 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
8082 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8083 tmp_carry
= CPU (h_cbit
);
8084 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8086 SI opval
= tmp_newval
;
8087 SET_H_GR (FLD (f_operand2
), opval
);
8088 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8092 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))));
8093 CPU (h_cbit
) = opval
;
8094 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8097 BI opval
= LTSI (tmp_newval
, 0);
8098 CPU (h_nbit
) = opval
;
8099 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8102 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8103 CPU (h_zbit
) = opval
;
8104 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8107 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)));
8108 CPU (h_vbit
) = opval
;
8109 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8114 CPU (h_xbit
) = opval
;
8115 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8119 SET_H_INSN_PREFIXED_P (opval
);
8120 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8130 CASE (sem
, INSN_SUBU_M_B_M
) : /* subu-m.b [${Rs}${inc}],$Rd */
8132 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8133 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8134 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8135 int UNUSED written
= 0;
8136 IADDR UNUSED pc
= abuf
->addr
;
8137 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8144 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
8147 tmp_postinc
= FLD (f_memmode
);
8148 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8149 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8150 ; if (NEBI (tmp_postinc
, 0)) {
8152 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8153 tmp_addr
= ADDSI (tmp_addr
, 1);
8156 SI opval
= tmp_addr
;
8157 SET_H_GR (FLD (f_operand1
), opval
);
8158 written
|= (1 << 11);
8159 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8164 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8165 tmp_carry
= CPU (h_cbit
);
8166 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8168 SI opval
= tmp_newval
;
8169 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8170 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8174 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))));
8175 CPU (h_cbit
) = opval
;
8176 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8179 BI opval
= LTSI (tmp_newval
, 0);
8180 CPU (h_nbit
) = opval
;
8181 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8184 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8185 CPU (h_zbit
) = opval
;
8186 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8189 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)));
8190 CPU (h_vbit
) = opval
;
8191 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8196 CPU (h_xbit
) = opval
;
8197 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8201 SET_H_INSN_PREFIXED_P (opval
);
8202 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8208 abuf
->written
= written
;
8213 CASE (sem
, INSN_SUBU_M_W_M
) : /* subu-m.w [${Rs}${inc}],$Rd */
8215 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8216 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8217 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8218 int UNUSED written
= 0;
8219 IADDR UNUSED pc
= abuf
->addr
;
8220 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8227 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
8230 tmp_postinc
= FLD (f_memmode
);
8231 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8232 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8233 ; if (NEBI (tmp_postinc
, 0)) {
8235 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8236 tmp_addr
= ADDSI (tmp_addr
, 2);
8239 SI opval
= tmp_addr
;
8240 SET_H_GR (FLD (f_operand1
), opval
);
8241 written
|= (1 << 11);
8242 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8247 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8248 tmp_carry
= CPU (h_cbit
);
8249 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8251 SI opval
= tmp_newval
;
8252 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8253 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8257 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))));
8258 CPU (h_cbit
) = opval
;
8259 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8262 BI opval
= LTSI (tmp_newval
, 0);
8263 CPU (h_nbit
) = opval
;
8264 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8267 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8268 CPU (h_zbit
) = opval
;
8269 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8272 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)));
8273 CPU (h_vbit
) = opval
;
8274 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8279 CPU (h_xbit
) = opval
;
8280 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8284 SET_H_INSN_PREFIXED_P (opval
);
8285 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8291 abuf
->written
= written
;
8296 CASE (sem
, INSN_SUBUCBR
) : /* [${Rs}${inc}],$Rd */
8298 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8299 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8300 #define FLD(f) abuf->fields.sfmt_addcbr.f
8301 int UNUSED written
= 0;
8302 IADDR UNUSED pc
= abuf
->addr
;
8303 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8310 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8311 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8312 tmp_carry
= CPU (h_cbit
);
8313 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8315 SI opval
= tmp_newval
;
8316 SET_H_GR (FLD (f_operand2
), opval
);
8317 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8321 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))));
8322 CPU (h_cbit
) = opval
;
8323 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8326 BI opval
= LTSI (tmp_newval
, 0);
8327 CPU (h_nbit
) = opval
;
8328 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8331 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8332 CPU (h_zbit
) = opval
;
8333 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8336 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)));
8337 CPU (h_vbit
) = opval
;
8338 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8343 CPU (h_xbit
) = opval
;
8344 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8348 SET_H_INSN_PREFIXED_P (opval
);
8349 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8359 CASE (sem
, INSN_SUBUCWR
) : /* [${Rs}${inc}],$Rd */
8361 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8363 #define FLD(f) abuf->fields.sfmt_addcwr.f
8364 int UNUSED written
= 0;
8365 IADDR UNUSED pc
= abuf
->addr
;
8366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8373 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8374 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8375 tmp_carry
= CPU (h_cbit
);
8376 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8378 SI opval
= tmp_newval
;
8379 SET_H_GR (FLD (f_operand2
), opval
);
8380 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8384 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))));
8385 CPU (h_cbit
) = opval
;
8386 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8389 BI opval
= LTSI (tmp_newval
, 0);
8390 CPU (h_nbit
) = opval
;
8391 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8394 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8395 CPU (h_zbit
) = opval
;
8396 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8399 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)));
8400 CPU (h_vbit
) = opval
;
8401 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8406 CPU (h_xbit
) = opval
;
8407 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8411 SET_H_INSN_PREFIXED_P (opval
);
8412 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8422 CASE (sem
, INSN_ADDC_R
) : /* addc $Rs,$Rd */
8424 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8425 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8426 #define FLD(f) abuf->fields.sfmt_addc_m.f
8427 int UNUSED written
= 0;
8428 IADDR UNUSED pc
= abuf
->addr
;
8429 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8438 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8439 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8440 tmp_carry
= CPU (h_cbit
);
8441 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8443 SI opval
= tmp_newval
;
8444 SET_H_GR (FLD (f_operand2
), opval
);
8445 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8449 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))));
8450 CPU (h_cbit
) = opval
;
8451 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8454 BI opval
= LTSI (tmp_newval
, 0);
8455 CPU (h_nbit
) = opval
;
8456 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8459 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8460 CPU (h_zbit
) = opval
;
8461 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8464 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)));
8465 CPU (h_vbit
) = opval
;
8466 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8471 CPU (h_xbit
) = opval
;
8472 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8476 SET_H_INSN_PREFIXED_P (opval
);
8477 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8488 CASE (sem
, INSN_ADDC_M
) : /* addc [${Rs}${inc}],${Rd} */
8490 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8491 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8492 #define FLD(f) abuf->fields.sfmt_addc_m.f
8493 int UNUSED written
= 0;
8494 IADDR UNUSED pc
= abuf
->addr
;
8495 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8504 tmp_tmpops
= ({ SI tmp_addr
;
8507 tmp_postinc
= FLD (f_memmode
);
8508 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8509 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
8510 ; if (NEBI (tmp_postinc
, 0)) {
8512 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8513 tmp_addr
= ADDSI (tmp_addr
, 4);
8516 SI opval
= tmp_addr
;
8517 SET_H_GR (FLD (f_operand1
), opval
);
8518 written
|= (1 << 10);
8519 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8524 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8525 tmp_carry
= CPU (h_cbit
);
8526 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8528 SI opval
= tmp_newval
;
8529 SET_H_GR (FLD (f_operand2
), opval
);
8530 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8534 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))));
8535 CPU (h_cbit
) = opval
;
8536 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8539 BI opval
= LTSI (tmp_newval
, 0);
8540 CPU (h_nbit
) = opval
;
8541 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8544 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8545 CPU (h_zbit
) = opval
;
8546 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8549 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)));
8550 CPU (h_vbit
) = opval
;
8551 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8556 CPU (h_xbit
) = opval
;
8557 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8561 SET_H_INSN_PREFIXED_P (opval
);
8562 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8569 abuf
->written
= written
;
8574 CASE (sem
, INSN_ADDC_C
) : /* addc ${const32},${Rd} */
8576 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8577 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8578 #define FLD(f) abuf->fields.sfmt_addcdr.f
8579 int UNUSED written
= 0;
8580 IADDR UNUSED pc
= abuf
->addr
;
8581 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8590 tmp_tmpops
= FLD (f_indir_pc__dword
);
8591 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8592 tmp_carry
= CPU (h_cbit
);
8593 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8595 SI opval
= tmp_newval
;
8596 SET_H_GR (FLD (f_operand2
), opval
);
8597 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8601 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))));
8602 CPU (h_cbit
) = opval
;
8603 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8606 BI opval
= LTSI (tmp_newval
, 0);
8607 CPU (h_nbit
) = opval
;
8608 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8611 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8612 CPU (h_zbit
) = opval
;
8613 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8616 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)));
8617 CPU (h_vbit
) = opval
;
8618 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8623 CPU (h_xbit
) = opval
;
8624 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8628 SET_H_INSN_PREFIXED_P (opval
);
8629 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8640 CASE (sem
, INSN_LAPC_D
) : /* lapc.d ${const32-pcrel},${Rd} */
8642 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8643 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8644 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8645 int UNUSED written
= 0;
8646 IADDR UNUSED pc
= abuf
->addr
;
8647 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8651 SI opval
= FLD (i_const32_pcrel
);
8652 SET_H_GR (FLD (f_operand2
), opval
);
8653 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8658 CPU (h_xbit
) = opval
;
8659 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8663 SET_H_INSN_PREFIXED_P (opval
);
8664 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8673 CASE (sem
, INSN_LAPCQ
) : /* lapcq ${qo},${Rd} */
8675 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8676 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8677 #define FLD(f) abuf->fields.sfmt_lapcq.f
8678 int UNUSED written
= 0;
8679 IADDR UNUSED pc
= abuf
->addr
;
8680 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8684 SI opval
= FLD (i_qo
);
8685 SET_H_GR (FLD (f_operand2
), opval
);
8686 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8691 CPU (h_xbit
) = opval
;
8692 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8696 SET_H_INSN_PREFIXED_P (opval
);
8697 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8706 CASE (sem
, INSN_ADDI_B_R
) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8708 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8709 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8710 #define FLD(f) abuf->fields.sfmt_addc_m.f
8711 int UNUSED written
= 0;
8712 IADDR UNUSED pc
= abuf
->addr
;
8713 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8717 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
8718 SET_H_GR (FLD (f_operand1
), opval
);
8719 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8724 CPU (h_xbit
) = opval
;
8725 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8729 SET_H_INSN_PREFIXED_P (opval
);
8730 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8739 CASE (sem
, INSN_ADDI_W_R
) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8741 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8742 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8743 #define FLD(f) abuf->fields.sfmt_addc_m.f
8744 int UNUSED written
= 0;
8745 IADDR UNUSED pc
= abuf
->addr
;
8746 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8750 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
8751 SET_H_GR (FLD (f_operand1
), opval
);
8752 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8757 CPU (h_xbit
) = opval
;
8758 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8762 SET_H_INSN_PREFIXED_P (opval
);
8763 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8772 CASE (sem
, INSN_ADDI_D_R
) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8774 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8775 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8776 #define FLD(f) abuf->fields.sfmt_addc_m.f
8777 int UNUSED written
= 0;
8778 IADDR UNUSED pc
= abuf
->addr
;
8779 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8783 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
8784 SET_H_GR (FLD (f_operand1
), opval
);
8785 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8790 CPU (h_xbit
) = opval
;
8791 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8795 SET_H_INSN_PREFIXED_P (opval
);
8796 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8805 CASE (sem
, INSN_NEG_B_R
) : /* neg.b $Rs,$Rd */
8807 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8808 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8809 #define FLD(f) abuf->fields.sfmt_addc_m.f
8810 int UNUSED written
= 0;
8811 IADDR UNUSED pc
= abuf
->addr
;
8812 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8819 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8821 tmp_carry
= CPU (h_cbit
);
8822 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8825 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
8827 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
8828 SET_H_GR (FLD (f_operand2
), opval
);
8829 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8834 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))));
8835 CPU (h_cbit
) = opval
;
8836 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8839 BI opval
= LTQI (tmp_newval
, 0);
8840 CPU (h_nbit
) = opval
;
8841 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8844 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8845 CPU (h_zbit
) = opval
;
8846 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8849 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)));
8850 CPU (h_vbit
) = opval
;
8851 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8856 CPU (h_xbit
) = opval
;
8857 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8861 SET_H_INSN_PREFIXED_P (opval
);
8862 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8872 CASE (sem
, INSN_NEG_W_R
) : /* neg.w $Rs,$Rd */
8874 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8875 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8876 #define FLD(f) abuf->fields.sfmt_addc_m.f
8877 int UNUSED written
= 0;
8878 IADDR UNUSED pc
= abuf
->addr
;
8879 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8886 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8888 tmp_carry
= CPU (h_cbit
);
8889 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8892 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
8894 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
8895 SET_H_GR (FLD (f_operand2
), opval
);
8896 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8901 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))));
8902 CPU (h_cbit
) = opval
;
8903 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8906 BI opval
= LTHI (tmp_newval
, 0);
8907 CPU (h_nbit
) = opval
;
8908 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8911 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8912 CPU (h_zbit
) = opval
;
8913 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8916 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)));
8917 CPU (h_vbit
) = opval
;
8918 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8923 CPU (h_xbit
) = opval
;
8924 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8928 SET_H_INSN_PREFIXED_P (opval
);
8929 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8939 CASE (sem
, INSN_NEG_D_R
) : /* neg.d $Rs,$Rd */
8941 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8943 #define FLD(f) abuf->fields.sfmt_addc_m.f
8944 int UNUSED written
= 0;
8945 IADDR UNUSED pc
= abuf
->addr
;
8946 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8953 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8955 tmp_carry
= CPU (h_cbit
);
8956 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8958 SI opval
= tmp_newval
;
8959 SET_H_GR (FLD (f_operand2
), opval
);
8960 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8964 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))));
8965 CPU (h_cbit
) = opval
;
8966 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8969 BI opval
= LTSI (tmp_newval
, 0);
8970 CPU (h_nbit
) = opval
;
8971 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8974 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8975 CPU (h_zbit
) = opval
;
8976 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8979 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)));
8980 CPU (h_vbit
) = opval
;
8981 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8986 CPU (h_xbit
) = opval
;
8987 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8991 SET_H_INSN_PREFIXED_P (opval
);
8992 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9002 CASE (sem
, INSN_TEST_M_B_M
) : /* test-m.b [${Rs}${inc}] */
9004 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9005 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9006 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9007 int UNUSED written
= 0;
9008 IADDR UNUSED pc
= abuf
->addr
;
9009 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9013 tmp_tmpd
= ({ SI tmp_addr
;
9016 tmp_postinc
= FLD (f_memmode
);
9017 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9018 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
9019 ; if (NEBI (tmp_postinc
, 0)) {
9021 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9022 tmp_addr
= ADDSI (tmp_addr
, 1);
9025 SI opval
= tmp_addr
;
9026 SET_H_GR (FLD (f_operand1
), opval
);
9027 written
|= (1 << 8);
9028 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9039 tmp_tmpopd
= tmp_tmpd
;
9040 tmp_carry
= CPU (h_cbit
);
9041 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9045 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))));
9046 CPU (h_cbit
) = opval
;
9047 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9050 BI opval
= LTQI (tmp_newval
, 0);
9051 CPU (h_nbit
) = opval
;
9052 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9055 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9056 CPU (h_zbit
) = opval
;
9057 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9060 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)));
9061 CPU (h_vbit
) = opval
;
9062 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9067 CPU (h_xbit
) = opval
;
9068 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9072 SET_H_INSN_PREFIXED_P (opval
);
9073 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9080 abuf
->written
= written
;
9085 CASE (sem
, INSN_TEST_M_W_M
) : /* test-m.w [${Rs}${inc}] */
9087 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9088 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9089 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9090 int UNUSED written
= 0;
9091 IADDR UNUSED pc
= abuf
->addr
;
9092 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9096 tmp_tmpd
= ({ SI tmp_addr
;
9099 tmp_postinc
= FLD (f_memmode
);
9100 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9101 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
9102 ; if (NEBI (tmp_postinc
, 0)) {
9104 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9105 tmp_addr
= ADDSI (tmp_addr
, 2);
9108 SI opval
= tmp_addr
;
9109 SET_H_GR (FLD (f_operand1
), opval
);
9110 written
|= (1 << 8);
9111 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9122 tmp_tmpopd
= tmp_tmpd
;
9123 tmp_carry
= CPU (h_cbit
);
9124 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9128 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))));
9129 CPU (h_cbit
) = opval
;
9130 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9133 BI opval
= LTHI (tmp_newval
, 0);
9134 CPU (h_nbit
) = opval
;
9135 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9138 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9139 CPU (h_zbit
) = opval
;
9140 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9143 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)));
9144 CPU (h_vbit
) = opval
;
9145 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9150 CPU (h_xbit
) = opval
;
9151 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9155 SET_H_INSN_PREFIXED_P (opval
);
9156 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9163 abuf
->written
= written
;
9168 CASE (sem
, INSN_TEST_M_D_M
) : /* test-m.d [${Rs}${inc}] */
9170 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9171 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9172 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9173 int UNUSED written
= 0;
9174 IADDR UNUSED pc
= abuf
->addr
;
9175 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9179 tmp_tmpd
= ({ SI tmp_addr
;
9182 tmp_postinc
= FLD (f_memmode
);
9183 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9184 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
9185 ; if (NEBI (tmp_postinc
, 0)) {
9187 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9188 tmp_addr
= ADDSI (tmp_addr
, 4);
9191 SI opval
= tmp_addr
;
9192 SET_H_GR (FLD (f_operand1
), opval
);
9193 written
|= (1 << 8);
9194 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9205 tmp_tmpopd
= tmp_tmpd
;
9206 tmp_carry
= CPU (h_cbit
);
9207 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9211 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))));
9212 CPU (h_cbit
) = opval
;
9213 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9216 BI opval
= LTSI (tmp_newval
, 0);
9217 CPU (h_nbit
) = opval
;
9218 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9221 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9222 CPU (h_zbit
) = opval
;
9223 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9226 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)));
9227 CPU (h_vbit
) = opval
;
9228 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9233 CPU (h_xbit
) = opval
;
9234 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9238 SET_H_INSN_PREFIXED_P (opval
);
9239 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9246 abuf
->written
= written
;
9251 CASE (sem
, INSN_MOVE_R_M_B_M
) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9253 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9254 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9255 #define FLD(f) abuf->fields.sfmt_addc_m.f
9256 int UNUSED written
= 0;
9257 IADDR UNUSED pc
= abuf
->addr
;
9258 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9262 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9266 tmp_postinc
= FLD (f_memmode
);
9267 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9268 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9269 if (EQBI (CPU (h_pbit
), 0)) {
9272 QI opval
= tmp_tmpd
;
9273 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9274 written
|= (1 << 10);
9275 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9278 BI opval
= CPU (h_pbit
);
9279 CPU (h_cbit
) = opval
;
9280 written
|= (1 << 9);
9281 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9287 CPU (h_cbit
) = opval
;
9288 written
|= (1 << 9);
9289 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9294 QI opval
= tmp_tmpd
;
9295 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9296 written
|= (1 << 10);
9297 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9300 if (NEBI (tmp_postinc
, 0)) {
9302 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9303 tmp_addr
= ADDSI (tmp_addr
, 1);
9306 SI opval
= tmp_addr
;
9307 SET_H_GR (FLD (f_operand1
), opval
);
9308 written
|= (1 << 8);
9309 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9317 CPU (h_xbit
) = opval
;
9318 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9322 SET_H_INSN_PREFIXED_P (opval
);
9323 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9328 abuf
->written
= written
;
9333 CASE (sem
, INSN_MOVE_R_M_W_M
) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9335 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9336 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9337 #define FLD(f) abuf->fields.sfmt_addc_m.f
9338 int UNUSED written
= 0;
9339 IADDR UNUSED pc
= abuf
->addr
;
9340 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9344 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9348 tmp_postinc
= FLD (f_memmode
);
9349 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9350 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9351 if (EQBI (CPU (h_pbit
), 0)) {
9354 HI opval
= tmp_tmpd
;
9355 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9356 written
|= (1 << 10);
9357 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9360 BI opval
= CPU (h_pbit
);
9361 CPU (h_cbit
) = opval
;
9362 written
|= (1 << 9);
9363 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9369 CPU (h_cbit
) = opval
;
9370 written
|= (1 << 9);
9371 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9376 HI opval
= tmp_tmpd
;
9377 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9378 written
|= (1 << 10);
9379 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9382 if (NEBI (tmp_postinc
, 0)) {
9384 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9385 tmp_addr
= ADDSI (tmp_addr
, 2);
9388 SI opval
= tmp_addr
;
9389 SET_H_GR (FLD (f_operand1
), opval
);
9390 written
|= (1 << 8);
9391 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9399 CPU (h_xbit
) = opval
;
9400 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9404 SET_H_INSN_PREFIXED_P (opval
);
9405 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9410 abuf
->written
= written
;
9415 CASE (sem
, INSN_MOVE_R_M_D_M
) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9417 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9418 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9419 #define FLD(f) abuf->fields.sfmt_addc_m.f
9420 int UNUSED written
= 0;
9421 IADDR UNUSED pc
= abuf
->addr
;
9422 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9426 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9430 tmp_postinc
= FLD (f_memmode
);
9431 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9432 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9433 if (EQBI (CPU (h_pbit
), 0)) {
9436 SI opval
= tmp_tmpd
;
9437 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9438 written
|= (1 << 10);
9439 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9442 BI opval
= CPU (h_pbit
);
9443 CPU (h_cbit
) = opval
;
9444 written
|= (1 << 9);
9445 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9451 CPU (h_cbit
) = opval
;
9452 written
|= (1 << 9);
9453 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9458 SI opval
= tmp_tmpd
;
9459 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9460 written
|= (1 << 10);
9461 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9464 if (NEBI (tmp_postinc
, 0)) {
9466 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9467 tmp_addr
= ADDSI (tmp_addr
, 4);
9470 SI opval
= tmp_addr
;
9471 SET_H_GR (FLD (f_operand1
), opval
);
9472 written
|= (1 << 8);
9473 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9481 CPU (h_xbit
) = opval
;
9482 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9486 SET_H_INSN_PREFIXED_P (opval
);
9487 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9492 abuf
->written
= written
;
9497 CASE (sem
, INSN_MULS_B
) : /* muls.b $Rs,$Rd */
9499 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9500 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9501 #define FLD(f) abuf->fields.sfmt_muls_b.f
9502 int UNUSED written
= 0;
9503 IADDR UNUSED pc
= abuf
->addr
;
9504 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9510 tmp_src1
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9511 tmp_src2
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9512 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9514 SI opval
= TRUNCDISI (tmp_tmpr
);
9515 SET_H_GR (FLD (f_operand2
), opval
);
9516 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9519 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9520 SET_H_SR (((UINT
) 7), opval
);
9521 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9525 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9526 CPU (h_cbit
) = opval
;
9527 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9530 BI opval
= LTDI (tmp_tmpr
, 0);
9531 CPU (h_nbit
) = opval
;
9532 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9535 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9536 CPU (h_zbit
) = opval
;
9537 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9540 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9541 CPU (h_vbit
) = opval
;
9542 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9547 CPU (h_xbit
) = opval
;
9548 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9552 SET_H_INSN_PREFIXED_P (opval
);
9553 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9563 CASE (sem
, INSN_MULS_W
) : /* muls.w $Rs,$Rd */
9565 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9566 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9567 #define FLD(f) abuf->fields.sfmt_muls_b.f
9568 int UNUSED written
= 0;
9569 IADDR UNUSED pc
= abuf
->addr
;
9570 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9576 tmp_src1
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9577 tmp_src2
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9578 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9580 SI opval
= TRUNCDISI (tmp_tmpr
);
9581 SET_H_GR (FLD (f_operand2
), opval
);
9582 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9585 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9586 SET_H_SR (((UINT
) 7), opval
);
9587 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9591 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9592 CPU (h_cbit
) = opval
;
9593 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9596 BI opval
= LTDI (tmp_tmpr
, 0);
9597 CPU (h_nbit
) = opval
;
9598 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9601 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9602 CPU (h_zbit
) = opval
;
9603 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9606 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9607 CPU (h_vbit
) = opval
;
9608 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9613 CPU (h_xbit
) = opval
;
9614 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9618 SET_H_INSN_PREFIXED_P (opval
);
9619 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9629 CASE (sem
, INSN_MULS_D
) : /* muls.d $Rs,$Rd */
9631 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9632 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9633 #define FLD(f) abuf->fields.sfmt_muls_b.f
9634 int UNUSED written
= 0;
9635 IADDR UNUSED pc
= abuf
->addr
;
9636 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9642 tmp_src1
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9643 tmp_src2
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9644 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9646 SI opval
= TRUNCDISI (tmp_tmpr
);
9647 SET_H_GR (FLD (f_operand2
), opval
);
9648 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9651 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9652 SET_H_SR (((UINT
) 7), opval
);
9653 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9657 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9658 CPU (h_cbit
) = opval
;
9659 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9662 BI opval
= LTDI (tmp_tmpr
, 0);
9663 CPU (h_nbit
) = opval
;
9664 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9667 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9668 CPU (h_zbit
) = opval
;
9669 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9672 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9673 CPU (h_vbit
) = opval
;
9674 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9679 CPU (h_xbit
) = opval
;
9680 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9684 SET_H_INSN_PREFIXED_P (opval
);
9685 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9695 CASE (sem
, INSN_MULU_B
) : /* mulu.b $Rs,$Rd */
9697 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9698 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9699 #define FLD(f) abuf->fields.sfmt_muls_b.f
9700 int UNUSED written
= 0;
9701 IADDR UNUSED pc
= abuf
->addr
;
9702 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9708 tmp_src1
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9709 tmp_src2
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9710 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9712 SI opval
= TRUNCDISI (tmp_tmpr
);
9713 SET_H_GR (FLD (f_operand2
), opval
);
9714 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9717 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9718 SET_H_SR (((UINT
) 7), opval
);
9719 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9723 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9724 CPU (h_cbit
) = opval
;
9725 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9728 BI opval
= LTDI (tmp_tmpr
, 0);
9729 CPU (h_nbit
) = opval
;
9730 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9733 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9734 CPU (h_zbit
) = opval
;
9735 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9738 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9739 CPU (h_vbit
) = opval
;
9740 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9745 CPU (h_xbit
) = opval
;
9746 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9750 SET_H_INSN_PREFIXED_P (opval
);
9751 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9761 CASE (sem
, INSN_MULU_W
) : /* mulu.w $Rs,$Rd */
9763 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9764 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9765 #define FLD(f) abuf->fields.sfmt_muls_b.f
9766 int UNUSED written
= 0;
9767 IADDR UNUSED pc
= abuf
->addr
;
9768 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9774 tmp_src1
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9775 tmp_src2
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9776 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9778 SI opval
= TRUNCDISI (tmp_tmpr
);
9779 SET_H_GR (FLD (f_operand2
), opval
);
9780 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9783 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9784 SET_H_SR (((UINT
) 7), opval
);
9785 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9789 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9790 CPU (h_cbit
) = opval
;
9791 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9794 BI opval
= LTDI (tmp_tmpr
, 0);
9795 CPU (h_nbit
) = opval
;
9796 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9799 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9800 CPU (h_zbit
) = opval
;
9801 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9804 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9805 CPU (h_vbit
) = opval
;
9806 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9811 CPU (h_xbit
) = opval
;
9812 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9816 SET_H_INSN_PREFIXED_P (opval
);
9817 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9827 CASE (sem
, INSN_MULU_D
) : /* mulu.d $Rs,$Rd */
9829 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9830 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9831 #define FLD(f) abuf->fields.sfmt_muls_b.f
9832 int UNUSED written
= 0;
9833 IADDR UNUSED pc
= abuf
->addr
;
9834 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9840 tmp_src1
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9841 tmp_src2
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9842 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9844 SI opval
= TRUNCDISI (tmp_tmpr
);
9845 SET_H_GR (FLD (f_operand2
), opval
);
9846 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9849 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9850 SET_H_SR (((UINT
) 7), opval
);
9851 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9855 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9856 CPU (h_cbit
) = opval
;
9857 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9860 BI opval
= LTDI (tmp_tmpr
, 0);
9861 CPU (h_nbit
) = opval
;
9862 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9865 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9866 CPU (h_zbit
) = opval
;
9867 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9870 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9871 CPU (h_vbit
) = opval
;
9872 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9877 CPU (h_xbit
) = opval
;
9878 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9882 SET_H_INSN_PREFIXED_P (opval
);
9883 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9893 CASE (sem
, INSN_MCP
) : /* mcp $Ps,$Rd */
9895 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9896 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9897 #define FLD(f) abuf->fields.sfmt_mcp.f
9898 int UNUSED written
= 0;
9899 IADDR UNUSED pc
= abuf
->addr
;
9900 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9910 tmp_tmpops
= GET_H_SR (FLD (f_operand2
));
9911 tmp_tmpopd
= GET_H_GR (FLD (f_operand1
));
9912 tmp_carry
= CPU (h_rbit
);
9913 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9915 SI opval
= tmp_newval
;
9916 SET_H_GR (FLD (f_operand1
), opval
);
9917 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9921 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))));
9922 CPU (h_rbit
) = opval
;
9923 TRACE_RESULT (current_cpu
, abuf
, "rbit", 'x', opval
);
9926 BI opval
= LTSI (tmp_newval
, 0);
9927 CPU (h_nbit
) = opval
;
9928 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9931 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9932 CPU (h_zbit
) = opval
;
9933 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9936 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)));
9937 CPU (h_vbit
) = opval
;
9938 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9943 CPU (h_xbit
) = opval
;
9944 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9948 SET_H_INSN_PREFIXED_P (opval
);
9949 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9960 CASE (sem
, INSN_DSTEP
) : /* dstep $Rs,$Rd */
9962 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9963 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9964 #define FLD(f) abuf->fields.sfmt_muls_b.f
9965 int UNUSED written
= 0;
9966 IADDR UNUSED pc
= abuf
->addr
;
9967 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9973 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9974 tmp_tmp
= SLLSI (GET_H_GR (FLD (f_operand2
)), 1);
9975 tmp_tmpd
= ((GEUSI (tmp_tmp
, tmp_tmps
)) ? (SUBSI (tmp_tmp
, tmp_tmps
)) : (tmp_tmp
));
9977 SI opval
= tmp_tmpd
;
9978 SET_H_GR (FLD (f_operand2
), opval
);
9979 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9983 BI opval
= LTSI (tmp_tmpd
, 0);
9984 CPU (h_nbit
) = opval
;
9985 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9988 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9989 CPU (h_zbit
) = opval
;
9990 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9992 SET_H_CBIT_MOVE (0);
9993 SET_H_VBIT_MOVE (0);
9997 CPU (h_xbit
) = opval
;
9998 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10002 SET_H_INSN_PREFIXED_P (opval
);
10003 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10013 CASE (sem
, INSN_ABS
) : /* abs $Rs,$Rd */
10015 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10016 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10017 #define FLD(f) abuf->fields.sfmt_muls_b.f
10018 int UNUSED written
= 0;
10019 IADDR UNUSED pc
= abuf
->addr
;
10020 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10024 tmp_tmpd
= ABSSI (GET_H_GR (FLD (f_operand1
)));
10026 SI opval
= tmp_tmpd
;
10027 SET_H_GR (FLD (f_operand2
), opval
);
10028 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10032 BI opval
= LTSI (tmp_tmpd
, 0);
10033 CPU (h_nbit
) = opval
;
10034 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10037 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10038 CPU (h_zbit
) = opval
;
10039 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10041 SET_H_CBIT_MOVE (0);
10042 SET_H_VBIT_MOVE (0);
10046 CPU (h_xbit
) = opval
;
10047 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10051 SET_H_INSN_PREFIXED_P (opval
);
10052 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10062 CASE (sem
, INSN_AND_B_R
) : /* and.b $Rs,$Rd */
10064 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10065 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10066 #define FLD(f) abuf->fields.sfmt_addc_m.f
10067 int UNUSED written
= 0;
10068 IADDR UNUSED pc
= abuf
->addr
;
10069 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10073 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10076 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10078 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10079 SET_H_GR (FLD (f_operand2
), opval
);
10080 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10085 BI opval
= LTQI (tmp_tmpd
, 0);
10086 CPU (h_nbit
) = opval
;
10087 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10090 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10091 CPU (h_zbit
) = opval
;
10092 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10094 SET_H_CBIT_MOVE (0);
10095 SET_H_VBIT_MOVE (0);
10099 CPU (h_xbit
) = opval
;
10100 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10104 SET_H_INSN_PREFIXED_P (opval
);
10105 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10115 CASE (sem
, INSN_AND_W_R
) : /* and.w $Rs,$Rd */
10117 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10118 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10119 #define FLD(f) abuf->fields.sfmt_addc_m.f
10120 int UNUSED written
= 0;
10121 IADDR UNUSED pc
= abuf
->addr
;
10122 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10126 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10129 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10131 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10132 SET_H_GR (FLD (f_operand2
), opval
);
10133 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10138 BI opval
= LTHI (tmp_tmpd
, 0);
10139 CPU (h_nbit
) = opval
;
10140 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10143 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10144 CPU (h_zbit
) = opval
;
10145 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10147 SET_H_CBIT_MOVE (0);
10148 SET_H_VBIT_MOVE (0);
10152 CPU (h_xbit
) = opval
;
10153 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10157 SET_H_INSN_PREFIXED_P (opval
);
10158 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10168 CASE (sem
, INSN_AND_D_R
) : /* and.d $Rs,$Rd */
10170 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10171 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10172 #define FLD(f) abuf->fields.sfmt_addc_m.f
10173 int UNUSED written
= 0;
10174 IADDR UNUSED pc
= abuf
->addr
;
10175 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10179 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10181 SI opval
= tmp_tmpd
;
10182 SET_H_GR (FLD (f_operand2
), opval
);
10183 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10187 BI opval
= LTSI (tmp_tmpd
, 0);
10188 CPU (h_nbit
) = opval
;
10189 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10192 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10193 CPU (h_zbit
) = opval
;
10194 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10196 SET_H_CBIT_MOVE (0);
10197 SET_H_VBIT_MOVE (0);
10201 CPU (h_xbit
) = opval
;
10202 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10206 SET_H_INSN_PREFIXED_P (opval
);
10207 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10217 CASE (sem
, INSN_AND_M_B_M
) : /* and-m.b [${Rs}${inc}],${Rd} */
10219 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10220 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10221 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10222 int UNUSED written
= 0;
10223 IADDR UNUSED pc
= abuf
->addr
;
10224 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10228 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10231 tmp_postinc
= FLD (f_memmode
);
10232 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10233 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10234 ; if (NEBI (tmp_postinc
, 0)) {
10236 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10237 tmp_addr
= ADDSI (tmp_addr
, 1);
10240 SI opval
= tmp_addr
;
10241 SET_H_GR (FLD (f_operand1
), opval
);
10242 written
|= (1 << 11);
10243 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10247 ; tmp_tmp_mem
; }));
10250 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10252 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10253 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10254 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10259 BI opval
= LTQI (tmp_tmpd
, 0);
10260 CPU (h_nbit
) = opval
;
10261 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10264 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10265 CPU (h_zbit
) = opval
;
10266 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10268 SET_H_CBIT_MOVE (0);
10269 SET_H_VBIT_MOVE (0);
10273 CPU (h_xbit
) = opval
;
10274 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10278 SET_H_INSN_PREFIXED_P (opval
);
10279 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10285 abuf
->written
= written
;
10290 CASE (sem
, INSN_AND_M_W_M
) : /* and-m.w [${Rs}${inc}],${Rd} */
10292 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10293 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10294 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10295 int UNUSED written
= 0;
10296 IADDR UNUSED pc
= abuf
->addr
;
10297 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10301 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10304 tmp_postinc
= FLD (f_memmode
);
10305 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10306 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10307 ; if (NEBI (tmp_postinc
, 0)) {
10309 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10310 tmp_addr
= ADDSI (tmp_addr
, 2);
10313 SI opval
= tmp_addr
;
10314 SET_H_GR (FLD (f_operand1
), opval
);
10315 written
|= (1 << 11);
10316 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10320 ; tmp_tmp_mem
; }));
10323 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10325 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10326 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10327 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10332 BI opval
= LTHI (tmp_tmpd
, 0);
10333 CPU (h_nbit
) = opval
;
10334 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10337 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10338 CPU (h_zbit
) = opval
;
10339 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10341 SET_H_CBIT_MOVE (0);
10342 SET_H_VBIT_MOVE (0);
10346 CPU (h_xbit
) = opval
;
10347 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10351 SET_H_INSN_PREFIXED_P (opval
);
10352 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10358 abuf
->written
= written
;
10363 CASE (sem
, INSN_AND_M_D_M
) : /* and-m.d [${Rs}${inc}],${Rd} */
10365 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10366 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10367 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10368 int UNUSED written
= 0;
10369 IADDR UNUSED pc
= abuf
->addr
;
10370 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10374 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10377 tmp_postinc
= FLD (f_memmode
);
10378 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10379 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10380 ; if (NEBI (tmp_postinc
, 0)) {
10382 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10383 tmp_addr
= ADDSI (tmp_addr
, 4);
10386 SI opval
= tmp_addr
;
10387 SET_H_GR (FLD (f_operand1
), opval
);
10388 written
|= (1 << 10);
10389 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10393 ; tmp_tmp_mem
; }));
10395 SI opval
= tmp_tmpd
;
10396 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10397 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10401 BI opval
= LTSI (tmp_tmpd
, 0);
10402 CPU (h_nbit
) = opval
;
10403 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10406 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10407 CPU (h_zbit
) = opval
;
10408 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10410 SET_H_CBIT_MOVE (0);
10411 SET_H_VBIT_MOVE (0);
10415 CPU (h_xbit
) = opval
;
10416 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10420 SET_H_INSN_PREFIXED_P (opval
);
10421 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10427 abuf
->written
= written
;
10432 CASE (sem
, INSN_ANDCBR
) : /* and.b ${sconst8}],${Rd} */
10434 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10435 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10436 #define FLD(f) abuf->fields.sfmt_addcbr.f
10437 int UNUSED written
= 0;
10438 IADDR UNUSED pc
= abuf
->addr
;
10439 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10443 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10446 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10448 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10449 SET_H_GR (FLD (f_operand2
), opval
);
10450 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10455 BI opval
= LTQI (tmp_tmpd
, 0);
10456 CPU (h_nbit
) = opval
;
10457 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10460 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10461 CPU (h_zbit
) = opval
;
10462 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10464 SET_H_CBIT_MOVE (0);
10465 SET_H_VBIT_MOVE (0);
10469 CPU (h_xbit
) = opval
;
10470 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10474 SET_H_INSN_PREFIXED_P (opval
);
10475 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10485 CASE (sem
, INSN_ANDCWR
) : /* and.w ${sconst16}],${Rd} */
10487 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10488 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10489 #define FLD(f) abuf->fields.sfmt_addcwr.f
10490 int UNUSED written
= 0;
10491 IADDR UNUSED pc
= abuf
->addr
;
10492 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10496 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10499 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10501 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10502 SET_H_GR (FLD (f_operand2
), opval
);
10503 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10508 BI opval
= LTHI (tmp_tmpd
, 0);
10509 CPU (h_nbit
) = opval
;
10510 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10513 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10514 CPU (h_zbit
) = opval
;
10515 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10517 SET_H_CBIT_MOVE (0);
10518 SET_H_VBIT_MOVE (0);
10522 CPU (h_xbit
) = opval
;
10523 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10527 SET_H_INSN_PREFIXED_P (opval
);
10528 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10538 CASE (sem
, INSN_ANDCDR
) : /* and.d ${const32}],${Rd} */
10540 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10541 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10542 #define FLD(f) abuf->fields.sfmt_addcdr.f
10543 int UNUSED written
= 0;
10544 IADDR UNUSED pc
= abuf
->addr
;
10545 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10549 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10551 SI opval
= tmp_tmpd
;
10552 SET_H_GR (FLD (f_operand2
), opval
);
10553 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10557 BI opval
= LTSI (tmp_tmpd
, 0);
10558 CPU (h_nbit
) = opval
;
10559 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10562 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10563 CPU (h_zbit
) = opval
;
10564 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10566 SET_H_CBIT_MOVE (0);
10567 SET_H_VBIT_MOVE (0);
10571 CPU (h_xbit
) = opval
;
10572 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10576 SET_H_INSN_PREFIXED_P (opval
);
10577 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10587 CASE (sem
, INSN_ANDQ
) : /* andq $i,$Rd */
10589 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10590 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10591 #define FLD(f) abuf->fields.sfmt_andq.f
10592 int UNUSED written
= 0;
10593 IADDR UNUSED pc
= abuf
->addr
;
10594 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10598 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10600 SI opval
= tmp_tmpd
;
10601 SET_H_GR (FLD (f_operand2
), opval
);
10602 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10606 BI opval
= LTSI (tmp_tmpd
, 0);
10607 CPU (h_nbit
) = opval
;
10608 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10611 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10612 CPU (h_zbit
) = opval
;
10613 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10615 SET_H_CBIT_MOVE (0);
10616 SET_H_VBIT_MOVE (0);
10620 CPU (h_xbit
) = opval
;
10621 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10625 SET_H_INSN_PREFIXED_P (opval
);
10626 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10636 CASE (sem
, INSN_ORR_B_R
) : /* orr.b $Rs,$Rd */
10638 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10639 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10640 #define FLD(f) abuf->fields.sfmt_addc_m.f
10641 int UNUSED written
= 0;
10642 IADDR UNUSED pc
= abuf
->addr
;
10643 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10647 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10650 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10652 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10653 SET_H_GR (FLD (f_operand2
), opval
);
10654 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10659 BI opval
= LTQI (tmp_tmpd
, 0);
10660 CPU (h_nbit
) = opval
;
10661 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10664 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10665 CPU (h_zbit
) = opval
;
10666 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10668 SET_H_CBIT_MOVE (0);
10669 SET_H_VBIT_MOVE (0);
10673 CPU (h_xbit
) = opval
;
10674 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10678 SET_H_INSN_PREFIXED_P (opval
);
10679 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10689 CASE (sem
, INSN_ORR_W_R
) : /* orr.w $Rs,$Rd */
10691 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10692 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10693 #define FLD(f) abuf->fields.sfmt_addc_m.f
10694 int UNUSED written
= 0;
10695 IADDR UNUSED pc
= abuf
->addr
;
10696 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10700 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10703 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10705 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10706 SET_H_GR (FLD (f_operand2
), opval
);
10707 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10712 BI opval
= LTHI (tmp_tmpd
, 0);
10713 CPU (h_nbit
) = opval
;
10714 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10717 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10718 CPU (h_zbit
) = opval
;
10719 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10721 SET_H_CBIT_MOVE (0);
10722 SET_H_VBIT_MOVE (0);
10726 CPU (h_xbit
) = opval
;
10727 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10731 SET_H_INSN_PREFIXED_P (opval
);
10732 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10742 CASE (sem
, INSN_ORR_D_R
) : /* orr.d $Rs,$Rd */
10744 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10745 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10746 #define FLD(f) abuf->fields.sfmt_addc_m.f
10747 int UNUSED written
= 0;
10748 IADDR UNUSED pc
= abuf
->addr
;
10749 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10753 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10755 SI opval
= tmp_tmpd
;
10756 SET_H_GR (FLD (f_operand2
), opval
);
10757 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10761 BI opval
= LTSI (tmp_tmpd
, 0);
10762 CPU (h_nbit
) = opval
;
10763 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10766 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10767 CPU (h_zbit
) = opval
;
10768 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10770 SET_H_CBIT_MOVE (0);
10771 SET_H_VBIT_MOVE (0);
10775 CPU (h_xbit
) = opval
;
10776 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10780 SET_H_INSN_PREFIXED_P (opval
);
10781 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10791 CASE (sem
, INSN_OR_M_B_M
) : /* or-m.b [${Rs}${inc}],${Rd} */
10793 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10794 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10795 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10796 int UNUSED written
= 0;
10797 IADDR UNUSED pc
= abuf
->addr
;
10798 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10802 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10805 tmp_postinc
= FLD (f_memmode
);
10806 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10807 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10808 ; if (NEBI (tmp_postinc
, 0)) {
10810 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10811 tmp_addr
= ADDSI (tmp_addr
, 1);
10814 SI opval
= tmp_addr
;
10815 SET_H_GR (FLD (f_operand1
), opval
);
10816 written
|= (1 << 11);
10817 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10821 ; tmp_tmp_mem
; }));
10824 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10826 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10827 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10828 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10833 BI opval
= LTQI (tmp_tmpd
, 0);
10834 CPU (h_nbit
) = opval
;
10835 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10838 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10839 CPU (h_zbit
) = opval
;
10840 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10842 SET_H_CBIT_MOVE (0);
10843 SET_H_VBIT_MOVE (0);
10847 CPU (h_xbit
) = opval
;
10848 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10852 SET_H_INSN_PREFIXED_P (opval
);
10853 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10859 abuf
->written
= written
;
10864 CASE (sem
, INSN_OR_M_W_M
) : /* or-m.w [${Rs}${inc}],${Rd} */
10866 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10867 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10868 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10869 int UNUSED written
= 0;
10870 IADDR UNUSED pc
= abuf
->addr
;
10871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10875 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10878 tmp_postinc
= FLD (f_memmode
);
10879 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10880 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10881 ; if (NEBI (tmp_postinc
, 0)) {
10883 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10884 tmp_addr
= ADDSI (tmp_addr
, 2);
10887 SI opval
= tmp_addr
;
10888 SET_H_GR (FLD (f_operand1
), opval
);
10889 written
|= (1 << 11);
10890 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10894 ; tmp_tmp_mem
; }));
10897 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10899 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10900 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10901 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10906 BI opval
= LTHI (tmp_tmpd
, 0);
10907 CPU (h_nbit
) = opval
;
10908 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10911 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10912 CPU (h_zbit
) = opval
;
10913 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10915 SET_H_CBIT_MOVE (0);
10916 SET_H_VBIT_MOVE (0);
10920 CPU (h_xbit
) = opval
;
10921 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10925 SET_H_INSN_PREFIXED_P (opval
);
10926 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10932 abuf
->written
= written
;
10937 CASE (sem
, INSN_OR_M_D_M
) : /* or-m.d [${Rs}${inc}],${Rd} */
10939 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10940 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10941 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10942 int UNUSED written
= 0;
10943 IADDR UNUSED pc
= abuf
->addr
;
10944 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10948 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10951 tmp_postinc
= FLD (f_memmode
);
10952 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10953 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10954 ; if (NEBI (tmp_postinc
, 0)) {
10956 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10957 tmp_addr
= ADDSI (tmp_addr
, 4);
10960 SI opval
= tmp_addr
;
10961 SET_H_GR (FLD (f_operand1
), opval
);
10962 written
|= (1 << 10);
10963 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10967 ; tmp_tmp_mem
; }));
10969 SI opval
= tmp_tmpd
;
10970 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10971 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10975 BI opval
= LTSI (tmp_tmpd
, 0);
10976 CPU (h_nbit
) = opval
;
10977 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10980 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10981 CPU (h_zbit
) = opval
;
10982 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10984 SET_H_CBIT_MOVE (0);
10985 SET_H_VBIT_MOVE (0);
10989 CPU (h_xbit
) = opval
;
10990 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10994 SET_H_INSN_PREFIXED_P (opval
);
10995 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11001 abuf
->written
= written
;
11006 CASE (sem
, INSN_ORCBR
) : /* or.b ${sconst8}],${Rd} */
11008 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11009 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11010 #define FLD(f) abuf->fields.sfmt_addcbr.f
11011 int UNUSED written
= 0;
11012 IADDR UNUSED pc
= abuf
->addr
;
11013 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11017 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
11020 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11022 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11023 SET_H_GR (FLD (f_operand2
), opval
);
11024 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11029 BI opval
= LTQI (tmp_tmpd
, 0);
11030 CPU (h_nbit
) = opval
;
11031 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11034 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11035 CPU (h_zbit
) = opval
;
11036 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11038 SET_H_CBIT_MOVE (0);
11039 SET_H_VBIT_MOVE (0);
11043 CPU (h_xbit
) = opval
;
11044 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11048 SET_H_INSN_PREFIXED_P (opval
);
11049 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11059 CASE (sem
, INSN_ORCWR
) : /* or.w ${sconst16}],${Rd} */
11061 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11062 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11063 #define FLD(f) abuf->fields.sfmt_addcwr.f
11064 int UNUSED written
= 0;
11065 IADDR UNUSED pc
= abuf
->addr
;
11066 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11070 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
11073 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11075 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11076 SET_H_GR (FLD (f_operand2
), opval
);
11077 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11082 BI opval
= LTHI (tmp_tmpd
, 0);
11083 CPU (h_nbit
) = opval
;
11084 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11087 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11088 CPU (h_zbit
) = opval
;
11089 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11091 SET_H_CBIT_MOVE (0);
11092 SET_H_VBIT_MOVE (0);
11096 CPU (h_xbit
) = opval
;
11097 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11101 SET_H_INSN_PREFIXED_P (opval
);
11102 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11112 CASE (sem
, INSN_ORCDR
) : /* or.d ${const32}],${Rd} */
11114 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11115 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11116 #define FLD(f) abuf->fields.sfmt_addcdr.f
11117 int UNUSED written
= 0;
11118 IADDR UNUSED pc
= abuf
->addr
;
11119 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
11123 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
11125 SI opval
= tmp_tmpd
;
11126 SET_H_GR (FLD (f_operand2
), opval
);
11127 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11131 BI opval
= LTSI (tmp_tmpd
, 0);
11132 CPU (h_nbit
) = opval
;
11133 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11136 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11137 CPU (h_zbit
) = opval
;
11138 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11140 SET_H_CBIT_MOVE (0);
11141 SET_H_VBIT_MOVE (0);
11145 CPU (h_xbit
) = opval
;
11146 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11150 SET_H_INSN_PREFIXED_P (opval
);
11151 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11161 CASE (sem
, INSN_ORQ
) : /* orq $i,$Rd */
11163 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11164 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11165 #define FLD(f) abuf->fields.sfmt_andq.f
11166 int UNUSED written
= 0;
11167 IADDR UNUSED pc
= abuf
->addr
;
11168 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11172 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
11174 SI opval
= tmp_tmpd
;
11175 SET_H_GR (FLD (f_operand2
), opval
);
11176 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11180 BI opval
= LTSI (tmp_tmpd
, 0);
11181 CPU (h_nbit
) = opval
;
11182 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11185 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11186 CPU (h_zbit
) = opval
;
11187 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11189 SET_H_CBIT_MOVE (0);
11190 SET_H_VBIT_MOVE (0);
11194 CPU (h_xbit
) = opval
;
11195 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11199 SET_H_INSN_PREFIXED_P (opval
);
11200 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11210 CASE (sem
, INSN_XOR
) : /* xor $Rs,$Rd */
11212 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11213 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11214 #define FLD(f) abuf->fields.sfmt_muls_b.f
11215 int UNUSED written
= 0;
11216 IADDR UNUSED pc
= abuf
->addr
;
11217 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11221 tmp_tmpd
= XORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
11223 SI opval
= tmp_tmpd
;
11224 SET_H_GR (FLD (f_operand2
), opval
);
11225 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11229 BI opval
= LTSI (tmp_tmpd
, 0);
11230 CPU (h_nbit
) = opval
;
11231 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11234 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11235 CPU (h_zbit
) = opval
;
11236 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11238 SET_H_CBIT_MOVE (0);
11239 SET_H_VBIT_MOVE (0);
11243 CPU (h_xbit
) = opval
;
11244 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11248 SET_H_INSN_PREFIXED_P (opval
);
11249 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11259 CASE (sem
, INSN_SWAP
) : /* swap${swapoption} ${Rs} */
11261 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11262 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11263 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11264 int UNUSED written
= 0;
11265 IADDR UNUSED pc
= abuf
->addr
;
11266 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11271 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
11272 tmp_tmpd
= ({ SI tmp_tmpcode
;
11275 tmp_tmpcode
= FLD (f_operand2
);
11276 ; tmp_tmpval
= tmp_tmps
;
11277 ; if (EQSI (tmp_tmpcode
, 0)) {
11278 tmp_tmpres
= (cgen_rtx_error (current_cpu
, "SWAP without swap modifier isn't implemented"), 0);
11280 else if (EQSI (tmp_tmpcode
, 1)) {
11281 tmp_tmpres
= ({ SI tmp_tmpr
;
11282 tmp_tmpr
= tmp_tmpval
;
11283 ; 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)))))))); });
11285 else if (EQSI (tmp_tmpcode
, 2)) {
11286 tmp_tmpres
= ({ SI tmp_tmpb
;
11287 tmp_tmpb
= tmp_tmpval
;
11288 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11290 else if (EQSI (tmp_tmpcode
, 3)) {
11291 tmp_tmpres
= ({ SI tmp_tmpr
;
11292 tmp_tmpr
= ({ SI tmp_tmpb
;
11293 tmp_tmpb
= tmp_tmpval
;
11294 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11295 ; 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)))))))); });
11297 else if (EQSI (tmp_tmpcode
, 4)) {
11298 tmp_tmpres
= ({ SI tmp_tmpb
;
11299 tmp_tmpb
= tmp_tmpval
;
11300 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11302 else if (EQSI (tmp_tmpcode
, 5)) {
11303 tmp_tmpres
= ({ SI tmp_tmpr
;
11304 tmp_tmpr
= ({ SI tmp_tmpb
;
11305 tmp_tmpb
= tmp_tmpval
;
11306 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11307 ; 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)))))))); });
11309 else if (EQSI (tmp_tmpcode
, 6)) {
11310 tmp_tmpres
= ({ SI tmp_tmpb
;
11311 tmp_tmpb
= ({ SI tmp_tmpb
;
11312 tmp_tmpb
= tmp_tmpval
;
11313 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11314 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11316 else if (EQSI (tmp_tmpcode
, 7)) {
11317 tmp_tmpres
= ({ SI tmp_tmpr
;
11318 tmp_tmpr
= ({ SI tmp_tmpb
;
11319 tmp_tmpb
= ({ SI tmp_tmpb
;
11320 tmp_tmpb
= tmp_tmpval
;
11321 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11322 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11323 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11325 else if (EQSI (tmp_tmpcode
, 8)) {
11326 tmp_tmpres
= INVSI (tmp_tmpval
);
11328 else if (EQSI (tmp_tmpcode
, 9)) {
11329 tmp_tmpres
= ({ SI tmp_tmpr
;
11330 tmp_tmpr
= INVSI (tmp_tmpval
);
11331 ; 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)))))))); });
11333 else if (EQSI (tmp_tmpcode
, 10)) {
11334 tmp_tmpres
= ({ SI tmp_tmpb
;
11335 tmp_tmpb
= INVSI (tmp_tmpval
);
11336 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11338 else if (EQSI (tmp_tmpcode
, 11)) {
11339 tmp_tmpres
= ({ SI tmp_tmpr
;
11340 tmp_tmpr
= ({ SI tmp_tmpb
;
11341 tmp_tmpb
= INVSI (tmp_tmpval
);
11342 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11343 ; 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)))))))); });
11345 else if (EQSI (tmp_tmpcode
, 12)) {
11346 tmp_tmpres
= ({ SI tmp_tmpb
;
11347 tmp_tmpb
= INVSI (tmp_tmpval
);
11348 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11350 else if (EQSI (tmp_tmpcode
, 13)) {
11351 tmp_tmpres
= ({ SI tmp_tmpr
;
11352 tmp_tmpr
= ({ SI tmp_tmpb
;
11353 tmp_tmpb
= INVSI (tmp_tmpval
);
11354 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11355 ; 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)))))))); });
11357 else if (EQSI (tmp_tmpcode
, 14)) {
11358 tmp_tmpres
= ({ SI tmp_tmpb
;
11359 tmp_tmpb
= ({ SI tmp_tmpb
;
11360 tmp_tmpb
= INVSI (tmp_tmpval
);
11361 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11362 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11364 else if (EQSI (tmp_tmpcode
, 15)) {
11365 tmp_tmpres
= ({ SI tmp_tmpr
;
11366 tmp_tmpr
= ({ SI tmp_tmpb
;
11367 tmp_tmpb
= ({ SI tmp_tmpb
;
11368 tmp_tmpb
= INVSI (tmp_tmpval
);
11369 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11370 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11371 ; 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)))))))); });
11375 SI opval
= tmp_tmpd
;
11376 SET_H_GR (FLD (f_operand1
), opval
);
11377 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11381 BI opval
= LTSI (tmp_tmpd
, 0);
11382 CPU (h_nbit
) = opval
;
11383 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11386 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11387 CPU (h_zbit
) = opval
;
11388 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11390 SET_H_CBIT_MOVE (0);
11391 SET_H_VBIT_MOVE (0);
11395 CPU (h_xbit
) = opval
;
11396 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11400 SET_H_INSN_PREFIXED_P (opval
);
11401 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11411 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11413 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11414 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11415 #define FLD(f) abuf->fields.sfmt_addc_m.f
11416 int UNUSED written
= 0;
11417 IADDR UNUSED pc
= abuf
->addr
;
11418 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11424 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11425 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11426 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11429 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11431 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11432 SET_H_GR (FLD (f_operand2
), opval
);
11433 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11438 BI opval
= LTQI (tmp_tmpd
, 0);
11439 CPU (h_nbit
) = opval
;
11440 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11443 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11444 CPU (h_zbit
) = opval
;
11445 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11447 SET_H_CBIT_MOVE (0);
11448 SET_H_VBIT_MOVE (0);
11452 CPU (h_xbit
) = opval
;
11453 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11457 SET_H_INSN_PREFIXED_P (opval
);
11458 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11468 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11470 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11471 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11472 #define FLD(f) abuf->fields.sfmt_addc_m.f
11473 int UNUSED written
= 0;
11474 IADDR UNUSED pc
= abuf
->addr
;
11475 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11481 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11482 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11483 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11486 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11488 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11489 SET_H_GR (FLD (f_operand2
), opval
);
11490 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11495 BI opval
= LTHI (tmp_tmpd
, 0);
11496 CPU (h_nbit
) = opval
;
11497 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11500 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11501 CPU (h_zbit
) = opval
;
11502 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11504 SET_H_CBIT_MOVE (0);
11505 SET_H_VBIT_MOVE (0);
11509 CPU (h_xbit
) = opval
;
11510 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11514 SET_H_INSN_PREFIXED_P (opval
);
11515 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11525 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11527 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11528 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11529 #define FLD(f) abuf->fields.sfmt_addc_m.f
11530 int UNUSED written
= 0;
11531 IADDR UNUSED pc
= abuf
->addr
;
11532 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11538 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11539 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11540 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11542 SI opval
= tmp_tmpd
;
11543 SET_H_GR (FLD (f_operand2
), opval
);
11544 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11548 BI opval
= LTSI (tmp_tmpd
, 0);
11549 CPU (h_nbit
) = opval
;
11550 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11553 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11554 CPU (h_zbit
) = opval
;
11555 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11557 SET_H_CBIT_MOVE (0);
11558 SET_H_VBIT_MOVE (0);
11562 CPU (h_xbit
) = opval
;
11563 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11567 SET_H_INSN_PREFIXED_P (opval
);
11568 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11578 CASE (sem
, INSN_ASRQ
) : /* asrq $c,${Rd} */
11580 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11581 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11582 #define FLD(f) abuf->fields.sfmt_asrq.f
11583 int UNUSED written
= 0;
11584 IADDR UNUSED pc
= abuf
->addr
;
11585 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11589 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11591 SI opval
= tmp_tmpd
;
11592 SET_H_GR (FLD (f_operand2
), opval
);
11593 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11597 BI opval
= LTSI (tmp_tmpd
, 0);
11598 CPU (h_nbit
) = opval
;
11599 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11602 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11603 CPU (h_zbit
) = opval
;
11604 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11606 SET_H_CBIT_MOVE (0);
11607 SET_H_VBIT_MOVE (0);
11611 CPU (h_xbit
) = opval
;
11612 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11616 SET_H_INSN_PREFIXED_P (opval
);
11617 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11627 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11631 #define FLD(f) abuf->fields.sfmt_addc_m.f
11632 int UNUSED written
= 0;
11633 IADDR UNUSED pc
= abuf
->addr
;
11634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11639 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11640 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11643 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11645 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11646 SET_H_GR (FLD (f_operand2
), opval
);
11647 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11652 BI opval
= LTQI (tmp_tmpd
, 0);
11653 CPU (h_nbit
) = opval
;
11654 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11657 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11658 CPU (h_zbit
) = opval
;
11659 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11661 SET_H_CBIT_MOVE (0);
11662 SET_H_VBIT_MOVE (0);
11666 CPU (h_xbit
) = opval
;
11667 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11671 SET_H_INSN_PREFIXED_P (opval
);
11672 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11682 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11684 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11685 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11686 #define FLD(f) abuf->fields.sfmt_addc_m.f
11687 int UNUSED written
= 0;
11688 IADDR UNUSED pc
= abuf
->addr
;
11689 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11694 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11695 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11698 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11700 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11701 SET_H_GR (FLD (f_operand2
), opval
);
11702 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11707 BI opval
= LTHI (tmp_tmpd
, 0);
11708 CPU (h_nbit
) = opval
;
11709 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11712 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11713 CPU (h_zbit
) = opval
;
11714 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11716 SET_H_CBIT_MOVE (0);
11717 SET_H_VBIT_MOVE (0);
11721 CPU (h_xbit
) = opval
;
11722 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11726 SET_H_INSN_PREFIXED_P (opval
);
11727 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11737 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11739 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11740 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11741 #define FLD(f) abuf->fields.sfmt_addc_m.f
11742 int UNUSED written
= 0;
11743 IADDR UNUSED pc
= abuf
->addr
;
11744 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11749 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11750 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11752 SI opval
= tmp_tmpd
;
11753 SET_H_GR (FLD (f_operand2
), opval
);
11754 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11758 BI opval
= LTSI (tmp_tmpd
, 0);
11759 CPU (h_nbit
) = opval
;
11760 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11763 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11764 CPU (h_zbit
) = opval
;
11765 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11767 SET_H_CBIT_MOVE (0);
11768 SET_H_VBIT_MOVE (0);
11772 CPU (h_xbit
) = opval
;
11773 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11777 SET_H_INSN_PREFIXED_P (opval
);
11778 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11788 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
11790 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11791 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11792 #define FLD(f) abuf->fields.sfmt_asrq.f
11793 int UNUSED written
= 0;
11794 IADDR UNUSED pc
= abuf
->addr
;
11795 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11799 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11801 SI opval
= tmp_tmpd
;
11802 SET_H_GR (FLD (f_operand2
), opval
);
11803 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11807 BI opval
= LTSI (tmp_tmpd
, 0);
11808 CPU (h_nbit
) = opval
;
11809 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11812 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11813 CPU (h_zbit
) = opval
;
11814 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11816 SET_H_CBIT_MOVE (0);
11817 SET_H_VBIT_MOVE (0);
11821 CPU (h_xbit
) = opval
;
11822 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11826 SET_H_INSN_PREFIXED_P (opval
);
11827 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11837 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
11839 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11840 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11841 #define FLD(f) abuf->fields.sfmt_addc_m.f
11842 int UNUSED written
= 0;
11843 IADDR UNUSED pc
= abuf
->addr
;
11844 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11849 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11850 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11853 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11855 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11856 SET_H_GR (FLD (f_operand2
), opval
);
11857 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11862 BI opval
= LTQI (tmp_tmpd
, 0);
11863 CPU (h_nbit
) = opval
;
11864 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11867 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11868 CPU (h_zbit
) = opval
;
11869 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11871 SET_H_CBIT_MOVE (0);
11872 SET_H_VBIT_MOVE (0);
11876 CPU (h_xbit
) = opval
;
11877 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11881 SET_H_INSN_PREFIXED_P (opval
);
11882 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11892 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
11894 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11895 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11896 #define FLD(f) abuf->fields.sfmt_addc_m.f
11897 int UNUSED written
= 0;
11898 IADDR UNUSED pc
= abuf
->addr
;
11899 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11904 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11905 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11908 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11910 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11911 SET_H_GR (FLD (f_operand2
), opval
);
11912 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11917 BI opval
= LTHI (tmp_tmpd
, 0);
11918 CPU (h_nbit
) = opval
;
11919 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11922 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11923 CPU (h_zbit
) = opval
;
11924 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11926 SET_H_CBIT_MOVE (0);
11927 SET_H_VBIT_MOVE (0);
11931 CPU (h_xbit
) = opval
;
11932 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11936 SET_H_INSN_PREFIXED_P (opval
);
11937 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11947 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
11949 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11950 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11951 #define FLD(f) abuf->fields.sfmt_addc_m.f
11952 int UNUSED written
= 0;
11953 IADDR UNUSED pc
= abuf
->addr
;
11954 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11959 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11960 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11962 SI opval
= tmp_tmpd
;
11963 SET_H_GR (FLD (f_operand2
), opval
);
11964 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11968 BI opval
= LTSI (tmp_tmpd
, 0);
11969 CPU (h_nbit
) = opval
;
11970 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11973 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11974 CPU (h_zbit
) = opval
;
11975 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11977 SET_H_CBIT_MOVE (0);
11978 SET_H_VBIT_MOVE (0);
11982 CPU (h_xbit
) = opval
;
11983 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11987 SET_H_INSN_PREFIXED_P (opval
);
11988 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11998 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
12000 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12001 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12002 #define FLD(f) abuf->fields.sfmt_asrq.f
12003 int UNUSED written
= 0;
12004 IADDR UNUSED pc
= abuf
->addr
;
12005 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12009 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
12011 SI opval
= tmp_tmpd
;
12012 SET_H_GR (FLD (f_operand2
), opval
);
12013 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12017 BI opval
= LTSI (tmp_tmpd
, 0);
12018 CPU (h_nbit
) = opval
;
12019 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12022 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12023 CPU (h_zbit
) = opval
;
12024 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12026 SET_H_CBIT_MOVE (0);
12027 SET_H_VBIT_MOVE (0);
12031 CPU (h_xbit
) = opval
;
12032 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12036 SET_H_INSN_PREFIXED_P (opval
);
12037 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12047 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
12049 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12050 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12051 #define FLD(f) abuf->fields.sfmt_muls_b.f
12052 int UNUSED written
= 0;
12053 IADDR UNUSED pc
= abuf
->addr
;
12054 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12059 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31)));
12062 BI opval
= LTSI (tmp_tmpd
, 0);
12063 CPU (h_nbit
) = opval
;
12064 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12067 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12068 CPU (h_zbit
) = opval
;
12069 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12071 SET_H_CBIT_MOVE (0);
12072 SET_H_VBIT_MOVE (0);
12076 CPU (h_xbit
) = opval
;
12077 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12081 SET_H_INSN_PREFIXED_P (opval
);
12082 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12092 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
12094 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12095 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12096 #define FLD(f) abuf->fields.sfmt_asrq.f
12097 int UNUSED written
= 0;
12098 IADDR UNUSED pc
= abuf
->addr
;
12099 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12103 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
12106 BI opval
= LTSI (tmp_tmpd
, 0);
12107 CPU (h_nbit
) = opval
;
12108 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12111 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12112 CPU (h_zbit
) = opval
;
12113 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12115 SET_H_CBIT_MOVE (0);
12116 SET_H_VBIT_MOVE (0);
12120 CPU (h_xbit
) = opval
;
12121 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12125 SET_H_INSN_PREFIXED_P (opval
);
12126 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12136 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
12138 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12139 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12140 #define FLD(f) abuf->fields.sfmt_setf.f
12141 int UNUSED written
= 0;
12142 IADDR UNUSED pc
= abuf
->addr
;
12143 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12147 tmp_tmp
= FLD (f_dstsrc
);
12148 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12151 CPU (h_cbit
) = opval
;
12152 written
|= (1 << 1);
12153 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12156 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12159 CPU (h_vbit
) = opval
;
12160 written
|= (1 << 7);
12161 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12164 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12167 CPU (h_zbit
) = opval
;
12168 written
|= (1 << 9);
12169 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12172 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12175 CPU (h_nbit
) = opval
;
12176 written
|= (1 << 3);
12177 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12180 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12183 CPU (h_xbit
) = opval
;
12184 written
|= (1 << 8);
12185 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12188 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12191 SET_H_IBIT (opval
);
12192 written
|= (1 << 2);
12193 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12196 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12199 SET_H_UBIT (opval
);
12200 written
|= (1 << 6);
12201 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12204 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12207 CPU (h_pbit
) = opval
;
12208 written
|= (1 << 4);
12209 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12214 SET_H_INSN_PREFIXED_P (opval
);
12215 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12217 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12220 CPU (h_xbit
) = opval
;
12221 written
|= (1 << 8);
12222 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12227 abuf
->written
= written
;
12232 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
12234 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12235 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12236 #define FLD(f) abuf->fields.sfmt_setf.f
12237 int UNUSED written
= 0;
12238 IADDR UNUSED pc
= abuf
->addr
;
12239 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12243 tmp_tmp
= FLD (f_dstsrc
);
12244 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12247 CPU (h_cbit
) = opval
;
12248 written
|= (1 << 1);
12249 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12252 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12255 CPU (h_vbit
) = opval
;
12256 written
|= (1 << 7);
12257 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12260 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12263 CPU (h_zbit
) = opval
;
12264 written
|= (1 << 9);
12265 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12268 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12271 CPU (h_nbit
) = opval
;
12272 written
|= (1 << 3);
12273 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12276 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12279 CPU (h_xbit
) = opval
;
12280 written
|= (1 << 8);
12281 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12284 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12287 SET_H_IBIT (opval
);
12288 written
|= (1 << 2);
12289 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12292 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12295 SET_H_UBIT (opval
);
12296 written
|= (1 << 6);
12297 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12300 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12303 CPU (h_pbit
) = opval
;
12304 written
|= (1 << 4);
12305 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12311 CPU (h_xbit
) = opval
;
12312 written
|= (1 << 8);
12313 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12317 SET_H_INSN_PREFIXED_P (opval
);
12318 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12323 abuf
->written
= written
;
12328 CASE (sem
, INSN_RFE
) : /* rfe */
12330 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12331 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12332 #define FLD(f) abuf->fields.sfmt_rfe.f
12333 int UNUSED written
= 0;
12334 IADDR UNUSED pc
= abuf
->addr
;
12335 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12343 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12344 tmp_keepmask
= 0xc0000000;
12345 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12346 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12347 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12349 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12350 SET_H_SR (((UINT
) 13), opval
);
12351 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12359 CASE (sem
, INSN_SFE
) : /* sfe */
12361 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12363 #define FLD(f) abuf->fields.sfmt_rfe.f
12364 int UNUSED written
= 0;
12365 IADDR UNUSED pc
= abuf
->addr
;
12366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12371 tmp_savemask
= 0xc0000000;
12372 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12374 SI opval
= ORSI (ANDSI (tmp_savemask
, tmp_oldccs
), ANDSI (INVSI (tmp_savemask
), SLLSI (tmp_oldccs
, 10)));
12375 SET_H_SR (((UINT
) 13), opval
);
12376 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12384 CASE (sem
, INSN_RFG
) : /* rfg */
12386 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12387 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12388 #define FLD(f) abuf->fields.fmt_empty.f
12389 int UNUSED written
= 0;
12390 IADDR UNUSED pc
= abuf
->addr
;
12391 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12393 crisv32f_rfg_handler (current_cpu
, pc
);
12399 CASE (sem
, INSN_RFN
) : /* rfn */
12401 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12403 #define FLD(f) abuf->fields.sfmt_rfe.f
12404 int UNUSED written
= 0;
12405 IADDR UNUSED pc
= abuf
->addr
;
12406 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12415 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12416 tmp_keepmask
= 0xc0000000;
12417 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12418 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12419 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12421 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12422 SET_H_SR (((UINT
) 13), opval
);
12423 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12428 SET_H_MBIT (opval
);
12429 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
12437 CASE (sem
, INSN_HALT
) : /* halt */
12439 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12440 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12441 #define FLD(f) abuf->fields.fmt_empty.f
12442 int UNUSED written
= 0;
12443 IADDR UNUSED pc
= abuf
->addr
;
12445 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12448 USI opval
= crisv32f_halt_handler (current_cpu
, pc
);
12449 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12450 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12453 SEM_BRANCH_FINI (vpc
);
12458 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12460 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12461 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12462 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12463 int UNUSED written
= 0;
12464 IADDR UNUSED pc
= abuf
->addr
;
12466 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12470 tmp_truthval
= ({ SI tmp_tmpcond
;
12472 tmp_tmpcond
= FLD (f_operand2
);
12473 ; if (EQSI (tmp_tmpcond
, 0)) {
12474 tmp_condres
= NOTBI (CPU (h_cbit
));
12476 else if (EQSI (tmp_tmpcond
, 1)) {
12477 tmp_condres
= CPU (h_cbit
);
12479 else if (EQSI (tmp_tmpcond
, 2)) {
12480 tmp_condres
= NOTBI (CPU (h_zbit
));
12482 else if (EQSI (tmp_tmpcond
, 3)) {
12483 tmp_condres
= CPU (h_zbit
);
12485 else if (EQSI (tmp_tmpcond
, 4)) {
12486 tmp_condres
= NOTBI (CPU (h_vbit
));
12488 else if (EQSI (tmp_tmpcond
, 5)) {
12489 tmp_condres
= CPU (h_vbit
);
12491 else if (EQSI (tmp_tmpcond
, 6)) {
12492 tmp_condres
= NOTBI (CPU (h_nbit
));
12494 else if (EQSI (tmp_tmpcond
, 7)) {
12495 tmp_condres
= CPU (h_nbit
);
12497 else if (EQSI (tmp_tmpcond
, 8)) {
12498 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12500 else if (EQSI (tmp_tmpcond
, 9)) {
12501 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12503 else if (EQSI (tmp_tmpcond
, 10)) {
12504 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12506 else if (EQSI (tmp_tmpcond
, 11)) {
12507 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12509 else if (EQSI (tmp_tmpcond
, 12)) {
12510 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12512 else if (EQSI (tmp_tmpcond
, 13)) {
12513 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12515 else if (EQSI (tmp_tmpcond
, 14)) {
12518 else if (EQSI (tmp_tmpcond
, 15)) {
12519 tmp_condres
= CPU (h_pbit
);
12522 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12526 CPU (h_xbit
) = opval
;
12527 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12531 SET_H_INSN_PREFIXED_P (opval
);
12532 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12535 if (tmp_truthval
) {
12538 USI opval
= FLD (i_o_pcrel
);
12539 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12540 written
|= (1 << 8);
12541 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12547 abuf
->written
= written
;
12548 SEM_BRANCH_FINI (vpc
);
12553 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12555 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12556 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12557 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12558 int UNUSED written
= 0;
12559 IADDR UNUSED pc
= abuf
->addr
;
12561 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12567 CPU (h_xbit
) = opval
;
12568 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12572 SET_H_INSN_PREFIXED_P (opval
);
12573 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12578 USI opval
= FLD (i_o_pcrel
);
12579 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12580 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12585 SEM_BRANCH_FINI (vpc
);
12590 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12592 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12593 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12594 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12595 int UNUSED written
= 0;
12596 IADDR UNUSED pc
= abuf
->addr
;
12598 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12602 tmp_truthval
= ({ SI tmp_tmpcond
;
12604 tmp_tmpcond
= FLD (f_operand2
);
12605 ; if (EQSI (tmp_tmpcond
, 0)) {
12606 tmp_condres
= NOTBI (CPU (h_cbit
));
12608 else if (EQSI (tmp_tmpcond
, 1)) {
12609 tmp_condres
= CPU (h_cbit
);
12611 else if (EQSI (tmp_tmpcond
, 2)) {
12612 tmp_condres
= NOTBI (CPU (h_zbit
));
12614 else if (EQSI (tmp_tmpcond
, 3)) {
12615 tmp_condres
= CPU (h_zbit
);
12617 else if (EQSI (tmp_tmpcond
, 4)) {
12618 tmp_condres
= NOTBI (CPU (h_vbit
));
12620 else if (EQSI (tmp_tmpcond
, 5)) {
12621 tmp_condres
= CPU (h_vbit
);
12623 else if (EQSI (tmp_tmpcond
, 6)) {
12624 tmp_condres
= NOTBI (CPU (h_nbit
));
12626 else if (EQSI (tmp_tmpcond
, 7)) {
12627 tmp_condres
= CPU (h_nbit
);
12629 else if (EQSI (tmp_tmpcond
, 8)) {
12630 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12632 else if (EQSI (tmp_tmpcond
, 9)) {
12633 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12635 else if (EQSI (tmp_tmpcond
, 10)) {
12636 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12638 else if (EQSI (tmp_tmpcond
, 11)) {
12639 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12641 else if (EQSI (tmp_tmpcond
, 12)) {
12642 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12644 else if (EQSI (tmp_tmpcond
, 13)) {
12645 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12647 else if (EQSI (tmp_tmpcond
, 14)) {
12650 else if (EQSI (tmp_tmpcond
, 15)) {
12651 tmp_condres
= CPU (h_pbit
);
12654 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12658 CPU (h_xbit
) = opval
;
12659 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12663 SET_H_INSN_PREFIXED_P (opval
);
12664 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12667 if (tmp_truthval
) {
12670 USI opval
= FLD (i_o_word_pcrel
);
12671 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12672 written
|= (1 << 8);
12673 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12679 abuf
->written
= written
;
12680 SEM_BRANCH_FINI (vpc
);
12685 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12687 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12688 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12689 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12690 int UNUSED written
= 0;
12691 IADDR UNUSED pc
= abuf
->addr
;
12693 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12699 CPU (h_xbit
) = opval
;
12700 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12704 SET_H_INSN_PREFIXED_P (opval
);
12705 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12710 USI opval
= FLD (i_o_word_pcrel
);
12711 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12712 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12717 SEM_BRANCH_FINI (vpc
);
12722 CASE (sem
, INSN_JAS_R
) : /* jas ${Rs},${Pd} */
12724 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12725 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12726 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12727 int UNUSED written
= 0;
12728 IADDR UNUSED pc
= abuf
->addr
;
12730 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12736 CPU (h_xbit
) = opval
;
12737 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12741 SET_H_INSN_PREFIXED_P (opval
);
12742 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12745 if (ANDIF (EQSI (FLD (f_operand1
), 1), EQSI (FLD (f_operand2
), 11))) {
12746 cris_flush_simulator_decode_cache (current_cpu
, pc
);
12751 SI opval
= ADDSI (pc
, 4);
12752 SET_H_SR (FLD (f_operand2
), opval
);
12753 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12756 USI opval
= GET_H_GR (FLD (f_operand1
));
12757 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12758 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12764 SEM_BRANCH_FINI (vpc
);
12769 CASE (sem
, INSN_JAS_C
) : /* jas ${const32},${Pd} */
12771 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12772 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12773 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12774 int UNUSED written
= 0;
12775 IADDR UNUSED pc
= abuf
->addr
;
12777 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12783 CPU (h_xbit
) = opval
;
12784 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12788 SET_H_INSN_PREFIXED_P (opval
);
12789 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12795 SI opval
= ADDSI (pc
, 8);
12796 SET_H_SR (FLD (f_operand2
), opval
);
12797 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12800 USI opval
= FLD (f_indir_pc__dword
);
12801 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12802 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12808 SEM_BRANCH_FINI (vpc
);
12813 CASE (sem
, INSN_JUMP_P
) : /* jump ${Ps} */
12815 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12816 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12817 #define FLD(f) abuf->fields.sfmt_mcp.f
12818 int UNUSED written
= 0;
12819 IADDR UNUSED pc
= abuf
->addr
;
12821 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12827 CPU (h_xbit
) = opval
;
12828 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12832 SET_H_INSN_PREFIXED_P (opval
);
12833 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12838 USI opval
= GET_H_SR (FLD (f_operand2
));
12839 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12840 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12845 SEM_BRANCH_FINI (vpc
);
12850 CASE (sem
, INSN_BAS_C
) : /* bas ${const32},${Pd} */
12852 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12854 #define FLD(f) abuf->fields.sfmt_bas_c.f
12855 int UNUSED written
= 0;
12856 IADDR UNUSED pc
= abuf
->addr
;
12858 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12864 CPU (h_xbit
) = opval
;
12865 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12869 SET_H_INSN_PREFIXED_P (opval
);
12870 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12876 SI opval
= ADDSI (pc
, 8);
12877 SET_H_SR (FLD (f_operand2
), opval
);
12878 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12881 USI opval
= FLD (i_const32_pcrel
);
12882 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12883 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12889 SEM_BRANCH_FINI (vpc
);
12894 CASE (sem
, INSN_JASC_R
) : /* jasc ${Rs},${Pd} */
12896 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12898 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12899 int UNUSED written
= 0;
12900 IADDR UNUSED pc
= abuf
->addr
;
12902 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12908 CPU (h_xbit
) = opval
;
12909 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12913 SET_H_INSN_PREFIXED_P (opval
);
12914 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12920 SI opval
= ADDSI (pc
, 8);
12921 SET_H_SR (FLD (f_operand2
), opval
);
12922 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12925 USI opval
= GET_H_GR (FLD (f_operand1
));
12926 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12927 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12933 SEM_BRANCH_FINI (vpc
);
12938 CASE (sem
, INSN_JASC_C
) : /* jasc ${const32},${Pd} */
12940 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12941 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12942 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12943 int UNUSED written
= 0;
12944 IADDR UNUSED pc
= abuf
->addr
;
12946 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12952 CPU (h_xbit
) = opval
;
12953 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12957 SET_H_INSN_PREFIXED_P (opval
);
12958 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12964 SI opval
= ADDSI (pc
, 12);
12965 SET_H_SR (FLD (f_operand2
), opval
);
12966 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12969 USI opval
= FLD (f_indir_pc__dword
);
12970 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12971 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12977 SEM_BRANCH_FINI (vpc
);
12982 CASE (sem
, INSN_BASC_C
) : /* basc ${const32},${Pd} */
12984 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12985 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12986 #define FLD(f) abuf->fields.sfmt_bas_c.f
12987 int UNUSED written
= 0;
12988 IADDR UNUSED pc
= abuf
->addr
;
12990 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12996 CPU (h_xbit
) = opval
;
12997 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13001 SET_H_INSN_PREFIXED_P (opval
);
13002 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13008 SI opval
= ADDSI (pc
, 12);
13009 SET_H_SR (FLD (f_operand2
), opval
);
13010 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13013 USI opval
= FLD (i_const32_pcrel
);
13014 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13015 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13021 SEM_BRANCH_FINI (vpc
);
13026 CASE (sem
, INSN_BREAK
) : /* break $n */
13028 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13029 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13030 #define FLD(f) abuf->fields.sfmt_break.f
13031 int UNUSED written
= 0;
13032 IADDR UNUSED pc
= abuf
->addr
;
13034 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13040 CPU (h_xbit
) = opval
;
13041 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13045 SET_H_INSN_PREFIXED_P (opval
);
13046 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13050 USI opval
= crisv32f_break_handler (current_cpu
, FLD (f_u4
), pc
);
13051 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13052 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13056 SEM_BRANCH_FINI (vpc
);
13061 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
13063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13065 #define FLD(f) abuf->fields.sfmt_muls_b.f
13066 int UNUSED written
= 0;
13067 IADDR UNUSED pc
= abuf
->addr
;
13068 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13074 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
13075 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13076 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13078 SI opval
= tmp_newval
;
13079 SET_H_GR (FLD (f_operand2
), opval
);
13080 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13084 BI opval
= LTSI (tmp_newval
, 0);
13085 CPU (h_nbit
) = opval
;
13086 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13089 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13090 CPU (h_zbit
) = opval
;
13091 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13093 SET_H_CBIT_MOVE (0);
13094 SET_H_VBIT_MOVE (0);
13098 CPU (h_xbit
) = opval
;
13099 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13103 SET_H_INSN_PREFIXED_P (opval
);
13104 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13114 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
13116 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13117 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13118 #define FLD(f) abuf->fields.sfmt_muls_b.f
13119 int UNUSED written
= 0;
13120 IADDR UNUSED pc
= abuf
->addr
;
13121 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13127 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
13128 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13129 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13131 SI opval
= tmp_newval
;
13132 SET_H_GR (FLD (f_operand2
), opval
);
13133 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13137 BI opval
= LTSI (tmp_newval
, 0);
13138 CPU (h_nbit
) = opval
;
13139 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13142 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13143 CPU (h_zbit
) = opval
;
13144 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13146 SET_H_CBIT_MOVE (0);
13147 SET_H_VBIT_MOVE (0);
13151 CPU (h_xbit
) = opval
;
13152 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13156 SET_H_INSN_PREFIXED_P (opval
);
13157 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13167 CASE (sem
, INSN_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
13169 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13170 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13171 #define FLD(f) abuf->fields.sfmt_muls_b.f
13172 int UNUSED written
= 0;
13173 IADDR UNUSED pc
= abuf
->addr
;
13174 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13180 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
13181 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13182 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13184 SI opval
= tmp_newval
;
13185 SET_H_GR (FLD (f_operand2
), opval
);
13186 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13190 BI opval
= LTSI (tmp_newval
, 0);
13191 CPU (h_nbit
) = opval
;
13192 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13195 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13196 CPU (h_zbit
) = opval
;
13197 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13199 SET_H_CBIT_MOVE (0);
13200 SET_H_VBIT_MOVE (0);
13204 CPU (h_xbit
) = opval
;
13205 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13209 SET_H_INSN_PREFIXED_P (opval
);
13210 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13220 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
13222 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13223 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13224 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13225 int UNUSED written
= 0;
13226 IADDR UNUSED pc
= abuf
->addr
;
13227 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13233 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
13234 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13235 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13237 SI opval
= tmp_newval
;
13238 SET_H_GR (FLD (f_operand2
), opval
);
13239 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13243 BI opval
= LTSI (tmp_newval
, 0);
13244 CPU (h_nbit
) = opval
;
13245 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13248 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13249 CPU (h_zbit
) = opval
;
13250 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13252 SET_H_CBIT_MOVE (0);
13253 SET_H_VBIT_MOVE (0);
13257 CPU (h_xbit
) = opval
;
13258 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13262 SET_H_INSN_PREFIXED_P (opval
);
13263 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13273 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
13275 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13276 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13277 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13278 int UNUSED written
= 0;
13279 IADDR UNUSED pc
= abuf
->addr
;
13280 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13286 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
13287 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13288 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13290 SI opval
= tmp_newval
;
13291 SET_H_GR (FLD (f_operand2
), opval
);
13292 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13296 BI opval
= LTSI (tmp_newval
, 0);
13297 CPU (h_nbit
) = opval
;
13298 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13301 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13302 CPU (h_zbit
) = opval
;
13303 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13305 SET_H_CBIT_MOVE (0);
13306 SET_H_VBIT_MOVE (0);
13310 CPU (h_xbit
) = opval
;
13311 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13315 SET_H_INSN_PREFIXED_P (opval
);
13316 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13326 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13328 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13329 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13330 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13331 int UNUSED written
= 0;
13332 IADDR UNUSED pc
= abuf
->addr
;
13333 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13339 tmp_tmpops
= FLD (f_indir_pc__dword
);
13340 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13341 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13343 SI opval
= tmp_newval
;
13344 SET_H_GR (FLD (f_operand2
), opval
);
13345 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13349 BI opval
= LTSI (tmp_newval
, 0);
13350 CPU (h_nbit
) = opval
;
13351 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13354 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13355 CPU (h_zbit
) = opval
;
13356 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13358 SET_H_CBIT_MOVE (0);
13359 SET_H_VBIT_MOVE (0);
13363 CPU (h_xbit
) = opval
;
13364 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13368 SET_H_INSN_PREFIXED_P (opval
);
13369 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13379 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13381 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13382 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13383 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13384 int UNUSED written
= 0;
13385 IADDR UNUSED pc
= abuf
->addr
;
13386 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13390 tmp_truthval
= ({ SI tmp_tmpcond
;
13392 tmp_tmpcond
= FLD (f_operand2
);
13393 ; if (EQSI (tmp_tmpcond
, 0)) {
13394 tmp_condres
= NOTBI (CPU (h_cbit
));
13396 else if (EQSI (tmp_tmpcond
, 1)) {
13397 tmp_condres
= CPU (h_cbit
);
13399 else if (EQSI (tmp_tmpcond
, 2)) {
13400 tmp_condres
= NOTBI (CPU (h_zbit
));
13402 else if (EQSI (tmp_tmpcond
, 3)) {
13403 tmp_condres
= CPU (h_zbit
);
13405 else if (EQSI (tmp_tmpcond
, 4)) {
13406 tmp_condres
= NOTBI (CPU (h_vbit
));
13408 else if (EQSI (tmp_tmpcond
, 5)) {
13409 tmp_condres
= CPU (h_vbit
);
13411 else if (EQSI (tmp_tmpcond
, 6)) {
13412 tmp_condres
= NOTBI (CPU (h_nbit
));
13414 else if (EQSI (tmp_tmpcond
, 7)) {
13415 tmp_condres
= CPU (h_nbit
);
13417 else if (EQSI (tmp_tmpcond
, 8)) {
13418 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13420 else if (EQSI (tmp_tmpcond
, 9)) {
13421 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13423 else if (EQSI (tmp_tmpcond
, 10)) {
13424 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13426 else if (EQSI (tmp_tmpcond
, 11)) {
13427 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13429 else if (EQSI (tmp_tmpcond
, 12)) {
13430 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13432 else if (EQSI (tmp_tmpcond
, 13)) {
13433 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13435 else if (EQSI (tmp_tmpcond
, 14)) {
13438 else if (EQSI (tmp_tmpcond
, 15)) {
13439 tmp_condres
= CPU (h_pbit
);
13443 SI opval
= ZEXTBISI (tmp_truthval
);
13444 SET_H_GR (FLD (f_operand1
), opval
);
13445 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13450 CPU (h_xbit
) = opval
;
13451 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13455 SET_H_INSN_PREFIXED_P (opval
);
13456 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13465 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13467 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13468 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13469 #define FLD(f) abuf->fields.sfmt_muls_b.f
13470 int UNUSED written
= 0;
13471 IADDR UNUSED pc
= abuf
->addr
;
13472 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13477 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13480 if (GESI (tmp_tmp
, 0)) {
13482 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13483 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13486 if (GESI (tmp_tmp
, 0)) {
13488 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13489 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13492 if (GESI (tmp_tmp
, 0)) {
13494 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13495 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13498 if (GESI (tmp_tmp
, 0)) {
13500 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13501 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13504 if (GESI (tmp_tmp
, 0)) {
13506 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13507 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13510 if (GESI (tmp_tmp
, 0)) {
13512 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13513 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13516 if (GESI (tmp_tmp
, 0)) {
13518 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13519 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13522 if (GESI (tmp_tmp
, 0)) {
13524 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13525 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13528 if (GESI (tmp_tmp
, 0)) {
13530 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13531 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13534 if (GESI (tmp_tmp
, 0)) {
13536 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13537 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13540 if (GESI (tmp_tmp
, 0)) {
13542 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13543 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13546 if (GESI (tmp_tmp
, 0)) {
13548 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13549 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13552 if (GESI (tmp_tmp
, 0)) {
13554 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13555 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13558 if (GESI (tmp_tmp
, 0)) {
13560 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13561 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13564 if (GESI (tmp_tmp
, 0)) {
13566 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13567 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13570 if (GESI (tmp_tmp
, 0)) {
13572 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13573 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13576 if (GESI (tmp_tmp
, 0)) {
13578 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13579 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13582 if (GESI (tmp_tmp
, 0)) {
13584 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13585 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13588 if (GESI (tmp_tmp
, 0)) {
13590 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13591 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13594 if (GESI (tmp_tmp
, 0)) {
13596 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13597 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13600 if (GESI (tmp_tmp
, 0)) {
13602 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13603 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13606 if (GESI (tmp_tmp
, 0)) {
13608 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13609 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13612 if (GESI (tmp_tmp
, 0)) {
13614 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13615 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13618 if (GESI (tmp_tmp
, 0)) {
13620 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13621 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13624 if (GESI (tmp_tmp
, 0)) {
13626 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13627 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13630 if (GESI (tmp_tmp
, 0)) {
13632 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13633 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13636 if (GESI (tmp_tmp
, 0)) {
13638 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13639 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13642 if (GESI (tmp_tmp
, 0)) {
13644 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13645 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13648 if (GESI (tmp_tmp
, 0)) {
13650 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13651 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13654 if (GESI (tmp_tmp
, 0)) {
13656 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13657 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13660 if (GESI (tmp_tmp
, 0)) {
13662 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13663 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13666 if (GESI (tmp_tmp
, 0)) {
13668 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13669 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13674 SI opval
= tmp_tmpd
;
13675 SET_H_GR (FLD (f_operand2
), opval
);
13676 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13680 BI opval
= LTSI (tmp_tmpd
, 0);
13681 CPU (h_nbit
) = opval
;
13682 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13685 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13686 CPU (h_zbit
) = opval
;
13687 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13689 SET_H_CBIT_MOVE (0);
13690 SET_H_VBIT_MOVE (0);
13694 CPU (h_xbit
) = opval
;
13695 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13699 SET_H_INSN_PREFIXED_P (opval
);
13700 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13710 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13712 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13713 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13714 #define FLD(f) abuf->fields.sfmt_addoq.f
13715 int UNUSED written
= 0;
13716 IADDR UNUSED pc
= abuf
->addr
;
13717 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13721 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13722 SET_H_PREFIXREG_V32 (opval
);
13723 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13727 SET_H_INSN_PREFIXED_P (opval
);
13728 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13736 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13738 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13740 #define FLD(f) abuf->fields.sfmt_addc_m.f
13741 int UNUSED written
= 0;
13742 IADDR UNUSED pc
= abuf
->addr
;
13743 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13747 tmp_tmps
= ({ SI tmp_addr
;
13750 tmp_postinc
= FLD (f_memmode
);
13751 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13752 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13753 ; if (NEBI (tmp_postinc
, 0)) {
13755 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13756 tmp_addr
= ADDSI (tmp_addr
, 1);
13759 SI opval
= tmp_addr
;
13760 SET_H_GR (FLD (f_operand1
), opval
);
13761 written
|= (1 << 6);
13762 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13768 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13769 SET_H_PREFIXREG_V32 (opval
);
13770 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13774 SET_H_INSN_PREFIXED_P (opval
);
13775 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13779 abuf
->written
= written
;
13784 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13786 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13787 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13788 #define FLD(f) abuf->fields.sfmt_addc_m.f
13789 int UNUSED written
= 0;
13790 IADDR UNUSED pc
= abuf
->addr
;
13791 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13795 tmp_tmps
= ({ SI tmp_addr
;
13798 tmp_postinc
= FLD (f_memmode
);
13799 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13800 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
13801 ; if (NEBI (tmp_postinc
, 0)) {
13803 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13804 tmp_addr
= ADDSI (tmp_addr
, 2);
13807 SI opval
= tmp_addr
;
13808 SET_H_GR (FLD (f_operand1
), opval
);
13809 written
|= (1 << 6);
13810 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13816 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
13817 SET_H_PREFIXREG_V32 (opval
);
13818 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13822 SET_H_INSN_PREFIXED_P (opval
);
13823 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13827 abuf
->written
= written
;
13832 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13834 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13835 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13836 #define FLD(f) abuf->fields.sfmt_addc_m.f
13837 int UNUSED written
= 0;
13838 IADDR UNUSED pc
= abuf
->addr
;
13839 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13843 tmp_tmps
= ({ SI tmp_addr
;
13846 tmp_postinc
= FLD (f_memmode
);
13847 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13848 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13849 ; if (NEBI (tmp_postinc
, 0)) {
13851 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13852 tmp_addr
= ADDSI (tmp_addr
, 4);
13855 SI opval
= tmp_addr
;
13856 SET_H_GR (FLD (f_operand1
), opval
);
13857 written
|= (1 << 6);
13858 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13864 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
13865 SET_H_PREFIXREG_V32 (opval
);
13866 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13870 SET_H_INSN_PREFIXED_P (opval
);
13871 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13875 abuf
->written
= written
;
13880 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
13882 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13883 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13884 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13885 int UNUSED written
= 0;
13886 IADDR UNUSED pc
= abuf
->addr
;
13887 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13891 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
13892 SET_H_PREFIXREG_V32 (opval
);
13893 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13897 SET_H_INSN_PREFIXED_P (opval
);
13898 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13906 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
13908 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13909 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13910 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13911 int UNUSED written
= 0;
13912 IADDR UNUSED pc
= abuf
->addr
;
13913 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13917 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
13918 SET_H_PREFIXREG_V32 (opval
);
13919 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13923 SET_H_INSN_PREFIXED_P (opval
);
13924 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13932 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
13934 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13936 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13937 int UNUSED written
= 0;
13938 IADDR UNUSED pc
= abuf
->addr
;
13939 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13943 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
13944 SET_H_PREFIXREG_V32 (opval
);
13945 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13949 SET_H_INSN_PREFIXED_P (opval
);
13950 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13958 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13960 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13961 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13962 #define FLD(f) abuf->fields.sfmt_muls_b.f
13963 int UNUSED written
= 0;
13964 IADDR UNUSED pc
= abuf
->addr
;
13965 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13969 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13970 SET_H_PREFIXREG_V32 (opval
);
13971 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13975 SET_H_INSN_PREFIXED_P (opval
);
13976 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13984 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13986 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13987 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13988 #define FLD(f) abuf->fields.sfmt_muls_b.f
13989 int UNUSED written
= 0;
13990 IADDR UNUSED pc
= abuf
->addr
;
13991 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13995 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
13996 SET_H_PREFIXREG_V32 (opval
);
13997 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14001 SET_H_INSN_PREFIXED_P (opval
);
14002 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14010 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14012 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14013 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14014 #define FLD(f) abuf->fields.sfmt_muls_b.f
14015 int UNUSED written
= 0;
14016 IADDR UNUSED pc
= abuf
->addr
;
14017 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14021 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14022 SET_H_PREFIXREG_V32 (opval
);
14023 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14027 SET_H_INSN_PREFIXED_P (opval
);
14028 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14036 CASE (sem
, INSN_FIDXI
) : /* fidxi [$Rs] */
14038 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14039 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14040 #define FLD(f) abuf->fields.sfmt_mcp.f
14041 int UNUSED written
= 0;
14042 IADDR UNUSED pc
= abuf
->addr
;
14044 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14047 USI opval
= crisv32f_fidxi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14048 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14049 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14052 SEM_BRANCH_FINI (vpc
);
14057 CASE (sem
, INSN_FTAGI
) : /* fidxi [$Rs] */
14059 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14060 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14061 #define FLD(f) abuf->fields.sfmt_mcp.f
14062 int UNUSED written
= 0;
14063 IADDR UNUSED pc
= abuf
->addr
;
14065 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14068 USI opval
= crisv32f_ftagi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14069 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14070 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14073 SEM_BRANCH_FINI (vpc
);
14078 CASE (sem
, INSN_FIDXD
) : /* fidxd [$Rs] */
14080 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14081 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14082 #define FLD(f) abuf->fields.sfmt_mcp.f
14083 int UNUSED written
= 0;
14084 IADDR UNUSED pc
= abuf
->addr
;
14086 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14089 USI opval
= crisv32f_fidxd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14090 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14091 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14094 SEM_BRANCH_FINI (vpc
);
14099 CASE (sem
, INSN_FTAGD
) : /* ftagd [$Rs] */
14101 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14102 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14103 #define FLD(f) abuf->fields.sfmt_mcp.f
14104 int UNUSED written
= 0;
14105 IADDR UNUSED pc
= abuf
->addr
;
14107 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14110 USI opval
= crisv32f_ftagd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14111 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14112 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14115 SEM_BRANCH_FINI (vpc
);
14122 ENDSWITCH (sem
) /* End of semantic switch. */
14124 /* At this point `vpc' contains the next insn to execute. */
14127 #undef DEFINE_SWITCH
14128 #endif /* DEFINE_SWITCH */