1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2005 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License 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);
658 tmp_newval
= GET_H_GR (FLD (f_operand1
));
660 SI opval
= EXTQISI (tmp_newval
);
661 SET_H_GR (FLD (f_operand2
), opval
);
662 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
666 BI opval
= LTSI (tmp_newval
, 0);
667 CPU (h_nbit
) = opval
;
668 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
671 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
672 CPU (h_zbit
) = opval
;
673 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
680 CPU (h_xbit
) = opval
;
681 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
685 SET_H_INSN_PREFIXED_P (opval
);
686 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
696 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
698 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
699 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
700 #define FLD(f) abuf->fields.sfmt_muls_b.f
701 int UNUSED written
= 0;
702 IADDR UNUSED pc
= abuf
->addr
;
703 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
707 tmp_newval
= GET_H_GR (FLD (f_operand1
));
709 SI opval
= EXTHISI (tmp_newval
);
710 SET_H_GR (FLD (f_operand2
), opval
);
711 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
715 BI opval
= LTSI (tmp_newval
, 0);
716 CPU (h_nbit
) = opval
;
717 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
720 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
721 CPU (h_zbit
) = opval
;
722 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
729 CPU (h_xbit
) = opval
;
730 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
734 SET_H_INSN_PREFIXED_P (opval
);
735 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
745 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
747 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
748 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
749 #define FLD(f) abuf->fields.sfmt_muls_b.f
750 int UNUSED written
= 0;
751 IADDR UNUSED pc
= abuf
->addr
;
752 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
756 tmp_newval
= GET_H_GR (FLD (f_operand1
));
758 SI opval
= ZEXTQISI (tmp_newval
);
759 SET_H_GR (FLD (f_operand2
), opval
);
760 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
764 BI opval
= LTSI (tmp_newval
, 0);
765 CPU (h_nbit
) = opval
;
766 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
769 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
770 CPU (h_zbit
) = opval
;
771 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
778 CPU (h_xbit
) = opval
;
779 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
783 SET_H_INSN_PREFIXED_P (opval
);
784 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
794 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
796 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
797 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
798 #define FLD(f) abuf->fields.sfmt_muls_b.f
799 int UNUSED written
= 0;
800 IADDR UNUSED pc
= abuf
->addr
;
801 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
805 tmp_newval
= GET_H_GR (FLD (f_operand1
));
807 SI opval
= ZEXTHISI (tmp_newval
);
808 SET_H_GR (FLD (f_operand2
), opval
);
809 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
813 BI opval
= LTSI (tmp_newval
, 0);
814 CPU (h_nbit
) = opval
;
815 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
818 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
819 CPU (h_zbit
) = opval
;
820 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
827 CPU (h_xbit
) = opval
;
828 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
832 SET_H_INSN_PREFIXED_P (opval
);
833 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
843 CASE (sem
, INSN_MOVECBR
) : /* move.b ${sconst8},${Rd} */
845 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
846 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
847 #define FLD(f) abuf->fields.sfmt_addcbr.f
848 int UNUSED written
= 0;
849 IADDR UNUSED pc
= abuf
->addr
;
850 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
854 tmp_newval
= FLD (f_indir_pc__byte
);
857 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
859 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
860 SET_H_GR (FLD (f_operand2
), opval
);
861 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
866 BI opval
= LTQI (tmp_newval
, 0);
867 CPU (h_nbit
) = opval
;
868 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
871 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
872 CPU (h_zbit
) = opval
;
873 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
880 CPU (h_xbit
) = opval
;
881 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
885 SET_H_INSN_PREFIXED_P (opval
);
886 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
896 CASE (sem
, INSN_MOVECWR
) : /* move.w ${sconst16},${Rd} */
898 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
899 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
900 #define FLD(f) abuf->fields.sfmt_addcwr.f
901 int UNUSED written
= 0;
902 IADDR UNUSED pc
= abuf
->addr
;
903 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
907 tmp_newval
= FLD (f_indir_pc__word
);
910 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
912 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
913 SET_H_GR (FLD (f_operand2
), opval
);
914 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
919 BI opval
= LTHI (tmp_newval
, 0);
920 CPU (h_nbit
) = opval
;
921 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
924 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
925 CPU (h_zbit
) = opval
;
926 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
933 CPU (h_xbit
) = opval
;
934 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
938 SET_H_INSN_PREFIXED_P (opval
);
939 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
949 CASE (sem
, INSN_MOVECDR
) : /* move.d ${const32},${Rd} */
951 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
952 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
953 #define FLD(f) abuf->fields.sfmt_bound_cd.f
954 int UNUSED written
= 0;
955 IADDR UNUSED pc
= abuf
->addr
;
956 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
960 tmp_newval
= FLD (f_indir_pc__dword
);
962 SI opval
= tmp_newval
;
963 SET_H_GR (FLD (f_operand2
), opval
);
964 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
968 BI opval
= LTSI (tmp_newval
, 0);
969 CPU (h_nbit
) = opval
;
970 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
973 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
974 CPU (h_zbit
) = opval
;
975 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
982 CPU (h_xbit
) = opval
;
983 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
987 SET_H_INSN_PREFIXED_P (opval
);
988 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
998 CASE (sem
, INSN_MOVSCBR
) : /* movs.b ${sconst8},${Rd} */
1000 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1001 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1002 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1003 int UNUSED written
= 0;
1004 IADDR UNUSED pc
= abuf
->addr
;
1005 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1009 tmp_newval
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1011 SI opval
= tmp_newval
;
1012 SET_H_GR (FLD (f_operand2
), opval
);
1013 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1017 BI opval
= LTSI (tmp_newval
, 0);
1018 CPU (h_nbit
) = opval
;
1019 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1022 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1023 CPU (h_zbit
) = opval
;
1024 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1026 SET_H_CBIT_MOVE (0);
1027 SET_H_VBIT_MOVE (0);
1031 CPU (h_xbit
) = opval
;
1032 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1036 SET_H_INSN_PREFIXED_P (opval
);
1037 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1047 CASE (sem
, INSN_MOVSCWR
) : /* movs.w ${sconst16},${Rd} */
1049 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1050 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1051 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1052 int UNUSED written
= 0;
1053 IADDR UNUSED pc
= abuf
->addr
;
1054 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1058 tmp_newval
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1060 SI opval
= tmp_newval
;
1061 SET_H_GR (FLD (f_operand2
), opval
);
1062 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1066 BI opval
= LTSI (tmp_newval
, 0);
1067 CPU (h_nbit
) = opval
;
1068 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1071 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1072 CPU (h_zbit
) = opval
;
1073 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1075 SET_H_CBIT_MOVE (0);
1076 SET_H_VBIT_MOVE (0);
1080 CPU (h_xbit
) = opval
;
1081 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1085 SET_H_INSN_PREFIXED_P (opval
);
1086 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1096 CASE (sem
, INSN_MOVUCBR
) : /* movu.b ${uconst8},${Rd} */
1098 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1099 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1100 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1101 int UNUSED written
= 0;
1102 IADDR UNUSED pc
= abuf
->addr
;
1103 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1107 tmp_newval
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1109 SI opval
= tmp_newval
;
1110 SET_H_GR (FLD (f_operand2
), opval
);
1111 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1115 BI opval
= LTSI (tmp_newval
, 0);
1116 CPU (h_nbit
) = opval
;
1117 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1120 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1121 CPU (h_zbit
) = opval
;
1122 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1124 SET_H_CBIT_MOVE (0);
1125 SET_H_VBIT_MOVE (0);
1129 CPU (h_xbit
) = opval
;
1130 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1134 SET_H_INSN_PREFIXED_P (opval
);
1135 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1145 CASE (sem
, INSN_MOVUCWR
) : /* movu.w ${uconst16},${Rd} */
1147 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1148 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1149 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1150 int UNUSED written
= 0;
1151 IADDR UNUSED pc
= abuf
->addr
;
1152 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1156 tmp_newval
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1158 SI opval
= tmp_newval
;
1159 SET_H_GR (FLD (f_operand2
), opval
);
1160 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1164 BI opval
= LTSI (tmp_newval
, 0);
1165 CPU (h_nbit
) = opval
;
1166 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1169 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1170 CPU (h_zbit
) = opval
;
1171 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1173 SET_H_CBIT_MOVE (0);
1174 SET_H_VBIT_MOVE (0);
1178 CPU (h_xbit
) = opval
;
1179 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1183 SET_H_INSN_PREFIXED_P (opval
);
1184 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1194 CASE (sem
, INSN_ADDQ
) : /* addq $j,$Rd */
1196 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1197 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1198 #define FLD(f) abuf->fields.sfmt_addq.f
1199 int UNUSED written
= 0;
1200 IADDR UNUSED pc
= abuf
->addr
;
1201 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1208 tmp_tmpops
= FLD (f_u6
);
1209 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1210 tmp_carry
= CPU (h_cbit
);
1211 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1213 SI opval
= tmp_newval
;
1214 SET_H_GR (FLD (f_operand2
), opval
);
1215 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1219 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))));
1220 CPU (h_cbit
) = opval
;
1221 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1224 BI opval
= LTSI (tmp_newval
, 0);
1225 CPU (h_nbit
) = opval
;
1226 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1229 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1230 CPU (h_zbit
) = opval
;
1231 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1234 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)));
1235 CPU (h_vbit
) = opval
;
1236 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1241 CPU (h_xbit
) = opval
;
1242 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1246 SET_H_INSN_PREFIXED_P (opval
);
1247 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1257 CASE (sem
, INSN_SUBQ
) : /* subq $j,$Rd */
1259 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1260 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1261 #define FLD(f) abuf->fields.sfmt_addq.f
1262 int UNUSED written
= 0;
1263 IADDR UNUSED pc
= abuf
->addr
;
1264 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1271 tmp_tmpops
= FLD (f_u6
);
1272 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1273 tmp_carry
= CPU (h_cbit
);
1274 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1276 SI opval
= tmp_newval
;
1277 SET_H_GR (FLD (f_operand2
), opval
);
1278 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1282 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))));
1283 CPU (h_cbit
) = opval
;
1284 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1287 BI opval
= LTSI (tmp_newval
, 0);
1288 CPU (h_nbit
) = opval
;
1289 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1292 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1293 CPU (h_zbit
) = opval
;
1294 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1297 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)));
1298 CPU (h_vbit
) = opval
;
1299 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1304 CPU (h_xbit
) = opval
;
1305 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1309 SET_H_INSN_PREFIXED_P (opval
);
1310 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1320 CASE (sem
, INSN_CMP_R_B_R
) : /* cmp-r.b $Rs,$Rd */
1322 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1323 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1324 #define FLD(f) abuf->fields.sfmt_muls_b.f
1325 int UNUSED written
= 0;
1326 IADDR UNUSED pc
= abuf
->addr
;
1327 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1334 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1335 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1336 tmp_carry
= CPU (h_cbit
);
1337 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1341 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))));
1342 CPU (h_cbit
) = opval
;
1343 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1346 BI opval
= LTQI (tmp_newval
, 0);
1347 CPU (h_nbit
) = opval
;
1348 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1351 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1352 CPU (h_zbit
) = opval
;
1353 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1356 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)));
1357 CPU (h_vbit
) = opval
;
1358 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1363 CPU (h_xbit
) = opval
;
1364 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1368 SET_H_INSN_PREFIXED_P (opval
);
1369 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1379 CASE (sem
, INSN_CMP_R_W_R
) : /* cmp-r.w $Rs,$Rd */
1381 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1382 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1383 #define FLD(f) abuf->fields.sfmt_muls_b.f
1384 int UNUSED written
= 0;
1385 IADDR UNUSED pc
= abuf
->addr
;
1386 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1393 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1394 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1395 tmp_carry
= CPU (h_cbit
);
1396 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1400 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))));
1401 CPU (h_cbit
) = opval
;
1402 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1405 BI opval
= LTHI (tmp_newval
, 0);
1406 CPU (h_nbit
) = opval
;
1407 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1410 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1411 CPU (h_zbit
) = opval
;
1412 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1415 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)));
1416 CPU (h_vbit
) = opval
;
1417 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1422 CPU (h_xbit
) = opval
;
1423 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1427 SET_H_INSN_PREFIXED_P (opval
);
1428 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1438 CASE (sem
, INSN_CMP_R_D_R
) : /* cmp-r.d $Rs,$Rd */
1440 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1441 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1442 #define FLD(f) abuf->fields.sfmt_muls_b.f
1443 int UNUSED written
= 0;
1444 IADDR UNUSED pc
= abuf
->addr
;
1445 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1452 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1453 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1454 tmp_carry
= CPU (h_cbit
);
1455 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1459 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))));
1460 CPU (h_cbit
) = opval
;
1461 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1464 BI opval
= LTSI (tmp_newval
, 0);
1465 CPU (h_nbit
) = opval
;
1466 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1469 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1470 CPU (h_zbit
) = opval
;
1471 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1474 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)));
1475 CPU (h_vbit
) = opval
;
1476 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1481 CPU (h_xbit
) = opval
;
1482 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1486 SET_H_INSN_PREFIXED_P (opval
);
1487 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1497 CASE (sem
, INSN_CMP_M_B_M
) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1499 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1500 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1501 #define FLD(f) abuf->fields.sfmt_addc_m.f
1502 int UNUSED written
= 0;
1503 IADDR UNUSED pc
= abuf
->addr
;
1504 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1511 tmp_tmpops
= ({ SI tmp_addr
;
1514 tmp_postinc
= FLD (f_memmode
);
1515 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1516 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1517 ; if (NEBI (tmp_postinc
, 0)) {
1519 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1520 tmp_addr
= ADDSI (tmp_addr
, 1);
1523 SI opval
= tmp_addr
;
1524 SET_H_GR (FLD (f_operand1
), opval
);
1525 written
|= (1 << 9);
1526 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1531 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1532 tmp_carry
= CPU (h_cbit
);
1533 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1537 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))));
1538 CPU (h_cbit
) = opval
;
1539 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1542 BI opval
= LTQI (tmp_newval
, 0);
1543 CPU (h_nbit
) = opval
;
1544 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1547 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1548 CPU (h_zbit
) = opval
;
1549 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1552 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)));
1553 CPU (h_vbit
) = opval
;
1554 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1559 CPU (h_xbit
) = opval
;
1560 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1564 SET_H_INSN_PREFIXED_P (opval
);
1565 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1571 abuf
->written
= written
;
1576 CASE (sem
, INSN_CMP_M_W_M
) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1578 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1579 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1580 #define FLD(f) abuf->fields.sfmt_addc_m.f
1581 int UNUSED written
= 0;
1582 IADDR UNUSED pc
= abuf
->addr
;
1583 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1590 tmp_tmpops
= ({ SI tmp_addr
;
1593 tmp_postinc
= FLD (f_memmode
);
1594 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1595 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
1596 ; if (NEBI (tmp_postinc
, 0)) {
1598 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1599 tmp_addr
= ADDSI (tmp_addr
, 2);
1602 SI opval
= tmp_addr
;
1603 SET_H_GR (FLD (f_operand1
), opval
);
1604 written
|= (1 << 9);
1605 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1610 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1611 tmp_carry
= CPU (h_cbit
);
1612 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1616 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))));
1617 CPU (h_cbit
) = opval
;
1618 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1621 BI opval
= LTHI (tmp_newval
, 0);
1622 CPU (h_nbit
) = opval
;
1623 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1626 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1627 CPU (h_zbit
) = opval
;
1628 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1631 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)));
1632 CPU (h_vbit
) = opval
;
1633 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1638 CPU (h_xbit
) = opval
;
1639 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1643 SET_H_INSN_PREFIXED_P (opval
);
1644 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1650 abuf
->written
= written
;
1655 CASE (sem
, INSN_CMP_M_D_M
) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1657 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1658 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1659 #define FLD(f) abuf->fields.sfmt_addc_m.f
1660 int UNUSED written
= 0;
1661 IADDR UNUSED pc
= abuf
->addr
;
1662 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1669 tmp_tmpops
= ({ SI tmp_addr
;
1672 tmp_postinc
= FLD (f_memmode
);
1673 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1674 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
1675 ; if (NEBI (tmp_postinc
, 0)) {
1677 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1678 tmp_addr
= ADDSI (tmp_addr
, 4);
1681 SI opval
= tmp_addr
;
1682 SET_H_GR (FLD (f_operand1
), opval
);
1683 written
|= (1 << 9);
1684 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1689 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1690 tmp_carry
= CPU (h_cbit
);
1691 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1695 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))));
1696 CPU (h_cbit
) = opval
;
1697 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1700 BI opval
= LTSI (tmp_newval
, 0);
1701 CPU (h_nbit
) = opval
;
1702 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1705 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1706 CPU (h_zbit
) = opval
;
1707 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1710 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)));
1711 CPU (h_vbit
) = opval
;
1712 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1717 CPU (h_xbit
) = opval
;
1718 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1722 SET_H_INSN_PREFIXED_P (opval
);
1723 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1729 abuf
->written
= written
;
1734 CASE (sem
, INSN_CMPCBR
) : /* cmp.b $sconst8,$Rd */
1736 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1737 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1738 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1739 int UNUSED written
= 0;
1740 IADDR UNUSED pc
= abuf
->addr
;
1741 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1748 tmp_tmpops
= TRUNCSIQI (FLD (f_indir_pc__byte
));
1749 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1750 tmp_carry
= CPU (h_cbit
);
1751 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1755 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))));
1756 CPU (h_cbit
) = opval
;
1757 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1760 BI opval
= LTQI (tmp_newval
, 0);
1761 CPU (h_nbit
) = opval
;
1762 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1765 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1766 CPU (h_zbit
) = opval
;
1767 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1770 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)));
1771 CPU (h_vbit
) = opval
;
1772 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1777 CPU (h_xbit
) = opval
;
1778 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1782 SET_H_INSN_PREFIXED_P (opval
);
1783 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1793 CASE (sem
, INSN_CMPCWR
) : /* cmp.w $sconst16,$Rd */
1795 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1796 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1797 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1798 int UNUSED written
= 0;
1799 IADDR UNUSED pc
= abuf
->addr
;
1800 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1807 tmp_tmpops
= TRUNCSIHI (FLD (f_indir_pc__word
));
1808 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1809 tmp_carry
= CPU (h_cbit
);
1810 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1814 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))));
1815 CPU (h_cbit
) = opval
;
1816 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1819 BI opval
= LTHI (tmp_newval
, 0);
1820 CPU (h_nbit
) = opval
;
1821 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1824 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1825 CPU (h_zbit
) = opval
;
1826 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1829 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)));
1830 CPU (h_vbit
) = opval
;
1831 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1836 CPU (h_xbit
) = opval
;
1837 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1841 SET_H_INSN_PREFIXED_P (opval
);
1842 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1852 CASE (sem
, INSN_CMPCDR
) : /* cmp.d $const32,$Rd */
1854 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1855 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1856 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1857 int UNUSED written
= 0;
1858 IADDR UNUSED pc
= abuf
->addr
;
1859 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1866 tmp_tmpops
= FLD (f_indir_pc__dword
);
1867 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1868 tmp_carry
= CPU (h_cbit
);
1869 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1873 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))));
1874 CPU (h_cbit
) = opval
;
1875 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1878 BI opval
= LTSI (tmp_newval
, 0);
1879 CPU (h_nbit
) = opval
;
1880 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1883 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1884 CPU (h_zbit
) = opval
;
1885 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1888 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)));
1889 CPU (h_vbit
) = opval
;
1890 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1895 CPU (h_xbit
) = opval
;
1896 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1900 SET_H_INSN_PREFIXED_P (opval
);
1901 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1911 CASE (sem
, INSN_CMPQ
) : /* cmpq $i,$Rd */
1913 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1914 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1915 #define FLD(f) abuf->fields.sfmt_andq.f
1916 int UNUSED written
= 0;
1917 IADDR UNUSED pc
= abuf
->addr
;
1918 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1925 tmp_tmpops
= FLD (f_s6
);
1926 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1927 tmp_carry
= CPU (h_cbit
);
1928 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1932 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))));
1933 CPU (h_cbit
) = opval
;
1934 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1937 BI opval
= LTSI (tmp_newval
, 0);
1938 CPU (h_nbit
) = opval
;
1939 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1942 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1943 CPU (h_zbit
) = opval
;
1944 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1947 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)));
1948 CPU (h_vbit
) = opval
;
1949 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1954 CPU (h_xbit
) = opval
;
1955 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1959 SET_H_INSN_PREFIXED_P (opval
);
1960 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1970 CASE (sem
, INSN_CMPS_M_B_M
) : /* cmps-m.b [${Rs}${inc}],$Rd */
1972 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1973 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1974 #define FLD(f) abuf->fields.sfmt_addc_m.f
1975 int UNUSED written
= 0;
1976 IADDR UNUSED pc
= abuf
->addr
;
1977 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1984 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
1987 tmp_postinc
= FLD (f_memmode
);
1988 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1989 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1990 ; if (NEBI (tmp_postinc
, 0)) {
1992 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1993 tmp_addr
= ADDSI (tmp_addr
, 1);
1996 SI opval
= tmp_addr
;
1997 SET_H_GR (FLD (f_operand1
), opval
);
1998 written
|= (1 << 9);
1999 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2004 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2005 tmp_carry
= CPU (h_cbit
);
2006 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2010 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))));
2011 CPU (h_cbit
) = opval
;
2012 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2015 BI opval
= LTSI (tmp_newval
, 0);
2016 CPU (h_nbit
) = opval
;
2017 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2020 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2021 CPU (h_zbit
) = opval
;
2022 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2025 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)));
2026 CPU (h_vbit
) = opval
;
2027 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2032 CPU (h_xbit
) = opval
;
2033 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2037 SET_H_INSN_PREFIXED_P (opval
);
2038 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2044 abuf
->written
= written
;
2049 CASE (sem
, INSN_CMPS_M_W_M
) : /* cmps-m.w [${Rs}${inc}],$Rd */
2051 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2052 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2053 #define FLD(f) abuf->fields.sfmt_addc_m.f
2054 int UNUSED written
= 0;
2055 IADDR UNUSED pc
= abuf
->addr
;
2056 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2063 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
2066 tmp_postinc
= FLD (f_memmode
);
2067 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2068 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2069 ; if (NEBI (tmp_postinc
, 0)) {
2071 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2072 tmp_addr
= ADDSI (tmp_addr
, 2);
2075 SI opval
= tmp_addr
;
2076 SET_H_GR (FLD (f_operand1
), opval
);
2077 written
|= (1 << 9);
2078 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2083 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2084 tmp_carry
= CPU (h_cbit
);
2085 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2089 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))));
2090 CPU (h_cbit
) = opval
;
2091 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2094 BI opval
= LTSI (tmp_newval
, 0);
2095 CPU (h_nbit
) = opval
;
2096 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2099 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2100 CPU (h_zbit
) = opval
;
2101 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2104 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)));
2105 CPU (h_vbit
) = opval
;
2106 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2111 CPU (h_xbit
) = opval
;
2112 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2116 SET_H_INSN_PREFIXED_P (opval
);
2117 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2123 abuf
->written
= written
;
2128 CASE (sem
, INSN_CMPSCBR
) : /* [${Rs}${inc}],$Rd */
2130 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2131 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2132 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2133 int UNUSED written
= 0;
2134 IADDR UNUSED pc
= abuf
->addr
;
2135 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2142 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2143 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2144 tmp_carry
= CPU (h_cbit
);
2145 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2149 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))));
2150 CPU (h_cbit
) = opval
;
2151 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2154 BI opval
= LTSI (tmp_newval
, 0);
2155 CPU (h_nbit
) = opval
;
2156 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2159 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2160 CPU (h_zbit
) = opval
;
2161 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2164 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)));
2165 CPU (h_vbit
) = opval
;
2166 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2171 CPU (h_xbit
) = opval
;
2172 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2176 SET_H_INSN_PREFIXED_P (opval
);
2177 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2187 CASE (sem
, INSN_CMPSCWR
) : /* [${Rs}${inc}],$Rd */
2189 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2190 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2191 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2192 int UNUSED written
= 0;
2193 IADDR UNUSED pc
= abuf
->addr
;
2194 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2201 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2202 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2203 tmp_carry
= CPU (h_cbit
);
2204 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2208 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))));
2209 CPU (h_cbit
) = opval
;
2210 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2213 BI opval
= LTSI (tmp_newval
, 0);
2214 CPU (h_nbit
) = opval
;
2215 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2218 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2219 CPU (h_zbit
) = opval
;
2220 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2223 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)));
2224 CPU (h_vbit
) = opval
;
2225 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2230 CPU (h_xbit
) = opval
;
2231 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2235 SET_H_INSN_PREFIXED_P (opval
);
2236 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2246 CASE (sem
, INSN_CMPU_M_B_M
) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2248 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2249 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2250 #define FLD(f) abuf->fields.sfmt_addc_m.f
2251 int UNUSED written
= 0;
2252 IADDR UNUSED pc
= abuf
->addr
;
2253 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2260 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
2263 tmp_postinc
= FLD (f_memmode
);
2264 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2265 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2266 ; if (NEBI (tmp_postinc
, 0)) {
2268 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2269 tmp_addr
= ADDSI (tmp_addr
, 1);
2272 SI opval
= tmp_addr
;
2273 SET_H_GR (FLD (f_operand1
), opval
);
2274 written
|= (1 << 9);
2275 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2280 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2281 tmp_carry
= CPU (h_cbit
);
2282 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2286 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))));
2287 CPU (h_cbit
) = opval
;
2288 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2291 BI opval
= LTSI (tmp_newval
, 0);
2292 CPU (h_nbit
) = opval
;
2293 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2296 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2297 CPU (h_zbit
) = opval
;
2298 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2301 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)));
2302 CPU (h_vbit
) = opval
;
2303 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2308 CPU (h_xbit
) = opval
;
2309 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2313 SET_H_INSN_PREFIXED_P (opval
);
2314 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2320 abuf
->written
= written
;
2325 CASE (sem
, INSN_CMPU_M_W_M
) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2327 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2328 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2329 #define FLD(f) abuf->fields.sfmt_addc_m.f
2330 int UNUSED written
= 0;
2331 IADDR UNUSED pc
= abuf
->addr
;
2332 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2339 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
2342 tmp_postinc
= FLD (f_memmode
);
2343 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2344 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2345 ; if (NEBI (tmp_postinc
, 0)) {
2347 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2348 tmp_addr
= ADDSI (tmp_addr
, 2);
2351 SI opval
= tmp_addr
;
2352 SET_H_GR (FLD (f_operand1
), opval
);
2353 written
|= (1 << 9);
2354 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2359 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2360 tmp_carry
= CPU (h_cbit
);
2361 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2365 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))));
2366 CPU (h_cbit
) = opval
;
2367 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2370 BI opval
= LTSI (tmp_newval
, 0);
2371 CPU (h_nbit
) = opval
;
2372 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2375 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2376 CPU (h_zbit
) = opval
;
2377 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2380 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)));
2381 CPU (h_vbit
) = opval
;
2382 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2387 CPU (h_xbit
) = opval
;
2388 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2392 SET_H_INSN_PREFIXED_P (opval
);
2393 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2399 abuf
->written
= written
;
2404 CASE (sem
, INSN_CMPUCBR
) : /* [${Rs}${inc}],$Rd */
2406 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2407 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2408 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2409 int UNUSED written
= 0;
2410 IADDR UNUSED pc
= abuf
->addr
;
2411 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2418 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2419 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2420 tmp_carry
= CPU (h_cbit
);
2421 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2425 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))));
2426 CPU (h_cbit
) = opval
;
2427 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2430 BI opval
= LTSI (tmp_newval
, 0);
2431 CPU (h_nbit
) = opval
;
2432 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2435 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2436 CPU (h_zbit
) = opval
;
2437 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2440 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)));
2441 CPU (h_vbit
) = opval
;
2442 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2447 CPU (h_xbit
) = opval
;
2448 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2452 SET_H_INSN_PREFIXED_P (opval
);
2453 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2463 CASE (sem
, INSN_CMPUCWR
) : /* [${Rs}${inc}],$Rd */
2465 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2466 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2467 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2468 int UNUSED written
= 0;
2469 IADDR UNUSED pc
= abuf
->addr
;
2470 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2477 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2478 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2479 tmp_carry
= CPU (h_cbit
);
2480 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2484 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))));
2485 CPU (h_cbit
) = opval
;
2486 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2489 BI opval
= LTSI (tmp_newval
, 0);
2490 CPU (h_nbit
) = opval
;
2491 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2494 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2495 CPU (h_zbit
) = opval
;
2496 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2499 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)));
2500 CPU (h_vbit
) = opval
;
2501 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2506 CPU (h_xbit
) = opval
;
2507 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2511 SET_H_INSN_PREFIXED_P (opval
);
2512 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2522 CASE (sem
, INSN_MOVE_M_B_M
) : /* move-m.b [${Rs}${inc}],${Rd} */
2524 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2525 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2526 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2527 int UNUSED written
= 0;
2528 IADDR UNUSED pc
= abuf
->addr
;
2529 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2533 tmp_tmp
= ({ SI tmp_addr
;
2536 tmp_postinc
= FLD (f_memmode
);
2537 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2538 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2539 ; if (NEBI (tmp_postinc
, 0)) {
2541 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2542 tmp_addr
= ADDSI (tmp_addr
, 1);
2545 SI opval
= tmp_addr
;
2546 SET_H_GR (FLD (f_operand1
), opval
);
2547 written
|= (1 << 10);
2548 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2555 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2557 SI opval
= ORSI (ANDSI (tmp_tmp
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
2558 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2559 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2564 BI opval
= LTQI (tmp_tmp
, 0);
2565 CPU (h_nbit
) = opval
;
2566 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2569 BI opval
= ANDIF (EQQI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2570 CPU (h_zbit
) = opval
;
2571 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2573 SET_H_CBIT_MOVE (0);
2574 SET_H_VBIT_MOVE (0);
2578 CPU (h_xbit
) = opval
;
2579 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2583 SET_H_INSN_PREFIXED_P (opval
);
2584 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2590 abuf
->written
= written
;
2595 CASE (sem
, INSN_MOVE_M_W_M
) : /* move-m.w [${Rs}${inc}],${Rd} */
2597 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2598 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2599 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2600 int UNUSED written
= 0;
2601 IADDR UNUSED pc
= abuf
->addr
;
2602 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2606 tmp_tmp
= ({ SI tmp_addr
;
2609 tmp_postinc
= FLD (f_memmode
);
2610 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2611 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2612 ; if (NEBI (tmp_postinc
, 0)) {
2614 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2615 tmp_addr
= ADDSI (tmp_addr
, 2);
2618 SI opval
= tmp_addr
;
2619 SET_H_GR (FLD (f_operand1
), opval
);
2620 written
|= (1 << 10);
2621 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2628 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2630 SI opval
= ORSI (ANDSI (tmp_tmp
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
2631 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2632 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2637 BI opval
= LTHI (tmp_tmp
, 0);
2638 CPU (h_nbit
) = opval
;
2639 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2642 BI opval
= ANDIF (EQHI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2643 CPU (h_zbit
) = opval
;
2644 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2646 SET_H_CBIT_MOVE (0);
2647 SET_H_VBIT_MOVE (0);
2651 CPU (h_xbit
) = opval
;
2652 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2656 SET_H_INSN_PREFIXED_P (opval
);
2657 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2663 abuf
->written
= written
;
2668 CASE (sem
, INSN_MOVE_M_D_M
) : /* move-m.d [${Rs}${inc}],${Rd} */
2670 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2671 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2672 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2673 int UNUSED written
= 0;
2674 IADDR UNUSED pc
= abuf
->addr
;
2675 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2679 tmp_tmp
= ({ SI tmp_addr
;
2682 tmp_postinc
= FLD (f_memmode
);
2683 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2684 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
2685 ; if (NEBI (tmp_postinc
, 0)) {
2687 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2688 tmp_addr
= ADDSI (tmp_addr
, 4);
2691 SI opval
= tmp_addr
;
2692 SET_H_GR (FLD (f_operand1
), opval
);
2693 written
|= (1 << 9);
2694 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2701 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2702 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2706 BI opval
= LTSI (tmp_tmp
, 0);
2707 CPU (h_nbit
) = opval
;
2708 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2711 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2712 CPU (h_zbit
) = opval
;
2713 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2715 SET_H_CBIT_MOVE (0);
2716 SET_H_VBIT_MOVE (0);
2720 CPU (h_xbit
) = opval
;
2721 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2725 SET_H_INSN_PREFIXED_P (opval
);
2726 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2732 abuf
->written
= written
;
2737 CASE (sem
, INSN_MOVS_M_B_M
) : /* movs-m.b [${Rs}${inc}],${Rd} */
2739 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2740 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2741 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2742 int UNUSED written
= 0;
2743 IADDR UNUSED pc
= abuf
->addr
;
2744 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2748 tmp_tmp
= EXTQISI (({ SI tmp_addr
;
2751 tmp_postinc
= FLD (f_memmode
);
2752 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2753 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2754 ; if (NEBI (tmp_postinc
, 0)) {
2756 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2757 tmp_addr
= ADDSI (tmp_addr
, 1);
2760 SI opval
= tmp_addr
;
2761 SET_H_GR (FLD (f_operand1
), opval
);
2762 written
|= (1 << 8);
2763 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2768 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2771 SET_H_GR (FLD (f_operand1
), opval
);
2772 written
|= (1 << 8);
2773 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2778 SET_H_GR (FLD (f_operand2
), opval
);
2779 written
|= (1 << 7);
2780 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2785 BI opval
= LTSI (tmp_tmp
, 0);
2786 CPU (h_nbit
) = opval
;
2787 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2790 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2791 CPU (h_zbit
) = opval
;
2792 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2794 SET_H_CBIT_MOVE (0);
2795 SET_H_VBIT_MOVE (0);
2799 CPU (h_xbit
) = opval
;
2800 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2804 SET_H_INSN_PREFIXED_P (opval
);
2805 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2811 abuf
->written
= written
;
2816 CASE (sem
, INSN_MOVS_M_W_M
) : /* movs-m.w [${Rs}${inc}],${Rd} */
2818 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2819 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2820 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2821 int UNUSED written
= 0;
2822 IADDR UNUSED pc
= abuf
->addr
;
2823 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2827 tmp_tmp
= EXTHISI (({ SI tmp_addr
;
2830 tmp_postinc
= FLD (f_memmode
);
2831 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2832 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2833 ; if (NEBI (tmp_postinc
, 0)) {
2835 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2836 tmp_addr
= ADDSI (tmp_addr
, 2);
2839 SI opval
= tmp_addr
;
2840 SET_H_GR (FLD (f_operand1
), opval
);
2841 written
|= (1 << 8);
2842 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2847 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2850 SET_H_GR (FLD (f_operand1
), opval
);
2851 written
|= (1 << 8);
2852 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2857 SET_H_GR (FLD (f_operand2
), opval
);
2858 written
|= (1 << 7);
2859 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2864 BI opval
= LTSI (tmp_tmp
, 0);
2865 CPU (h_nbit
) = opval
;
2866 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2869 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2870 CPU (h_zbit
) = opval
;
2871 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2873 SET_H_CBIT_MOVE (0);
2874 SET_H_VBIT_MOVE (0);
2878 CPU (h_xbit
) = opval
;
2879 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2883 SET_H_INSN_PREFIXED_P (opval
);
2884 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2890 abuf
->written
= written
;
2895 CASE (sem
, INSN_MOVU_M_B_M
) : /* movu-m.b [${Rs}${inc}],${Rd} */
2897 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2898 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2899 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2900 int UNUSED written
= 0;
2901 IADDR UNUSED pc
= abuf
->addr
;
2902 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2906 tmp_tmp
= ZEXTQISI (({ SI tmp_addr
;
2909 tmp_postinc
= FLD (f_memmode
);
2910 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2911 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2912 ; if (NEBI (tmp_postinc
, 0)) {
2914 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2915 tmp_addr
= ADDSI (tmp_addr
, 1);
2918 SI opval
= tmp_addr
;
2919 SET_H_GR (FLD (f_operand1
), opval
);
2920 written
|= (1 << 8);
2921 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2926 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2929 SET_H_GR (FLD (f_operand1
), opval
);
2930 written
|= (1 << 8);
2931 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2936 SET_H_GR (FLD (f_operand2
), opval
);
2937 written
|= (1 << 7);
2938 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2943 BI opval
= LTSI (tmp_tmp
, 0);
2944 CPU (h_nbit
) = opval
;
2945 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2948 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2949 CPU (h_zbit
) = opval
;
2950 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2952 SET_H_CBIT_MOVE (0);
2953 SET_H_VBIT_MOVE (0);
2957 CPU (h_xbit
) = opval
;
2958 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2962 SET_H_INSN_PREFIXED_P (opval
);
2963 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2969 abuf
->written
= written
;
2974 CASE (sem
, INSN_MOVU_M_W_M
) : /* movu-m.w [${Rs}${inc}],${Rd} */
2976 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2978 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2979 int UNUSED written
= 0;
2980 IADDR UNUSED pc
= abuf
->addr
;
2981 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2985 tmp_tmp
= ZEXTHISI (({ SI tmp_addr
;
2988 tmp_postinc
= FLD (f_memmode
);
2989 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2990 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2991 ; if (NEBI (tmp_postinc
, 0)) {
2993 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2994 tmp_addr
= ADDSI (tmp_addr
, 2);
2997 SI opval
= tmp_addr
;
2998 SET_H_GR (FLD (f_operand1
), opval
);
2999 written
|= (1 << 8);
3000 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3005 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3008 SET_H_GR (FLD (f_operand1
), opval
);
3009 written
|= (1 << 8);
3010 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3015 SET_H_GR (FLD (f_operand2
), opval
);
3016 written
|= (1 << 7);
3017 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3022 BI opval
= LTSI (tmp_tmp
, 0);
3023 CPU (h_nbit
) = opval
;
3024 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3027 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3028 CPU (h_zbit
) = opval
;
3029 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3031 SET_H_CBIT_MOVE (0);
3032 SET_H_VBIT_MOVE (0);
3036 CPU (h_xbit
) = opval
;
3037 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3041 SET_H_INSN_PREFIXED_P (opval
);
3042 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3048 abuf
->written
= written
;
3053 CASE (sem
, INSN_MOVE_R_SPRV32
) : /* move ${Rs},${Pd} */
3055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3057 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3058 int UNUSED written
= 0;
3059 IADDR UNUSED pc
= abuf
->addr
;
3060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3065 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
3066 tmp_rno
= FLD (f_operand2
);
3067 if (ORIF (ORIF (EQSI (tmp_rno
, 0), EQSI (tmp_rno
, 1)), ORIF (EQSI (tmp_rno
, 4), EQSI (tmp_rno
, 8)))) {
3068 cgen_rtx_error (current_cpu
, "move-r-spr: trying to set a read-only special register");
3073 SET_H_SR (FLD (f_operand2
), opval
);
3074 written
|= (1 << 2);
3075 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3081 CPU (h_xbit
) = opval
;
3082 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3086 SET_H_INSN_PREFIXED_P (opval
);
3087 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3092 abuf
->written
= written
;
3097 CASE (sem
, INSN_MOVE_SPR_RV32
) : /* move ${Ps},${Rd-sfield} */
3099 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3100 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3101 #define FLD(f) abuf->fields.sfmt_mcp.f
3102 int UNUSED written
= 0;
3103 IADDR UNUSED pc
= abuf
->addr
;
3104 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3110 tmp_prno
= FLD (f_operand2
);
3111 tmp_newval
= GET_H_SR (FLD (f_operand2
));
3112 if (EQSI (tmp_prno
, 2)) {
3115 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3117 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3118 SET_H_GR (FLD (f_operand1
), opval
);
3119 written
|= (1 << 4);
3120 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3124 else if (EQSI (tmp_prno
, 3)) {
3127 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3129 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3130 SET_H_GR (FLD (f_operand1
), opval
);
3131 written
|= (1 << 4);
3132 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3136 else if (EQSI (tmp_prno
, 5)) {
3138 SI opval
= tmp_newval
;
3139 SET_H_GR (FLD (f_operand1
), opval
);
3140 written
|= (1 << 4);
3141 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3144 else if (EQSI (tmp_prno
, 6)) {
3146 SI opval
= tmp_newval
;
3147 SET_H_GR (FLD (f_operand1
), opval
);
3148 written
|= (1 << 4);
3149 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3152 else if (EQSI (tmp_prno
, 7)) {
3154 SI opval
= tmp_newval
;
3155 SET_H_GR (FLD (f_operand1
), opval
);
3156 written
|= (1 << 4);
3157 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3160 else if (EQSI (tmp_prno
, 9)) {
3162 SI opval
= tmp_newval
;
3163 SET_H_GR (FLD (f_operand1
), opval
);
3164 written
|= (1 << 4);
3165 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3168 else if (EQSI (tmp_prno
, 10)) {
3170 SI opval
= tmp_newval
;
3171 SET_H_GR (FLD (f_operand1
), opval
);
3172 written
|= (1 << 4);
3173 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3176 else if (EQSI (tmp_prno
, 11)) {
3178 SI opval
= tmp_newval
;
3179 SET_H_GR (FLD (f_operand1
), opval
);
3180 written
|= (1 << 4);
3181 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3184 else if (EQSI (tmp_prno
, 12)) {
3186 SI opval
= tmp_newval
;
3187 SET_H_GR (FLD (f_operand1
), opval
);
3188 written
|= (1 << 4);
3189 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3192 else if (EQSI (tmp_prno
, 13)) {
3194 SI opval
= tmp_newval
;
3195 SET_H_GR (FLD (f_operand1
), opval
);
3196 written
|= (1 << 4);
3197 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3200 else if (EQSI (tmp_prno
, 14)) {
3202 SI opval
= tmp_newval
;
3203 SET_H_GR (FLD (f_operand1
), opval
);
3204 written
|= (1 << 4);
3205 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3208 else if (EQSI (tmp_prno
, 15)) {
3210 SI opval
= tmp_newval
;
3211 SET_H_GR (FLD (f_operand1
), opval
);
3212 written
|= (1 << 4);
3213 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3216 else if (EQSI (tmp_prno
, 0)) {
3219 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3221 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3222 SET_H_GR (FLD (f_operand1
), opval
);
3223 written
|= (1 << 4);
3224 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3228 else if (EQSI (tmp_prno
, 1)) {
3231 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3233 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3234 SET_H_GR (FLD (f_operand1
), opval
);
3235 written
|= (1 << 4);
3236 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3240 else if (EQSI (tmp_prno
, 4)) {
3243 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3245 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3246 SET_H_GR (FLD (f_operand1
), opval
);
3247 written
|= (1 << 4);
3248 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3252 else if (EQSI (tmp_prno
, 8)) {
3254 SI opval
= tmp_newval
;
3255 SET_H_GR (FLD (f_operand1
), opval
);
3256 written
|= (1 << 4);
3257 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3261 cgen_rtx_error (current_cpu
, "move-spr-r from unimplemented register");
3266 CPU (h_xbit
) = opval
;
3267 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3271 SET_H_INSN_PREFIXED_P (opval
);
3272 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3277 abuf
->written
= written
;
3282 CASE (sem
, INSN_MOVE_M_SPRV32
) : /* move [${Rs}${inc}],${Pd} */
3284 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3285 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3286 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3287 int UNUSED written
= 0;
3288 IADDR UNUSED pc
= abuf
->addr
;
3289 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3294 tmp_rno
= FLD (f_operand2
);
3295 if (EQSI (tmp_rno
, 2)) {
3296 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3299 tmp_postinc
= FLD (f_memmode
);
3300 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3301 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3302 ; if (NEBI (tmp_postinc
, 0)) {
3304 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3305 tmp_addr
= ADDSI (tmp_addr
, 1);
3308 SI opval
= tmp_addr
;
3309 SET_H_GR (FLD (f_operand1
), opval
);
3310 written
|= (1 << 8);
3311 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3317 else if (EQSI (tmp_rno
, 3)) {
3318 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3321 tmp_postinc
= FLD (f_memmode
);
3322 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3323 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3324 ; if (NEBI (tmp_postinc
, 0)) {
3326 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3327 tmp_addr
= ADDSI (tmp_addr
, 1);
3330 SI opval
= tmp_addr
;
3331 SET_H_GR (FLD (f_operand1
), opval
);
3332 written
|= (1 << 8);
3333 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3339 else if (EQSI (tmp_rno
, 5)) {
3340 tmp_newval
= ({ SI tmp_addr
;
3343 tmp_postinc
= FLD (f_memmode
);
3344 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3345 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3346 ; if (NEBI (tmp_postinc
, 0)) {
3348 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3349 tmp_addr
= ADDSI (tmp_addr
, 4);
3352 SI opval
= tmp_addr
;
3353 SET_H_GR (FLD (f_operand1
), opval
);
3354 written
|= (1 << 8);
3355 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3361 else if (EQSI (tmp_rno
, 6)) {
3362 tmp_newval
= ({ SI tmp_addr
;
3365 tmp_postinc
= FLD (f_memmode
);
3366 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3367 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3368 ; if (NEBI (tmp_postinc
, 0)) {
3370 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3371 tmp_addr
= ADDSI (tmp_addr
, 4);
3374 SI opval
= tmp_addr
;
3375 SET_H_GR (FLD (f_operand1
), opval
);
3376 written
|= (1 << 8);
3377 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3383 else if (EQSI (tmp_rno
, 7)) {
3384 tmp_newval
= ({ SI tmp_addr
;
3387 tmp_postinc
= FLD (f_memmode
);
3388 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3389 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3390 ; if (NEBI (tmp_postinc
, 0)) {
3392 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3393 tmp_addr
= ADDSI (tmp_addr
, 4);
3396 SI opval
= tmp_addr
;
3397 SET_H_GR (FLD (f_operand1
), opval
);
3398 written
|= (1 << 8);
3399 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3405 else if (EQSI (tmp_rno
, 9)) {
3406 tmp_newval
= ({ SI tmp_addr
;
3409 tmp_postinc
= FLD (f_memmode
);
3410 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3411 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3412 ; if (NEBI (tmp_postinc
, 0)) {
3414 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3415 tmp_addr
= ADDSI (tmp_addr
, 4);
3418 SI opval
= tmp_addr
;
3419 SET_H_GR (FLD (f_operand1
), opval
);
3420 written
|= (1 << 8);
3421 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3427 else if (EQSI (tmp_rno
, 10)) {
3428 tmp_newval
= ({ SI tmp_addr
;
3431 tmp_postinc
= FLD (f_memmode
);
3432 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3433 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3434 ; if (NEBI (tmp_postinc
, 0)) {
3436 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3437 tmp_addr
= ADDSI (tmp_addr
, 4);
3440 SI opval
= tmp_addr
;
3441 SET_H_GR (FLD (f_operand1
), opval
);
3442 written
|= (1 << 8);
3443 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3449 else if (EQSI (tmp_rno
, 11)) {
3450 tmp_newval
= ({ SI tmp_addr
;
3453 tmp_postinc
= FLD (f_memmode
);
3454 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3455 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3456 ; if (NEBI (tmp_postinc
, 0)) {
3458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3459 tmp_addr
= ADDSI (tmp_addr
, 4);
3462 SI opval
= tmp_addr
;
3463 SET_H_GR (FLD (f_operand1
), opval
);
3464 written
|= (1 << 8);
3465 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3471 else if (EQSI (tmp_rno
, 12)) {
3472 tmp_newval
= ({ SI tmp_addr
;
3475 tmp_postinc
= FLD (f_memmode
);
3476 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3477 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3478 ; if (NEBI (tmp_postinc
, 0)) {
3480 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3481 tmp_addr
= ADDSI (tmp_addr
, 4);
3484 SI opval
= tmp_addr
;
3485 SET_H_GR (FLD (f_operand1
), opval
);
3486 written
|= (1 << 8);
3487 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3493 else if (EQSI (tmp_rno
, 13)) {
3494 tmp_newval
= ({ SI tmp_addr
;
3497 tmp_postinc
= FLD (f_memmode
);
3498 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3499 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3500 ; if (NEBI (tmp_postinc
, 0)) {
3502 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3503 tmp_addr
= ADDSI (tmp_addr
, 4);
3506 SI opval
= tmp_addr
;
3507 SET_H_GR (FLD (f_operand1
), opval
);
3508 written
|= (1 << 8);
3509 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3515 else if (EQSI (tmp_rno
, 14)) {
3516 tmp_newval
= ({ SI tmp_addr
;
3519 tmp_postinc
= FLD (f_memmode
);
3520 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3521 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3522 ; if (NEBI (tmp_postinc
, 0)) {
3524 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3525 tmp_addr
= ADDSI (tmp_addr
, 4);
3528 SI opval
= tmp_addr
;
3529 SET_H_GR (FLD (f_operand1
), opval
);
3530 written
|= (1 << 8);
3531 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3537 else if (EQSI (tmp_rno
, 15)) {
3538 tmp_newval
= ({ SI tmp_addr
;
3541 tmp_postinc
= FLD (f_memmode
);
3542 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3543 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3544 ; if (NEBI (tmp_postinc
, 0)) {
3546 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3547 tmp_addr
= ADDSI (tmp_addr
, 4);
3550 SI opval
= tmp_addr
;
3551 SET_H_GR (FLD (f_operand1
), opval
);
3552 written
|= (1 << 8);
3553 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3560 cgen_rtx_error (current_cpu
, "Trying to set unimplemented special register");
3563 SI opval
= tmp_newval
;
3564 SET_H_SR (FLD (f_operand2
), opval
);
3565 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3570 CPU (h_xbit
) = opval
;
3571 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3575 SET_H_INSN_PREFIXED_P (opval
);
3576 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3581 abuf
->written
= written
;
3586 CASE (sem
, INSN_MOVE_C_SPRV32_P2
) : /* move ${const32},${Pd} */
3588 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3589 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3590 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3591 int UNUSED written
= 0;
3592 IADDR UNUSED pc
= abuf
->addr
;
3593 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3597 SI opval
= FLD (f_indir_pc__dword
);
3598 SET_H_SR (FLD (f_operand2
), opval
);
3599 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3604 CPU (h_xbit
) = opval
;
3605 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3609 SET_H_INSN_PREFIXED_P (opval
);
3610 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3619 CASE (sem
, INSN_MOVE_C_SPRV32_P3
) : /* move ${const32},${Pd} */
3621 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3622 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3623 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3624 int UNUSED written
= 0;
3625 IADDR UNUSED pc
= abuf
->addr
;
3626 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3630 SI opval
= FLD (f_indir_pc__dword
);
3631 SET_H_SR (FLD (f_operand2
), opval
);
3632 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3637 CPU (h_xbit
) = opval
;
3638 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3642 SET_H_INSN_PREFIXED_P (opval
);
3643 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3652 CASE (sem
, INSN_MOVE_C_SPRV32_P5
) : /* move ${const32},${Pd} */
3654 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3655 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3656 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3657 int UNUSED written
= 0;
3658 IADDR UNUSED pc
= abuf
->addr
;
3659 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3663 SI opval
= FLD (f_indir_pc__dword
);
3664 SET_H_SR (FLD (f_operand2
), opval
);
3665 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3670 CPU (h_xbit
) = opval
;
3671 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3675 SET_H_INSN_PREFIXED_P (opval
);
3676 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3685 CASE (sem
, INSN_MOVE_C_SPRV32_P6
) : /* move ${const32},${Pd} */
3687 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3688 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3689 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3690 int UNUSED written
= 0;
3691 IADDR UNUSED pc
= abuf
->addr
;
3692 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3696 SI opval
= FLD (f_indir_pc__dword
);
3697 SET_H_SR (FLD (f_operand2
), opval
);
3698 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3703 CPU (h_xbit
) = opval
;
3704 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3708 SET_H_INSN_PREFIXED_P (opval
);
3709 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3718 CASE (sem
, INSN_MOVE_C_SPRV32_P7
) : /* move ${const32},${Pd} */
3720 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3721 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3722 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3723 int UNUSED written
= 0;
3724 IADDR UNUSED pc
= abuf
->addr
;
3725 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3729 SI opval
= FLD (f_indir_pc__dword
);
3730 SET_H_SR (FLD (f_operand2
), opval
);
3731 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3736 CPU (h_xbit
) = opval
;
3737 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3741 SET_H_INSN_PREFIXED_P (opval
);
3742 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3751 CASE (sem
, INSN_MOVE_C_SPRV32_P9
) : /* move ${const32},${Pd} */
3753 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3754 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3755 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3756 int UNUSED written
= 0;
3757 IADDR UNUSED pc
= abuf
->addr
;
3758 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3762 SI opval
= FLD (f_indir_pc__dword
);
3763 SET_H_SR (FLD (f_operand2
), opval
);
3764 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3769 CPU (h_xbit
) = opval
;
3770 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3774 SET_H_INSN_PREFIXED_P (opval
);
3775 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3784 CASE (sem
, INSN_MOVE_C_SPRV32_P10
) : /* move ${const32},${Pd} */
3786 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3787 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3788 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3789 int UNUSED written
= 0;
3790 IADDR UNUSED pc
= abuf
->addr
;
3791 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3795 SI opval
= FLD (f_indir_pc__dword
);
3796 SET_H_SR (FLD (f_operand2
), opval
);
3797 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3802 CPU (h_xbit
) = opval
;
3803 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3807 SET_H_INSN_PREFIXED_P (opval
);
3808 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3817 CASE (sem
, INSN_MOVE_C_SPRV32_P11
) : /* move ${const32},${Pd} */
3819 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3820 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3821 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3822 int UNUSED written
= 0;
3823 IADDR UNUSED pc
= abuf
->addr
;
3824 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3828 SI opval
= FLD (f_indir_pc__dword
);
3829 SET_H_SR (FLD (f_operand2
), opval
);
3830 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3835 CPU (h_xbit
) = opval
;
3836 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3840 SET_H_INSN_PREFIXED_P (opval
);
3841 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3850 CASE (sem
, INSN_MOVE_C_SPRV32_P12
) : /* move ${const32},${Pd} */
3852 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3854 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3855 int UNUSED written
= 0;
3856 IADDR UNUSED pc
= abuf
->addr
;
3857 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3861 SI opval
= FLD (f_indir_pc__dword
);
3862 SET_H_SR (FLD (f_operand2
), opval
);
3863 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3868 CPU (h_xbit
) = opval
;
3869 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3873 SET_H_INSN_PREFIXED_P (opval
);
3874 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3883 CASE (sem
, INSN_MOVE_C_SPRV32_P13
) : /* move ${const32},${Pd} */
3885 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3886 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3887 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3888 int UNUSED written
= 0;
3889 IADDR UNUSED pc
= abuf
->addr
;
3890 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3894 SI opval
= FLD (f_indir_pc__dword
);
3895 SET_H_SR (FLD (f_operand2
), opval
);
3896 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3901 CPU (h_xbit
) = opval
;
3902 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3906 SET_H_INSN_PREFIXED_P (opval
);
3907 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3916 CASE (sem
, INSN_MOVE_C_SPRV32_P14
) : /* move ${const32},${Pd} */
3918 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3919 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3920 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3921 int UNUSED written
= 0;
3922 IADDR UNUSED pc
= abuf
->addr
;
3923 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3927 SI opval
= FLD (f_indir_pc__dword
);
3928 SET_H_SR (FLD (f_operand2
), opval
);
3929 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3934 CPU (h_xbit
) = opval
;
3935 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3939 SET_H_INSN_PREFIXED_P (opval
);
3940 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3949 CASE (sem
, INSN_MOVE_C_SPRV32_P15
) : /* move ${const32},${Pd} */
3951 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3952 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3953 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3954 int UNUSED written
= 0;
3955 IADDR UNUSED pc
= abuf
->addr
;
3956 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3960 SI opval
= FLD (f_indir_pc__dword
);
3961 SET_H_SR (FLD (f_operand2
), opval
);
3962 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3967 CPU (h_xbit
) = opval
;
3968 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3972 SET_H_INSN_PREFIXED_P (opval
);
3973 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3982 CASE (sem
, INSN_MOVE_SPR_MV32
) : /* move ${Ps},[${Rd-sfield}${inc}] */
3984 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3985 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3986 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3987 int UNUSED written
= 0;
3988 IADDR UNUSED pc
= abuf
->addr
;
3989 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3993 tmp_rno
= FLD (f_operand2
);
3994 if (EQSI (tmp_rno
, 2)) {
3998 tmp_postinc
= FLD (f_memmode
);
3999 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4000 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4001 if (EQBI (CPU (h_pbit
), 0)) {
4004 QI opval
= GET_H_SR (FLD (f_operand2
));
4005 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4006 written
|= (1 << 12);
4007 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4010 BI opval
= CPU (h_pbit
);
4011 CPU (h_cbit
) = opval
;
4012 written
|= (1 << 10);
4013 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4019 CPU (h_cbit
) = opval
;
4020 written
|= (1 << 10);
4021 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4026 QI opval
= GET_H_SR (FLD (f_operand2
));
4027 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4028 written
|= (1 << 12);
4029 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4032 if (NEBI (tmp_postinc
, 0)) {
4034 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4035 tmp_addr
= ADDSI (tmp_addr
, 1);
4038 SI opval
= tmp_addr
;
4039 SET_H_GR (FLD (f_operand1
), opval
);
4040 written
|= (1 << 9);
4041 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4047 else if (EQSI (tmp_rno
, 3)) {
4051 tmp_postinc
= FLD (f_memmode
);
4052 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4053 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4054 if (EQBI (CPU (h_pbit
), 0)) {
4057 QI opval
= GET_H_SR (FLD (f_operand2
));
4058 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4059 written
|= (1 << 12);
4060 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4063 BI opval
= CPU (h_pbit
);
4064 CPU (h_cbit
) = opval
;
4065 written
|= (1 << 10);
4066 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4072 CPU (h_cbit
) = opval
;
4073 written
|= (1 << 10);
4074 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4079 QI opval
= GET_H_SR (FLD (f_operand2
));
4080 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4081 written
|= (1 << 12);
4082 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4085 if (NEBI (tmp_postinc
, 0)) {
4087 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4088 tmp_addr
= ADDSI (tmp_addr
, 1);
4091 SI opval
= tmp_addr
;
4092 SET_H_GR (FLD (f_operand1
), opval
);
4093 written
|= (1 << 9);
4094 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4100 else if (EQSI (tmp_rno
, 5)) {
4104 tmp_postinc
= FLD (f_memmode
);
4105 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4106 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4107 if (EQBI (CPU (h_pbit
), 0)) {
4110 SI opval
= GET_H_SR (FLD (f_operand2
));
4111 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4112 written
|= (1 << 13);
4113 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4116 BI opval
= CPU (h_pbit
);
4117 CPU (h_cbit
) = opval
;
4118 written
|= (1 << 10);
4119 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4125 CPU (h_cbit
) = opval
;
4126 written
|= (1 << 10);
4127 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4132 SI opval
= GET_H_SR (FLD (f_operand2
));
4133 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4134 written
|= (1 << 13);
4135 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4138 if (NEBI (tmp_postinc
, 0)) {
4140 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4141 tmp_addr
= ADDSI (tmp_addr
, 4);
4144 SI opval
= tmp_addr
;
4145 SET_H_GR (FLD (f_operand1
), opval
);
4146 written
|= (1 << 9);
4147 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4153 else if (EQSI (tmp_rno
, 6)) {
4157 tmp_postinc
= FLD (f_memmode
);
4158 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4159 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4160 if (EQBI (CPU (h_pbit
), 0)) {
4163 SI opval
= GET_H_SR (FLD (f_operand2
));
4164 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4165 written
|= (1 << 13);
4166 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4169 BI opval
= CPU (h_pbit
);
4170 CPU (h_cbit
) = opval
;
4171 written
|= (1 << 10);
4172 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4178 CPU (h_cbit
) = opval
;
4179 written
|= (1 << 10);
4180 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4185 SI opval
= GET_H_SR (FLD (f_operand2
));
4186 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4187 written
|= (1 << 13);
4188 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4191 if (NEBI (tmp_postinc
, 0)) {
4193 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4194 tmp_addr
= ADDSI (tmp_addr
, 4);
4197 SI opval
= tmp_addr
;
4198 SET_H_GR (FLD (f_operand1
), opval
);
4199 written
|= (1 << 9);
4200 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4206 else if (EQSI (tmp_rno
, 7)) {
4210 tmp_postinc
= FLD (f_memmode
);
4211 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4212 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4213 if (EQBI (CPU (h_pbit
), 0)) {
4216 SI opval
= GET_H_SR (FLD (f_operand2
));
4217 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4218 written
|= (1 << 13);
4219 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4222 BI opval
= CPU (h_pbit
);
4223 CPU (h_cbit
) = opval
;
4224 written
|= (1 << 10);
4225 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4231 CPU (h_cbit
) = opval
;
4232 written
|= (1 << 10);
4233 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4238 SI opval
= GET_H_SR (FLD (f_operand2
));
4239 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4240 written
|= (1 << 13);
4241 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4244 if (NEBI (tmp_postinc
, 0)) {
4246 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4247 tmp_addr
= ADDSI (tmp_addr
, 4);
4250 SI opval
= tmp_addr
;
4251 SET_H_GR (FLD (f_operand1
), opval
);
4252 written
|= (1 << 9);
4253 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4259 else if (EQSI (tmp_rno
, 9)) {
4263 tmp_postinc
= FLD (f_memmode
);
4264 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4265 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4266 if (EQBI (CPU (h_pbit
), 0)) {
4269 SI opval
= GET_H_SR (FLD (f_operand2
));
4270 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4271 written
|= (1 << 13);
4272 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4275 BI opval
= CPU (h_pbit
);
4276 CPU (h_cbit
) = opval
;
4277 written
|= (1 << 10);
4278 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4284 CPU (h_cbit
) = opval
;
4285 written
|= (1 << 10);
4286 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4291 SI opval
= GET_H_SR (FLD (f_operand2
));
4292 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4293 written
|= (1 << 13);
4294 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4297 if (NEBI (tmp_postinc
, 0)) {
4299 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4300 tmp_addr
= ADDSI (tmp_addr
, 4);
4303 SI opval
= tmp_addr
;
4304 SET_H_GR (FLD (f_operand1
), opval
);
4305 written
|= (1 << 9);
4306 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4312 else if (EQSI (tmp_rno
, 10)) {
4316 tmp_postinc
= FLD (f_memmode
);
4317 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4318 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4319 if (EQBI (CPU (h_pbit
), 0)) {
4322 SI opval
= GET_H_SR (FLD (f_operand2
));
4323 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4324 written
|= (1 << 13);
4325 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4328 BI opval
= CPU (h_pbit
);
4329 CPU (h_cbit
) = opval
;
4330 written
|= (1 << 10);
4331 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4337 CPU (h_cbit
) = opval
;
4338 written
|= (1 << 10);
4339 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4344 SI opval
= GET_H_SR (FLD (f_operand2
));
4345 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4346 written
|= (1 << 13);
4347 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4350 if (NEBI (tmp_postinc
, 0)) {
4352 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4353 tmp_addr
= ADDSI (tmp_addr
, 4);
4356 SI opval
= tmp_addr
;
4357 SET_H_GR (FLD (f_operand1
), opval
);
4358 written
|= (1 << 9);
4359 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4365 else if (EQSI (tmp_rno
, 11)) {
4369 tmp_postinc
= FLD (f_memmode
);
4370 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4371 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4372 if (EQBI (CPU (h_pbit
), 0)) {
4375 SI opval
= GET_H_SR (FLD (f_operand2
));
4376 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4377 written
|= (1 << 13);
4378 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4381 BI opval
= CPU (h_pbit
);
4382 CPU (h_cbit
) = opval
;
4383 written
|= (1 << 10);
4384 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4390 CPU (h_cbit
) = opval
;
4391 written
|= (1 << 10);
4392 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4397 SI opval
= GET_H_SR (FLD (f_operand2
));
4398 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4399 written
|= (1 << 13);
4400 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4403 if (NEBI (tmp_postinc
, 0)) {
4405 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4406 tmp_addr
= ADDSI (tmp_addr
, 4);
4409 SI opval
= tmp_addr
;
4410 SET_H_GR (FLD (f_operand1
), opval
);
4411 written
|= (1 << 9);
4412 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4418 else if (EQSI (tmp_rno
, 12)) {
4422 tmp_postinc
= FLD (f_memmode
);
4423 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4424 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4425 if (EQBI (CPU (h_pbit
), 0)) {
4428 SI opval
= GET_H_SR (FLD (f_operand2
));
4429 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4430 written
|= (1 << 13);
4431 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4434 BI opval
= CPU (h_pbit
);
4435 CPU (h_cbit
) = opval
;
4436 written
|= (1 << 10);
4437 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4443 CPU (h_cbit
) = opval
;
4444 written
|= (1 << 10);
4445 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4450 SI opval
= GET_H_SR (FLD (f_operand2
));
4451 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4452 written
|= (1 << 13);
4453 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4456 if (NEBI (tmp_postinc
, 0)) {
4458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4459 tmp_addr
= ADDSI (tmp_addr
, 4);
4462 SI opval
= tmp_addr
;
4463 SET_H_GR (FLD (f_operand1
), opval
);
4464 written
|= (1 << 9);
4465 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4471 else if (EQSI (tmp_rno
, 13)) {
4475 tmp_postinc
= FLD (f_memmode
);
4476 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4477 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4478 if (EQBI (CPU (h_pbit
), 0)) {
4481 SI opval
= GET_H_SR (FLD (f_operand2
));
4482 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4483 written
|= (1 << 13);
4484 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4487 BI opval
= CPU (h_pbit
);
4488 CPU (h_cbit
) = opval
;
4489 written
|= (1 << 10);
4490 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4496 CPU (h_cbit
) = opval
;
4497 written
|= (1 << 10);
4498 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4503 SI opval
= GET_H_SR (FLD (f_operand2
));
4504 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4505 written
|= (1 << 13);
4506 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4509 if (NEBI (tmp_postinc
, 0)) {
4511 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4512 tmp_addr
= ADDSI (tmp_addr
, 4);
4515 SI opval
= tmp_addr
;
4516 SET_H_GR (FLD (f_operand1
), opval
);
4517 written
|= (1 << 9);
4518 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4524 else if (EQSI (tmp_rno
, 14)) {
4528 tmp_postinc
= FLD (f_memmode
);
4529 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4530 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4531 if (EQBI (CPU (h_pbit
), 0)) {
4534 SI opval
= GET_H_SR (FLD (f_operand2
));
4535 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4536 written
|= (1 << 13);
4537 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4540 BI opval
= CPU (h_pbit
);
4541 CPU (h_cbit
) = opval
;
4542 written
|= (1 << 10);
4543 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4549 CPU (h_cbit
) = opval
;
4550 written
|= (1 << 10);
4551 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4556 SI opval
= GET_H_SR (FLD (f_operand2
));
4557 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4558 written
|= (1 << 13);
4559 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4562 if (NEBI (tmp_postinc
, 0)) {
4564 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4565 tmp_addr
= ADDSI (tmp_addr
, 4);
4568 SI opval
= tmp_addr
;
4569 SET_H_GR (FLD (f_operand1
), opval
);
4570 written
|= (1 << 9);
4571 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4577 else if (EQSI (tmp_rno
, 15)) {
4581 tmp_postinc
= FLD (f_memmode
);
4582 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4583 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4584 if (EQBI (CPU (h_pbit
), 0)) {
4587 SI opval
= GET_H_SR (FLD (f_operand2
));
4588 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4589 written
|= (1 << 13);
4590 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4593 BI opval
= CPU (h_pbit
);
4594 CPU (h_cbit
) = opval
;
4595 written
|= (1 << 10);
4596 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4602 CPU (h_cbit
) = opval
;
4603 written
|= (1 << 10);
4604 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4609 SI opval
= GET_H_SR (FLD (f_operand2
));
4610 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4611 written
|= (1 << 13);
4612 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4615 if (NEBI (tmp_postinc
, 0)) {
4617 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4618 tmp_addr
= ADDSI (tmp_addr
, 4);
4621 SI opval
= tmp_addr
;
4622 SET_H_GR (FLD (f_operand1
), opval
);
4623 written
|= (1 << 9);
4624 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4630 else if (EQSI (tmp_rno
, 0)) {
4634 tmp_postinc
= FLD (f_memmode
);
4635 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4636 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4637 if (EQBI (CPU (h_pbit
), 0)) {
4640 QI opval
= GET_H_SR (FLD (f_operand2
));
4641 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4642 written
|= (1 << 12);
4643 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4646 BI opval
= CPU (h_pbit
);
4647 CPU (h_cbit
) = opval
;
4648 written
|= (1 << 10);
4649 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4655 CPU (h_cbit
) = opval
;
4656 written
|= (1 << 10);
4657 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4662 QI opval
= GET_H_SR (FLD (f_operand2
));
4663 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4664 written
|= (1 << 12);
4665 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4668 if (NEBI (tmp_postinc
, 0)) {
4670 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4671 tmp_addr
= ADDSI (tmp_addr
, 1);
4674 SI opval
= tmp_addr
;
4675 SET_H_GR (FLD (f_operand1
), opval
);
4676 written
|= (1 << 9);
4677 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4683 else if (EQSI (tmp_rno
, 1)) {
4687 tmp_postinc
= FLD (f_memmode
);
4688 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4689 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4690 if (EQBI (CPU (h_pbit
), 0)) {
4693 QI opval
= GET_H_SR (FLD (f_operand2
));
4694 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4695 written
|= (1 << 12);
4696 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4699 BI opval
= CPU (h_pbit
);
4700 CPU (h_cbit
) = opval
;
4701 written
|= (1 << 10);
4702 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4708 CPU (h_cbit
) = opval
;
4709 written
|= (1 << 10);
4710 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4715 QI opval
= GET_H_SR (FLD (f_operand2
));
4716 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4717 written
|= (1 << 12);
4718 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4721 if (NEBI (tmp_postinc
, 0)) {
4723 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4724 tmp_addr
= ADDSI (tmp_addr
, 1);
4727 SI opval
= tmp_addr
;
4728 SET_H_GR (FLD (f_operand1
), opval
);
4729 written
|= (1 << 9);
4730 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4736 else if (EQSI (tmp_rno
, 4)) {
4740 tmp_postinc
= FLD (f_memmode
);
4741 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4742 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4743 if (EQBI (CPU (h_pbit
), 0)) {
4746 HI opval
= GET_H_SR (FLD (f_operand2
));
4747 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4748 written
|= (1 << 11);
4749 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4752 BI opval
= CPU (h_pbit
);
4753 CPU (h_cbit
) = opval
;
4754 written
|= (1 << 10);
4755 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4761 CPU (h_cbit
) = opval
;
4762 written
|= (1 << 10);
4763 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4768 HI opval
= GET_H_SR (FLD (f_operand2
));
4769 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4770 written
|= (1 << 11);
4771 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4774 if (NEBI (tmp_postinc
, 0)) {
4776 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4777 tmp_addr
= ADDSI (tmp_addr
, 2);
4780 SI opval
= tmp_addr
;
4781 SET_H_GR (FLD (f_operand1
), opval
);
4782 written
|= (1 << 9);
4783 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4789 else if (EQSI (tmp_rno
, 8)) {
4793 tmp_postinc
= FLD (f_memmode
);
4794 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4795 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4796 if (EQBI (CPU (h_pbit
), 0)) {
4799 SI opval
= GET_H_SR (FLD (f_operand2
));
4800 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4801 written
|= (1 << 13);
4802 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4805 BI opval
= CPU (h_pbit
);
4806 CPU (h_cbit
) = opval
;
4807 written
|= (1 << 10);
4808 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4814 CPU (h_cbit
) = opval
;
4815 written
|= (1 << 10);
4816 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4821 SI opval
= GET_H_SR (FLD (f_operand2
));
4822 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4823 written
|= (1 << 13);
4824 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4827 if (NEBI (tmp_postinc
, 0)) {
4829 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4830 tmp_addr
= ADDSI (tmp_addr
, 4);
4833 SI opval
= tmp_addr
;
4834 SET_H_GR (FLD (f_operand1
), opval
);
4835 written
|= (1 << 9);
4836 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4843 cgen_rtx_error (current_cpu
, "write from unimplemented special register");
4848 CPU (h_xbit
) = opval
;
4849 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4853 SET_H_INSN_PREFIXED_P (opval
);
4854 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4859 abuf
->written
= written
;
4864 CASE (sem
, INSN_MOVE_SS_R
) : /* move ${Ss},${Rd-sfield} */
4866 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4867 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4868 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4869 int UNUSED written
= 0;
4870 IADDR UNUSED pc
= abuf
->addr
;
4871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4875 SI opval
= GET_H_SUPR (FLD (f_operand2
));
4876 SET_H_GR (FLD (f_operand1
), opval
);
4877 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4882 CPU (h_xbit
) = opval
;
4883 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4887 SET_H_INSN_PREFIXED_P (opval
);
4888 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4897 CASE (sem
, INSN_MOVE_R_SS
) : /* move ${Rs},${Sd} */
4899 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4900 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4901 #define FLD(f) abuf->fields.sfmt_mcp.f
4902 int UNUSED written
= 0;
4903 IADDR UNUSED pc
= abuf
->addr
;
4904 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4908 SI opval
= GET_H_GR (FLD (f_operand1
));
4909 SET_H_SUPR (FLD (f_operand2
), opval
);
4910 TRACE_RESULT (current_cpu
, abuf
, "supr", 'x', opval
);
4915 CPU (h_xbit
) = opval
;
4916 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4920 SET_H_INSN_PREFIXED_P (opval
);
4921 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4930 CASE (sem
, INSN_MOVEM_R_M_V32
) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4932 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4933 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4934 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
4935 int UNUSED written
= 0;
4936 IADDR UNUSED pc
= abuf
->addr
;
4937 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4942 tmp_postinc
= FLD (f_memmode
);
4945 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
4947 tmp_addr
= GET_H_GR (FLD (f_operand1
));
4949 if (GESI (FLD (f_operand2
), 0)) {
4952 tmp_tmp
= GET_H_GR (((UINT
) 0));
4955 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4956 written
|= (1 << 21);
4957 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4959 tmp_addr
= ADDSI (tmp_addr
, 4);
4962 if (GESI (FLD (f_operand2
), 1)) {
4965 tmp_tmp
= GET_H_GR (((UINT
) 1));
4968 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4969 written
|= (1 << 21);
4970 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4972 tmp_addr
= ADDSI (tmp_addr
, 4);
4975 if (GESI (FLD (f_operand2
), 2)) {
4978 tmp_tmp
= GET_H_GR (((UINT
) 2));
4981 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4982 written
|= (1 << 21);
4983 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4985 tmp_addr
= ADDSI (tmp_addr
, 4);
4988 if (GESI (FLD (f_operand2
), 3)) {
4991 tmp_tmp
= GET_H_GR (((UINT
) 3));
4994 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4995 written
|= (1 << 21);
4996 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4998 tmp_addr
= ADDSI (tmp_addr
, 4);
5001 if (GESI (FLD (f_operand2
), 4)) {
5004 tmp_tmp
= GET_H_GR (((UINT
) 4));
5007 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5008 written
|= (1 << 21);
5009 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5011 tmp_addr
= ADDSI (tmp_addr
, 4);
5014 if (GESI (FLD (f_operand2
), 5)) {
5017 tmp_tmp
= GET_H_GR (((UINT
) 5));
5020 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5021 written
|= (1 << 21);
5022 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5024 tmp_addr
= ADDSI (tmp_addr
, 4);
5027 if (GESI (FLD (f_operand2
), 6)) {
5030 tmp_tmp
= GET_H_GR (((UINT
) 6));
5033 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5034 written
|= (1 << 21);
5035 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5037 tmp_addr
= ADDSI (tmp_addr
, 4);
5040 if (GESI (FLD (f_operand2
), 7)) {
5043 tmp_tmp
= GET_H_GR (((UINT
) 7));
5046 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5047 written
|= (1 << 21);
5048 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5050 tmp_addr
= ADDSI (tmp_addr
, 4);
5053 if (GESI (FLD (f_operand2
), 8)) {
5056 tmp_tmp
= GET_H_GR (((UINT
) 8));
5059 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5060 written
|= (1 << 21);
5061 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5063 tmp_addr
= ADDSI (tmp_addr
, 4);
5066 if (GESI (FLD (f_operand2
), 9)) {
5069 tmp_tmp
= GET_H_GR (((UINT
) 9));
5072 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5073 written
|= (1 << 21);
5074 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5076 tmp_addr
= ADDSI (tmp_addr
, 4);
5079 if (GESI (FLD (f_operand2
), 10)) {
5082 tmp_tmp
= GET_H_GR (((UINT
) 10));
5085 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5086 written
|= (1 << 21);
5087 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5089 tmp_addr
= ADDSI (tmp_addr
, 4);
5092 if (GESI (FLD (f_operand2
), 11)) {
5095 tmp_tmp
= GET_H_GR (((UINT
) 11));
5098 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5099 written
|= (1 << 21);
5100 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5102 tmp_addr
= ADDSI (tmp_addr
, 4);
5105 if (GESI (FLD (f_operand2
), 12)) {
5108 tmp_tmp
= GET_H_GR (((UINT
) 12));
5111 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5112 written
|= (1 << 21);
5113 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5115 tmp_addr
= ADDSI (tmp_addr
, 4);
5118 if (GESI (FLD (f_operand2
), 13)) {
5121 tmp_tmp
= GET_H_GR (((UINT
) 13));
5124 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5125 written
|= (1 << 21);
5126 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5128 tmp_addr
= ADDSI (tmp_addr
, 4);
5131 if (GESI (FLD (f_operand2
), 14)) {
5134 tmp_tmp
= GET_H_GR (((UINT
) 14));
5137 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5138 written
|= (1 << 21);
5139 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5141 tmp_addr
= ADDSI (tmp_addr
, 4);
5144 if (GESI (FLD (f_operand2
), 15)) {
5147 tmp_tmp
= GET_H_GR (((UINT
) 15));
5150 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5151 written
|= (1 << 21);
5152 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5154 tmp_addr
= ADDSI (tmp_addr
, 4);
5158 if (NEBI (tmp_postinc
, 0)) {
5160 SI opval
= tmp_addr
;
5161 SET_H_GR (FLD (f_operand1
), opval
);
5162 written
|= (1 << 20);
5163 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5169 CPU (h_xbit
) = opval
;
5170 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5174 SET_H_INSN_PREFIXED_P (opval
);
5175 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5180 abuf
->written
= written
;
5185 CASE (sem
, INSN_MOVEM_M_R_V32
) : /* movem [${Rs}${inc}],${Rd} */
5187 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5188 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5189 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5190 int UNUSED written
= 0;
5191 IADDR UNUSED pc
= abuf
->addr
;
5192 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5197 tmp_postinc
= FLD (f_memmode
);
5198 tmp_addr
= GET_H_GR (FLD (f_operand1
));
5201 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
5204 if (GESI (FLD (f_operand2
), 0)) {
5207 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5210 SET_H_GR (((UINT
) 0), opval
);
5211 written
|= (1 << 6);
5212 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5214 tmp_addr
= ADDSI (tmp_addr
, 4);
5217 if (GESI (FLD (f_operand2
), 1)) {
5220 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5223 SET_H_GR (((UINT
) 1), opval
);
5224 written
|= (1 << 7);
5225 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5227 tmp_addr
= ADDSI (tmp_addr
, 4);
5230 if (GESI (FLD (f_operand2
), 2)) {
5233 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5236 SET_H_GR (((UINT
) 2), opval
);
5237 written
|= (1 << 14);
5238 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5240 tmp_addr
= ADDSI (tmp_addr
, 4);
5243 if (GESI (FLD (f_operand2
), 3)) {
5246 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5249 SET_H_GR (((UINT
) 3), opval
);
5250 written
|= (1 << 15);
5251 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5253 tmp_addr
= ADDSI (tmp_addr
, 4);
5256 if (GESI (FLD (f_operand2
), 4)) {
5259 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5262 SET_H_GR (((UINT
) 4), opval
);
5263 written
|= (1 << 16);
5264 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5266 tmp_addr
= ADDSI (tmp_addr
, 4);
5269 if (GESI (FLD (f_operand2
), 5)) {
5272 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5275 SET_H_GR (((UINT
) 5), opval
);
5276 written
|= (1 << 17);
5277 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5279 tmp_addr
= ADDSI (tmp_addr
, 4);
5282 if (GESI (FLD (f_operand2
), 6)) {
5285 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5288 SET_H_GR (((UINT
) 6), opval
);
5289 written
|= (1 << 18);
5290 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5292 tmp_addr
= ADDSI (tmp_addr
, 4);
5295 if (GESI (FLD (f_operand2
), 7)) {
5298 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5301 SET_H_GR (((UINT
) 7), opval
);
5302 written
|= (1 << 19);
5303 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5305 tmp_addr
= ADDSI (tmp_addr
, 4);
5308 if (GESI (FLD (f_operand2
), 8)) {
5311 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5314 SET_H_GR (((UINT
) 8), opval
);
5315 written
|= (1 << 20);
5316 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5318 tmp_addr
= ADDSI (tmp_addr
, 4);
5321 if (GESI (FLD (f_operand2
), 9)) {
5324 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5327 SET_H_GR (((UINT
) 9), opval
);
5328 written
|= (1 << 21);
5329 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5331 tmp_addr
= ADDSI (tmp_addr
, 4);
5334 if (GESI (FLD (f_operand2
), 10)) {
5337 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5340 SET_H_GR (((UINT
) 10), opval
);
5341 written
|= (1 << 8);
5342 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5344 tmp_addr
= ADDSI (tmp_addr
, 4);
5347 if (GESI (FLD (f_operand2
), 11)) {
5350 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5353 SET_H_GR (((UINT
) 11), opval
);
5354 written
|= (1 << 9);
5355 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5357 tmp_addr
= ADDSI (tmp_addr
, 4);
5360 if (GESI (FLD (f_operand2
), 12)) {
5363 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5366 SET_H_GR (((UINT
) 12), opval
);
5367 written
|= (1 << 10);
5368 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5370 tmp_addr
= ADDSI (tmp_addr
, 4);
5373 if (GESI (FLD (f_operand2
), 13)) {
5376 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5379 SET_H_GR (((UINT
) 13), opval
);
5380 written
|= (1 << 11);
5381 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5383 tmp_addr
= ADDSI (tmp_addr
, 4);
5386 if (GESI (FLD (f_operand2
), 14)) {
5389 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5392 SET_H_GR (((UINT
) 14), opval
);
5393 written
|= (1 << 12);
5394 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5396 tmp_addr
= ADDSI (tmp_addr
, 4);
5399 if (GESI (FLD (f_operand2
), 15)) {
5402 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5405 SET_H_GR (((UINT
) 15), opval
);
5406 written
|= (1 << 13);
5407 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5409 tmp_addr
= ADDSI (tmp_addr
, 4);
5413 if (NEBI (tmp_postinc
, 0)) {
5415 SI opval
= tmp_addr
;
5416 SET_H_GR (FLD (f_operand1
), opval
);
5417 written
|= (1 << 5);
5418 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5424 CPU (h_xbit
) = opval
;
5425 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5429 SET_H_INSN_PREFIXED_P (opval
);
5430 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5435 abuf
->written
= written
;
5440 CASE (sem
, INSN_ADD_B_R
) : /* add.b $Rs,$Rd */
5442 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5443 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5444 #define FLD(f) abuf->fields.sfmt_addc_m.f
5445 int UNUSED written
= 0;
5446 IADDR UNUSED pc
= abuf
->addr
;
5447 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5454 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5455 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5456 tmp_carry
= CPU (h_cbit
);
5457 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5460 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5462 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5463 SET_H_GR (FLD (f_operand2
), opval
);
5464 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5469 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd
, 0), GEQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_newval
, 0))));
5470 CPU (h_cbit
) = opval
;
5471 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5474 BI opval
= LTQI (tmp_newval
, 0);
5475 CPU (h_nbit
) = opval
;
5476 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5479 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5480 CPU (h_zbit
) = opval
;
5481 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5484 BI opval
= ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
5485 CPU (h_vbit
) = opval
;
5486 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5491 CPU (h_xbit
) = opval
;
5492 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5496 SET_H_INSN_PREFIXED_P (opval
);
5497 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5507 CASE (sem
, INSN_ADD_W_R
) : /* add.w $Rs,$Rd */
5509 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5510 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5511 #define FLD(f) abuf->fields.sfmt_addc_m.f
5512 int UNUSED written
= 0;
5513 IADDR UNUSED pc
= abuf
->addr
;
5514 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5521 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5522 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5523 tmp_carry
= CPU (h_cbit
);
5524 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5527 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5529 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5530 SET_H_GR (FLD (f_operand2
), opval
);
5531 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5536 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd
, 0), GEHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_newval
, 0))));
5537 CPU (h_cbit
) = opval
;
5538 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5541 BI opval
= LTHI (tmp_newval
, 0);
5542 CPU (h_nbit
) = opval
;
5543 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5546 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5547 CPU (h_zbit
) = opval
;
5548 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5551 BI opval
= ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
5552 CPU (h_vbit
) = opval
;
5553 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5558 CPU (h_xbit
) = opval
;
5559 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5563 SET_H_INSN_PREFIXED_P (opval
);
5564 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5574 CASE (sem
, INSN_ADD_D_R
) : /* add.d $Rs,$Rd */
5576 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5577 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5578 #define FLD(f) abuf->fields.sfmt_addc_m.f
5579 int UNUSED written
= 0;
5580 IADDR UNUSED pc
= abuf
->addr
;
5581 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5588 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5589 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5590 tmp_carry
= CPU (h_cbit
);
5591 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5593 SI opval
= tmp_newval
;
5594 SET_H_GR (FLD (f_operand2
), opval
);
5595 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5599 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
5600 CPU (h_cbit
) = opval
;
5601 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5604 BI opval
= LTSI (tmp_newval
, 0);
5605 CPU (h_nbit
) = opval
;
5606 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5609 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5610 CPU (h_zbit
) = opval
;
5611 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5614 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
5615 CPU (h_vbit
) = opval
;
5616 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5621 CPU (h_xbit
) = opval
;
5622 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5626 SET_H_INSN_PREFIXED_P (opval
);
5627 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5637 CASE (sem
, INSN_ADD_M_B_M
) : /* add-m.b [${Rs}${inc}],${Rd} */
5639 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5640 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5641 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5642 int UNUSED written
= 0;
5643 IADDR UNUSED pc
= abuf
->addr
;
5644 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5651 tmp_tmpops
= ({ SI tmp_addr
;
5654 tmp_postinc
= FLD (f_memmode
);
5655 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5656 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
5657 ; if (NEBI (tmp_postinc
, 0)) {
5659 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5660 tmp_addr
= ADDSI (tmp_addr
, 1);
5663 SI opval
= tmp_addr
;
5664 SET_H_GR (FLD (f_operand1
), opval
);
5665 written
|= (1 << 12);
5666 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5671 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5672 tmp_carry
= CPU (h_cbit
);
5673 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5676 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5678 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5679 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5680 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5685 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd
, 0), GEQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_newval
, 0))));
5686 CPU (h_cbit
) = opval
;
5687 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5690 BI opval
= LTQI (tmp_newval
, 0);
5691 CPU (h_nbit
) = opval
;
5692 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5695 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5696 CPU (h_zbit
) = opval
;
5697 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5700 BI opval
= ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
5701 CPU (h_vbit
) = opval
;
5702 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5707 CPU (h_xbit
) = opval
;
5708 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5712 SET_H_INSN_PREFIXED_P (opval
);
5713 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5719 abuf
->written
= written
;
5724 CASE (sem
, INSN_ADD_M_W_M
) : /* add-m.w [${Rs}${inc}],${Rd} */
5726 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5727 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5728 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5729 int UNUSED written
= 0;
5730 IADDR UNUSED pc
= abuf
->addr
;
5731 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5738 tmp_tmpops
= ({ SI tmp_addr
;
5741 tmp_postinc
= FLD (f_memmode
);
5742 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5743 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
5744 ; if (NEBI (tmp_postinc
, 0)) {
5746 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5747 tmp_addr
= ADDSI (tmp_addr
, 2);
5750 SI opval
= tmp_addr
;
5751 SET_H_GR (FLD (f_operand1
), opval
);
5752 written
|= (1 << 12);
5753 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5758 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5759 tmp_carry
= CPU (h_cbit
);
5760 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5763 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5765 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5766 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5767 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5772 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd
, 0), GEHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_newval
, 0))));
5773 CPU (h_cbit
) = opval
;
5774 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5777 BI opval
= LTHI (tmp_newval
, 0);
5778 CPU (h_nbit
) = opval
;
5779 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5782 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5783 CPU (h_zbit
) = opval
;
5784 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5787 BI opval
= ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
5788 CPU (h_vbit
) = opval
;
5789 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5794 CPU (h_xbit
) = opval
;
5795 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5799 SET_H_INSN_PREFIXED_P (opval
);
5800 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5806 abuf
->written
= written
;
5811 CASE (sem
, INSN_ADD_M_D_M
) : /* add-m.d [${Rs}${inc}],${Rd} */
5813 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5814 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5815 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5816 int UNUSED written
= 0;
5817 IADDR UNUSED pc
= abuf
->addr
;
5818 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5825 tmp_tmpops
= ({ SI tmp_addr
;
5828 tmp_postinc
= FLD (f_memmode
);
5829 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5830 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5831 ; if (NEBI (tmp_postinc
, 0)) {
5833 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5834 tmp_addr
= ADDSI (tmp_addr
, 4);
5837 SI opval
= tmp_addr
;
5838 SET_H_GR (FLD (f_operand1
), opval
);
5839 written
|= (1 << 11);
5840 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5845 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5846 tmp_carry
= CPU (h_cbit
);
5847 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5849 SI opval
= tmp_newval
;
5850 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5851 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5855 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
5856 CPU (h_cbit
) = opval
;
5857 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5860 BI opval
= LTSI (tmp_newval
, 0);
5861 CPU (h_nbit
) = opval
;
5862 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5865 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5866 CPU (h_zbit
) = opval
;
5867 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5870 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
5871 CPU (h_vbit
) = opval
;
5872 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5877 CPU (h_xbit
) = opval
;
5878 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5882 SET_H_INSN_PREFIXED_P (opval
);
5883 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5889 abuf
->written
= written
;
5894 CASE (sem
, INSN_ADDCBR
) : /* add.b ${sconst8}],${Rd} */
5896 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5898 #define FLD(f) abuf->fields.sfmt_addcbr.f
5899 int UNUSED written
= 0;
5900 IADDR UNUSED pc
= abuf
->addr
;
5901 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5908 tmp_tmpops
= FLD (f_indir_pc__byte
);
5909 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5910 tmp_carry
= CPU (h_cbit
);
5911 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5914 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5916 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5917 SET_H_GR (FLD (f_operand2
), opval
);
5918 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5923 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd
, 0), GEQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_newval
, 0))));
5924 CPU (h_cbit
) = opval
;
5925 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5928 BI opval
= LTQI (tmp_newval
, 0);
5929 CPU (h_nbit
) = opval
;
5930 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5933 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5934 CPU (h_zbit
) = opval
;
5935 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5938 BI opval
= ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
5939 CPU (h_vbit
) = opval
;
5940 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5945 CPU (h_xbit
) = opval
;
5946 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5950 SET_H_INSN_PREFIXED_P (opval
);
5951 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5961 CASE (sem
, INSN_ADDCWR
) : /* add.w ${sconst16}],${Rd} */
5963 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5964 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5965 #define FLD(f) abuf->fields.sfmt_addcwr.f
5966 int UNUSED written
= 0;
5967 IADDR UNUSED pc
= abuf
->addr
;
5968 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5975 tmp_tmpops
= FLD (f_indir_pc__word
);
5976 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5977 tmp_carry
= CPU (h_cbit
);
5978 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5981 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5983 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5984 SET_H_GR (FLD (f_operand2
), opval
);
5985 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5990 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd
, 0), GEHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_newval
, 0))));
5991 CPU (h_cbit
) = opval
;
5992 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5995 BI opval
= LTHI (tmp_newval
, 0);
5996 CPU (h_nbit
) = opval
;
5997 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6000 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6001 CPU (h_zbit
) = opval
;
6002 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6005 BI opval
= ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
6006 CPU (h_vbit
) = opval
;
6007 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6012 CPU (h_xbit
) = opval
;
6013 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6017 SET_H_INSN_PREFIXED_P (opval
);
6018 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6028 CASE (sem
, INSN_ADDCDR
) : /* add.d ${const32}],${Rd} */
6030 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6031 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6032 #define FLD(f) abuf->fields.sfmt_addcdr.f
6033 int UNUSED written
= 0;
6034 IADDR UNUSED pc
= abuf
->addr
;
6035 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6042 tmp_tmpops
= FLD (f_indir_pc__dword
);
6043 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6044 tmp_carry
= CPU (h_cbit
);
6045 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6047 SI opval
= tmp_newval
;
6048 SET_H_GR (FLD (f_operand2
), opval
);
6049 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6053 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6054 CPU (h_cbit
) = opval
;
6055 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6058 BI opval
= LTSI (tmp_newval
, 0);
6059 CPU (h_nbit
) = opval
;
6060 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6063 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6064 CPU (h_zbit
) = opval
;
6065 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6068 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6069 CPU (h_vbit
) = opval
;
6070 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6075 CPU (h_xbit
) = opval
;
6076 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6080 SET_H_INSN_PREFIXED_P (opval
);
6081 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6091 CASE (sem
, INSN_ADDS_B_R
) : /* adds.b $Rs,$Rd */
6093 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6095 #define FLD(f) abuf->fields.sfmt_addc_m.f
6096 int UNUSED written
= 0;
6097 IADDR UNUSED pc
= abuf
->addr
;
6098 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6105 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6106 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6107 tmp_carry
= CPU (h_cbit
);
6108 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6110 SI opval
= tmp_newval
;
6111 SET_H_GR (FLD (f_operand2
), opval
);
6112 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6116 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6117 CPU (h_cbit
) = opval
;
6118 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6121 BI opval
= LTSI (tmp_newval
, 0);
6122 CPU (h_nbit
) = opval
;
6123 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6126 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6127 CPU (h_zbit
) = opval
;
6128 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6131 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6132 CPU (h_vbit
) = opval
;
6133 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6138 CPU (h_xbit
) = opval
;
6139 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6143 SET_H_INSN_PREFIXED_P (opval
);
6144 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6154 CASE (sem
, INSN_ADDS_W_R
) : /* adds.w $Rs,$Rd */
6156 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6157 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6158 #define FLD(f) abuf->fields.sfmt_addc_m.f
6159 int UNUSED written
= 0;
6160 IADDR UNUSED pc
= abuf
->addr
;
6161 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6168 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6169 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6170 tmp_carry
= CPU (h_cbit
);
6171 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6173 SI opval
= tmp_newval
;
6174 SET_H_GR (FLD (f_operand2
), opval
);
6175 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6179 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6180 CPU (h_cbit
) = opval
;
6181 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6184 BI opval
= LTSI (tmp_newval
, 0);
6185 CPU (h_nbit
) = opval
;
6186 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6189 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6190 CPU (h_zbit
) = opval
;
6191 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6194 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6195 CPU (h_vbit
) = opval
;
6196 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6201 CPU (h_xbit
) = opval
;
6202 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6206 SET_H_INSN_PREFIXED_P (opval
);
6207 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6217 CASE (sem
, INSN_ADDS_M_B_M
) : /* adds-m.b [${Rs}${inc}],$Rd */
6219 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6220 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6221 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6222 int UNUSED written
= 0;
6223 IADDR UNUSED pc
= abuf
->addr
;
6224 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6231 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
6234 tmp_postinc
= FLD (f_memmode
);
6235 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6236 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6237 ; if (NEBI (tmp_postinc
, 0)) {
6239 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6240 tmp_addr
= ADDSI (tmp_addr
, 1);
6243 SI opval
= tmp_addr
;
6244 SET_H_GR (FLD (f_operand1
), opval
);
6245 written
|= (1 << 11);
6246 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6251 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6252 tmp_carry
= CPU (h_cbit
);
6253 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6255 SI opval
= tmp_newval
;
6256 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6257 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6261 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6262 CPU (h_cbit
) = opval
;
6263 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6266 BI opval
= LTSI (tmp_newval
, 0);
6267 CPU (h_nbit
) = opval
;
6268 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6271 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6272 CPU (h_zbit
) = opval
;
6273 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6276 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6277 CPU (h_vbit
) = opval
;
6278 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6283 CPU (h_xbit
) = opval
;
6284 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6288 SET_H_INSN_PREFIXED_P (opval
);
6289 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6295 abuf
->written
= written
;
6300 CASE (sem
, INSN_ADDS_M_W_M
) : /* adds-m.w [${Rs}${inc}],$Rd */
6302 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6303 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6304 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6305 int UNUSED written
= 0;
6306 IADDR UNUSED pc
= abuf
->addr
;
6307 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6314 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
6317 tmp_postinc
= FLD (f_memmode
);
6318 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6319 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6320 ; if (NEBI (tmp_postinc
, 0)) {
6322 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6323 tmp_addr
= ADDSI (tmp_addr
, 2);
6326 SI opval
= tmp_addr
;
6327 SET_H_GR (FLD (f_operand1
), opval
);
6328 written
|= (1 << 11);
6329 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6334 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6335 tmp_carry
= CPU (h_cbit
);
6336 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6338 SI opval
= tmp_newval
;
6339 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6340 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6344 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6345 CPU (h_cbit
) = opval
;
6346 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6349 BI opval
= LTSI (tmp_newval
, 0);
6350 CPU (h_nbit
) = opval
;
6351 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6354 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6355 CPU (h_zbit
) = opval
;
6356 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6359 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6360 CPU (h_vbit
) = opval
;
6361 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6366 CPU (h_xbit
) = opval
;
6367 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6371 SET_H_INSN_PREFIXED_P (opval
);
6372 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6378 abuf
->written
= written
;
6383 CASE (sem
, INSN_ADDSCBR
) : /* [${Rs}${inc}],$Rd */
6385 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6386 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6387 #define FLD(f) abuf->fields.sfmt_addcbr.f
6388 int UNUSED written
= 0;
6389 IADDR UNUSED pc
= abuf
->addr
;
6390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6397 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6398 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6399 tmp_carry
= CPU (h_cbit
);
6400 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6402 SI opval
= tmp_newval
;
6403 SET_H_GR (FLD (f_operand2
), opval
);
6404 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6408 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6409 CPU (h_cbit
) = opval
;
6410 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6413 BI opval
= LTSI (tmp_newval
, 0);
6414 CPU (h_nbit
) = opval
;
6415 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6418 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6419 CPU (h_zbit
) = opval
;
6420 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6423 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6424 CPU (h_vbit
) = opval
;
6425 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6430 CPU (h_xbit
) = opval
;
6431 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6435 SET_H_INSN_PREFIXED_P (opval
);
6436 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6446 CASE (sem
, INSN_ADDSCWR
) : /* [${Rs}${inc}],$Rd */
6448 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6449 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6450 #define FLD(f) abuf->fields.sfmt_addcwr.f
6451 int UNUSED written
= 0;
6452 IADDR UNUSED pc
= abuf
->addr
;
6453 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6460 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6461 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6462 tmp_carry
= CPU (h_cbit
);
6463 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6465 SI opval
= tmp_newval
;
6466 SET_H_GR (FLD (f_operand2
), opval
);
6467 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6471 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6472 CPU (h_cbit
) = opval
;
6473 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6476 BI opval
= LTSI (tmp_newval
, 0);
6477 CPU (h_nbit
) = opval
;
6478 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6481 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6482 CPU (h_zbit
) = opval
;
6483 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6486 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6487 CPU (h_vbit
) = opval
;
6488 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6493 CPU (h_xbit
) = opval
;
6494 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6498 SET_H_INSN_PREFIXED_P (opval
);
6499 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6509 CASE (sem
, INSN_ADDU_B_R
) : /* addu.b $Rs,$Rd */
6511 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6512 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6513 #define FLD(f) abuf->fields.sfmt_addc_m.f
6514 int UNUSED written
= 0;
6515 IADDR UNUSED pc
= abuf
->addr
;
6516 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6523 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6524 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6525 tmp_carry
= CPU (h_cbit
);
6526 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6528 SI opval
= tmp_newval
;
6529 SET_H_GR (FLD (f_operand2
), opval
);
6530 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6534 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6535 CPU (h_cbit
) = opval
;
6536 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6539 BI opval
= LTSI (tmp_newval
, 0);
6540 CPU (h_nbit
) = opval
;
6541 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6544 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6545 CPU (h_zbit
) = opval
;
6546 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6549 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6550 CPU (h_vbit
) = opval
;
6551 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6556 CPU (h_xbit
) = opval
;
6557 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6561 SET_H_INSN_PREFIXED_P (opval
);
6562 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6572 CASE (sem
, INSN_ADDU_W_R
) : /* addu.w $Rs,$Rd */
6574 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6575 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6576 #define FLD(f) abuf->fields.sfmt_addc_m.f
6577 int UNUSED written
= 0;
6578 IADDR UNUSED pc
= abuf
->addr
;
6579 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6586 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6587 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6588 tmp_carry
= CPU (h_cbit
);
6589 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6591 SI opval
= tmp_newval
;
6592 SET_H_GR (FLD (f_operand2
), opval
);
6593 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6597 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6598 CPU (h_cbit
) = opval
;
6599 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6602 BI opval
= LTSI (tmp_newval
, 0);
6603 CPU (h_nbit
) = opval
;
6604 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6607 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6608 CPU (h_zbit
) = opval
;
6609 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6612 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6613 CPU (h_vbit
) = opval
;
6614 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6619 CPU (h_xbit
) = opval
;
6620 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6624 SET_H_INSN_PREFIXED_P (opval
);
6625 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6635 CASE (sem
, INSN_ADDU_M_B_M
) : /* addu-m.b [${Rs}${inc}],$Rd */
6637 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6638 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6639 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6640 int UNUSED written
= 0;
6641 IADDR UNUSED pc
= abuf
->addr
;
6642 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6649 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
6652 tmp_postinc
= FLD (f_memmode
);
6653 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6654 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6655 ; if (NEBI (tmp_postinc
, 0)) {
6657 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6658 tmp_addr
= ADDSI (tmp_addr
, 1);
6661 SI opval
= tmp_addr
;
6662 SET_H_GR (FLD (f_operand1
), opval
);
6663 written
|= (1 << 11);
6664 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6669 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6670 tmp_carry
= CPU (h_cbit
);
6671 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6673 SI opval
= tmp_newval
;
6674 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6675 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6679 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6680 CPU (h_cbit
) = opval
;
6681 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6684 BI opval
= LTSI (tmp_newval
, 0);
6685 CPU (h_nbit
) = opval
;
6686 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6689 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6690 CPU (h_zbit
) = opval
;
6691 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6694 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6695 CPU (h_vbit
) = opval
;
6696 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6701 CPU (h_xbit
) = opval
;
6702 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6706 SET_H_INSN_PREFIXED_P (opval
);
6707 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6713 abuf
->written
= written
;
6718 CASE (sem
, INSN_ADDU_M_W_M
) : /* addu-m.w [${Rs}${inc}],$Rd */
6720 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6721 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6722 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6723 int UNUSED written
= 0;
6724 IADDR UNUSED pc
= abuf
->addr
;
6725 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6732 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
6735 tmp_postinc
= FLD (f_memmode
);
6736 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6737 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6738 ; if (NEBI (tmp_postinc
, 0)) {
6740 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6741 tmp_addr
= ADDSI (tmp_addr
, 2);
6744 SI opval
= tmp_addr
;
6745 SET_H_GR (FLD (f_operand1
), opval
);
6746 written
|= (1 << 11);
6747 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6752 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6753 tmp_carry
= CPU (h_cbit
);
6754 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6756 SI opval
= tmp_newval
;
6757 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6758 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6762 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6763 CPU (h_cbit
) = opval
;
6764 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6767 BI opval
= LTSI (tmp_newval
, 0);
6768 CPU (h_nbit
) = opval
;
6769 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6772 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6773 CPU (h_zbit
) = opval
;
6774 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6777 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6778 CPU (h_vbit
) = opval
;
6779 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6784 CPU (h_xbit
) = opval
;
6785 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6789 SET_H_INSN_PREFIXED_P (opval
);
6790 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6796 abuf
->written
= written
;
6801 CASE (sem
, INSN_ADDUCBR
) : /* [${Rs}${inc}],$Rd */
6803 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6804 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6805 #define FLD(f) abuf->fields.sfmt_addcbr.f
6806 int UNUSED written
= 0;
6807 IADDR UNUSED pc
= abuf
->addr
;
6808 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6815 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6816 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6817 tmp_carry
= CPU (h_cbit
);
6818 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6820 SI opval
= tmp_newval
;
6821 SET_H_GR (FLD (f_operand2
), opval
);
6822 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6826 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6827 CPU (h_cbit
) = opval
;
6828 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6831 BI opval
= LTSI (tmp_newval
, 0);
6832 CPU (h_nbit
) = opval
;
6833 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6836 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6837 CPU (h_zbit
) = opval
;
6838 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6841 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6842 CPU (h_vbit
) = opval
;
6843 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6848 CPU (h_xbit
) = opval
;
6849 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6853 SET_H_INSN_PREFIXED_P (opval
);
6854 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6864 CASE (sem
, INSN_ADDUCWR
) : /* [${Rs}${inc}],$Rd */
6866 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6867 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6868 #define FLD(f) abuf->fields.sfmt_addcwr.f
6869 int UNUSED written
= 0;
6870 IADDR UNUSED pc
= abuf
->addr
;
6871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6878 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6879 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6880 tmp_carry
= CPU (h_cbit
);
6881 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6883 SI opval
= tmp_newval
;
6884 SET_H_GR (FLD (f_operand2
), opval
);
6885 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6889 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6890 CPU (h_cbit
) = opval
;
6891 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6894 BI opval
= LTSI (tmp_newval
, 0);
6895 CPU (h_nbit
) = opval
;
6896 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6899 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6900 CPU (h_zbit
) = opval
;
6901 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6904 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6905 CPU (h_vbit
) = opval
;
6906 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6911 CPU (h_xbit
) = opval
;
6912 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6916 SET_H_INSN_PREFIXED_P (opval
);
6917 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6927 CASE (sem
, INSN_SUB_B_R
) : /* sub.b $Rs,$Rd */
6929 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6930 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6931 #define FLD(f) abuf->fields.sfmt_addc_m.f
6932 int UNUSED written
= 0;
6933 IADDR UNUSED pc
= abuf
->addr
;
6934 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6941 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
6942 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6943 tmp_carry
= CPU (h_cbit
);
6944 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6947 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
6949 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
6950 SET_H_GR (FLD (f_operand2
), opval
);
6951 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6956 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd
, 0), LTQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_newval
, 0))));
6957 CPU (h_cbit
) = opval
;
6958 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6961 BI opval
= LTQI (tmp_newval
, 0);
6962 CPU (h_nbit
) = opval
;
6963 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6966 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6967 CPU (h_zbit
) = opval
;
6968 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6971 BI opval
= ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
6972 CPU (h_vbit
) = opval
;
6973 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6978 CPU (h_xbit
) = opval
;
6979 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6983 SET_H_INSN_PREFIXED_P (opval
);
6984 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6994 CASE (sem
, INSN_SUB_W_R
) : /* sub.w $Rs,$Rd */
6996 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6997 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6998 #define FLD(f) abuf->fields.sfmt_addc_m.f
6999 int UNUSED written
= 0;
7000 IADDR UNUSED pc
= abuf
->addr
;
7001 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7008 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7009 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7010 tmp_carry
= CPU (h_cbit
);
7011 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7014 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7016 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7017 SET_H_GR (FLD (f_operand2
), opval
);
7018 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7023 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd
, 0), LTHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_newval
, 0))));
7024 CPU (h_cbit
) = opval
;
7025 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7028 BI opval
= LTHI (tmp_newval
, 0);
7029 CPU (h_nbit
) = opval
;
7030 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7033 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7034 CPU (h_zbit
) = opval
;
7035 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7038 BI opval
= ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
7039 CPU (h_vbit
) = opval
;
7040 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7045 CPU (h_xbit
) = opval
;
7046 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7050 SET_H_INSN_PREFIXED_P (opval
);
7051 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7061 CASE (sem
, INSN_SUB_D_R
) : /* sub.d $Rs,$Rd */
7063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7065 #define FLD(f) abuf->fields.sfmt_addc_m.f
7066 int UNUSED written
= 0;
7067 IADDR UNUSED pc
= abuf
->addr
;
7068 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7075 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7076 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7077 tmp_carry
= CPU (h_cbit
);
7078 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7080 SI opval
= tmp_newval
;
7081 SET_H_GR (FLD (f_operand2
), opval
);
7082 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7086 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7087 CPU (h_cbit
) = opval
;
7088 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7091 BI opval
= LTSI (tmp_newval
, 0);
7092 CPU (h_nbit
) = opval
;
7093 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7096 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7097 CPU (h_zbit
) = opval
;
7098 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7101 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7102 CPU (h_vbit
) = opval
;
7103 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7108 CPU (h_xbit
) = opval
;
7109 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7113 SET_H_INSN_PREFIXED_P (opval
);
7114 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7124 CASE (sem
, INSN_SUB_M_B_M
) : /* sub-m.b [${Rs}${inc}],${Rd} */
7126 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7127 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7128 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7129 int UNUSED written
= 0;
7130 IADDR UNUSED pc
= abuf
->addr
;
7131 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7138 tmp_tmpops
= ({ SI tmp_addr
;
7141 tmp_postinc
= FLD (f_memmode
);
7142 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7143 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7144 ; if (NEBI (tmp_postinc
, 0)) {
7146 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7147 tmp_addr
= ADDSI (tmp_addr
, 1);
7150 SI opval
= tmp_addr
;
7151 SET_H_GR (FLD (f_operand1
), opval
);
7152 written
|= (1 << 12);
7153 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7158 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7159 tmp_carry
= CPU (h_cbit
);
7160 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7163 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7165 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7166 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7167 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7172 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd
, 0), LTQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_newval
, 0))));
7173 CPU (h_cbit
) = opval
;
7174 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7177 BI opval
= LTQI (tmp_newval
, 0);
7178 CPU (h_nbit
) = opval
;
7179 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7182 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7183 CPU (h_zbit
) = opval
;
7184 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7187 BI opval
= ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
7188 CPU (h_vbit
) = opval
;
7189 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7194 CPU (h_xbit
) = opval
;
7195 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7199 SET_H_INSN_PREFIXED_P (opval
);
7200 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7206 abuf
->written
= written
;
7211 CASE (sem
, INSN_SUB_M_W_M
) : /* sub-m.w [${Rs}${inc}],${Rd} */
7213 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7214 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7215 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7216 int UNUSED written
= 0;
7217 IADDR UNUSED pc
= abuf
->addr
;
7218 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7225 tmp_tmpops
= ({ SI tmp_addr
;
7228 tmp_postinc
= FLD (f_memmode
);
7229 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7230 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7231 ; if (NEBI (tmp_postinc
, 0)) {
7233 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7234 tmp_addr
= ADDSI (tmp_addr
, 2);
7237 SI opval
= tmp_addr
;
7238 SET_H_GR (FLD (f_operand1
), opval
);
7239 written
|= (1 << 12);
7240 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7245 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7246 tmp_carry
= CPU (h_cbit
);
7247 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7250 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7252 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7253 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7254 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7259 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd
, 0), LTHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_newval
, 0))));
7260 CPU (h_cbit
) = opval
;
7261 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7264 BI opval
= LTHI (tmp_newval
, 0);
7265 CPU (h_nbit
) = opval
;
7266 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7269 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7270 CPU (h_zbit
) = opval
;
7271 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7274 BI opval
= ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
7275 CPU (h_vbit
) = opval
;
7276 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7281 CPU (h_xbit
) = opval
;
7282 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7286 SET_H_INSN_PREFIXED_P (opval
);
7287 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7293 abuf
->written
= written
;
7298 CASE (sem
, INSN_SUB_M_D_M
) : /* sub-m.d [${Rs}${inc}],${Rd} */
7300 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7301 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7302 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7303 int UNUSED written
= 0;
7304 IADDR UNUSED pc
= abuf
->addr
;
7305 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7312 tmp_tmpops
= ({ SI tmp_addr
;
7315 tmp_postinc
= FLD (f_memmode
);
7316 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7317 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
7318 ; if (NEBI (tmp_postinc
, 0)) {
7320 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7321 tmp_addr
= ADDSI (tmp_addr
, 4);
7324 SI opval
= tmp_addr
;
7325 SET_H_GR (FLD (f_operand1
), opval
);
7326 written
|= (1 << 11);
7327 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7332 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7333 tmp_carry
= CPU (h_cbit
);
7334 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7336 SI opval
= tmp_newval
;
7337 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7338 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7342 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7343 CPU (h_cbit
) = opval
;
7344 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7347 BI opval
= LTSI (tmp_newval
, 0);
7348 CPU (h_nbit
) = opval
;
7349 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7352 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7353 CPU (h_zbit
) = opval
;
7354 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7357 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7358 CPU (h_vbit
) = opval
;
7359 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7364 CPU (h_xbit
) = opval
;
7365 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7369 SET_H_INSN_PREFIXED_P (opval
);
7370 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7376 abuf
->written
= written
;
7381 CASE (sem
, INSN_SUBCBR
) : /* sub.b ${sconst8}],${Rd} */
7383 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7384 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7385 #define FLD(f) abuf->fields.sfmt_addcbr.f
7386 int UNUSED written
= 0;
7387 IADDR UNUSED pc
= abuf
->addr
;
7388 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7395 tmp_tmpops
= FLD (f_indir_pc__byte
);
7396 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7397 tmp_carry
= CPU (h_cbit
);
7398 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7401 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7403 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7404 SET_H_GR (FLD (f_operand2
), opval
);
7405 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7410 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd
, 0), LTQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_newval
, 0))));
7411 CPU (h_cbit
) = opval
;
7412 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7415 BI opval
= LTQI (tmp_newval
, 0);
7416 CPU (h_nbit
) = opval
;
7417 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7420 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7421 CPU (h_zbit
) = opval
;
7422 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7425 BI opval
= ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
7426 CPU (h_vbit
) = opval
;
7427 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7432 CPU (h_xbit
) = opval
;
7433 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7437 SET_H_INSN_PREFIXED_P (opval
);
7438 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7448 CASE (sem
, INSN_SUBCWR
) : /* sub.w ${sconst16}],${Rd} */
7450 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7452 #define FLD(f) abuf->fields.sfmt_addcwr.f
7453 int UNUSED written
= 0;
7454 IADDR UNUSED pc
= abuf
->addr
;
7455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7462 tmp_tmpops
= FLD (f_indir_pc__word
);
7463 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7464 tmp_carry
= CPU (h_cbit
);
7465 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7468 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7470 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7471 SET_H_GR (FLD (f_operand2
), opval
);
7472 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7477 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd
, 0), LTHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_newval
, 0))));
7478 CPU (h_cbit
) = opval
;
7479 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7482 BI opval
= LTHI (tmp_newval
, 0);
7483 CPU (h_nbit
) = opval
;
7484 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7487 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7488 CPU (h_zbit
) = opval
;
7489 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7492 BI opval
= ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
7493 CPU (h_vbit
) = opval
;
7494 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7499 CPU (h_xbit
) = opval
;
7500 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7504 SET_H_INSN_PREFIXED_P (opval
);
7505 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7515 CASE (sem
, INSN_SUBCDR
) : /* sub.d ${const32}],${Rd} */
7517 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7518 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7519 #define FLD(f) abuf->fields.sfmt_addcdr.f
7520 int UNUSED written
= 0;
7521 IADDR UNUSED pc
= abuf
->addr
;
7522 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
7529 tmp_tmpops
= FLD (f_indir_pc__dword
);
7530 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7531 tmp_carry
= CPU (h_cbit
);
7532 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7534 SI opval
= tmp_newval
;
7535 SET_H_GR (FLD (f_operand2
), opval
);
7536 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7540 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7541 CPU (h_cbit
) = opval
;
7542 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7545 BI opval
= LTSI (tmp_newval
, 0);
7546 CPU (h_nbit
) = opval
;
7547 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7550 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7551 CPU (h_zbit
) = opval
;
7552 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7555 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7556 CPU (h_vbit
) = opval
;
7557 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7562 CPU (h_xbit
) = opval
;
7563 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7567 SET_H_INSN_PREFIXED_P (opval
);
7568 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7578 CASE (sem
, INSN_SUBS_B_R
) : /* subs.b $Rs,$Rd */
7580 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7581 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7582 #define FLD(f) abuf->fields.sfmt_addc_m.f
7583 int UNUSED written
= 0;
7584 IADDR UNUSED pc
= abuf
->addr
;
7585 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7592 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
7593 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7594 tmp_carry
= CPU (h_cbit
);
7595 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7597 SI opval
= tmp_newval
;
7598 SET_H_GR (FLD (f_operand2
), opval
);
7599 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7603 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7604 CPU (h_cbit
) = opval
;
7605 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7608 BI opval
= LTSI (tmp_newval
, 0);
7609 CPU (h_nbit
) = opval
;
7610 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7613 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7614 CPU (h_zbit
) = opval
;
7615 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7618 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7619 CPU (h_vbit
) = opval
;
7620 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7625 CPU (h_xbit
) = opval
;
7626 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7630 SET_H_INSN_PREFIXED_P (opval
);
7631 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7641 CASE (sem
, INSN_SUBS_W_R
) : /* subs.w $Rs,$Rd */
7643 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7644 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7645 #define FLD(f) abuf->fields.sfmt_addc_m.f
7646 int UNUSED written
= 0;
7647 IADDR UNUSED pc
= abuf
->addr
;
7648 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7655 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
7656 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7657 tmp_carry
= CPU (h_cbit
);
7658 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7660 SI opval
= tmp_newval
;
7661 SET_H_GR (FLD (f_operand2
), opval
);
7662 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7666 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7667 CPU (h_cbit
) = opval
;
7668 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7671 BI opval
= LTSI (tmp_newval
, 0);
7672 CPU (h_nbit
) = opval
;
7673 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7676 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7677 CPU (h_zbit
) = opval
;
7678 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7681 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7682 CPU (h_vbit
) = opval
;
7683 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7688 CPU (h_xbit
) = opval
;
7689 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7693 SET_H_INSN_PREFIXED_P (opval
);
7694 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7704 CASE (sem
, INSN_SUBS_M_B_M
) : /* subs-m.b [${Rs}${inc}],$Rd */
7706 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7708 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7709 int UNUSED written
= 0;
7710 IADDR UNUSED pc
= abuf
->addr
;
7711 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7718 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
7721 tmp_postinc
= FLD (f_memmode
);
7722 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7723 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7724 ; if (NEBI (tmp_postinc
, 0)) {
7726 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7727 tmp_addr
= ADDSI (tmp_addr
, 1);
7730 SI opval
= tmp_addr
;
7731 SET_H_GR (FLD (f_operand1
), opval
);
7732 written
|= (1 << 11);
7733 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7738 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7739 tmp_carry
= CPU (h_cbit
);
7740 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7742 SI opval
= tmp_newval
;
7743 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7744 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7748 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7749 CPU (h_cbit
) = opval
;
7750 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7753 BI opval
= LTSI (tmp_newval
, 0);
7754 CPU (h_nbit
) = opval
;
7755 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7758 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7759 CPU (h_zbit
) = opval
;
7760 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7763 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7764 CPU (h_vbit
) = opval
;
7765 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7770 CPU (h_xbit
) = opval
;
7771 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7775 SET_H_INSN_PREFIXED_P (opval
);
7776 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7782 abuf
->written
= written
;
7787 CASE (sem
, INSN_SUBS_M_W_M
) : /* subs-m.w [${Rs}${inc}],$Rd */
7789 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7790 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7791 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7792 int UNUSED written
= 0;
7793 IADDR UNUSED pc
= abuf
->addr
;
7794 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7801 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
7804 tmp_postinc
= FLD (f_memmode
);
7805 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7806 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7807 ; if (NEBI (tmp_postinc
, 0)) {
7809 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7810 tmp_addr
= ADDSI (tmp_addr
, 2);
7813 SI opval
= tmp_addr
;
7814 SET_H_GR (FLD (f_operand1
), opval
);
7815 written
|= (1 << 11);
7816 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7821 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7822 tmp_carry
= CPU (h_cbit
);
7823 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7825 SI opval
= tmp_newval
;
7826 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7827 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7831 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7832 CPU (h_cbit
) = opval
;
7833 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7836 BI opval
= LTSI (tmp_newval
, 0);
7837 CPU (h_nbit
) = opval
;
7838 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7841 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7842 CPU (h_zbit
) = opval
;
7843 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7846 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7847 CPU (h_vbit
) = opval
;
7848 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7853 CPU (h_xbit
) = opval
;
7854 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7858 SET_H_INSN_PREFIXED_P (opval
);
7859 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7865 abuf
->written
= written
;
7870 CASE (sem
, INSN_SUBSCBR
) : /* [${Rs}${inc}],$Rd */
7872 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7873 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7874 #define FLD(f) abuf->fields.sfmt_addcbr.f
7875 int UNUSED written
= 0;
7876 IADDR UNUSED pc
= abuf
->addr
;
7877 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7884 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
7885 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7886 tmp_carry
= CPU (h_cbit
);
7887 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7889 SI opval
= tmp_newval
;
7890 SET_H_GR (FLD (f_operand2
), opval
);
7891 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7895 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7896 CPU (h_cbit
) = opval
;
7897 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7900 BI opval
= LTSI (tmp_newval
, 0);
7901 CPU (h_nbit
) = opval
;
7902 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7905 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7906 CPU (h_zbit
) = opval
;
7907 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7910 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7911 CPU (h_vbit
) = opval
;
7912 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7917 CPU (h_xbit
) = opval
;
7918 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7922 SET_H_INSN_PREFIXED_P (opval
);
7923 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7933 CASE (sem
, INSN_SUBSCWR
) : /* [${Rs}${inc}],$Rd */
7935 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7936 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7937 #define FLD(f) abuf->fields.sfmt_addcwr.f
7938 int UNUSED written
= 0;
7939 IADDR UNUSED pc
= abuf
->addr
;
7940 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7947 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
7948 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7949 tmp_carry
= CPU (h_cbit
);
7950 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7952 SI opval
= tmp_newval
;
7953 SET_H_GR (FLD (f_operand2
), opval
);
7954 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7958 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
7959 CPU (h_cbit
) = opval
;
7960 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7963 BI opval
= LTSI (tmp_newval
, 0);
7964 CPU (h_nbit
) = opval
;
7965 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7968 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7969 CPU (h_zbit
) = opval
;
7970 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7973 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
7974 CPU (h_vbit
) = opval
;
7975 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7980 CPU (h_xbit
) = opval
;
7981 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7985 SET_H_INSN_PREFIXED_P (opval
);
7986 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7996 CASE (sem
, INSN_SUBU_B_R
) : /* subu.b $Rs,$Rd */
7998 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7999 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8000 #define FLD(f) abuf->fields.sfmt_addc_m.f
8001 int UNUSED written
= 0;
8002 IADDR UNUSED pc
= abuf
->addr
;
8003 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8010 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
8011 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8012 tmp_carry
= CPU (h_cbit
);
8013 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8015 SI opval
= tmp_newval
;
8016 SET_H_GR (FLD (f_operand2
), opval
);
8017 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8021 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8022 CPU (h_cbit
) = opval
;
8023 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8026 BI opval
= LTSI (tmp_newval
, 0);
8027 CPU (h_nbit
) = opval
;
8028 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8031 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8032 CPU (h_zbit
) = opval
;
8033 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8036 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8037 CPU (h_vbit
) = opval
;
8038 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8043 CPU (h_xbit
) = opval
;
8044 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8048 SET_H_INSN_PREFIXED_P (opval
);
8049 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8059 CASE (sem
, INSN_SUBU_W_R
) : /* subu.w $Rs,$Rd */
8061 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8062 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8063 #define FLD(f) abuf->fields.sfmt_addc_m.f
8064 int UNUSED written
= 0;
8065 IADDR UNUSED pc
= abuf
->addr
;
8066 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8073 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
8074 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8075 tmp_carry
= CPU (h_cbit
);
8076 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8078 SI opval
= tmp_newval
;
8079 SET_H_GR (FLD (f_operand2
), opval
);
8080 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8084 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8085 CPU (h_cbit
) = opval
;
8086 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8089 BI opval
= LTSI (tmp_newval
, 0);
8090 CPU (h_nbit
) = opval
;
8091 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8094 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8095 CPU (h_zbit
) = opval
;
8096 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8099 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8100 CPU (h_vbit
) = opval
;
8101 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8106 CPU (h_xbit
) = opval
;
8107 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8111 SET_H_INSN_PREFIXED_P (opval
);
8112 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8122 CASE (sem
, INSN_SUBU_M_B_M
) : /* subu-m.b [${Rs}${inc}],$Rd */
8124 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8126 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8127 int UNUSED written
= 0;
8128 IADDR UNUSED pc
= abuf
->addr
;
8129 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8136 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
8139 tmp_postinc
= FLD (f_memmode
);
8140 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8141 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8142 ; if (NEBI (tmp_postinc
, 0)) {
8144 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8145 tmp_addr
= ADDSI (tmp_addr
, 1);
8148 SI opval
= tmp_addr
;
8149 SET_H_GR (FLD (f_operand1
), opval
);
8150 written
|= (1 << 11);
8151 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8156 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8157 tmp_carry
= CPU (h_cbit
);
8158 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8160 SI opval
= tmp_newval
;
8161 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8162 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8166 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8167 CPU (h_cbit
) = opval
;
8168 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8171 BI opval
= LTSI (tmp_newval
, 0);
8172 CPU (h_nbit
) = opval
;
8173 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8176 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8177 CPU (h_zbit
) = opval
;
8178 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8181 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8182 CPU (h_vbit
) = opval
;
8183 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8188 CPU (h_xbit
) = opval
;
8189 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8193 SET_H_INSN_PREFIXED_P (opval
);
8194 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8200 abuf
->written
= written
;
8205 CASE (sem
, INSN_SUBU_M_W_M
) : /* subu-m.w [${Rs}${inc}],$Rd */
8207 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8208 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8209 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8210 int UNUSED written
= 0;
8211 IADDR UNUSED pc
= abuf
->addr
;
8212 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8219 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
8222 tmp_postinc
= FLD (f_memmode
);
8223 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8224 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8225 ; if (NEBI (tmp_postinc
, 0)) {
8227 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8228 tmp_addr
= ADDSI (tmp_addr
, 2);
8231 SI opval
= tmp_addr
;
8232 SET_H_GR (FLD (f_operand1
), opval
);
8233 written
|= (1 << 11);
8234 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8239 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8240 tmp_carry
= CPU (h_cbit
);
8241 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8243 SI opval
= tmp_newval
;
8244 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8245 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8249 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8250 CPU (h_cbit
) = opval
;
8251 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8254 BI opval
= LTSI (tmp_newval
, 0);
8255 CPU (h_nbit
) = opval
;
8256 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8259 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8260 CPU (h_zbit
) = opval
;
8261 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8264 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8265 CPU (h_vbit
) = opval
;
8266 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8271 CPU (h_xbit
) = opval
;
8272 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8276 SET_H_INSN_PREFIXED_P (opval
);
8277 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8283 abuf
->written
= written
;
8288 CASE (sem
, INSN_SUBUCBR
) : /* [${Rs}${inc}],$Rd */
8290 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8291 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8292 #define FLD(f) abuf->fields.sfmt_addcbr.f
8293 int UNUSED written
= 0;
8294 IADDR UNUSED pc
= abuf
->addr
;
8295 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8302 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8303 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8304 tmp_carry
= CPU (h_cbit
);
8305 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8307 SI opval
= tmp_newval
;
8308 SET_H_GR (FLD (f_operand2
), opval
);
8309 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8313 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8314 CPU (h_cbit
) = opval
;
8315 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8318 BI opval
= LTSI (tmp_newval
, 0);
8319 CPU (h_nbit
) = opval
;
8320 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8323 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8324 CPU (h_zbit
) = opval
;
8325 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8328 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8329 CPU (h_vbit
) = opval
;
8330 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8335 CPU (h_xbit
) = opval
;
8336 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8340 SET_H_INSN_PREFIXED_P (opval
);
8341 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8351 CASE (sem
, INSN_SUBUCWR
) : /* [${Rs}${inc}],$Rd */
8353 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8354 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8355 #define FLD(f) abuf->fields.sfmt_addcwr.f
8356 int UNUSED written
= 0;
8357 IADDR UNUSED pc
= abuf
->addr
;
8358 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8365 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8366 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8367 tmp_carry
= CPU (h_cbit
);
8368 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8370 SI opval
= tmp_newval
;
8371 SET_H_GR (FLD (f_operand2
), opval
);
8372 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8376 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8377 CPU (h_cbit
) = opval
;
8378 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8381 BI opval
= LTSI (tmp_newval
, 0);
8382 CPU (h_nbit
) = opval
;
8383 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8386 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8387 CPU (h_zbit
) = opval
;
8388 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8391 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8392 CPU (h_vbit
) = opval
;
8393 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8398 CPU (h_xbit
) = opval
;
8399 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8403 SET_H_INSN_PREFIXED_P (opval
);
8404 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8414 CASE (sem
, INSN_ADDC_R
) : /* addc $Rs,$Rd */
8416 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8417 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8418 #define FLD(f) abuf->fields.sfmt_addc_m.f
8419 int UNUSED written
= 0;
8420 IADDR UNUSED pc
= abuf
->addr
;
8421 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8430 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8431 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8432 tmp_carry
= CPU (h_cbit
);
8433 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8435 SI opval
= tmp_newval
;
8436 SET_H_GR (FLD (f_operand2
), opval
);
8437 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8441 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
8442 CPU (h_cbit
) = opval
;
8443 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8446 BI opval
= LTSI (tmp_newval
, 0);
8447 CPU (h_nbit
) = opval
;
8448 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8451 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8452 CPU (h_zbit
) = opval
;
8453 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8456 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8457 CPU (h_vbit
) = opval
;
8458 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8463 CPU (h_xbit
) = opval
;
8464 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8468 SET_H_INSN_PREFIXED_P (opval
);
8469 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8480 CASE (sem
, INSN_ADDC_M
) : /* addc [${Rs}${inc}],${Rd} */
8482 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8483 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8484 #define FLD(f) abuf->fields.sfmt_addc_m.f
8485 int UNUSED written
= 0;
8486 IADDR UNUSED pc
= abuf
->addr
;
8487 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8496 tmp_tmpops
= ({ SI tmp_addr
;
8499 tmp_postinc
= FLD (f_memmode
);
8500 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8501 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
8502 ; if (NEBI (tmp_postinc
, 0)) {
8504 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8505 tmp_addr
= ADDSI (tmp_addr
, 4);
8508 SI opval
= tmp_addr
;
8509 SET_H_GR (FLD (f_operand1
), opval
);
8510 written
|= (1 << 10);
8511 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8516 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8517 tmp_carry
= CPU (h_cbit
);
8518 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8520 SI opval
= tmp_newval
;
8521 SET_H_GR (FLD (f_operand2
), opval
);
8522 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8526 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
8527 CPU (h_cbit
) = opval
;
8528 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8531 BI opval
= LTSI (tmp_newval
, 0);
8532 CPU (h_nbit
) = opval
;
8533 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8536 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8537 CPU (h_zbit
) = opval
;
8538 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8541 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8542 CPU (h_vbit
) = opval
;
8543 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8548 CPU (h_xbit
) = opval
;
8549 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8553 SET_H_INSN_PREFIXED_P (opval
);
8554 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8561 abuf
->written
= written
;
8566 CASE (sem
, INSN_ADDC_C
) : /* addc ${const32},${Rd} */
8568 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8569 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8570 #define FLD(f) abuf->fields.sfmt_addcdr.f
8571 int UNUSED written
= 0;
8572 IADDR UNUSED pc
= abuf
->addr
;
8573 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8582 tmp_tmpops
= FLD (f_indir_pc__dword
);
8583 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8584 tmp_carry
= CPU (h_cbit
);
8585 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8587 SI opval
= tmp_newval
;
8588 SET_H_GR (FLD (f_operand2
), opval
);
8589 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8593 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
8594 CPU (h_cbit
) = opval
;
8595 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8598 BI opval
= LTSI (tmp_newval
, 0);
8599 CPU (h_nbit
) = opval
;
8600 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8603 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8604 CPU (h_zbit
) = opval
;
8605 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8608 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8609 CPU (h_vbit
) = opval
;
8610 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8615 CPU (h_xbit
) = opval
;
8616 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8620 SET_H_INSN_PREFIXED_P (opval
);
8621 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8632 CASE (sem
, INSN_LAPC_D
) : /* lapc.d ${const32-pcrel},${Rd} */
8634 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8635 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8636 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8637 int UNUSED written
= 0;
8638 IADDR UNUSED pc
= abuf
->addr
;
8639 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8643 SI opval
= FLD (i_const32_pcrel
);
8644 SET_H_GR (FLD (f_operand2
), opval
);
8645 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8650 CPU (h_xbit
) = opval
;
8651 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8655 SET_H_INSN_PREFIXED_P (opval
);
8656 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8665 CASE (sem
, INSN_LAPCQ
) : /* lapcq ${qo},${Rd} */
8667 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8668 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8669 #define FLD(f) abuf->fields.sfmt_lapcq.f
8670 int UNUSED written
= 0;
8671 IADDR UNUSED pc
= abuf
->addr
;
8672 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8676 SI opval
= FLD (i_qo
);
8677 SET_H_GR (FLD (f_operand2
), opval
);
8678 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8683 CPU (h_xbit
) = opval
;
8684 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8688 SET_H_INSN_PREFIXED_P (opval
);
8689 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8698 CASE (sem
, INSN_ADDI_B_R
) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8700 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8701 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8702 #define FLD(f) abuf->fields.sfmt_addc_m.f
8703 int UNUSED written
= 0;
8704 IADDR UNUSED pc
= abuf
->addr
;
8705 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8709 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
8710 SET_H_GR (FLD (f_operand1
), opval
);
8711 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8716 CPU (h_xbit
) = opval
;
8717 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8721 SET_H_INSN_PREFIXED_P (opval
);
8722 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8731 CASE (sem
, INSN_ADDI_W_R
) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8733 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8734 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8735 #define FLD(f) abuf->fields.sfmt_addc_m.f
8736 int UNUSED written
= 0;
8737 IADDR UNUSED pc
= abuf
->addr
;
8738 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8742 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
8743 SET_H_GR (FLD (f_operand1
), opval
);
8744 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8749 CPU (h_xbit
) = opval
;
8750 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8754 SET_H_INSN_PREFIXED_P (opval
);
8755 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8764 CASE (sem
, INSN_ADDI_D_R
) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8766 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8767 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8768 #define FLD(f) abuf->fields.sfmt_addc_m.f
8769 int UNUSED written
= 0;
8770 IADDR UNUSED pc
= abuf
->addr
;
8771 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8775 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
8776 SET_H_GR (FLD (f_operand1
), opval
);
8777 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8782 CPU (h_xbit
) = opval
;
8783 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8787 SET_H_INSN_PREFIXED_P (opval
);
8788 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8797 CASE (sem
, INSN_NEG_B_R
) : /* neg.b $Rs,$Rd */
8799 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8800 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8801 #define FLD(f) abuf->fields.sfmt_addc_m.f
8802 int UNUSED written
= 0;
8803 IADDR UNUSED pc
= abuf
->addr
;
8804 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8811 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8813 tmp_carry
= CPU (h_cbit
);
8814 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8817 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
8819 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
8820 SET_H_GR (FLD (f_operand2
), opval
);
8821 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8826 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd
, 0), LTQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_newval
, 0))));
8827 CPU (h_cbit
) = opval
;
8828 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8831 BI opval
= LTQI (tmp_newval
, 0);
8832 CPU (h_nbit
) = opval
;
8833 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8836 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8837 CPU (h_zbit
) = opval
;
8838 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8841 BI opval
= ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
8842 CPU (h_vbit
) = opval
;
8843 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8848 CPU (h_xbit
) = opval
;
8849 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8853 SET_H_INSN_PREFIXED_P (opval
);
8854 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8864 CASE (sem
, INSN_NEG_W_R
) : /* neg.w $Rs,$Rd */
8866 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8867 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8868 #define FLD(f) abuf->fields.sfmt_addc_m.f
8869 int UNUSED written
= 0;
8870 IADDR UNUSED pc
= abuf
->addr
;
8871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8878 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8880 tmp_carry
= CPU (h_cbit
);
8881 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8884 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
8886 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
8887 SET_H_GR (FLD (f_operand2
), opval
);
8888 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8893 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd
, 0), LTHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_newval
, 0))));
8894 CPU (h_cbit
) = opval
;
8895 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8898 BI opval
= LTHI (tmp_newval
, 0);
8899 CPU (h_nbit
) = opval
;
8900 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8903 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8904 CPU (h_zbit
) = opval
;
8905 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8908 BI opval
= ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
8909 CPU (h_vbit
) = opval
;
8910 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8915 CPU (h_xbit
) = opval
;
8916 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8920 SET_H_INSN_PREFIXED_P (opval
);
8921 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8931 CASE (sem
, INSN_NEG_D_R
) : /* neg.d $Rs,$Rd */
8933 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8934 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8935 #define FLD(f) abuf->fields.sfmt_addc_m.f
8936 int UNUSED written
= 0;
8937 IADDR UNUSED pc
= abuf
->addr
;
8938 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8945 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8947 tmp_carry
= CPU (h_cbit
);
8948 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8950 SI opval
= tmp_newval
;
8951 SET_H_GR (FLD (f_operand2
), opval
);
8952 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8956 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
8957 CPU (h_cbit
) = opval
;
8958 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8961 BI opval
= LTSI (tmp_newval
, 0);
8962 CPU (h_nbit
) = opval
;
8963 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8966 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8967 CPU (h_zbit
) = opval
;
8968 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8971 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
8972 CPU (h_vbit
) = opval
;
8973 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8978 CPU (h_xbit
) = opval
;
8979 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8983 SET_H_INSN_PREFIXED_P (opval
);
8984 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8994 CASE (sem
, INSN_TEST_M_B_M
) : /* test-m.b [${Rs}${inc}] */
8996 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8997 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8998 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
8999 int UNUSED written
= 0;
9000 IADDR UNUSED pc
= abuf
->addr
;
9001 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9005 tmp_tmpd
= ({ SI tmp_addr
;
9008 tmp_postinc
= FLD (f_memmode
);
9009 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9010 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
9011 ; if (NEBI (tmp_postinc
, 0)) {
9013 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9014 tmp_addr
= ADDSI (tmp_addr
, 1);
9017 SI opval
= tmp_addr
;
9018 SET_H_GR (FLD (f_operand1
), opval
);
9019 written
|= (1 << 8);
9020 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9031 tmp_tmpopd
= tmp_tmpd
;
9032 tmp_carry
= CPU (h_cbit
);
9033 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9037 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd
, 0), LTQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_newval
, 0))));
9038 CPU (h_cbit
) = opval
;
9039 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9042 BI opval
= LTQI (tmp_newval
, 0);
9043 CPU (h_nbit
) = opval
;
9044 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9047 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9048 CPU (h_zbit
) = opval
;
9049 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9052 BI opval
= ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
9053 CPU (h_vbit
) = opval
;
9054 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9059 CPU (h_xbit
) = opval
;
9060 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9064 SET_H_INSN_PREFIXED_P (opval
);
9065 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9072 abuf
->written
= written
;
9077 CASE (sem
, INSN_TEST_M_W_M
) : /* test-m.w [${Rs}${inc}] */
9079 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9080 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9081 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9082 int UNUSED written
= 0;
9083 IADDR UNUSED pc
= abuf
->addr
;
9084 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9088 tmp_tmpd
= ({ SI tmp_addr
;
9091 tmp_postinc
= FLD (f_memmode
);
9092 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9093 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
9094 ; if (NEBI (tmp_postinc
, 0)) {
9096 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9097 tmp_addr
= ADDSI (tmp_addr
, 2);
9100 SI opval
= tmp_addr
;
9101 SET_H_GR (FLD (f_operand1
), opval
);
9102 written
|= (1 << 8);
9103 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9114 tmp_tmpopd
= tmp_tmpd
;
9115 tmp_carry
= CPU (h_cbit
);
9116 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9120 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd
, 0), LTHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_newval
, 0))));
9121 CPU (h_cbit
) = opval
;
9122 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9125 BI opval
= LTHI (tmp_newval
, 0);
9126 CPU (h_nbit
) = opval
;
9127 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9130 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9131 CPU (h_zbit
) = opval
;
9132 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9135 BI opval
= ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
9136 CPU (h_vbit
) = opval
;
9137 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9142 CPU (h_xbit
) = opval
;
9143 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9147 SET_H_INSN_PREFIXED_P (opval
);
9148 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9155 abuf
->written
= written
;
9160 CASE (sem
, INSN_TEST_M_D_M
) : /* test-m.d [${Rs}${inc}] */
9162 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9163 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9164 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9165 int UNUSED written
= 0;
9166 IADDR UNUSED pc
= abuf
->addr
;
9167 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9171 tmp_tmpd
= ({ SI tmp_addr
;
9174 tmp_postinc
= FLD (f_memmode
);
9175 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9176 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
9177 ; if (NEBI (tmp_postinc
, 0)) {
9179 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9180 tmp_addr
= ADDSI (tmp_addr
, 4);
9183 SI opval
= tmp_addr
;
9184 SET_H_GR (FLD (f_operand1
), opval
);
9185 written
|= (1 << 8);
9186 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9197 tmp_tmpopd
= tmp_tmpd
;
9198 tmp_carry
= CPU (h_cbit
);
9199 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9203 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), ORIF (ANDIF (GESI (tmp_tmpopd
, 0), LTSI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_newval
, 0))));
9204 CPU (h_cbit
) = opval
;
9205 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9208 BI opval
= LTSI (tmp_newval
, 0);
9209 CPU (h_nbit
) = opval
;
9210 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9213 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9214 CPU (h_zbit
) = opval
;
9215 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9218 BI opval
= ORIF (ANDIF (ANDIF (GESI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
9219 CPU (h_vbit
) = opval
;
9220 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9225 CPU (h_xbit
) = opval
;
9226 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9230 SET_H_INSN_PREFIXED_P (opval
);
9231 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9238 abuf
->written
= written
;
9243 CASE (sem
, INSN_MOVE_R_M_B_M
) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9245 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9247 #define FLD(f) abuf->fields.sfmt_addc_m.f
9248 int UNUSED written
= 0;
9249 IADDR UNUSED pc
= abuf
->addr
;
9250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9254 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9258 tmp_postinc
= FLD (f_memmode
);
9259 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9260 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9261 if (EQBI (CPU (h_pbit
), 0)) {
9264 QI opval
= tmp_tmpd
;
9265 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9266 written
|= (1 << 10);
9267 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9270 BI opval
= CPU (h_pbit
);
9271 CPU (h_cbit
) = opval
;
9272 written
|= (1 << 9);
9273 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9279 CPU (h_cbit
) = opval
;
9280 written
|= (1 << 9);
9281 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9286 QI opval
= tmp_tmpd
;
9287 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9288 written
|= (1 << 10);
9289 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9292 if (NEBI (tmp_postinc
, 0)) {
9294 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9295 tmp_addr
= ADDSI (tmp_addr
, 1);
9298 SI opval
= tmp_addr
;
9299 SET_H_GR (FLD (f_operand1
), opval
);
9300 written
|= (1 << 8);
9301 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9309 CPU (h_xbit
) = opval
;
9310 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9314 SET_H_INSN_PREFIXED_P (opval
);
9315 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9320 abuf
->written
= written
;
9325 CASE (sem
, INSN_MOVE_R_M_W_M
) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9327 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9328 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9329 #define FLD(f) abuf->fields.sfmt_addc_m.f
9330 int UNUSED written
= 0;
9331 IADDR UNUSED pc
= abuf
->addr
;
9332 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9336 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9340 tmp_postinc
= FLD (f_memmode
);
9341 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9342 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9343 if (EQBI (CPU (h_pbit
), 0)) {
9346 HI opval
= tmp_tmpd
;
9347 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9348 written
|= (1 << 10);
9349 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9352 BI opval
= CPU (h_pbit
);
9353 CPU (h_cbit
) = opval
;
9354 written
|= (1 << 9);
9355 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9361 CPU (h_cbit
) = opval
;
9362 written
|= (1 << 9);
9363 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9368 HI opval
= tmp_tmpd
;
9369 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9370 written
|= (1 << 10);
9371 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9374 if (NEBI (tmp_postinc
, 0)) {
9376 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9377 tmp_addr
= ADDSI (tmp_addr
, 2);
9380 SI opval
= tmp_addr
;
9381 SET_H_GR (FLD (f_operand1
), opval
);
9382 written
|= (1 << 8);
9383 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9391 CPU (h_xbit
) = opval
;
9392 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9396 SET_H_INSN_PREFIXED_P (opval
);
9397 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9402 abuf
->written
= written
;
9407 CASE (sem
, INSN_MOVE_R_M_D_M
) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9409 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9410 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9411 #define FLD(f) abuf->fields.sfmt_addc_m.f
9412 int UNUSED written
= 0;
9413 IADDR UNUSED pc
= abuf
->addr
;
9414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9418 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9422 tmp_postinc
= FLD (f_memmode
);
9423 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9424 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9425 if (EQBI (CPU (h_pbit
), 0)) {
9428 SI opval
= tmp_tmpd
;
9429 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9430 written
|= (1 << 10);
9431 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9434 BI opval
= CPU (h_pbit
);
9435 CPU (h_cbit
) = opval
;
9436 written
|= (1 << 9);
9437 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9443 CPU (h_cbit
) = opval
;
9444 written
|= (1 << 9);
9445 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9450 SI opval
= tmp_tmpd
;
9451 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9452 written
|= (1 << 10);
9453 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9456 if (NEBI (tmp_postinc
, 0)) {
9458 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9459 tmp_addr
= ADDSI (tmp_addr
, 4);
9462 SI opval
= tmp_addr
;
9463 SET_H_GR (FLD (f_operand1
), opval
);
9464 written
|= (1 << 8);
9465 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9473 CPU (h_xbit
) = opval
;
9474 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9478 SET_H_INSN_PREFIXED_P (opval
);
9479 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9484 abuf
->written
= written
;
9489 CASE (sem
, INSN_MULS_B
) : /* muls.b $Rs,$Rd */
9491 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9492 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9493 #define FLD(f) abuf->fields.sfmt_muls_b.f
9494 int UNUSED written
= 0;
9495 IADDR UNUSED pc
= abuf
->addr
;
9496 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9502 tmp_src1
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9503 tmp_src2
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9504 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9506 SI opval
= TRUNCDISI (tmp_tmpr
);
9507 SET_H_GR (FLD (f_operand2
), opval
);
9508 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9511 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9512 SET_H_SR (((UINT
) 7), opval
);
9513 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9517 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9518 CPU (h_cbit
) = opval
;
9519 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9522 BI opval
= LTDI (tmp_tmpr
, 0);
9523 CPU (h_nbit
) = opval
;
9524 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9527 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9528 CPU (h_zbit
) = opval
;
9529 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9532 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9533 CPU (h_vbit
) = opval
;
9534 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9539 CPU (h_xbit
) = opval
;
9540 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9544 SET_H_INSN_PREFIXED_P (opval
);
9545 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9555 CASE (sem
, INSN_MULS_W
) : /* muls.w $Rs,$Rd */
9557 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9558 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9559 #define FLD(f) abuf->fields.sfmt_muls_b.f
9560 int UNUSED written
= 0;
9561 IADDR UNUSED pc
= abuf
->addr
;
9562 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9568 tmp_src1
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9569 tmp_src2
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9570 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9572 SI opval
= TRUNCDISI (tmp_tmpr
);
9573 SET_H_GR (FLD (f_operand2
), opval
);
9574 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9577 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9578 SET_H_SR (((UINT
) 7), opval
);
9579 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9583 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9584 CPU (h_cbit
) = opval
;
9585 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9588 BI opval
= LTDI (tmp_tmpr
, 0);
9589 CPU (h_nbit
) = opval
;
9590 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9593 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9594 CPU (h_zbit
) = opval
;
9595 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9598 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9599 CPU (h_vbit
) = opval
;
9600 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9605 CPU (h_xbit
) = opval
;
9606 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9610 SET_H_INSN_PREFIXED_P (opval
);
9611 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9621 CASE (sem
, INSN_MULS_D
) : /* muls.d $Rs,$Rd */
9623 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9624 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9625 #define FLD(f) abuf->fields.sfmt_muls_b.f
9626 int UNUSED written
= 0;
9627 IADDR UNUSED pc
= abuf
->addr
;
9628 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9634 tmp_src1
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9635 tmp_src2
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9636 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9638 SI opval
= TRUNCDISI (tmp_tmpr
);
9639 SET_H_GR (FLD (f_operand2
), opval
);
9640 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9643 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9644 SET_H_SR (((UINT
) 7), opval
);
9645 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9649 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9650 CPU (h_cbit
) = opval
;
9651 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9654 BI opval
= LTDI (tmp_tmpr
, 0);
9655 CPU (h_nbit
) = opval
;
9656 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9659 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9660 CPU (h_zbit
) = opval
;
9661 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9664 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9665 CPU (h_vbit
) = opval
;
9666 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9671 CPU (h_xbit
) = opval
;
9672 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9676 SET_H_INSN_PREFIXED_P (opval
);
9677 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9687 CASE (sem
, INSN_MULU_B
) : /* mulu.b $Rs,$Rd */
9689 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9690 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9691 #define FLD(f) abuf->fields.sfmt_muls_b.f
9692 int UNUSED written
= 0;
9693 IADDR UNUSED pc
= abuf
->addr
;
9694 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9700 tmp_src1
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9701 tmp_src2
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9702 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9704 SI opval
= TRUNCDISI (tmp_tmpr
);
9705 SET_H_GR (FLD (f_operand2
), opval
);
9706 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9709 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9710 SET_H_SR (((UINT
) 7), opval
);
9711 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9715 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9716 CPU (h_cbit
) = opval
;
9717 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9720 BI opval
= LTDI (tmp_tmpr
, 0);
9721 CPU (h_nbit
) = opval
;
9722 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9725 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9726 CPU (h_zbit
) = opval
;
9727 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9730 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9731 CPU (h_vbit
) = opval
;
9732 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9737 CPU (h_xbit
) = opval
;
9738 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9742 SET_H_INSN_PREFIXED_P (opval
);
9743 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9753 CASE (sem
, INSN_MULU_W
) : /* mulu.w $Rs,$Rd */
9755 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9756 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9757 #define FLD(f) abuf->fields.sfmt_muls_b.f
9758 int UNUSED written
= 0;
9759 IADDR UNUSED pc
= abuf
->addr
;
9760 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9766 tmp_src1
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9767 tmp_src2
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9768 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9770 SI opval
= TRUNCDISI (tmp_tmpr
);
9771 SET_H_GR (FLD (f_operand2
), opval
);
9772 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9775 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9776 SET_H_SR (((UINT
) 7), opval
);
9777 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9781 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9782 CPU (h_cbit
) = opval
;
9783 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9786 BI opval
= LTDI (tmp_tmpr
, 0);
9787 CPU (h_nbit
) = opval
;
9788 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9791 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9792 CPU (h_zbit
) = opval
;
9793 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9796 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9797 CPU (h_vbit
) = opval
;
9798 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9803 CPU (h_xbit
) = opval
;
9804 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9808 SET_H_INSN_PREFIXED_P (opval
);
9809 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9819 CASE (sem
, INSN_MULU_D
) : /* mulu.d $Rs,$Rd */
9821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9823 #define FLD(f) abuf->fields.sfmt_muls_b.f
9824 int UNUSED written
= 0;
9825 IADDR UNUSED pc
= abuf
->addr
;
9826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9832 tmp_src1
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9833 tmp_src2
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9834 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9836 SI opval
= TRUNCDISI (tmp_tmpr
);
9837 SET_H_GR (FLD (f_operand2
), opval
);
9838 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9841 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9842 SET_H_SR (((UINT
) 7), opval
);
9843 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9847 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9848 CPU (h_cbit
) = opval
;
9849 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9852 BI opval
= LTDI (tmp_tmpr
, 0);
9853 CPU (h_nbit
) = opval
;
9854 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9857 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9858 CPU (h_zbit
) = opval
;
9859 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9862 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9863 CPU (h_vbit
) = opval
;
9864 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9869 CPU (h_xbit
) = opval
;
9870 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9874 SET_H_INSN_PREFIXED_P (opval
);
9875 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9885 CASE (sem
, INSN_MCP
) : /* mcp $Ps,$Rd */
9887 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9888 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9889 #define FLD(f) abuf->fields.sfmt_mcp.f
9890 int UNUSED written
= 0;
9891 IADDR UNUSED pc
= abuf
->addr
;
9892 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9902 tmp_tmpops
= GET_H_SR (FLD (f_operand2
));
9903 tmp_tmpopd
= GET_H_GR (FLD (f_operand1
));
9904 tmp_carry
= CPU (h_rbit
);
9905 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9907 SI opval
= tmp_newval
;
9908 SET_H_GR (FLD (f_operand1
), opval
);
9909 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9913 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
9914 CPU (h_rbit
) = opval
;
9915 TRACE_RESULT (current_cpu
, abuf
, "rbit", 'x', opval
);
9918 BI opval
= LTSI (tmp_newval
, 0);
9919 CPU (h_nbit
) = opval
;
9920 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9923 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9924 CPU (h_zbit
) = opval
;
9925 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9928 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
9929 CPU (h_vbit
) = opval
;
9930 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9935 CPU (h_xbit
) = opval
;
9936 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9940 SET_H_INSN_PREFIXED_P (opval
);
9941 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9952 CASE (sem
, INSN_DSTEP
) : /* dstep $Rs,$Rd */
9954 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9955 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9956 #define FLD(f) abuf->fields.sfmt_muls_b.f
9957 int UNUSED written
= 0;
9958 IADDR UNUSED pc
= abuf
->addr
;
9959 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9965 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9966 tmp_tmp
= SLLSI (GET_H_GR (FLD (f_operand2
)), 1);
9967 tmp_tmpd
= ((GEUSI (tmp_tmp
, tmp_tmps
)) ? (SUBSI (tmp_tmp
, tmp_tmps
)) : (tmp_tmp
));
9969 SI opval
= tmp_tmpd
;
9970 SET_H_GR (FLD (f_operand2
), opval
);
9971 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9975 BI opval
= LTSI (tmp_tmpd
, 0);
9976 CPU (h_nbit
) = opval
;
9977 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9980 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9981 CPU (h_zbit
) = opval
;
9982 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9984 SET_H_CBIT_MOVE (0);
9985 SET_H_VBIT_MOVE (0);
9989 CPU (h_xbit
) = opval
;
9990 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9994 SET_H_INSN_PREFIXED_P (opval
);
9995 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10005 CASE (sem
, INSN_ABS
) : /* abs $Rs,$Rd */
10007 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10008 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10009 #define FLD(f) abuf->fields.sfmt_muls_b.f
10010 int UNUSED written
= 0;
10011 IADDR UNUSED pc
= abuf
->addr
;
10012 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10016 tmp_tmpd
= ABSSI (GET_H_GR (FLD (f_operand1
)));
10018 SI opval
= tmp_tmpd
;
10019 SET_H_GR (FLD (f_operand2
), opval
);
10020 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10024 BI opval
= LTSI (tmp_tmpd
, 0);
10025 CPU (h_nbit
) = opval
;
10026 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10029 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10030 CPU (h_zbit
) = opval
;
10031 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10033 SET_H_CBIT_MOVE (0);
10034 SET_H_VBIT_MOVE (0);
10038 CPU (h_xbit
) = opval
;
10039 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10043 SET_H_INSN_PREFIXED_P (opval
);
10044 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10054 CASE (sem
, INSN_AND_B_R
) : /* and.b $Rs,$Rd */
10056 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10057 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10058 #define FLD(f) abuf->fields.sfmt_addc_m.f
10059 int UNUSED written
= 0;
10060 IADDR UNUSED pc
= abuf
->addr
;
10061 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10065 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10068 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10070 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10071 SET_H_GR (FLD (f_operand2
), opval
);
10072 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10077 BI opval
= LTQI (tmp_tmpd
, 0);
10078 CPU (h_nbit
) = opval
;
10079 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10082 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10083 CPU (h_zbit
) = opval
;
10084 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10086 SET_H_CBIT_MOVE (0);
10087 SET_H_VBIT_MOVE (0);
10091 CPU (h_xbit
) = opval
;
10092 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10096 SET_H_INSN_PREFIXED_P (opval
);
10097 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10107 CASE (sem
, INSN_AND_W_R
) : /* and.w $Rs,$Rd */
10109 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10110 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10111 #define FLD(f) abuf->fields.sfmt_addc_m.f
10112 int UNUSED written
= 0;
10113 IADDR UNUSED pc
= abuf
->addr
;
10114 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10118 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10121 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10123 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10124 SET_H_GR (FLD (f_operand2
), opval
);
10125 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10130 BI opval
= LTHI (tmp_tmpd
, 0);
10131 CPU (h_nbit
) = opval
;
10132 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10135 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10136 CPU (h_zbit
) = opval
;
10137 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10139 SET_H_CBIT_MOVE (0);
10140 SET_H_VBIT_MOVE (0);
10144 CPU (h_xbit
) = opval
;
10145 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10149 SET_H_INSN_PREFIXED_P (opval
);
10150 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10160 CASE (sem
, INSN_AND_D_R
) : /* and.d $Rs,$Rd */
10162 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10163 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10164 #define FLD(f) abuf->fields.sfmt_addc_m.f
10165 int UNUSED written
= 0;
10166 IADDR UNUSED pc
= abuf
->addr
;
10167 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10171 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10173 SI opval
= tmp_tmpd
;
10174 SET_H_GR (FLD (f_operand2
), opval
);
10175 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10179 BI opval
= LTSI (tmp_tmpd
, 0);
10180 CPU (h_nbit
) = opval
;
10181 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10184 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10185 CPU (h_zbit
) = opval
;
10186 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10188 SET_H_CBIT_MOVE (0);
10189 SET_H_VBIT_MOVE (0);
10193 CPU (h_xbit
) = opval
;
10194 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10198 SET_H_INSN_PREFIXED_P (opval
);
10199 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10209 CASE (sem
, INSN_AND_M_B_M
) : /* and-m.b [${Rs}${inc}],${Rd} */
10211 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10212 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10213 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10214 int UNUSED written
= 0;
10215 IADDR UNUSED pc
= abuf
->addr
;
10216 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10220 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10223 tmp_postinc
= FLD (f_memmode
);
10224 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10225 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10226 ; if (NEBI (tmp_postinc
, 0)) {
10228 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10229 tmp_addr
= ADDSI (tmp_addr
, 1);
10232 SI opval
= tmp_addr
;
10233 SET_H_GR (FLD (f_operand1
), opval
);
10234 written
|= (1 << 11);
10235 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10239 ; tmp_tmp_mem
; }));
10242 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10244 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10245 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10246 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10251 BI opval
= LTQI (tmp_tmpd
, 0);
10252 CPU (h_nbit
) = opval
;
10253 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10256 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10257 CPU (h_zbit
) = opval
;
10258 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10260 SET_H_CBIT_MOVE (0);
10261 SET_H_VBIT_MOVE (0);
10265 CPU (h_xbit
) = opval
;
10266 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10270 SET_H_INSN_PREFIXED_P (opval
);
10271 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10277 abuf
->written
= written
;
10282 CASE (sem
, INSN_AND_M_W_M
) : /* and-m.w [${Rs}${inc}],${Rd} */
10284 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10285 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10286 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10287 int UNUSED written
= 0;
10288 IADDR UNUSED pc
= abuf
->addr
;
10289 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10293 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10296 tmp_postinc
= FLD (f_memmode
);
10297 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10298 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10299 ; if (NEBI (tmp_postinc
, 0)) {
10301 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10302 tmp_addr
= ADDSI (tmp_addr
, 2);
10305 SI opval
= tmp_addr
;
10306 SET_H_GR (FLD (f_operand1
), opval
);
10307 written
|= (1 << 11);
10308 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10312 ; tmp_tmp_mem
; }));
10315 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10317 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10318 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10319 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10324 BI opval
= LTHI (tmp_tmpd
, 0);
10325 CPU (h_nbit
) = opval
;
10326 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10329 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10330 CPU (h_zbit
) = opval
;
10331 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10333 SET_H_CBIT_MOVE (0);
10334 SET_H_VBIT_MOVE (0);
10338 CPU (h_xbit
) = opval
;
10339 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10343 SET_H_INSN_PREFIXED_P (opval
);
10344 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10350 abuf
->written
= written
;
10355 CASE (sem
, INSN_AND_M_D_M
) : /* and-m.d [${Rs}${inc}],${Rd} */
10357 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10358 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10359 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10360 int UNUSED written
= 0;
10361 IADDR UNUSED pc
= abuf
->addr
;
10362 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10366 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10369 tmp_postinc
= FLD (f_memmode
);
10370 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10371 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10372 ; if (NEBI (tmp_postinc
, 0)) {
10374 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10375 tmp_addr
= ADDSI (tmp_addr
, 4);
10378 SI opval
= tmp_addr
;
10379 SET_H_GR (FLD (f_operand1
), opval
);
10380 written
|= (1 << 10);
10381 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10385 ; tmp_tmp_mem
; }));
10387 SI opval
= tmp_tmpd
;
10388 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10389 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10393 BI opval
= LTSI (tmp_tmpd
, 0);
10394 CPU (h_nbit
) = opval
;
10395 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10398 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10399 CPU (h_zbit
) = opval
;
10400 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10402 SET_H_CBIT_MOVE (0);
10403 SET_H_VBIT_MOVE (0);
10407 CPU (h_xbit
) = opval
;
10408 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10412 SET_H_INSN_PREFIXED_P (opval
);
10413 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10419 abuf
->written
= written
;
10424 CASE (sem
, INSN_ANDCBR
) : /* and.b ${sconst8}],${Rd} */
10426 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10427 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10428 #define FLD(f) abuf->fields.sfmt_addcbr.f
10429 int UNUSED written
= 0;
10430 IADDR UNUSED pc
= abuf
->addr
;
10431 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10435 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10438 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10440 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10441 SET_H_GR (FLD (f_operand2
), opval
);
10442 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10447 BI opval
= LTQI (tmp_tmpd
, 0);
10448 CPU (h_nbit
) = opval
;
10449 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10452 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10453 CPU (h_zbit
) = opval
;
10454 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10456 SET_H_CBIT_MOVE (0);
10457 SET_H_VBIT_MOVE (0);
10461 CPU (h_xbit
) = opval
;
10462 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10466 SET_H_INSN_PREFIXED_P (opval
);
10467 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10477 CASE (sem
, INSN_ANDCWR
) : /* and.w ${sconst16}],${Rd} */
10479 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10480 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10481 #define FLD(f) abuf->fields.sfmt_addcwr.f
10482 int UNUSED written
= 0;
10483 IADDR UNUSED pc
= abuf
->addr
;
10484 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10488 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10491 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10493 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10494 SET_H_GR (FLD (f_operand2
), opval
);
10495 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10500 BI opval
= LTHI (tmp_tmpd
, 0);
10501 CPU (h_nbit
) = opval
;
10502 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10505 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10506 CPU (h_zbit
) = opval
;
10507 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10509 SET_H_CBIT_MOVE (0);
10510 SET_H_VBIT_MOVE (0);
10514 CPU (h_xbit
) = opval
;
10515 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10519 SET_H_INSN_PREFIXED_P (opval
);
10520 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10530 CASE (sem
, INSN_ANDCDR
) : /* and.d ${const32}],${Rd} */
10532 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10533 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10534 #define FLD(f) abuf->fields.sfmt_addcdr.f
10535 int UNUSED written
= 0;
10536 IADDR UNUSED pc
= abuf
->addr
;
10537 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10541 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10543 SI opval
= tmp_tmpd
;
10544 SET_H_GR (FLD (f_operand2
), opval
);
10545 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10549 BI opval
= LTSI (tmp_tmpd
, 0);
10550 CPU (h_nbit
) = opval
;
10551 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10554 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10555 CPU (h_zbit
) = opval
;
10556 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10558 SET_H_CBIT_MOVE (0);
10559 SET_H_VBIT_MOVE (0);
10563 CPU (h_xbit
) = opval
;
10564 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10568 SET_H_INSN_PREFIXED_P (opval
);
10569 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10579 CASE (sem
, INSN_ANDQ
) : /* andq $i,$Rd */
10581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10582 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10583 #define FLD(f) abuf->fields.sfmt_andq.f
10584 int UNUSED written
= 0;
10585 IADDR UNUSED pc
= abuf
->addr
;
10586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10590 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10592 SI opval
= tmp_tmpd
;
10593 SET_H_GR (FLD (f_operand2
), opval
);
10594 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10598 BI opval
= LTSI (tmp_tmpd
, 0);
10599 CPU (h_nbit
) = opval
;
10600 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10603 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10604 CPU (h_zbit
) = opval
;
10605 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10607 SET_H_CBIT_MOVE (0);
10608 SET_H_VBIT_MOVE (0);
10612 CPU (h_xbit
) = opval
;
10613 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10617 SET_H_INSN_PREFIXED_P (opval
);
10618 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10628 CASE (sem
, INSN_ORR_B_R
) : /* orr.b $Rs,$Rd */
10630 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10631 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10632 #define FLD(f) abuf->fields.sfmt_addc_m.f
10633 int UNUSED written
= 0;
10634 IADDR UNUSED pc
= abuf
->addr
;
10635 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10639 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10642 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10644 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10645 SET_H_GR (FLD (f_operand2
), opval
);
10646 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10651 BI opval
= LTQI (tmp_tmpd
, 0);
10652 CPU (h_nbit
) = opval
;
10653 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10656 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10657 CPU (h_zbit
) = opval
;
10658 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10660 SET_H_CBIT_MOVE (0);
10661 SET_H_VBIT_MOVE (0);
10665 CPU (h_xbit
) = opval
;
10666 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10670 SET_H_INSN_PREFIXED_P (opval
);
10671 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10681 CASE (sem
, INSN_ORR_W_R
) : /* orr.w $Rs,$Rd */
10683 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10684 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10685 #define FLD(f) abuf->fields.sfmt_addc_m.f
10686 int UNUSED written
= 0;
10687 IADDR UNUSED pc
= abuf
->addr
;
10688 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10692 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10695 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10697 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10698 SET_H_GR (FLD (f_operand2
), opval
);
10699 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10704 BI opval
= LTHI (tmp_tmpd
, 0);
10705 CPU (h_nbit
) = opval
;
10706 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10709 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10710 CPU (h_zbit
) = opval
;
10711 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10713 SET_H_CBIT_MOVE (0);
10714 SET_H_VBIT_MOVE (0);
10718 CPU (h_xbit
) = opval
;
10719 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10723 SET_H_INSN_PREFIXED_P (opval
);
10724 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10734 CASE (sem
, INSN_ORR_D_R
) : /* orr.d $Rs,$Rd */
10736 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10737 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10738 #define FLD(f) abuf->fields.sfmt_addc_m.f
10739 int UNUSED written
= 0;
10740 IADDR UNUSED pc
= abuf
->addr
;
10741 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10745 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10747 SI opval
= tmp_tmpd
;
10748 SET_H_GR (FLD (f_operand2
), opval
);
10749 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10753 BI opval
= LTSI (tmp_tmpd
, 0);
10754 CPU (h_nbit
) = opval
;
10755 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10758 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10759 CPU (h_zbit
) = opval
;
10760 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10762 SET_H_CBIT_MOVE (0);
10763 SET_H_VBIT_MOVE (0);
10767 CPU (h_xbit
) = opval
;
10768 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10772 SET_H_INSN_PREFIXED_P (opval
);
10773 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10783 CASE (sem
, INSN_OR_M_B_M
) : /* or-m.b [${Rs}${inc}],${Rd} */
10785 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10786 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10787 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10788 int UNUSED written
= 0;
10789 IADDR UNUSED pc
= abuf
->addr
;
10790 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10794 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10797 tmp_postinc
= FLD (f_memmode
);
10798 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10799 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10800 ; if (NEBI (tmp_postinc
, 0)) {
10802 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10803 tmp_addr
= ADDSI (tmp_addr
, 1);
10806 SI opval
= tmp_addr
;
10807 SET_H_GR (FLD (f_operand1
), opval
);
10808 written
|= (1 << 11);
10809 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10813 ; tmp_tmp_mem
; }));
10816 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10818 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10819 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10820 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10825 BI opval
= LTQI (tmp_tmpd
, 0);
10826 CPU (h_nbit
) = opval
;
10827 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10830 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10831 CPU (h_zbit
) = opval
;
10832 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10834 SET_H_CBIT_MOVE (0);
10835 SET_H_VBIT_MOVE (0);
10839 CPU (h_xbit
) = opval
;
10840 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10844 SET_H_INSN_PREFIXED_P (opval
);
10845 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10851 abuf
->written
= written
;
10856 CASE (sem
, INSN_OR_M_W_M
) : /* or-m.w [${Rs}${inc}],${Rd} */
10858 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10859 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10860 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10861 int UNUSED written
= 0;
10862 IADDR UNUSED pc
= abuf
->addr
;
10863 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10867 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10870 tmp_postinc
= FLD (f_memmode
);
10871 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10872 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10873 ; if (NEBI (tmp_postinc
, 0)) {
10875 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10876 tmp_addr
= ADDSI (tmp_addr
, 2);
10879 SI opval
= tmp_addr
;
10880 SET_H_GR (FLD (f_operand1
), opval
);
10881 written
|= (1 << 11);
10882 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10886 ; tmp_tmp_mem
; }));
10889 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10891 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10892 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10893 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10898 BI opval
= LTHI (tmp_tmpd
, 0);
10899 CPU (h_nbit
) = opval
;
10900 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10903 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10904 CPU (h_zbit
) = opval
;
10905 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10907 SET_H_CBIT_MOVE (0);
10908 SET_H_VBIT_MOVE (0);
10912 CPU (h_xbit
) = opval
;
10913 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10917 SET_H_INSN_PREFIXED_P (opval
);
10918 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10924 abuf
->written
= written
;
10929 CASE (sem
, INSN_OR_M_D_M
) : /* or-m.d [${Rs}${inc}],${Rd} */
10931 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10932 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10933 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10934 int UNUSED written
= 0;
10935 IADDR UNUSED pc
= abuf
->addr
;
10936 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10940 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10943 tmp_postinc
= FLD (f_memmode
);
10944 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10945 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10946 ; if (NEBI (tmp_postinc
, 0)) {
10948 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10949 tmp_addr
= ADDSI (tmp_addr
, 4);
10952 SI opval
= tmp_addr
;
10953 SET_H_GR (FLD (f_operand1
), opval
);
10954 written
|= (1 << 10);
10955 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10959 ; tmp_tmp_mem
; }));
10961 SI opval
= tmp_tmpd
;
10962 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10963 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10967 BI opval
= LTSI (tmp_tmpd
, 0);
10968 CPU (h_nbit
) = opval
;
10969 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10972 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10973 CPU (h_zbit
) = opval
;
10974 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10976 SET_H_CBIT_MOVE (0);
10977 SET_H_VBIT_MOVE (0);
10981 CPU (h_xbit
) = opval
;
10982 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10986 SET_H_INSN_PREFIXED_P (opval
);
10987 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10993 abuf
->written
= written
;
10998 CASE (sem
, INSN_ORCBR
) : /* or.b ${sconst8}],${Rd} */
11000 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11001 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11002 #define FLD(f) abuf->fields.sfmt_addcbr.f
11003 int UNUSED written
= 0;
11004 IADDR UNUSED pc
= abuf
->addr
;
11005 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11009 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
11012 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11014 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11015 SET_H_GR (FLD (f_operand2
), opval
);
11016 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11021 BI opval
= LTQI (tmp_tmpd
, 0);
11022 CPU (h_nbit
) = opval
;
11023 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11026 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11027 CPU (h_zbit
) = opval
;
11028 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11030 SET_H_CBIT_MOVE (0);
11031 SET_H_VBIT_MOVE (0);
11035 CPU (h_xbit
) = opval
;
11036 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11040 SET_H_INSN_PREFIXED_P (opval
);
11041 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11051 CASE (sem
, INSN_ORCWR
) : /* or.w ${sconst16}],${Rd} */
11053 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11054 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11055 #define FLD(f) abuf->fields.sfmt_addcwr.f
11056 int UNUSED written
= 0;
11057 IADDR UNUSED pc
= abuf
->addr
;
11058 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11062 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
11065 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11067 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11068 SET_H_GR (FLD (f_operand2
), opval
);
11069 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11074 BI opval
= LTHI (tmp_tmpd
, 0);
11075 CPU (h_nbit
) = opval
;
11076 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11079 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11080 CPU (h_zbit
) = opval
;
11081 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11083 SET_H_CBIT_MOVE (0);
11084 SET_H_VBIT_MOVE (0);
11088 CPU (h_xbit
) = opval
;
11089 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11093 SET_H_INSN_PREFIXED_P (opval
);
11094 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11104 CASE (sem
, INSN_ORCDR
) : /* or.d ${const32}],${Rd} */
11106 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11108 #define FLD(f) abuf->fields.sfmt_addcdr.f
11109 int UNUSED written
= 0;
11110 IADDR UNUSED pc
= abuf
->addr
;
11111 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
11115 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
11117 SI opval
= tmp_tmpd
;
11118 SET_H_GR (FLD (f_operand2
), opval
);
11119 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11123 BI opval
= LTSI (tmp_tmpd
, 0);
11124 CPU (h_nbit
) = opval
;
11125 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11128 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11129 CPU (h_zbit
) = opval
;
11130 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11132 SET_H_CBIT_MOVE (0);
11133 SET_H_VBIT_MOVE (0);
11137 CPU (h_xbit
) = opval
;
11138 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11142 SET_H_INSN_PREFIXED_P (opval
);
11143 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11153 CASE (sem
, INSN_ORQ
) : /* orq $i,$Rd */
11155 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11156 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11157 #define FLD(f) abuf->fields.sfmt_andq.f
11158 int UNUSED written
= 0;
11159 IADDR UNUSED pc
= abuf
->addr
;
11160 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11164 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
11166 SI opval
= tmp_tmpd
;
11167 SET_H_GR (FLD (f_operand2
), opval
);
11168 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11172 BI opval
= LTSI (tmp_tmpd
, 0);
11173 CPU (h_nbit
) = opval
;
11174 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11177 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11178 CPU (h_zbit
) = opval
;
11179 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11181 SET_H_CBIT_MOVE (0);
11182 SET_H_VBIT_MOVE (0);
11186 CPU (h_xbit
) = opval
;
11187 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11191 SET_H_INSN_PREFIXED_P (opval
);
11192 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11202 CASE (sem
, INSN_XOR
) : /* xor $Rs,$Rd */
11204 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11206 #define FLD(f) abuf->fields.sfmt_muls_b.f
11207 int UNUSED written
= 0;
11208 IADDR UNUSED pc
= abuf
->addr
;
11209 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11213 tmp_tmpd
= XORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
11215 SI opval
= tmp_tmpd
;
11216 SET_H_GR (FLD (f_operand2
), opval
);
11217 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11221 BI opval
= LTSI (tmp_tmpd
, 0);
11222 CPU (h_nbit
) = opval
;
11223 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11226 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11227 CPU (h_zbit
) = opval
;
11228 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11230 SET_H_CBIT_MOVE (0);
11231 SET_H_VBIT_MOVE (0);
11235 CPU (h_xbit
) = opval
;
11236 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11240 SET_H_INSN_PREFIXED_P (opval
);
11241 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11251 CASE (sem
, INSN_SWAP
) : /* swap${swapoption} ${Rs} */
11253 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11254 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11255 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11256 int UNUSED written
= 0;
11257 IADDR UNUSED pc
= abuf
->addr
;
11258 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11263 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
11264 tmp_tmpd
= ({ SI tmp_tmpcode
;
11267 tmp_tmpcode
= FLD (f_operand2
);
11268 ; tmp_tmpval
= tmp_tmps
;
11269 ; if (EQSI (tmp_tmpcode
, 0)) {
11270 tmp_tmpres
= (cgen_rtx_error (current_cpu
, "SWAP without swap modifier isn't implemented"), 0);
11272 else if (EQSI (tmp_tmpcode
, 1)) {
11273 tmp_tmpres
= ({ SI tmp_tmpr
;
11274 tmp_tmpr
= tmp_tmpval
;
11275 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11277 else if (EQSI (tmp_tmpcode
, 2)) {
11278 tmp_tmpres
= ({ SI tmp_tmpb
;
11279 tmp_tmpb
= tmp_tmpval
;
11280 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11282 else if (EQSI (tmp_tmpcode
, 3)) {
11283 tmp_tmpres
= ({ SI tmp_tmpr
;
11284 tmp_tmpr
= ({ SI tmp_tmpb
;
11285 tmp_tmpb
= tmp_tmpval
;
11286 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11287 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11289 else if (EQSI (tmp_tmpcode
, 4)) {
11290 tmp_tmpres
= ({ SI tmp_tmpb
;
11291 tmp_tmpb
= tmp_tmpval
;
11292 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11294 else if (EQSI (tmp_tmpcode
, 5)) {
11295 tmp_tmpres
= ({ SI tmp_tmpr
;
11296 tmp_tmpr
= ({ SI tmp_tmpb
;
11297 tmp_tmpb
= tmp_tmpval
;
11298 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11299 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11301 else if (EQSI (tmp_tmpcode
, 6)) {
11302 tmp_tmpres
= ({ SI tmp_tmpb
;
11303 tmp_tmpb
= ({ SI tmp_tmpb
;
11304 tmp_tmpb
= tmp_tmpval
;
11305 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11306 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11308 else if (EQSI (tmp_tmpcode
, 7)) {
11309 tmp_tmpres
= ({ SI tmp_tmpr
;
11310 tmp_tmpr
= ({ SI tmp_tmpb
;
11311 tmp_tmpb
= ({ SI tmp_tmpb
;
11312 tmp_tmpb
= tmp_tmpval
;
11313 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11314 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11315 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11317 else if (EQSI (tmp_tmpcode
, 8)) {
11318 tmp_tmpres
= INVSI (tmp_tmpval
);
11320 else if (EQSI (tmp_tmpcode
, 9)) {
11321 tmp_tmpres
= ({ SI tmp_tmpr
;
11322 tmp_tmpr
= INVSI (tmp_tmpval
);
11323 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11325 else if (EQSI (tmp_tmpcode
, 10)) {
11326 tmp_tmpres
= ({ SI tmp_tmpb
;
11327 tmp_tmpb
= INVSI (tmp_tmpval
);
11328 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11330 else if (EQSI (tmp_tmpcode
, 11)) {
11331 tmp_tmpres
= ({ SI tmp_tmpr
;
11332 tmp_tmpr
= ({ SI tmp_tmpb
;
11333 tmp_tmpb
= INVSI (tmp_tmpval
);
11334 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11335 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11337 else if (EQSI (tmp_tmpcode
, 12)) {
11338 tmp_tmpres
= ({ SI tmp_tmpb
;
11339 tmp_tmpb
= INVSI (tmp_tmpval
);
11340 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11342 else if (EQSI (tmp_tmpcode
, 13)) {
11343 tmp_tmpres
= ({ SI tmp_tmpr
;
11344 tmp_tmpr
= ({ SI tmp_tmpb
;
11345 tmp_tmpb
= INVSI (tmp_tmpval
);
11346 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11347 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11349 else if (EQSI (tmp_tmpcode
, 14)) {
11350 tmp_tmpres
= ({ SI tmp_tmpb
;
11351 tmp_tmpb
= ({ SI tmp_tmpb
;
11352 tmp_tmpb
= INVSI (tmp_tmpval
);
11353 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11354 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11356 else if (EQSI (tmp_tmpcode
, 15)) {
11357 tmp_tmpres
= ({ SI tmp_tmpr
;
11358 tmp_tmpr
= ({ SI tmp_tmpb
;
11359 tmp_tmpb
= ({ SI tmp_tmpb
;
11360 tmp_tmpb
= INVSI (tmp_tmpval
);
11361 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11362 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11363 ; ORSI (SLLSI (ANDSI (tmp_tmpr
, 16843009), 7), ORSI (SLLSI (ANDSI (tmp_tmpr
, 33686018), 5), ORSI (SLLSI (ANDSI (tmp_tmpr
, 67372036), 3), ORSI (SLLSI (ANDSI (tmp_tmpr
, 134744072), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 269488144), 1), ORSI (SRLSI (ANDSI (tmp_tmpr
, 538976288), 3), ORSI (SRLSI (ANDSI (tmp_tmpr
, 1077952576), 5), SRLSI (ANDSI (tmp_tmpr
, 0x80808080), 7)))))))); });
11367 SI opval
= tmp_tmpd
;
11368 SET_H_GR (FLD (f_operand1
), opval
);
11369 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11373 BI opval
= LTSI (tmp_tmpd
, 0);
11374 CPU (h_nbit
) = opval
;
11375 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11378 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11379 CPU (h_zbit
) = opval
;
11380 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11382 SET_H_CBIT_MOVE (0);
11383 SET_H_VBIT_MOVE (0);
11387 CPU (h_xbit
) = opval
;
11388 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11392 SET_H_INSN_PREFIXED_P (opval
);
11393 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11403 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11405 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11406 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11407 #define FLD(f) abuf->fields.sfmt_addc_m.f
11408 int UNUSED written
= 0;
11409 IADDR UNUSED pc
= abuf
->addr
;
11410 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11416 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11417 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11418 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11421 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11423 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11424 SET_H_GR (FLD (f_operand2
), opval
);
11425 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11430 BI opval
= LTQI (tmp_tmpd
, 0);
11431 CPU (h_nbit
) = opval
;
11432 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11435 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11436 CPU (h_zbit
) = opval
;
11437 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11439 SET_H_CBIT_MOVE (0);
11440 SET_H_VBIT_MOVE (0);
11444 CPU (h_xbit
) = opval
;
11445 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11449 SET_H_INSN_PREFIXED_P (opval
);
11450 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11460 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11462 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11463 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11464 #define FLD(f) abuf->fields.sfmt_addc_m.f
11465 int UNUSED written
= 0;
11466 IADDR UNUSED pc
= abuf
->addr
;
11467 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11473 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11474 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11475 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11478 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11480 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11481 SET_H_GR (FLD (f_operand2
), opval
);
11482 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11487 BI opval
= LTHI (tmp_tmpd
, 0);
11488 CPU (h_nbit
) = opval
;
11489 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11492 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11493 CPU (h_zbit
) = opval
;
11494 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11496 SET_H_CBIT_MOVE (0);
11497 SET_H_VBIT_MOVE (0);
11501 CPU (h_xbit
) = opval
;
11502 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11506 SET_H_INSN_PREFIXED_P (opval
);
11507 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11517 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11519 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11520 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11521 #define FLD(f) abuf->fields.sfmt_addc_m.f
11522 int UNUSED written
= 0;
11523 IADDR UNUSED pc
= abuf
->addr
;
11524 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11530 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11531 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11532 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11534 SI opval
= tmp_tmpd
;
11535 SET_H_GR (FLD (f_operand2
), opval
);
11536 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11540 BI opval
= LTSI (tmp_tmpd
, 0);
11541 CPU (h_nbit
) = opval
;
11542 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11545 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11546 CPU (h_zbit
) = opval
;
11547 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11549 SET_H_CBIT_MOVE (0);
11550 SET_H_VBIT_MOVE (0);
11554 CPU (h_xbit
) = opval
;
11555 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11559 SET_H_INSN_PREFIXED_P (opval
);
11560 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11570 CASE (sem
, INSN_ASRQ
) : /* asrq $c,${Rd} */
11572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11574 #define FLD(f) abuf->fields.sfmt_asrq.f
11575 int UNUSED written
= 0;
11576 IADDR UNUSED pc
= abuf
->addr
;
11577 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11581 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11583 SI opval
= tmp_tmpd
;
11584 SET_H_GR (FLD (f_operand2
), opval
);
11585 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11589 BI opval
= LTSI (tmp_tmpd
, 0);
11590 CPU (h_nbit
) = opval
;
11591 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11594 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11595 CPU (h_zbit
) = opval
;
11596 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11598 SET_H_CBIT_MOVE (0);
11599 SET_H_VBIT_MOVE (0);
11603 CPU (h_xbit
) = opval
;
11604 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11608 SET_H_INSN_PREFIXED_P (opval
);
11609 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11619 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11621 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11622 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11623 #define FLD(f) abuf->fields.sfmt_addc_m.f
11624 int UNUSED written
= 0;
11625 IADDR UNUSED pc
= abuf
->addr
;
11626 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11631 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11632 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11635 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11637 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11638 SET_H_GR (FLD (f_operand2
), opval
);
11639 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11644 BI opval
= LTQI (tmp_tmpd
, 0);
11645 CPU (h_nbit
) = opval
;
11646 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11649 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11650 CPU (h_zbit
) = opval
;
11651 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11653 SET_H_CBIT_MOVE (0);
11654 SET_H_VBIT_MOVE (0);
11658 CPU (h_xbit
) = opval
;
11659 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11663 SET_H_INSN_PREFIXED_P (opval
);
11664 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11674 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11676 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11677 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11678 #define FLD(f) abuf->fields.sfmt_addc_m.f
11679 int UNUSED written
= 0;
11680 IADDR UNUSED pc
= abuf
->addr
;
11681 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11686 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11687 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11690 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11692 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11693 SET_H_GR (FLD (f_operand2
), opval
);
11694 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11699 BI opval
= LTHI (tmp_tmpd
, 0);
11700 CPU (h_nbit
) = opval
;
11701 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11704 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11705 CPU (h_zbit
) = opval
;
11706 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11708 SET_H_CBIT_MOVE (0);
11709 SET_H_VBIT_MOVE (0);
11713 CPU (h_xbit
) = opval
;
11714 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11718 SET_H_INSN_PREFIXED_P (opval
);
11719 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11729 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11731 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11732 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11733 #define FLD(f) abuf->fields.sfmt_addc_m.f
11734 int UNUSED written
= 0;
11735 IADDR UNUSED pc
= abuf
->addr
;
11736 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11741 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11742 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11744 SI opval
= tmp_tmpd
;
11745 SET_H_GR (FLD (f_operand2
), opval
);
11746 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11750 BI opval
= LTSI (tmp_tmpd
, 0);
11751 CPU (h_nbit
) = opval
;
11752 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11755 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11756 CPU (h_zbit
) = opval
;
11757 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11759 SET_H_CBIT_MOVE (0);
11760 SET_H_VBIT_MOVE (0);
11764 CPU (h_xbit
) = opval
;
11765 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11769 SET_H_INSN_PREFIXED_P (opval
);
11770 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11780 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
11782 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11783 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11784 #define FLD(f) abuf->fields.sfmt_asrq.f
11785 int UNUSED written
= 0;
11786 IADDR UNUSED pc
= abuf
->addr
;
11787 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11791 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11793 SI opval
= tmp_tmpd
;
11794 SET_H_GR (FLD (f_operand2
), opval
);
11795 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11799 BI opval
= LTSI (tmp_tmpd
, 0);
11800 CPU (h_nbit
) = opval
;
11801 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11804 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11805 CPU (h_zbit
) = opval
;
11806 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11808 SET_H_CBIT_MOVE (0);
11809 SET_H_VBIT_MOVE (0);
11813 CPU (h_xbit
) = opval
;
11814 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11818 SET_H_INSN_PREFIXED_P (opval
);
11819 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11829 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
11831 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11832 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11833 #define FLD(f) abuf->fields.sfmt_addc_m.f
11834 int UNUSED written
= 0;
11835 IADDR UNUSED pc
= abuf
->addr
;
11836 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11841 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11842 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11845 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11847 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11848 SET_H_GR (FLD (f_operand2
), opval
);
11849 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11854 BI opval
= LTQI (tmp_tmpd
, 0);
11855 CPU (h_nbit
) = opval
;
11856 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11859 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11860 CPU (h_zbit
) = opval
;
11861 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11863 SET_H_CBIT_MOVE (0);
11864 SET_H_VBIT_MOVE (0);
11868 CPU (h_xbit
) = opval
;
11869 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11873 SET_H_INSN_PREFIXED_P (opval
);
11874 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11884 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
11886 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11887 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11888 #define FLD(f) abuf->fields.sfmt_addc_m.f
11889 int UNUSED written
= 0;
11890 IADDR UNUSED pc
= abuf
->addr
;
11891 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11896 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11897 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11900 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11902 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11903 SET_H_GR (FLD (f_operand2
), opval
);
11904 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11909 BI opval
= LTHI (tmp_tmpd
, 0);
11910 CPU (h_nbit
) = opval
;
11911 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11914 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11915 CPU (h_zbit
) = opval
;
11916 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11918 SET_H_CBIT_MOVE (0);
11919 SET_H_VBIT_MOVE (0);
11923 CPU (h_xbit
) = opval
;
11924 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11928 SET_H_INSN_PREFIXED_P (opval
);
11929 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11939 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
11941 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11943 #define FLD(f) abuf->fields.sfmt_addc_m.f
11944 int UNUSED written
= 0;
11945 IADDR UNUSED pc
= abuf
->addr
;
11946 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11951 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11952 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11954 SI opval
= tmp_tmpd
;
11955 SET_H_GR (FLD (f_operand2
), opval
);
11956 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11960 BI opval
= LTSI (tmp_tmpd
, 0);
11961 CPU (h_nbit
) = opval
;
11962 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11965 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11966 CPU (h_zbit
) = opval
;
11967 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11969 SET_H_CBIT_MOVE (0);
11970 SET_H_VBIT_MOVE (0);
11974 CPU (h_xbit
) = opval
;
11975 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11979 SET_H_INSN_PREFIXED_P (opval
);
11980 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11990 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
11992 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11993 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11994 #define FLD(f) abuf->fields.sfmt_asrq.f
11995 int UNUSED written
= 0;
11996 IADDR UNUSED pc
= abuf
->addr
;
11997 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12001 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
12003 SI opval
= tmp_tmpd
;
12004 SET_H_GR (FLD (f_operand2
), opval
);
12005 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12009 BI opval
= LTSI (tmp_tmpd
, 0);
12010 CPU (h_nbit
) = opval
;
12011 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12014 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12015 CPU (h_zbit
) = opval
;
12016 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12018 SET_H_CBIT_MOVE (0);
12019 SET_H_VBIT_MOVE (0);
12023 CPU (h_xbit
) = opval
;
12024 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12028 SET_H_INSN_PREFIXED_P (opval
);
12029 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12039 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
12041 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12042 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12043 #define FLD(f) abuf->fields.sfmt_muls_b.f
12044 int UNUSED written
= 0;
12045 IADDR UNUSED pc
= abuf
->addr
;
12046 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12051 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31)));
12054 BI opval
= LTSI (tmp_tmpd
, 0);
12055 CPU (h_nbit
) = opval
;
12056 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12059 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12060 CPU (h_zbit
) = opval
;
12061 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12063 SET_H_CBIT_MOVE (0);
12064 SET_H_VBIT_MOVE (0);
12068 CPU (h_xbit
) = opval
;
12069 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12073 SET_H_INSN_PREFIXED_P (opval
);
12074 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12084 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
12086 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12087 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12088 #define FLD(f) abuf->fields.sfmt_asrq.f
12089 int UNUSED written
= 0;
12090 IADDR UNUSED pc
= abuf
->addr
;
12091 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12095 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
12098 BI opval
= LTSI (tmp_tmpd
, 0);
12099 CPU (h_nbit
) = opval
;
12100 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12103 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12104 CPU (h_zbit
) = opval
;
12105 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12107 SET_H_CBIT_MOVE (0);
12108 SET_H_VBIT_MOVE (0);
12112 CPU (h_xbit
) = opval
;
12113 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12117 SET_H_INSN_PREFIXED_P (opval
);
12118 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12128 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
12130 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12131 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12132 #define FLD(f) abuf->fields.sfmt_setf.f
12133 int UNUSED written
= 0;
12134 IADDR UNUSED pc
= abuf
->addr
;
12135 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12139 tmp_tmp
= FLD (f_dstsrc
);
12140 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12143 CPU (h_cbit
) = opval
;
12144 written
|= (1 << 1);
12145 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12148 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12151 CPU (h_vbit
) = opval
;
12152 written
|= (1 << 7);
12153 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12156 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12159 CPU (h_zbit
) = opval
;
12160 written
|= (1 << 9);
12161 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12164 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12167 CPU (h_nbit
) = opval
;
12168 written
|= (1 << 3);
12169 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12172 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12175 CPU (h_xbit
) = opval
;
12176 written
|= (1 << 8);
12177 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12180 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12183 SET_H_IBIT (opval
);
12184 written
|= (1 << 2);
12185 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12188 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12191 SET_H_UBIT (opval
);
12192 written
|= (1 << 6);
12193 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12196 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12199 CPU (h_pbit
) = opval
;
12200 written
|= (1 << 4);
12201 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12206 SET_H_INSN_PREFIXED_P (opval
);
12207 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12209 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12212 CPU (h_xbit
) = opval
;
12213 written
|= (1 << 8);
12214 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12219 abuf
->written
= written
;
12224 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
12226 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12227 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12228 #define FLD(f) abuf->fields.sfmt_setf.f
12229 int UNUSED written
= 0;
12230 IADDR UNUSED pc
= abuf
->addr
;
12231 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12235 tmp_tmp
= FLD (f_dstsrc
);
12236 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12239 CPU (h_cbit
) = opval
;
12240 written
|= (1 << 1);
12241 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12244 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12247 CPU (h_vbit
) = opval
;
12248 written
|= (1 << 7);
12249 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12252 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12255 CPU (h_zbit
) = opval
;
12256 written
|= (1 << 9);
12257 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12260 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12263 CPU (h_nbit
) = opval
;
12264 written
|= (1 << 3);
12265 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12268 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12271 CPU (h_xbit
) = opval
;
12272 written
|= (1 << 8);
12273 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12276 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12279 SET_H_IBIT (opval
);
12280 written
|= (1 << 2);
12281 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12284 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12287 SET_H_UBIT (opval
);
12288 written
|= (1 << 6);
12289 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12292 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12295 CPU (h_pbit
) = opval
;
12296 written
|= (1 << 4);
12297 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12303 CPU (h_xbit
) = opval
;
12304 written
|= (1 << 8);
12305 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12309 SET_H_INSN_PREFIXED_P (opval
);
12310 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12315 abuf
->written
= written
;
12320 CASE (sem
, INSN_RFE
) : /* rfe */
12322 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12323 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12324 #define FLD(f) abuf->fields.sfmt_rfe.f
12325 int UNUSED written
= 0;
12326 IADDR UNUSED pc
= abuf
->addr
;
12327 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12335 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12336 tmp_keepmask
= 0xc0000000;
12337 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12338 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12339 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12341 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12342 SET_H_SR (((UINT
) 13), opval
);
12343 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12351 CASE (sem
, INSN_SFE
) : /* sfe */
12353 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12354 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12355 #define FLD(f) abuf->fields.sfmt_rfe.f
12356 int UNUSED written
= 0;
12357 IADDR UNUSED pc
= abuf
->addr
;
12358 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12363 tmp_savemask
= 0xc0000000;
12364 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12366 SI opval
= ORSI (ANDSI (tmp_savemask
, tmp_oldccs
), ANDSI (INVSI (tmp_savemask
), SLLSI (tmp_oldccs
, 10)));
12367 SET_H_SR (((UINT
) 13), opval
);
12368 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12376 CASE (sem
, INSN_RFG
) : /* rfg */
12378 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12379 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12380 #define FLD(f) abuf->fields.fmt_empty.f
12381 int UNUSED written
= 0;
12382 IADDR UNUSED pc
= abuf
->addr
;
12383 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12385 crisv32f_rfg_handler (current_cpu
, pc
);
12391 CASE (sem
, INSN_RFN
) : /* rfn */
12393 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12394 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12395 #define FLD(f) abuf->fields.sfmt_rfe.f
12396 int UNUSED written
= 0;
12397 IADDR UNUSED pc
= abuf
->addr
;
12398 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12407 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12408 tmp_keepmask
= 0xc0000000;
12409 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12410 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12411 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12413 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12414 SET_H_SR (((UINT
) 13), opval
);
12415 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12420 SET_H_MBIT (opval
);
12421 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
12429 CASE (sem
, INSN_HALT
) : /* halt */
12431 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12432 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12433 #define FLD(f) abuf->fields.fmt_empty.f
12434 int UNUSED written
= 0;
12435 IADDR UNUSED pc
= abuf
->addr
;
12437 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12440 USI opval
= crisv32f_halt_handler (current_cpu
, pc
);
12441 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12442 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12445 SEM_BRANCH_FINI (vpc
);
12450 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12452 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12453 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12454 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12455 int UNUSED written
= 0;
12456 IADDR UNUSED pc
= abuf
->addr
;
12458 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12462 tmp_truthval
= ({ SI tmp_tmpcond
;
12464 tmp_tmpcond
= FLD (f_operand2
);
12465 ; if (EQSI (tmp_tmpcond
, 0)) {
12466 tmp_condres
= NOTBI (CPU (h_cbit
));
12468 else if (EQSI (tmp_tmpcond
, 1)) {
12469 tmp_condres
= CPU (h_cbit
);
12471 else if (EQSI (tmp_tmpcond
, 2)) {
12472 tmp_condres
= NOTBI (CPU (h_zbit
));
12474 else if (EQSI (tmp_tmpcond
, 3)) {
12475 tmp_condres
= CPU (h_zbit
);
12477 else if (EQSI (tmp_tmpcond
, 4)) {
12478 tmp_condres
= NOTBI (CPU (h_vbit
));
12480 else if (EQSI (tmp_tmpcond
, 5)) {
12481 tmp_condres
= CPU (h_vbit
);
12483 else if (EQSI (tmp_tmpcond
, 6)) {
12484 tmp_condres
= NOTBI (CPU (h_nbit
));
12486 else if (EQSI (tmp_tmpcond
, 7)) {
12487 tmp_condres
= CPU (h_nbit
);
12489 else if (EQSI (tmp_tmpcond
, 8)) {
12490 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12492 else if (EQSI (tmp_tmpcond
, 9)) {
12493 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12495 else if (EQSI (tmp_tmpcond
, 10)) {
12496 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12498 else if (EQSI (tmp_tmpcond
, 11)) {
12499 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12501 else if (EQSI (tmp_tmpcond
, 12)) {
12502 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12504 else if (EQSI (tmp_tmpcond
, 13)) {
12505 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12507 else if (EQSI (tmp_tmpcond
, 14)) {
12510 else if (EQSI (tmp_tmpcond
, 15)) {
12511 tmp_condres
= CPU (h_pbit
);
12514 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12518 CPU (h_xbit
) = opval
;
12519 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12523 SET_H_INSN_PREFIXED_P (opval
);
12524 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12527 if (tmp_truthval
) {
12530 USI opval
= FLD (i_o_pcrel
);
12531 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12532 written
|= (1 << 8);
12533 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12539 abuf
->written
= written
;
12540 SEM_BRANCH_FINI (vpc
);
12545 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12547 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12548 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12549 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12550 int UNUSED written
= 0;
12551 IADDR UNUSED pc
= abuf
->addr
;
12553 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12559 CPU (h_xbit
) = opval
;
12560 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12564 SET_H_INSN_PREFIXED_P (opval
);
12565 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12570 USI opval
= FLD (i_o_pcrel
);
12571 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12572 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12577 SEM_BRANCH_FINI (vpc
);
12582 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12584 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12585 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12586 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12587 int UNUSED written
= 0;
12588 IADDR UNUSED pc
= abuf
->addr
;
12590 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12594 tmp_truthval
= ({ SI tmp_tmpcond
;
12596 tmp_tmpcond
= FLD (f_operand2
);
12597 ; if (EQSI (tmp_tmpcond
, 0)) {
12598 tmp_condres
= NOTBI (CPU (h_cbit
));
12600 else if (EQSI (tmp_tmpcond
, 1)) {
12601 tmp_condres
= CPU (h_cbit
);
12603 else if (EQSI (tmp_tmpcond
, 2)) {
12604 tmp_condres
= NOTBI (CPU (h_zbit
));
12606 else if (EQSI (tmp_tmpcond
, 3)) {
12607 tmp_condres
= CPU (h_zbit
);
12609 else if (EQSI (tmp_tmpcond
, 4)) {
12610 tmp_condres
= NOTBI (CPU (h_vbit
));
12612 else if (EQSI (tmp_tmpcond
, 5)) {
12613 tmp_condres
= CPU (h_vbit
);
12615 else if (EQSI (tmp_tmpcond
, 6)) {
12616 tmp_condres
= NOTBI (CPU (h_nbit
));
12618 else if (EQSI (tmp_tmpcond
, 7)) {
12619 tmp_condres
= CPU (h_nbit
);
12621 else if (EQSI (tmp_tmpcond
, 8)) {
12622 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12624 else if (EQSI (tmp_tmpcond
, 9)) {
12625 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12627 else if (EQSI (tmp_tmpcond
, 10)) {
12628 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12630 else if (EQSI (tmp_tmpcond
, 11)) {
12631 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12633 else if (EQSI (tmp_tmpcond
, 12)) {
12634 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12636 else if (EQSI (tmp_tmpcond
, 13)) {
12637 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12639 else if (EQSI (tmp_tmpcond
, 14)) {
12642 else if (EQSI (tmp_tmpcond
, 15)) {
12643 tmp_condres
= CPU (h_pbit
);
12646 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12650 CPU (h_xbit
) = opval
;
12651 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12655 SET_H_INSN_PREFIXED_P (opval
);
12656 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12659 if (tmp_truthval
) {
12662 USI opval
= FLD (i_o_word_pcrel
);
12663 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12664 written
|= (1 << 8);
12665 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12671 abuf
->written
= written
;
12672 SEM_BRANCH_FINI (vpc
);
12677 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12679 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12680 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12681 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12682 int UNUSED written
= 0;
12683 IADDR UNUSED pc
= abuf
->addr
;
12685 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12691 CPU (h_xbit
) = opval
;
12692 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12696 SET_H_INSN_PREFIXED_P (opval
);
12697 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12702 USI opval
= FLD (i_o_word_pcrel
);
12703 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12704 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12709 SEM_BRANCH_FINI (vpc
);
12714 CASE (sem
, INSN_JAS_R
) : /* jas ${Rs},${Pd} */
12716 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12717 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12718 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12719 int UNUSED written
= 0;
12720 IADDR UNUSED pc
= abuf
->addr
;
12722 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12728 CPU (h_xbit
) = opval
;
12729 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12733 SET_H_INSN_PREFIXED_P (opval
);
12734 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12737 if (ANDIF (EQSI (FLD (f_operand1
), 1), EQSI (FLD (f_operand2
), 11))) {
12738 cris_flush_simulator_decode_cache (current_cpu
, pc
);
12743 SI opval
= ADDSI (pc
, 4);
12744 SET_H_SR (FLD (f_operand2
), opval
);
12745 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12748 USI opval
= GET_H_GR (FLD (f_operand1
));
12749 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12750 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12756 SEM_BRANCH_FINI (vpc
);
12761 CASE (sem
, INSN_JAS_C
) : /* jas ${const32},${Pd} */
12763 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12764 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12765 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12766 int UNUSED written
= 0;
12767 IADDR UNUSED pc
= abuf
->addr
;
12769 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12775 CPU (h_xbit
) = opval
;
12776 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12780 SET_H_INSN_PREFIXED_P (opval
);
12781 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12787 SI opval
= ADDSI (pc
, 8);
12788 SET_H_SR (FLD (f_operand2
), opval
);
12789 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12792 USI opval
= FLD (f_indir_pc__dword
);
12793 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12794 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12800 SEM_BRANCH_FINI (vpc
);
12805 CASE (sem
, INSN_JUMP_P
) : /* jump ${Ps} */
12807 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12808 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12809 #define FLD(f) abuf->fields.sfmt_mcp.f
12810 int UNUSED written
= 0;
12811 IADDR UNUSED pc
= abuf
->addr
;
12813 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12819 CPU (h_xbit
) = opval
;
12820 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12824 SET_H_INSN_PREFIXED_P (opval
);
12825 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12830 USI opval
= GET_H_SR (FLD (f_operand2
));
12831 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12832 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12837 SEM_BRANCH_FINI (vpc
);
12842 CASE (sem
, INSN_BAS_C
) : /* bas ${const32},${Pd} */
12844 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12845 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12846 #define FLD(f) abuf->fields.sfmt_bas_c.f
12847 int UNUSED written
= 0;
12848 IADDR UNUSED pc
= abuf
->addr
;
12850 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12856 CPU (h_xbit
) = opval
;
12857 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12861 SET_H_INSN_PREFIXED_P (opval
);
12862 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12868 SI opval
= ADDSI (pc
, 8);
12869 SET_H_SR (FLD (f_operand2
), opval
);
12870 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12873 USI opval
= FLD (i_const32_pcrel
);
12874 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12875 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12881 SEM_BRANCH_FINI (vpc
);
12886 CASE (sem
, INSN_JASC_R
) : /* jasc ${Rs},${Pd} */
12888 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12889 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12890 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12891 int UNUSED written
= 0;
12892 IADDR UNUSED pc
= abuf
->addr
;
12894 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12900 CPU (h_xbit
) = opval
;
12901 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12905 SET_H_INSN_PREFIXED_P (opval
);
12906 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12912 SI opval
= ADDSI (pc
, 8);
12913 SET_H_SR (FLD (f_operand2
), opval
);
12914 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12917 USI opval
= GET_H_GR (FLD (f_operand1
));
12918 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12919 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12925 SEM_BRANCH_FINI (vpc
);
12930 CASE (sem
, INSN_JASC_C
) : /* jasc ${const32},${Pd} */
12932 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12933 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12934 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12935 int UNUSED written
= 0;
12936 IADDR UNUSED pc
= abuf
->addr
;
12938 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12944 CPU (h_xbit
) = opval
;
12945 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12949 SET_H_INSN_PREFIXED_P (opval
);
12950 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12956 SI opval
= ADDSI (pc
, 12);
12957 SET_H_SR (FLD (f_operand2
), opval
);
12958 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12961 USI opval
= FLD (f_indir_pc__dword
);
12962 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12963 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12969 SEM_BRANCH_FINI (vpc
);
12974 CASE (sem
, INSN_BASC_C
) : /* basc ${const32},${Pd} */
12976 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12978 #define FLD(f) abuf->fields.sfmt_bas_c.f
12979 int UNUSED written
= 0;
12980 IADDR UNUSED pc
= abuf
->addr
;
12982 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12988 CPU (h_xbit
) = opval
;
12989 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12993 SET_H_INSN_PREFIXED_P (opval
);
12994 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13000 SI opval
= ADDSI (pc
, 12);
13001 SET_H_SR (FLD (f_operand2
), opval
);
13002 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13005 USI opval
= FLD (i_const32_pcrel
);
13006 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13007 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13013 SEM_BRANCH_FINI (vpc
);
13018 CASE (sem
, INSN_BREAK
) : /* break $n */
13020 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13021 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13022 #define FLD(f) abuf->fields.sfmt_break.f
13023 int UNUSED written
= 0;
13024 IADDR UNUSED pc
= abuf
->addr
;
13026 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13032 CPU (h_xbit
) = opval
;
13033 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13037 SET_H_INSN_PREFIXED_P (opval
);
13038 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13042 USI opval
= crisv32f_break_handler (current_cpu
, FLD (f_u4
), pc
);
13043 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13044 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13048 SEM_BRANCH_FINI (vpc
);
13053 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
13055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13057 #define FLD(f) abuf->fields.sfmt_muls_b.f
13058 int UNUSED written
= 0;
13059 IADDR UNUSED pc
= abuf
->addr
;
13060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13066 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
13067 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13068 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13070 SI opval
= tmp_newval
;
13071 SET_H_GR (FLD (f_operand2
), opval
);
13072 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13076 BI opval
= LTSI (tmp_newval
, 0);
13077 CPU (h_nbit
) = opval
;
13078 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13081 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13082 CPU (h_zbit
) = opval
;
13083 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13085 SET_H_CBIT_MOVE (0);
13086 SET_H_VBIT_MOVE (0);
13090 CPU (h_xbit
) = opval
;
13091 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13095 SET_H_INSN_PREFIXED_P (opval
);
13096 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13106 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
13108 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13109 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13110 #define FLD(f) abuf->fields.sfmt_muls_b.f
13111 int UNUSED written
= 0;
13112 IADDR UNUSED pc
= abuf
->addr
;
13113 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13119 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
13120 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13121 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13123 SI opval
= tmp_newval
;
13124 SET_H_GR (FLD (f_operand2
), opval
);
13125 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13129 BI opval
= LTSI (tmp_newval
, 0);
13130 CPU (h_nbit
) = opval
;
13131 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13134 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13135 CPU (h_zbit
) = opval
;
13136 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13138 SET_H_CBIT_MOVE (0);
13139 SET_H_VBIT_MOVE (0);
13143 CPU (h_xbit
) = opval
;
13144 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13148 SET_H_INSN_PREFIXED_P (opval
);
13149 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13159 CASE (sem
, INSN_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
13161 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13162 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13163 #define FLD(f) abuf->fields.sfmt_muls_b.f
13164 int UNUSED written
= 0;
13165 IADDR UNUSED pc
= abuf
->addr
;
13166 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13172 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
13173 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13174 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13176 SI opval
= tmp_newval
;
13177 SET_H_GR (FLD (f_operand2
), opval
);
13178 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13182 BI opval
= LTSI (tmp_newval
, 0);
13183 CPU (h_nbit
) = opval
;
13184 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13187 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13188 CPU (h_zbit
) = opval
;
13189 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13191 SET_H_CBIT_MOVE (0);
13192 SET_H_VBIT_MOVE (0);
13196 CPU (h_xbit
) = opval
;
13197 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13201 SET_H_INSN_PREFIXED_P (opval
);
13202 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13212 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
13214 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13215 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13216 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13217 int UNUSED written
= 0;
13218 IADDR UNUSED pc
= abuf
->addr
;
13219 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13225 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
13226 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13227 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13229 SI opval
= tmp_newval
;
13230 SET_H_GR (FLD (f_operand2
), opval
);
13231 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13235 BI opval
= LTSI (tmp_newval
, 0);
13236 CPU (h_nbit
) = opval
;
13237 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13240 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13241 CPU (h_zbit
) = opval
;
13242 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13244 SET_H_CBIT_MOVE (0);
13245 SET_H_VBIT_MOVE (0);
13249 CPU (h_xbit
) = opval
;
13250 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13254 SET_H_INSN_PREFIXED_P (opval
);
13255 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13265 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
13267 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13269 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13270 int UNUSED written
= 0;
13271 IADDR UNUSED pc
= abuf
->addr
;
13272 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13278 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
13279 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13280 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13282 SI opval
= tmp_newval
;
13283 SET_H_GR (FLD (f_operand2
), opval
);
13284 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13288 BI opval
= LTSI (tmp_newval
, 0);
13289 CPU (h_nbit
) = opval
;
13290 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13293 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13294 CPU (h_zbit
) = opval
;
13295 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13297 SET_H_CBIT_MOVE (0);
13298 SET_H_VBIT_MOVE (0);
13302 CPU (h_xbit
) = opval
;
13303 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13307 SET_H_INSN_PREFIXED_P (opval
);
13308 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13318 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13320 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13321 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13322 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13323 int UNUSED written
= 0;
13324 IADDR UNUSED pc
= abuf
->addr
;
13325 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13331 tmp_tmpops
= FLD (f_indir_pc__dword
);
13332 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13333 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13335 SI opval
= tmp_newval
;
13336 SET_H_GR (FLD (f_operand2
), opval
);
13337 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13341 BI opval
= LTSI (tmp_newval
, 0);
13342 CPU (h_nbit
) = opval
;
13343 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13346 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13347 CPU (h_zbit
) = opval
;
13348 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13350 SET_H_CBIT_MOVE (0);
13351 SET_H_VBIT_MOVE (0);
13355 CPU (h_xbit
) = opval
;
13356 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13360 SET_H_INSN_PREFIXED_P (opval
);
13361 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13371 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13373 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13374 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13375 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13376 int UNUSED written
= 0;
13377 IADDR UNUSED pc
= abuf
->addr
;
13378 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13382 tmp_truthval
= ({ SI tmp_tmpcond
;
13384 tmp_tmpcond
= FLD (f_operand2
);
13385 ; if (EQSI (tmp_tmpcond
, 0)) {
13386 tmp_condres
= NOTBI (CPU (h_cbit
));
13388 else if (EQSI (tmp_tmpcond
, 1)) {
13389 tmp_condres
= CPU (h_cbit
);
13391 else if (EQSI (tmp_tmpcond
, 2)) {
13392 tmp_condres
= NOTBI (CPU (h_zbit
));
13394 else if (EQSI (tmp_tmpcond
, 3)) {
13395 tmp_condres
= CPU (h_zbit
);
13397 else if (EQSI (tmp_tmpcond
, 4)) {
13398 tmp_condres
= NOTBI (CPU (h_vbit
));
13400 else if (EQSI (tmp_tmpcond
, 5)) {
13401 tmp_condres
= CPU (h_vbit
);
13403 else if (EQSI (tmp_tmpcond
, 6)) {
13404 tmp_condres
= NOTBI (CPU (h_nbit
));
13406 else if (EQSI (tmp_tmpcond
, 7)) {
13407 tmp_condres
= CPU (h_nbit
);
13409 else if (EQSI (tmp_tmpcond
, 8)) {
13410 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13412 else if (EQSI (tmp_tmpcond
, 9)) {
13413 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13415 else if (EQSI (tmp_tmpcond
, 10)) {
13416 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13418 else if (EQSI (tmp_tmpcond
, 11)) {
13419 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13421 else if (EQSI (tmp_tmpcond
, 12)) {
13422 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13424 else if (EQSI (tmp_tmpcond
, 13)) {
13425 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13427 else if (EQSI (tmp_tmpcond
, 14)) {
13430 else if (EQSI (tmp_tmpcond
, 15)) {
13431 tmp_condres
= CPU (h_pbit
);
13435 SI opval
= ZEXTBISI (tmp_truthval
);
13436 SET_H_GR (FLD (f_operand1
), opval
);
13437 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13442 CPU (h_xbit
) = opval
;
13443 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13447 SET_H_INSN_PREFIXED_P (opval
);
13448 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13457 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13459 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13460 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13461 #define FLD(f) abuf->fields.sfmt_muls_b.f
13462 int UNUSED written
= 0;
13463 IADDR UNUSED pc
= abuf
->addr
;
13464 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13469 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13472 if (GESI (tmp_tmp
, 0)) {
13474 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13475 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13478 if (GESI (tmp_tmp
, 0)) {
13480 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13481 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13484 if (GESI (tmp_tmp
, 0)) {
13486 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13487 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13490 if (GESI (tmp_tmp
, 0)) {
13492 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13493 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13496 if (GESI (tmp_tmp
, 0)) {
13498 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13499 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13502 if (GESI (tmp_tmp
, 0)) {
13504 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13505 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13508 if (GESI (tmp_tmp
, 0)) {
13510 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13511 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13514 if (GESI (tmp_tmp
, 0)) {
13516 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13517 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13520 if (GESI (tmp_tmp
, 0)) {
13522 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13523 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13526 if (GESI (tmp_tmp
, 0)) {
13528 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13529 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13532 if (GESI (tmp_tmp
, 0)) {
13534 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13535 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13538 if (GESI (tmp_tmp
, 0)) {
13540 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13541 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13544 if (GESI (tmp_tmp
, 0)) {
13546 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13547 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13550 if (GESI (tmp_tmp
, 0)) {
13552 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13553 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13556 if (GESI (tmp_tmp
, 0)) {
13558 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13559 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13562 if (GESI (tmp_tmp
, 0)) {
13564 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13565 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13568 if (GESI (tmp_tmp
, 0)) {
13570 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13571 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13574 if (GESI (tmp_tmp
, 0)) {
13576 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13577 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13580 if (GESI (tmp_tmp
, 0)) {
13582 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13583 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13586 if (GESI (tmp_tmp
, 0)) {
13588 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13589 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13592 if (GESI (tmp_tmp
, 0)) {
13594 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13595 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13598 if (GESI (tmp_tmp
, 0)) {
13600 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13601 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13604 if (GESI (tmp_tmp
, 0)) {
13606 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13607 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13610 if (GESI (tmp_tmp
, 0)) {
13612 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13613 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13616 if (GESI (tmp_tmp
, 0)) {
13618 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13619 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13622 if (GESI (tmp_tmp
, 0)) {
13624 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13625 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13628 if (GESI (tmp_tmp
, 0)) {
13630 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13631 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13634 if (GESI (tmp_tmp
, 0)) {
13636 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13637 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13640 if (GESI (tmp_tmp
, 0)) {
13642 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13643 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13646 if (GESI (tmp_tmp
, 0)) {
13648 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13649 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13652 if (GESI (tmp_tmp
, 0)) {
13654 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13655 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13658 if (GESI (tmp_tmp
, 0)) {
13660 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13661 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13666 SI opval
= tmp_tmpd
;
13667 SET_H_GR (FLD (f_operand2
), opval
);
13668 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13672 BI opval
= LTSI (tmp_tmpd
, 0);
13673 CPU (h_nbit
) = opval
;
13674 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13677 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13678 CPU (h_zbit
) = opval
;
13679 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13681 SET_H_CBIT_MOVE (0);
13682 SET_H_VBIT_MOVE (0);
13686 CPU (h_xbit
) = opval
;
13687 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13691 SET_H_INSN_PREFIXED_P (opval
);
13692 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13702 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13704 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13705 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13706 #define FLD(f) abuf->fields.sfmt_addoq.f
13707 int UNUSED written
= 0;
13708 IADDR UNUSED pc
= abuf
->addr
;
13709 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13713 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13714 SET_H_PREFIXREG_V32 (opval
);
13715 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13719 SET_H_INSN_PREFIXED_P (opval
);
13720 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13728 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13730 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13731 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13732 #define FLD(f) abuf->fields.sfmt_addc_m.f
13733 int UNUSED written
= 0;
13734 IADDR UNUSED pc
= abuf
->addr
;
13735 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13739 tmp_tmps
= ({ SI tmp_addr
;
13742 tmp_postinc
= FLD (f_memmode
);
13743 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13744 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13745 ; if (NEBI (tmp_postinc
, 0)) {
13747 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13748 tmp_addr
= ADDSI (tmp_addr
, 1);
13751 SI opval
= tmp_addr
;
13752 SET_H_GR (FLD (f_operand1
), opval
);
13753 written
|= (1 << 6);
13754 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13760 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13761 SET_H_PREFIXREG_V32 (opval
);
13762 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13766 SET_H_INSN_PREFIXED_P (opval
);
13767 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13771 abuf
->written
= written
;
13776 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13778 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13779 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13780 #define FLD(f) abuf->fields.sfmt_addc_m.f
13781 int UNUSED written
= 0;
13782 IADDR UNUSED pc
= abuf
->addr
;
13783 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13787 tmp_tmps
= ({ SI tmp_addr
;
13790 tmp_postinc
= FLD (f_memmode
);
13791 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13792 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
13793 ; if (NEBI (tmp_postinc
, 0)) {
13795 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13796 tmp_addr
= ADDSI (tmp_addr
, 2);
13799 SI opval
= tmp_addr
;
13800 SET_H_GR (FLD (f_operand1
), opval
);
13801 written
|= (1 << 6);
13802 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13808 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
13809 SET_H_PREFIXREG_V32 (opval
);
13810 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13814 SET_H_INSN_PREFIXED_P (opval
);
13815 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13819 abuf
->written
= written
;
13824 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13826 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13827 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13828 #define FLD(f) abuf->fields.sfmt_addc_m.f
13829 int UNUSED written
= 0;
13830 IADDR UNUSED pc
= abuf
->addr
;
13831 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13835 tmp_tmps
= ({ SI tmp_addr
;
13838 tmp_postinc
= FLD (f_memmode
);
13839 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13840 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13841 ; if (NEBI (tmp_postinc
, 0)) {
13843 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13844 tmp_addr
= ADDSI (tmp_addr
, 4);
13847 SI opval
= tmp_addr
;
13848 SET_H_GR (FLD (f_operand1
), opval
);
13849 written
|= (1 << 6);
13850 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13856 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
13857 SET_H_PREFIXREG_V32 (opval
);
13858 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13862 SET_H_INSN_PREFIXED_P (opval
);
13863 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13867 abuf
->written
= written
;
13872 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
13874 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13875 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13876 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13877 int UNUSED written
= 0;
13878 IADDR UNUSED pc
= abuf
->addr
;
13879 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13883 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
13884 SET_H_PREFIXREG_V32 (opval
);
13885 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13889 SET_H_INSN_PREFIXED_P (opval
);
13890 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13898 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
13900 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13901 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13902 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13903 int UNUSED written
= 0;
13904 IADDR UNUSED pc
= abuf
->addr
;
13905 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13909 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
13910 SET_H_PREFIXREG_V32 (opval
);
13911 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13915 SET_H_INSN_PREFIXED_P (opval
);
13916 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13924 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
13926 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13927 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13928 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13929 int UNUSED written
= 0;
13930 IADDR UNUSED pc
= abuf
->addr
;
13931 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13935 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
13936 SET_H_PREFIXREG_V32 (opval
);
13937 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13941 SET_H_INSN_PREFIXED_P (opval
);
13942 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13950 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13952 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13953 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13954 #define FLD(f) abuf->fields.sfmt_muls_b.f
13955 int UNUSED written
= 0;
13956 IADDR UNUSED pc
= abuf
->addr
;
13957 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13961 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13962 SET_H_PREFIXREG_V32 (opval
);
13963 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13967 SET_H_INSN_PREFIXED_P (opval
);
13968 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13976 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13978 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13979 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13980 #define FLD(f) abuf->fields.sfmt_muls_b.f
13981 int UNUSED written
= 0;
13982 IADDR UNUSED pc
= abuf
->addr
;
13983 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13987 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
13988 SET_H_PREFIXREG_V32 (opval
);
13989 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13993 SET_H_INSN_PREFIXED_P (opval
);
13994 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14002 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14004 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14005 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14006 #define FLD(f) abuf->fields.sfmt_muls_b.f
14007 int UNUSED written
= 0;
14008 IADDR UNUSED pc
= abuf
->addr
;
14009 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14013 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14014 SET_H_PREFIXREG_V32 (opval
);
14015 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14019 SET_H_INSN_PREFIXED_P (opval
);
14020 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14028 CASE (sem
, INSN_FIDXI
) : /* fidxi [$Rs] */
14030 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14031 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14032 #define FLD(f) abuf->fields.sfmt_mcp.f
14033 int UNUSED written
= 0;
14034 IADDR UNUSED pc
= abuf
->addr
;
14036 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14039 USI opval
= crisv32f_fidxi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14040 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14041 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14044 SEM_BRANCH_FINI (vpc
);
14049 CASE (sem
, INSN_FTAGI
) : /* fidxi [$Rs] */
14051 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14052 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14053 #define FLD(f) abuf->fields.sfmt_mcp.f
14054 int UNUSED written
= 0;
14055 IADDR UNUSED pc
= abuf
->addr
;
14057 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14060 USI opval
= crisv32f_ftagi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14061 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14062 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14065 SEM_BRANCH_FINI (vpc
);
14070 CASE (sem
, INSN_FIDXD
) : /* fidxd [$Rs] */
14072 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14073 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14074 #define FLD(f) abuf->fields.sfmt_mcp.f
14075 int UNUSED written
= 0;
14076 IADDR UNUSED pc
= abuf
->addr
;
14078 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14081 USI opval
= crisv32f_fidxd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14082 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14083 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14086 SEM_BRANCH_FINI (vpc
);
14091 CASE (sem
, INSN_FTAGD
) : /* ftagd [$Rs] */
14093 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14095 #define FLD(f) abuf->fields.sfmt_mcp.f
14096 int UNUSED written
= 0;
14097 IADDR UNUSED pc
= abuf
->addr
;
14099 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14102 USI opval
= crisv32f_ftagd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14103 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14104 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14107 SEM_BRANCH_FINI (vpc
);
14114 ENDSWITCH (sem
) /* End of semantic switch. */
14116 /* At this point `vpc' contains the next insn to execute. */
14119 #undef DEFINE_SWITCH
14120 #endif /* DEFINE_SWITCH */