1 /* Simulator instruction semantics for crisv10f.
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 { CRISV10F_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
36 { CRISV10F_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
37 { CRISV10F_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
38 { CRISV10F_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
39 { CRISV10F_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
40 { CRISV10F_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
41 { CRISV10F_INSN_NOP
, && case_sem_INSN_NOP
},
42 { CRISV10F_INSN_MOVE_B_R
, && case_sem_INSN_MOVE_B_R
},
43 { CRISV10F_INSN_MOVE_W_R
, && case_sem_INSN_MOVE_W_R
},
44 { CRISV10F_INSN_MOVE_D_R
, && case_sem_INSN_MOVE_D_R
},
45 { CRISV10F_INSN_MOVEPCR
, && case_sem_INSN_MOVEPCR
},
46 { CRISV10F_INSN_MOVEQ
, && case_sem_INSN_MOVEQ
},
47 { CRISV10F_INSN_MOVS_B_R
, && case_sem_INSN_MOVS_B_R
},
48 { CRISV10F_INSN_MOVS_W_R
, && case_sem_INSN_MOVS_W_R
},
49 { CRISV10F_INSN_MOVU_B_R
, && case_sem_INSN_MOVU_B_R
},
50 { CRISV10F_INSN_MOVU_W_R
, && case_sem_INSN_MOVU_W_R
},
51 { CRISV10F_INSN_MOVECBR
, && case_sem_INSN_MOVECBR
},
52 { CRISV10F_INSN_MOVECWR
, && case_sem_INSN_MOVECWR
},
53 { CRISV10F_INSN_MOVECDR
, && case_sem_INSN_MOVECDR
},
54 { CRISV10F_INSN_MOVSCBR
, && case_sem_INSN_MOVSCBR
},
55 { CRISV10F_INSN_MOVSCWR
, && case_sem_INSN_MOVSCWR
},
56 { CRISV10F_INSN_MOVUCBR
, && case_sem_INSN_MOVUCBR
},
57 { CRISV10F_INSN_MOVUCWR
, && case_sem_INSN_MOVUCWR
},
58 { CRISV10F_INSN_ADDQ
, && case_sem_INSN_ADDQ
},
59 { CRISV10F_INSN_SUBQ
, && case_sem_INSN_SUBQ
},
60 { CRISV10F_INSN_CMP_R_B_R
, && case_sem_INSN_CMP_R_B_R
},
61 { CRISV10F_INSN_CMP_R_W_R
, && case_sem_INSN_CMP_R_W_R
},
62 { CRISV10F_INSN_CMP_R_D_R
, && case_sem_INSN_CMP_R_D_R
},
63 { CRISV10F_INSN_CMP_M_B_M
, && case_sem_INSN_CMP_M_B_M
},
64 { CRISV10F_INSN_CMP_M_W_M
, && case_sem_INSN_CMP_M_W_M
},
65 { CRISV10F_INSN_CMP_M_D_M
, && case_sem_INSN_CMP_M_D_M
},
66 { CRISV10F_INSN_CMPCBR
, && case_sem_INSN_CMPCBR
},
67 { CRISV10F_INSN_CMPCWR
, && case_sem_INSN_CMPCWR
},
68 { CRISV10F_INSN_CMPCDR
, && case_sem_INSN_CMPCDR
},
69 { CRISV10F_INSN_CMPQ
, && case_sem_INSN_CMPQ
},
70 { CRISV10F_INSN_CMPS_M_B_M
, && case_sem_INSN_CMPS_M_B_M
},
71 { CRISV10F_INSN_CMPS_M_W_M
, && case_sem_INSN_CMPS_M_W_M
},
72 { CRISV10F_INSN_CMPSCBR
, && case_sem_INSN_CMPSCBR
},
73 { CRISV10F_INSN_CMPSCWR
, && case_sem_INSN_CMPSCWR
},
74 { CRISV10F_INSN_CMPU_M_B_M
, && case_sem_INSN_CMPU_M_B_M
},
75 { CRISV10F_INSN_CMPU_M_W_M
, && case_sem_INSN_CMPU_M_W_M
},
76 { CRISV10F_INSN_CMPUCBR
, && case_sem_INSN_CMPUCBR
},
77 { CRISV10F_INSN_CMPUCWR
, && case_sem_INSN_CMPUCWR
},
78 { CRISV10F_INSN_MOVE_M_B_M
, && case_sem_INSN_MOVE_M_B_M
},
79 { CRISV10F_INSN_MOVE_M_W_M
, && case_sem_INSN_MOVE_M_W_M
},
80 { CRISV10F_INSN_MOVE_M_D_M
, && case_sem_INSN_MOVE_M_D_M
},
81 { CRISV10F_INSN_MOVS_M_B_M
, && case_sem_INSN_MOVS_M_B_M
},
82 { CRISV10F_INSN_MOVS_M_W_M
, && case_sem_INSN_MOVS_M_W_M
},
83 { CRISV10F_INSN_MOVU_M_B_M
, && case_sem_INSN_MOVU_M_B_M
},
84 { CRISV10F_INSN_MOVU_M_W_M
, && case_sem_INSN_MOVU_M_W_M
},
85 { CRISV10F_INSN_MOVE_R_SPRV10
, && case_sem_INSN_MOVE_R_SPRV10
},
86 { CRISV10F_INSN_MOVE_SPR_RV10
, && case_sem_INSN_MOVE_SPR_RV10
},
87 { CRISV10F_INSN_RET_TYPE
, && case_sem_INSN_RET_TYPE
},
88 { CRISV10F_INSN_MOVE_M_SPRV10
, && case_sem_INSN_MOVE_M_SPRV10
},
89 { CRISV10F_INSN_MOVE_C_SPRV10_P0
, && case_sem_INSN_MOVE_C_SPRV10_P0
},
90 { CRISV10F_INSN_MOVE_C_SPRV10_P1
, && case_sem_INSN_MOVE_C_SPRV10_P1
},
91 { CRISV10F_INSN_MOVE_C_SPRV10_P4
, && case_sem_INSN_MOVE_C_SPRV10_P4
},
92 { CRISV10F_INSN_MOVE_C_SPRV10_P5
, && case_sem_INSN_MOVE_C_SPRV10_P5
},
93 { CRISV10F_INSN_MOVE_C_SPRV10_P8
, && case_sem_INSN_MOVE_C_SPRV10_P8
},
94 { CRISV10F_INSN_MOVE_C_SPRV10_P9
, && case_sem_INSN_MOVE_C_SPRV10_P9
},
95 { CRISV10F_INSN_MOVE_C_SPRV10_P10
, && case_sem_INSN_MOVE_C_SPRV10_P10
},
96 { CRISV10F_INSN_MOVE_C_SPRV10_P11
, && case_sem_INSN_MOVE_C_SPRV10_P11
},
97 { CRISV10F_INSN_MOVE_C_SPRV10_P12
, && case_sem_INSN_MOVE_C_SPRV10_P12
},
98 { CRISV10F_INSN_MOVE_C_SPRV10_P13
, && case_sem_INSN_MOVE_C_SPRV10_P13
},
99 { CRISV10F_INSN_MOVE_C_SPRV10_P7
, && case_sem_INSN_MOVE_C_SPRV10_P7
},
100 { CRISV10F_INSN_MOVE_C_SPRV10_P14
, && case_sem_INSN_MOVE_C_SPRV10_P14
},
101 { CRISV10F_INSN_MOVE_C_SPRV10_P15
, && case_sem_INSN_MOVE_C_SPRV10_P15
},
102 { CRISV10F_INSN_MOVE_SPR_MV10
, && case_sem_INSN_MOVE_SPR_MV10
},
103 { CRISV10F_INSN_SBFS
, && case_sem_INSN_SBFS
},
104 { CRISV10F_INSN_MOVEM_R_M
, && case_sem_INSN_MOVEM_R_M
},
105 { CRISV10F_INSN_MOVEM_M_R
, && case_sem_INSN_MOVEM_M_R
},
106 { CRISV10F_INSN_MOVEM_M_PC
, && case_sem_INSN_MOVEM_M_PC
},
107 { CRISV10F_INSN_ADD_B_R
, && case_sem_INSN_ADD_B_R
},
108 { CRISV10F_INSN_ADD_W_R
, && case_sem_INSN_ADD_W_R
},
109 { CRISV10F_INSN_ADD_D_R
, && case_sem_INSN_ADD_D_R
},
110 { CRISV10F_INSN_ADD_M_B_M
, && case_sem_INSN_ADD_M_B_M
},
111 { CRISV10F_INSN_ADD_M_W_M
, && case_sem_INSN_ADD_M_W_M
},
112 { CRISV10F_INSN_ADD_M_D_M
, && case_sem_INSN_ADD_M_D_M
},
113 { CRISV10F_INSN_ADDCBR
, && case_sem_INSN_ADDCBR
},
114 { CRISV10F_INSN_ADDCWR
, && case_sem_INSN_ADDCWR
},
115 { CRISV10F_INSN_ADDCDR
, && case_sem_INSN_ADDCDR
},
116 { CRISV10F_INSN_ADDCPC
, && case_sem_INSN_ADDCPC
},
117 { CRISV10F_INSN_ADDS_B_R
, && case_sem_INSN_ADDS_B_R
},
118 { CRISV10F_INSN_ADDS_W_R
, && case_sem_INSN_ADDS_W_R
},
119 { CRISV10F_INSN_ADDS_M_B_M
, && case_sem_INSN_ADDS_M_B_M
},
120 { CRISV10F_INSN_ADDS_M_W_M
, && case_sem_INSN_ADDS_M_W_M
},
121 { CRISV10F_INSN_ADDSCBR
, && case_sem_INSN_ADDSCBR
},
122 { CRISV10F_INSN_ADDSCWR
, && case_sem_INSN_ADDSCWR
},
123 { CRISV10F_INSN_ADDSPCPC
, && case_sem_INSN_ADDSPCPC
},
124 { CRISV10F_INSN_ADDU_B_R
, && case_sem_INSN_ADDU_B_R
},
125 { CRISV10F_INSN_ADDU_W_R
, && case_sem_INSN_ADDU_W_R
},
126 { CRISV10F_INSN_ADDU_M_B_M
, && case_sem_INSN_ADDU_M_B_M
},
127 { CRISV10F_INSN_ADDU_M_W_M
, && case_sem_INSN_ADDU_M_W_M
},
128 { CRISV10F_INSN_ADDUCBR
, && case_sem_INSN_ADDUCBR
},
129 { CRISV10F_INSN_ADDUCWR
, && case_sem_INSN_ADDUCWR
},
130 { CRISV10F_INSN_SUB_B_R
, && case_sem_INSN_SUB_B_R
},
131 { CRISV10F_INSN_SUB_W_R
, && case_sem_INSN_SUB_W_R
},
132 { CRISV10F_INSN_SUB_D_R
, && case_sem_INSN_SUB_D_R
},
133 { CRISV10F_INSN_SUB_M_B_M
, && case_sem_INSN_SUB_M_B_M
},
134 { CRISV10F_INSN_SUB_M_W_M
, && case_sem_INSN_SUB_M_W_M
},
135 { CRISV10F_INSN_SUB_M_D_M
, && case_sem_INSN_SUB_M_D_M
},
136 { CRISV10F_INSN_SUBCBR
, && case_sem_INSN_SUBCBR
},
137 { CRISV10F_INSN_SUBCWR
, && case_sem_INSN_SUBCWR
},
138 { CRISV10F_INSN_SUBCDR
, && case_sem_INSN_SUBCDR
},
139 { CRISV10F_INSN_SUBS_B_R
, && case_sem_INSN_SUBS_B_R
},
140 { CRISV10F_INSN_SUBS_W_R
, && case_sem_INSN_SUBS_W_R
},
141 { CRISV10F_INSN_SUBS_M_B_M
, && case_sem_INSN_SUBS_M_B_M
},
142 { CRISV10F_INSN_SUBS_M_W_M
, && case_sem_INSN_SUBS_M_W_M
},
143 { CRISV10F_INSN_SUBSCBR
, && case_sem_INSN_SUBSCBR
},
144 { CRISV10F_INSN_SUBSCWR
, && case_sem_INSN_SUBSCWR
},
145 { CRISV10F_INSN_SUBU_B_R
, && case_sem_INSN_SUBU_B_R
},
146 { CRISV10F_INSN_SUBU_W_R
, && case_sem_INSN_SUBU_W_R
},
147 { CRISV10F_INSN_SUBU_M_B_M
, && case_sem_INSN_SUBU_M_B_M
},
148 { CRISV10F_INSN_SUBU_M_W_M
, && case_sem_INSN_SUBU_M_W_M
},
149 { CRISV10F_INSN_SUBUCBR
, && case_sem_INSN_SUBUCBR
},
150 { CRISV10F_INSN_SUBUCWR
, && case_sem_INSN_SUBUCWR
},
151 { CRISV10F_INSN_ADDI_B_R
, && case_sem_INSN_ADDI_B_R
},
152 { CRISV10F_INSN_ADDI_W_R
, && case_sem_INSN_ADDI_W_R
},
153 { CRISV10F_INSN_ADDI_D_R
, && case_sem_INSN_ADDI_D_R
},
154 { CRISV10F_INSN_NEG_B_R
, && case_sem_INSN_NEG_B_R
},
155 { CRISV10F_INSN_NEG_W_R
, && case_sem_INSN_NEG_W_R
},
156 { CRISV10F_INSN_NEG_D_R
, && case_sem_INSN_NEG_D_R
},
157 { CRISV10F_INSN_TEST_M_B_M
, && case_sem_INSN_TEST_M_B_M
},
158 { CRISV10F_INSN_TEST_M_W_M
, && case_sem_INSN_TEST_M_W_M
},
159 { CRISV10F_INSN_TEST_M_D_M
, && case_sem_INSN_TEST_M_D_M
},
160 { CRISV10F_INSN_MOVE_R_M_B_M
, && case_sem_INSN_MOVE_R_M_B_M
},
161 { CRISV10F_INSN_MOVE_R_M_W_M
, && case_sem_INSN_MOVE_R_M_W_M
},
162 { CRISV10F_INSN_MOVE_R_M_D_M
, && case_sem_INSN_MOVE_R_M_D_M
},
163 { CRISV10F_INSN_MULS_B
, && case_sem_INSN_MULS_B
},
164 { CRISV10F_INSN_MULS_W
, && case_sem_INSN_MULS_W
},
165 { CRISV10F_INSN_MULS_D
, && case_sem_INSN_MULS_D
},
166 { CRISV10F_INSN_MULU_B
, && case_sem_INSN_MULU_B
},
167 { CRISV10F_INSN_MULU_W
, && case_sem_INSN_MULU_W
},
168 { CRISV10F_INSN_MULU_D
, && case_sem_INSN_MULU_D
},
169 { CRISV10F_INSN_MSTEP
, && case_sem_INSN_MSTEP
},
170 { CRISV10F_INSN_DSTEP
, && case_sem_INSN_DSTEP
},
171 { CRISV10F_INSN_ABS
, && case_sem_INSN_ABS
},
172 { CRISV10F_INSN_AND_B_R
, && case_sem_INSN_AND_B_R
},
173 { CRISV10F_INSN_AND_W_R
, && case_sem_INSN_AND_W_R
},
174 { CRISV10F_INSN_AND_D_R
, && case_sem_INSN_AND_D_R
},
175 { CRISV10F_INSN_AND_M_B_M
, && case_sem_INSN_AND_M_B_M
},
176 { CRISV10F_INSN_AND_M_W_M
, && case_sem_INSN_AND_M_W_M
},
177 { CRISV10F_INSN_AND_M_D_M
, && case_sem_INSN_AND_M_D_M
},
178 { CRISV10F_INSN_ANDCBR
, && case_sem_INSN_ANDCBR
},
179 { CRISV10F_INSN_ANDCWR
, && case_sem_INSN_ANDCWR
},
180 { CRISV10F_INSN_ANDCDR
, && case_sem_INSN_ANDCDR
},
181 { CRISV10F_INSN_ANDQ
, && case_sem_INSN_ANDQ
},
182 { CRISV10F_INSN_ORR_B_R
, && case_sem_INSN_ORR_B_R
},
183 { CRISV10F_INSN_ORR_W_R
, && case_sem_INSN_ORR_W_R
},
184 { CRISV10F_INSN_ORR_D_R
, && case_sem_INSN_ORR_D_R
},
185 { CRISV10F_INSN_OR_M_B_M
, && case_sem_INSN_OR_M_B_M
},
186 { CRISV10F_INSN_OR_M_W_M
, && case_sem_INSN_OR_M_W_M
},
187 { CRISV10F_INSN_OR_M_D_M
, && case_sem_INSN_OR_M_D_M
},
188 { CRISV10F_INSN_ORCBR
, && case_sem_INSN_ORCBR
},
189 { CRISV10F_INSN_ORCWR
, && case_sem_INSN_ORCWR
},
190 { CRISV10F_INSN_ORCDR
, && case_sem_INSN_ORCDR
},
191 { CRISV10F_INSN_ORQ
, && case_sem_INSN_ORQ
},
192 { CRISV10F_INSN_XOR
, && case_sem_INSN_XOR
},
193 { CRISV10F_INSN_SWAP
, && case_sem_INSN_SWAP
},
194 { CRISV10F_INSN_ASRR_B_R
, && case_sem_INSN_ASRR_B_R
},
195 { CRISV10F_INSN_ASRR_W_R
, && case_sem_INSN_ASRR_W_R
},
196 { CRISV10F_INSN_ASRR_D_R
, && case_sem_INSN_ASRR_D_R
},
197 { CRISV10F_INSN_ASRQ
, && case_sem_INSN_ASRQ
},
198 { CRISV10F_INSN_LSRR_B_R
, && case_sem_INSN_LSRR_B_R
},
199 { CRISV10F_INSN_LSRR_W_R
, && case_sem_INSN_LSRR_W_R
},
200 { CRISV10F_INSN_LSRR_D_R
, && case_sem_INSN_LSRR_D_R
},
201 { CRISV10F_INSN_LSRQ
, && case_sem_INSN_LSRQ
},
202 { CRISV10F_INSN_LSLR_B_R
, && case_sem_INSN_LSLR_B_R
},
203 { CRISV10F_INSN_LSLR_W_R
, && case_sem_INSN_LSLR_W_R
},
204 { CRISV10F_INSN_LSLR_D_R
, && case_sem_INSN_LSLR_D_R
},
205 { CRISV10F_INSN_LSLQ
, && case_sem_INSN_LSLQ
},
206 { CRISV10F_INSN_BTST
, && case_sem_INSN_BTST
},
207 { CRISV10F_INSN_BTSTQ
, && case_sem_INSN_BTSTQ
},
208 { CRISV10F_INSN_SETF
, && case_sem_INSN_SETF
},
209 { CRISV10F_INSN_CLEARF
, && case_sem_INSN_CLEARF
},
210 { CRISV10F_INSN_BCC_B
, && case_sem_INSN_BCC_B
},
211 { CRISV10F_INSN_BA_B
, && case_sem_INSN_BA_B
},
212 { CRISV10F_INSN_BCC_W
, && case_sem_INSN_BCC_W
},
213 { CRISV10F_INSN_BA_W
, && case_sem_INSN_BA_W
},
214 { CRISV10F_INSN_JUMP_R
, && case_sem_INSN_JUMP_R
},
215 { CRISV10F_INSN_JUMP_M
, && case_sem_INSN_JUMP_M
},
216 { CRISV10F_INSN_JUMP_C
, && case_sem_INSN_JUMP_C
},
217 { CRISV10F_INSN_BREAK
, && case_sem_INSN_BREAK
},
218 { CRISV10F_INSN_BOUND_R_B_R
, && case_sem_INSN_BOUND_R_B_R
},
219 { CRISV10F_INSN_BOUND_R_W_R
, && case_sem_INSN_BOUND_R_W_R
},
220 { CRISV10F_INSN_BOUND_R_D_R
, && case_sem_INSN_BOUND_R_D_R
},
221 { CRISV10F_INSN_BOUND_M_B_M
, && case_sem_INSN_BOUND_M_B_M
},
222 { CRISV10F_INSN_BOUND_M_W_M
, && case_sem_INSN_BOUND_M_W_M
},
223 { CRISV10F_INSN_BOUND_M_D_M
, && case_sem_INSN_BOUND_M_D_M
},
224 { CRISV10F_INSN_BOUND_CB
, && case_sem_INSN_BOUND_CB
},
225 { CRISV10F_INSN_BOUND_CW
, && case_sem_INSN_BOUND_CW
},
226 { CRISV10F_INSN_BOUND_CD
, && case_sem_INSN_BOUND_CD
},
227 { CRISV10F_INSN_SCC
, && case_sem_INSN_SCC
},
228 { CRISV10F_INSN_LZ
, && case_sem_INSN_LZ
},
229 { CRISV10F_INSN_ADDOQ
, && case_sem_INSN_ADDOQ
},
230 { CRISV10F_INSN_BDAPQPC
, && case_sem_INSN_BDAPQPC
},
231 { CRISV10F_INSN_ADDO_M_B_M
, && case_sem_INSN_ADDO_M_B_M
},
232 { CRISV10F_INSN_ADDO_M_W_M
, && case_sem_INSN_ADDO_M_W_M
},
233 { CRISV10F_INSN_ADDO_M_D_M
, && case_sem_INSN_ADDO_M_D_M
},
234 { CRISV10F_INSN_ADDO_CB
, && case_sem_INSN_ADDO_CB
},
235 { CRISV10F_INSN_ADDO_CW
, && case_sem_INSN_ADDO_CW
},
236 { CRISV10F_INSN_ADDO_CD
, && case_sem_INSN_ADDO_CD
},
237 { CRISV10F_INSN_DIP_M
, && case_sem_INSN_DIP_M
},
238 { CRISV10F_INSN_DIP_C
, && case_sem_INSN_DIP_C
},
239 { CRISV10F_INSN_ADDI_ACR_B_R
, && case_sem_INSN_ADDI_ACR_B_R
},
240 { CRISV10F_INSN_ADDI_ACR_W_R
, && case_sem_INSN_ADDI_ACR_W_R
},
241 { CRISV10F_INSN_ADDI_ACR_D_R
, && case_sem_INSN_ADDI_ACR_D_R
},
242 { CRISV10F_INSN_BIAP_PC_B_R
, && case_sem_INSN_BIAP_PC_B_R
},
243 { CRISV10F_INSN_BIAP_PC_W_R
, && case_sem_INSN_BIAP_PC_W_R
},
244 { CRISV10F_INSN_BIAP_PC_D_R
, && case_sem_INSN_BIAP_PC_D_R
},
249 for (i
= 0; labels
[i
].label
!= 0; ++i
)
252 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
254 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
259 #endif /* DEFINE_LABELS */
263 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
264 off frills like tracing and profiling. */
265 /* FIXME: A better way would be to have TRACE_RESULT check for something
266 that can cause it to be optimized out. Another way would be to emit
267 special handlers into the instruction "stream". */
271 #define TRACE_RESULT(cpu, abuf, name, type, val)
275 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
276 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
278 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
285 /* Branch to next handler without going around main loop. */
286 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
287 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
289 #else /* ! WITH_SCACHE_PBB */
291 #define NEXT(vpc) BREAK (sem)
294 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
296 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
299 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
302 #endif /* ! WITH_SCACHE_PBB */
306 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
308 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
309 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
310 #define FLD(f) abuf->fields.fmt_empty.f
311 int UNUSED written
= 0;
312 IADDR UNUSED pc
= abuf
->addr
;
313 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
316 /* Update the recorded pc in the cpu state struct.
317 Only necessary for WITH_SCACHE case, but to avoid the
318 conditional compilation .... */
320 /* Virtual insns have zero size. Overwrite vpc with address of next insn
321 using the default-insn-bitsize spec. When executing insns in parallel
322 we may want to queue the fault and continue execution. */
323 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
324 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
331 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
333 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
334 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
335 #define FLD(f) abuf->fields.fmt_empty.f
336 int UNUSED written
= 0;
337 IADDR UNUSED pc
= abuf
->addr
;
338 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
341 #if WITH_SCACHE_PBB_CRISV10F
342 crisv10f_pbb_after (current_cpu
, sem_arg
);
350 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
352 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
354 #define FLD(f) abuf->fields.fmt_empty.f
355 int UNUSED written
= 0;
356 IADDR UNUSED pc
= abuf
->addr
;
357 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
360 #if WITH_SCACHE_PBB_CRISV10F
361 crisv10f_pbb_before (current_cpu
, sem_arg
);
369 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
371 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
372 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
373 #define FLD(f) abuf->fields.fmt_empty.f
374 int UNUSED written
= 0;
375 IADDR UNUSED pc
= abuf
->addr
;
376 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
379 #if WITH_SCACHE_PBB_CRISV10F
381 vpc
= crisv10f_pbb_cti_chain (current_cpu
, sem_arg
,
382 pbb_br_type
, pbb_br_npc
);
385 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
386 vpc
= crisv10f_pbb_cti_chain (current_cpu
, sem_arg
,
387 CPU_PBB_BR_TYPE (current_cpu
),
388 CPU_PBB_BR_NPC (current_cpu
));
397 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
399 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
400 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
401 #define FLD(f) abuf->fields.fmt_empty.f
402 int UNUSED written
= 0;
403 IADDR UNUSED pc
= abuf
->addr
;
404 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
407 #if WITH_SCACHE_PBB_CRISV10F
408 vpc
= crisv10f_pbb_chain (current_cpu
, sem_arg
);
419 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
421 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
422 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
423 #define FLD(f) abuf->fields.fmt_empty.f
424 int UNUSED written
= 0;
425 IADDR UNUSED pc
= abuf
->addr
;
426 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
429 #if WITH_SCACHE_PBB_CRISV10F
430 #if defined DEFINE_SWITCH || defined FAST_P
431 /* In the switch case FAST_P is a constant, allowing several optimizations
432 in any called inline functions. */
433 vpc
= crisv10f_pbb_begin (current_cpu
, FAST_P
);
435 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
436 vpc
= crisv10f_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
438 vpc
= crisv10f_pbb_begin (current_cpu
, 0);
448 CASE (sem
, INSN_NOP
) : /* nop */
450 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
452 #define FLD(f) abuf->fields.fmt_empty.f
453 int UNUSED written
= 0;
454 IADDR UNUSED pc
= abuf
->addr
;
455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
460 CPU (h_xbit
) = opval
;
461 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
465 SET_H_INSN_PREFIXED_P (opval
);
466 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
474 CASE (sem
, INSN_MOVE_B_R
) : /* move.b move.m ${Rs},${Rd} */
476 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
477 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
478 #define FLD(f) abuf->fields.sfmt_add_b_r.f
479 int UNUSED written
= 0;
480 IADDR UNUSED pc
= abuf
->addr
;
481 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
485 tmp_newval
= GET_H_GR (FLD (f_operand1
));
488 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
490 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
491 SET_H_GR (FLD (f_operand2
), opval
);
492 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
497 BI opval
= LTQI (tmp_newval
, 0);
498 CPU (h_nbit
) = opval
;
499 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
502 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
503 CPU (h_zbit
) = opval
;
504 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
511 CPU (h_xbit
) = opval
;
512 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
516 SET_H_INSN_PREFIXED_P (opval
);
517 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
527 CASE (sem
, INSN_MOVE_W_R
) : /* move.w move.m ${Rs},${Rd} */
529 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
530 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
531 #define FLD(f) abuf->fields.sfmt_add_b_r.f
532 int UNUSED written
= 0;
533 IADDR UNUSED pc
= abuf
->addr
;
534 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
538 tmp_newval
= GET_H_GR (FLD (f_operand1
));
541 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
543 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
544 SET_H_GR (FLD (f_operand2
), opval
);
545 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
550 BI opval
= LTHI (tmp_newval
, 0);
551 CPU (h_nbit
) = opval
;
552 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
555 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
556 CPU (h_zbit
) = opval
;
557 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
564 CPU (h_xbit
) = opval
;
565 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
569 SET_H_INSN_PREFIXED_P (opval
);
570 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
580 CASE (sem
, INSN_MOVE_D_R
) : /* move.d move.m ${Rs},${Rd} */
582 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
583 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
584 #define FLD(f) abuf->fields.sfmt_add_b_r.f
585 int UNUSED written
= 0;
586 IADDR UNUSED pc
= abuf
->addr
;
587 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
591 tmp_newval
= GET_H_GR (FLD (f_operand1
));
593 SI opval
= tmp_newval
;
594 SET_H_GR (FLD (f_operand2
), opval
);
595 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
599 BI opval
= LTSI (tmp_newval
, 0);
600 CPU (h_nbit
) = opval
;
601 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
604 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
605 CPU (h_zbit
) = opval
;
606 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
613 CPU (h_xbit
) = opval
;
614 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
618 SET_H_INSN_PREFIXED_P (opval
);
619 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
629 CASE (sem
, INSN_MOVEPCR
) : /* move.d PC,${Rd} */
631 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
632 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
633 #define FLD(f) abuf->fields.sfmt_moveq.f
634 int UNUSED written
= 0;
635 IADDR UNUSED pc
= abuf
->addr
;
637 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
641 tmp_pcval
= ADDSI (pc
, 2);
643 SI opval
= tmp_pcval
;
644 SET_H_GR (FLD (f_operand2
), opval
);
645 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
649 BI opval
= LTSI (tmp_pcval
, 0);
650 CPU (h_nbit
) = opval
;
651 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
654 BI opval
= ANDIF (EQSI (tmp_pcval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
655 CPU (h_zbit
) = opval
;
656 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
663 CPU (h_xbit
) = opval
;
664 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
668 SET_H_INSN_PREFIXED_P (opval
);
669 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
675 SEM_BRANCH_FINI (vpc
);
680 CASE (sem
, INSN_MOVEQ
) : /* moveq $i,$Rd */
682 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
683 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
684 #define FLD(f) abuf->fields.sfmt_moveq.f
685 int UNUSED written
= 0;
686 IADDR UNUSED pc
= abuf
->addr
;
687 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
691 tmp_newval
= FLD (f_s6
);
693 SI opval
= tmp_newval
;
694 SET_H_GR (FLD (f_operand2
), opval
);
695 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
698 SET_H_NBIT_MOVE (LTSI (tmp_newval
, 0));
699 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1))));
705 CPU (h_xbit
) = opval
;
706 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
710 SET_H_INSN_PREFIXED_P (opval
);
711 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
721 CASE (sem
, INSN_MOVS_B_R
) : /* movs.b movs.m ${Rs},${Rd} */
723 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
724 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
725 #define FLD(f) abuf->fields.sfmt_muls_b.f
726 int UNUSED written
= 0;
727 IADDR UNUSED pc
= abuf
->addr
;
728 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
732 tmp_newval
= GET_H_GR (FLD (f_operand1
));
734 SI opval
= EXTQISI (tmp_newval
);
735 SET_H_GR (FLD (f_operand2
), opval
);
736 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
740 BI opval
= LTSI (tmp_newval
, 0);
741 CPU (h_nbit
) = opval
;
742 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
745 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
746 CPU (h_zbit
) = opval
;
747 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
754 CPU (h_xbit
) = opval
;
755 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
759 SET_H_INSN_PREFIXED_P (opval
);
760 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
770 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
772 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
773 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
774 #define FLD(f) abuf->fields.sfmt_muls_b.f
775 int UNUSED written
= 0;
776 IADDR UNUSED pc
= abuf
->addr
;
777 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
781 tmp_newval
= GET_H_GR (FLD (f_operand1
));
783 SI opval
= EXTHISI (tmp_newval
);
784 SET_H_GR (FLD (f_operand2
), opval
);
785 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
789 BI opval
= LTSI (tmp_newval
, 0);
790 CPU (h_nbit
) = opval
;
791 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
794 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
795 CPU (h_zbit
) = opval
;
796 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
803 CPU (h_xbit
) = opval
;
804 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
808 SET_H_INSN_PREFIXED_P (opval
);
809 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
819 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
823 #define FLD(f) abuf->fields.sfmt_muls_b.f
824 int UNUSED written
= 0;
825 IADDR UNUSED pc
= abuf
->addr
;
826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
830 tmp_newval
= GET_H_GR (FLD (f_operand1
));
832 SI opval
= ZEXTQISI (tmp_newval
);
833 SET_H_GR (FLD (f_operand2
), opval
);
834 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
838 BI opval
= LTSI (tmp_newval
, 0);
839 CPU (h_nbit
) = opval
;
840 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
843 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
844 CPU (h_zbit
) = opval
;
845 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
852 CPU (h_xbit
) = opval
;
853 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
857 SET_H_INSN_PREFIXED_P (opval
);
858 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
868 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
870 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
871 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
872 #define FLD(f) abuf->fields.sfmt_muls_b.f
873 int UNUSED written
= 0;
874 IADDR UNUSED pc
= abuf
->addr
;
875 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
879 tmp_newval
= GET_H_GR (FLD (f_operand1
));
881 SI opval
= ZEXTHISI (tmp_newval
);
882 SET_H_GR (FLD (f_operand2
), opval
);
883 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
887 BI opval
= LTSI (tmp_newval
, 0);
888 CPU (h_nbit
) = opval
;
889 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
892 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
893 CPU (h_zbit
) = opval
;
894 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
901 CPU (h_xbit
) = opval
;
902 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
906 SET_H_INSN_PREFIXED_P (opval
);
907 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
917 CASE (sem
, INSN_MOVECBR
) : /* move.b ${sconst8},${Rd} */
919 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
920 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
921 #define FLD(f) abuf->fields.sfmt_addcbr.f
922 int UNUSED written
= 0;
923 IADDR UNUSED pc
= abuf
->addr
;
924 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
928 tmp_newval
= FLD (f_indir_pc__byte
);
931 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
933 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
934 SET_H_GR (FLD (f_operand2
), opval
);
935 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
940 BI opval
= LTQI (tmp_newval
, 0);
941 CPU (h_nbit
) = opval
;
942 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
945 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
946 CPU (h_zbit
) = opval
;
947 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
954 CPU (h_xbit
) = opval
;
955 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
959 SET_H_INSN_PREFIXED_P (opval
);
960 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
970 CASE (sem
, INSN_MOVECWR
) : /* move.w ${sconst16},${Rd} */
972 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
973 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
974 #define FLD(f) abuf->fields.sfmt_addcwr.f
975 int UNUSED written
= 0;
976 IADDR UNUSED pc
= abuf
->addr
;
977 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
981 tmp_newval
= FLD (f_indir_pc__word
);
984 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
986 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
987 SET_H_GR (FLD (f_operand2
), opval
);
988 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
993 BI opval
= LTHI (tmp_newval
, 0);
994 CPU (h_nbit
) = opval
;
995 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
998 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
999 CPU (h_zbit
) = opval
;
1000 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1002 SET_H_CBIT_MOVE (0);
1003 SET_H_VBIT_MOVE (0);
1007 CPU (h_xbit
) = opval
;
1008 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1012 SET_H_INSN_PREFIXED_P (opval
);
1013 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1023 CASE (sem
, INSN_MOVECDR
) : /* move.d ${const32},${Rd} */
1025 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1026 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1027 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1028 int UNUSED written
= 0;
1029 IADDR UNUSED pc
= abuf
->addr
;
1030 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1034 tmp_newval
= FLD (f_indir_pc__dword
);
1036 SI opval
= tmp_newval
;
1037 SET_H_GR (FLD (f_operand2
), opval
);
1038 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1042 BI opval
= LTSI (tmp_newval
, 0);
1043 CPU (h_nbit
) = opval
;
1044 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1047 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1048 CPU (h_zbit
) = opval
;
1049 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1051 SET_H_CBIT_MOVE (0);
1052 SET_H_VBIT_MOVE (0);
1056 CPU (h_xbit
) = opval
;
1057 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1061 SET_H_INSN_PREFIXED_P (opval
);
1062 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1072 CASE (sem
, INSN_MOVSCBR
) : /* movs.b ${sconst8},${Rd} */
1074 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1075 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1076 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1077 int UNUSED written
= 0;
1078 IADDR UNUSED pc
= abuf
->addr
;
1079 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1083 tmp_newval
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1085 SI opval
= tmp_newval
;
1086 SET_H_GR (FLD (f_operand2
), opval
);
1087 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1091 BI opval
= LTSI (tmp_newval
, 0);
1092 CPU (h_nbit
) = opval
;
1093 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1096 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1097 CPU (h_zbit
) = opval
;
1098 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1100 SET_H_CBIT_MOVE (0);
1101 SET_H_VBIT_MOVE (0);
1105 CPU (h_xbit
) = opval
;
1106 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1110 SET_H_INSN_PREFIXED_P (opval
);
1111 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1121 CASE (sem
, INSN_MOVSCWR
) : /* movs.w ${sconst16},${Rd} */
1123 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1125 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1126 int UNUSED written
= 0;
1127 IADDR UNUSED pc
= abuf
->addr
;
1128 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1132 tmp_newval
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1134 SI opval
= tmp_newval
;
1135 SET_H_GR (FLD (f_operand2
), opval
);
1136 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1140 BI opval
= LTSI (tmp_newval
, 0);
1141 CPU (h_nbit
) = opval
;
1142 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1145 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1146 CPU (h_zbit
) = opval
;
1147 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1149 SET_H_CBIT_MOVE (0);
1150 SET_H_VBIT_MOVE (0);
1154 CPU (h_xbit
) = opval
;
1155 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1159 SET_H_INSN_PREFIXED_P (opval
);
1160 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1170 CASE (sem
, INSN_MOVUCBR
) : /* movu.b ${uconst8},${Rd} */
1172 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1173 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1174 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1175 int UNUSED written
= 0;
1176 IADDR UNUSED pc
= abuf
->addr
;
1177 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1181 tmp_newval
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1183 SI opval
= tmp_newval
;
1184 SET_H_GR (FLD (f_operand2
), opval
);
1185 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1189 BI opval
= LTSI (tmp_newval
, 0);
1190 CPU (h_nbit
) = opval
;
1191 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1194 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1195 CPU (h_zbit
) = opval
;
1196 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1198 SET_H_CBIT_MOVE (0);
1199 SET_H_VBIT_MOVE (0);
1203 CPU (h_xbit
) = opval
;
1204 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1208 SET_H_INSN_PREFIXED_P (opval
);
1209 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1219 CASE (sem
, INSN_MOVUCWR
) : /* movu.w ${uconst16},${Rd} */
1221 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1222 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1223 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1224 int UNUSED written
= 0;
1225 IADDR UNUSED pc
= abuf
->addr
;
1226 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1230 tmp_newval
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1232 SI opval
= tmp_newval
;
1233 SET_H_GR (FLD (f_operand2
), opval
);
1234 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1238 BI opval
= LTSI (tmp_newval
, 0);
1239 CPU (h_nbit
) = opval
;
1240 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1243 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1244 CPU (h_zbit
) = opval
;
1245 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1247 SET_H_CBIT_MOVE (0);
1248 SET_H_VBIT_MOVE (0);
1252 CPU (h_xbit
) = opval
;
1253 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1257 SET_H_INSN_PREFIXED_P (opval
);
1258 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1268 CASE (sem
, INSN_ADDQ
) : /* addq $j,$Rd */
1270 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1271 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1272 #define FLD(f) abuf->fields.sfmt_addq.f
1273 int UNUSED written
= 0;
1274 IADDR UNUSED pc
= abuf
->addr
;
1275 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1282 tmp_tmpops
= FLD (f_u6
);
1283 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1284 tmp_carry
= CPU (h_cbit
);
1285 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1287 SI opval
= tmp_newval
;
1288 SET_H_GR (FLD (f_operand2
), opval
);
1289 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1293 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))));
1294 CPU (h_cbit
) = opval
;
1295 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1298 BI opval
= LTSI (tmp_newval
, 0);
1299 CPU (h_nbit
) = opval
;
1300 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1303 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1304 CPU (h_zbit
) = opval
;
1305 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1308 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)));
1309 CPU (h_vbit
) = opval
;
1310 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1315 CPU (h_xbit
) = opval
;
1316 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1320 SET_H_INSN_PREFIXED_P (opval
);
1321 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1331 CASE (sem
, INSN_SUBQ
) : /* subq $j,$Rd */
1333 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1334 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1335 #define FLD(f) abuf->fields.sfmt_addq.f
1336 int UNUSED written
= 0;
1337 IADDR UNUSED pc
= abuf
->addr
;
1338 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1345 tmp_tmpops
= FLD (f_u6
);
1346 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1347 tmp_carry
= CPU (h_cbit
);
1348 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1350 SI opval
= tmp_newval
;
1351 SET_H_GR (FLD (f_operand2
), opval
);
1352 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1356 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))));
1357 CPU (h_cbit
) = opval
;
1358 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1361 BI opval
= LTSI (tmp_newval
, 0);
1362 CPU (h_nbit
) = opval
;
1363 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1366 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1367 CPU (h_zbit
) = opval
;
1368 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1371 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)));
1372 CPU (h_vbit
) = opval
;
1373 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1378 CPU (h_xbit
) = opval
;
1379 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1383 SET_H_INSN_PREFIXED_P (opval
);
1384 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1394 CASE (sem
, INSN_CMP_R_B_R
) : /* cmp-r.b $Rs,$Rd */
1396 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1398 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1399 int UNUSED written
= 0;
1400 IADDR UNUSED pc
= abuf
->addr
;
1401 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1408 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1409 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1410 tmp_carry
= CPU (h_cbit
);
1411 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1415 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))));
1416 CPU (h_cbit
) = opval
;
1417 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1420 BI opval
= LTQI (tmp_newval
, 0);
1421 CPU (h_nbit
) = opval
;
1422 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1425 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1426 CPU (h_zbit
) = opval
;
1427 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1430 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)));
1431 CPU (h_vbit
) = opval
;
1432 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1437 CPU (h_xbit
) = opval
;
1438 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1442 SET_H_INSN_PREFIXED_P (opval
);
1443 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1453 CASE (sem
, INSN_CMP_R_W_R
) : /* cmp-r.w $Rs,$Rd */
1455 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1456 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1457 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1458 int UNUSED written
= 0;
1459 IADDR UNUSED pc
= abuf
->addr
;
1460 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1467 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1468 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1469 tmp_carry
= CPU (h_cbit
);
1470 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1474 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))));
1475 CPU (h_cbit
) = opval
;
1476 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1479 BI opval
= LTHI (tmp_newval
, 0);
1480 CPU (h_nbit
) = opval
;
1481 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1484 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1485 CPU (h_zbit
) = opval
;
1486 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1489 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)));
1490 CPU (h_vbit
) = opval
;
1491 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1496 CPU (h_xbit
) = opval
;
1497 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1501 SET_H_INSN_PREFIXED_P (opval
);
1502 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1512 CASE (sem
, INSN_CMP_R_D_R
) : /* cmp-r.d $Rs,$Rd */
1514 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1515 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1516 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1517 int UNUSED written
= 0;
1518 IADDR UNUSED pc
= abuf
->addr
;
1519 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1526 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1527 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1528 tmp_carry
= CPU (h_cbit
);
1529 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1533 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))));
1534 CPU (h_cbit
) = opval
;
1535 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1538 BI opval
= LTSI (tmp_newval
, 0);
1539 CPU (h_nbit
) = opval
;
1540 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1543 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1544 CPU (h_zbit
) = opval
;
1545 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1548 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)));
1549 CPU (h_vbit
) = opval
;
1550 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1555 CPU (h_xbit
) = opval
;
1556 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1560 SET_H_INSN_PREFIXED_P (opval
);
1561 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1571 CASE (sem
, INSN_CMP_M_B_M
) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1573 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1574 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1575 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1576 int UNUSED written
= 0;
1577 IADDR UNUSED pc
= abuf
->addr
;
1578 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1585 tmp_tmpops
= ({ SI tmp_addr
;
1588 tmp_postinc
= FLD (f_memmode
);
1589 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
1590 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1591 ; if (NEBI (tmp_postinc
, 0)) {
1593 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1594 tmp_addr
= ADDSI (tmp_addr
, 1);
1597 SI opval
= tmp_addr
;
1598 SET_H_GR (FLD (f_operand1
), opval
);
1599 written
|= (1 << 9);
1600 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1605 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1606 tmp_carry
= CPU (h_cbit
);
1607 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1611 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))));
1612 CPU (h_cbit
) = opval
;
1613 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1616 BI opval
= LTQI (tmp_newval
, 0);
1617 CPU (h_nbit
) = opval
;
1618 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1621 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1622 CPU (h_zbit
) = opval
;
1623 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1626 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)));
1627 CPU (h_vbit
) = opval
;
1628 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1633 CPU (h_xbit
) = opval
;
1634 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1638 SET_H_INSN_PREFIXED_P (opval
);
1639 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1645 abuf
->written
= written
;
1650 CASE (sem
, INSN_CMP_M_W_M
) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1652 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1653 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1654 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1655 int UNUSED written
= 0;
1656 IADDR UNUSED pc
= abuf
->addr
;
1657 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1664 tmp_tmpops
= ({ SI tmp_addr
;
1667 tmp_postinc
= FLD (f_memmode
);
1668 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
1669 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
1670 ; if (NEBI (tmp_postinc
, 0)) {
1672 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1673 tmp_addr
= ADDSI (tmp_addr
, 2);
1676 SI opval
= tmp_addr
;
1677 SET_H_GR (FLD (f_operand1
), opval
);
1678 written
|= (1 << 9);
1679 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1684 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1685 tmp_carry
= CPU (h_cbit
);
1686 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1690 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))));
1691 CPU (h_cbit
) = opval
;
1692 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1695 BI opval
= LTHI (tmp_newval
, 0);
1696 CPU (h_nbit
) = opval
;
1697 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1700 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1701 CPU (h_zbit
) = opval
;
1702 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1705 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)));
1706 CPU (h_vbit
) = opval
;
1707 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1712 CPU (h_xbit
) = opval
;
1713 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1717 SET_H_INSN_PREFIXED_P (opval
);
1718 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1724 abuf
->written
= written
;
1729 CASE (sem
, INSN_CMP_M_D_M
) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1731 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1732 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1733 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1734 int UNUSED written
= 0;
1735 IADDR UNUSED pc
= abuf
->addr
;
1736 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1743 tmp_tmpops
= ({ SI tmp_addr
;
1746 tmp_postinc
= FLD (f_memmode
);
1747 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
1748 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
1749 ; if (NEBI (tmp_postinc
, 0)) {
1751 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1752 tmp_addr
= ADDSI (tmp_addr
, 4);
1755 SI opval
= tmp_addr
;
1756 SET_H_GR (FLD (f_operand1
), opval
);
1757 written
|= (1 << 9);
1758 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1763 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1764 tmp_carry
= CPU (h_cbit
);
1765 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1769 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))));
1770 CPU (h_cbit
) = opval
;
1771 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1774 BI opval
= LTSI (tmp_newval
, 0);
1775 CPU (h_nbit
) = opval
;
1776 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1779 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1780 CPU (h_zbit
) = opval
;
1781 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1784 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)));
1785 CPU (h_vbit
) = opval
;
1786 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1791 CPU (h_xbit
) = opval
;
1792 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1796 SET_H_INSN_PREFIXED_P (opval
);
1797 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1803 abuf
->written
= written
;
1808 CASE (sem
, INSN_CMPCBR
) : /* cmp.b $sconst8,$Rd */
1810 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1811 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1812 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1813 int UNUSED written
= 0;
1814 IADDR UNUSED pc
= abuf
->addr
;
1815 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1822 tmp_tmpops
= TRUNCSIQI (FLD (f_indir_pc__byte
));
1823 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1824 tmp_carry
= CPU (h_cbit
);
1825 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1829 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))));
1830 CPU (h_cbit
) = opval
;
1831 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1834 BI opval
= LTQI (tmp_newval
, 0);
1835 CPU (h_nbit
) = opval
;
1836 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1839 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1840 CPU (h_zbit
) = opval
;
1841 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1844 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)));
1845 CPU (h_vbit
) = opval
;
1846 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1851 CPU (h_xbit
) = opval
;
1852 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1856 SET_H_INSN_PREFIXED_P (opval
);
1857 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1867 CASE (sem
, INSN_CMPCWR
) : /* cmp.w $sconst16,$Rd */
1869 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1870 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1871 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1872 int UNUSED written
= 0;
1873 IADDR UNUSED pc
= abuf
->addr
;
1874 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1881 tmp_tmpops
= TRUNCSIHI (FLD (f_indir_pc__word
));
1882 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1883 tmp_carry
= CPU (h_cbit
);
1884 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1888 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))));
1889 CPU (h_cbit
) = opval
;
1890 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1893 BI opval
= LTHI (tmp_newval
, 0);
1894 CPU (h_nbit
) = opval
;
1895 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1898 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1899 CPU (h_zbit
) = opval
;
1900 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1903 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)));
1904 CPU (h_vbit
) = opval
;
1905 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1910 CPU (h_xbit
) = opval
;
1911 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1915 SET_H_INSN_PREFIXED_P (opval
);
1916 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1926 CASE (sem
, INSN_CMPCDR
) : /* cmp.d $const32,$Rd */
1928 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1929 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1930 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1931 int UNUSED written
= 0;
1932 IADDR UNUSED pc
= abuf
->addr
;
1933 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1940 tmp_tmpops
= FLD (f_indir_pc__dword
);
1941 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1942 tmp_carry
= CPU (h_cbit
);
1943 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1947 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))));
1948 CPU (h_cbit
) = opval
;
1949 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1952 BI opval
= LTSI (tmp_newval
, 0);
1953 CPU (h_nbit
) = opval
;
1954 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1957 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1958 CPU (h_zbit
) = opval
;
1959 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1962 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)));
1963 CPU (h_vbit
) = opval
;
1964 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1969 CPU (h_xbit
) = opval
;
1970 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1974 SET_H_INSN_PREFIXED_P (opval
);
1975 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1985 CASE (sem
, INSN_CMPQ
) : /* cmpq $i,$Rd */
1987 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1989 #define FLD(f) abuf->fields.sfmt_andq.f
1990 int UNUSED written
= 0;
1991 IADDR UNUSED pc
= abuf
->addr
;
1992 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1999 tmp_tmpops
= FLD (f_s6
);
2000 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2001 tmp_carry
= CPU (h_cbit
);
2002 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2006 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))));
2007 CPU (h_cbit
) = opval
;
2008 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2011 BI opval
= LTSI (tmp_newval
, 0);
2012 CPU (h_nbit
) = opval
;
2013 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2016 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2017 CPU (h_zbit
) = opval
;
2018 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2021 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)));
2022 CPU (h_vbit
) = opval
;
2023 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2028 CPU (h_xbit
) = opval
;
2029 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2033 SET_H_INSN_PREFIXED_P (opval
);
2034 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2044 CASE (sem
, INSN_CMPS_M_B_M
) : /* cmps-m.b [${Rs}${inc}],$Rd */
2046 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2048 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2049 int UNUSED written
= 0;
2050 IADDR UNUSED pc
= abuf
->addr
;
2051 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2058 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
2061 tmp_postinc
= FLD (f_memmode
);
2062 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2063 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2064 ; if (NEBI (tmp_postinc
, 0)) {
2066 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2067 tmp_addr
= ADDSI (tmp_addr
, 1);
2070 SI opval
= tmp_addr
;
2071 SET_H_GR (FLD (f_operand1
), opval
);
2072 written
|= (1 << 9);
2073 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2078 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2079 tmp_carry
= CPU (h_cbit
);
2080 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2084 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))));
2085 CPU (h_cbit
) = opval
;
2086 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2089 BI opval
= LTSI (tmp_newval
, 0);
2090 CPU (h_nbit
) = opval
;
2091 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2094 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2095 CPU (h_zbit
) = opval
;
2096 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2099 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)));
2100 CPU (h_vbit
) = opval
;
2101 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2106 CPU (h_xbit
) = opval
;
2107 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2111 SET_H_INSN_PREFIXED_P (opval
);
2112 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2118 abuf
->written
= written
;
2123 CASE (sem
, INSN_CMPS_M_W_M
) : /* cmps-m.w [${Rs}${inc}],$Rd */
2125 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2126 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2127 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2128 int UNUSED written
= 0;
2129 IADDR UNUSED pc
= abuf
->addr
;
2130 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2137 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
2140 tmp_postinc
= FLD (f_memmode
);
2141 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2142 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2143 ; if (NEBI (tmp_postinc
, 0)) {
2145 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2146 tmp_addr
= ADDSI (tmp_addr
, 2);
2149 SI opval
= tmp_addr
;
2150 SET_H_GR (FLD (f_operand1
), opval
);
2151 written
|= (1 << 9);
2152 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2157 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2158 tmp_carry
= CPU (h_cbit
);
2159 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2163 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))));
2164 CPU (h_cbit
) = opval
;
2165 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2168 BI opval
= LTSI (tmp_newval
, 0);
2169 CPU (h_nbit
) = opval
;
2170 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2173 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2174 CPU (h_zbit
) = opval
;
2175 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2178 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)));
2179 CPU (h_vbit
) = opval
;
2180 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2185 CPU (h_xbit
) = opval
;
2186 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2190 SET_H_INSN_PREFIXED_P (opval
);
2191 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2197 abuf
->written
= written
;
2202 CASE (sem
, INSN_CMPSCBR
) : /* [${Rs}${inc}],$Rd */
2204 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2206 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2207 int UNUSED written
= 0;
2208 IADDR UNUSED pc
= abuf
->addr
;
2209 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2216 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2217 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2218 tmp_carry
= CPU (h_cbit
);
2219 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2223 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))));
2224 CPU (h_cbit
) = opval
;
2225 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2228 BI opval
= LTSI (tmp_newval
, 0);
2229 CPU (h_nbit
) = opval
;
2230 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2233 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2234 CPU (h_zbit
) = opval
;
2235 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2238 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)));
2239 CPU (h_vbit
) = opval
;
2240 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2245 CPU (h_xbit
) = opval
;
2246 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2250 SET_H_INSN_PREFIXED_P (opval
);
2251 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2261 CASE (sem
, INSN_CMPSCWR
) : /* [${Rs}${inc}],$Rd */
2263 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2264 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2265 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2266 int UNUSED written
= 0;
2267 IADDR UNUSED pc
= abuf
->addr
;
2268 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2275 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2276 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2277 tmp_carry
= CPU (h_cbit
);
2278 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2282 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))));
2283 CPU (h_cbit
) = opval
;
2284 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2287 BI opval
= LTSI (tmp_newval
, 0);
2288 CPU (h_nbit
) = opval
;
2289 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2292 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2293 CPU (h_zbit
) = opval
;
2294 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2297 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)));
2298 CPU (h_vbit
) = opval
;
2299 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2304 CPU (h_xbit
) = opval
;
2305 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2309 SET_H_INSN_PREFIXED_P (opval
);
2310 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2320 CASE (sem
, INSN_CMPU_M_B_M
) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2322 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2323 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2324 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2325 int UNUSED written
= 0;
2326 IADDR UNUSED pc
= abuf
->addr
;
2327 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2334 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
2337 tmp_postinc
= FLD (f_memmode
);
2338 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2339 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2340 ; if (NEBI (tmp_postinc
, 0)) {
2342 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2343 tmp_addr
= ADDSI (tmp_addr
, 1);
2346 SI opval
= tmp_addr
;
2347 SET_H_GR (FLD (f_operand1
), opval
);
2348 written
|= (1 << 9);
2349 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2354 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2355 tmp_carry
= CPU (h_cbit
);
2356 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2360 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))));
2361 CPU (h_cbit
) = opval
;
2362 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2365 BI opval
= LTSI (tmp_newval
, 0);
2366 CPU (h_nbit
) = opval
;
2367 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2370 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2371 CPU (h_zbit
) = opval
;
2372 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2375 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)));
2376 CPU (h_vbit
) = opval
;
2377 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2382 CPU (h_xbit
) = opval
;
2383 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2387 SET_H_INSN_PREFIXED_P (opval
);
2388 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2394 abuf
->written
= written
;
2399 CASE (sem
, INSN_CMPU_M_W_M
) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2401 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2403 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2404 int UNUSED written
= 0;
2405 IADDR UNUSED pc
= abuf
->addr
;
2406 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2413 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
2416 tmp_postinc
= FLD (f_memmode
);
2417 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2418 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2419 ; if (NEBI (tmp_postinc
, 0)) {
2421 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2422 tmp_addr
= ADDSI (tmp_addr
, 2);
2425 SI opval
= tmp_addr
;
2426 SET_H_GR (FLD (f_operand1
), opval
);
2427 written
|= (1 << 9);
2428 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2433 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2434 tmp_carry
= CPU (h_cbit
);
2435 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2439 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))));
2440 CPU (h_cbit
) = opval
;
2441 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2444 BI opval
= LTSI (tmp_newval
, 0);
2445 CPU (h_nbit
) = opval
;
2446 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2449 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2450 CPU (h_zbit
) = opval
;
2451 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2454 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)));
2455 CPU (h_vbit
) = opval
;
2456 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2461 CPU (h_xbit
) = opval
;
2462 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2466 SET_H_INSN_PREFIXED_P (opval
);
2467 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2473 abuf
->written
= written
;
2478 CASE (sem
, INSN_CMPUCBR
) : /* [${Rs}${inc}],$Rd */
2480 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2481 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2482 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2483 int UNUSED written
= 0;
2484 IADDR UNUSED pc
= abuf
->addr
;
2485 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2492 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2493 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2494 tmp_carry
= CPU (h_cbit
);
2495 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2499 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))));
2500 CPU (h_cbit
) = opval
;
2501 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2504 BI opval
= LTSI (tmp_newval
, 0);
2505 CPU (h_nbit
) = opval
;
2506 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2509 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2510 CPU (h_zbit
) = opval
;
2511 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2514 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)));
2515 CPU (h_vbit
) = opval
;
2516 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2521 CPU (h_xbit
) = opval
;
2522 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2526 SET_H_INSN_PREFIXED_P (opval
);
2527 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2537 CASE (sem
, INSN_CMPUCWR
) : /* [${Rs}${inc}],$Rd */
2539 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2540 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2541 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2542 int UNUSED written
= 0;
2543 IADDR UNUSED pc
= abuf
->addr
;
2544 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2551 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2552 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2553 tmp_carry
= CPU (h_cbit
);
2554 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2558 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))));
2559 CPU (h_cbit
) = opval
;
2560 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2563 BI opval
= LTSI (tmp_newval
, 0);
2564 CPU (h_nbit
) = opval
;
2565 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2568 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2569 CPU (h_zbit
) = opval
;
2570 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2573 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)));
2574 CPU (h_vbit
) = opval
;
2575 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2580 CPU (h_xbit
) = opval
;
2581 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2585 SET_H_INSN_PREFIXED_P (opval
);
2586 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2596 CASE (sem
, INSN_MOVE_M_B_M
) : /* move-m.b [${Rs}${inc}],${Rd} */
2598 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2599 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2600 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2601 int UNUSED written
= 0;
2602 IADDR UNUSED pc
= abuf
->addr
;
2603 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2607 tmp_tmp
= ({ SI tmp_addr
;
2610 tmp_postinc
= FLD (f_memmode
);
2611 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2612 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2613 ; if (NEBI (tmp_postinc
, 0)) {
2615 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2616 tmp_addr
= ADDSI (tmp_addr
, 1);
2619 SI opval
= tmp_addr
;
2620 SET_H_GR (FLD (f_operand1
), opval
);
2621 written
|= (1 << 10);
2622 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2629 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2631 SI opval
= ORSI (ANDSI (tmp_tmp
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
2632 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2633 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2638 BI opval
= LTQI (tmp_tmp
, 0);
2639 CPU (h_nbit
) = opval
;
2640 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2643 BI opval
= ANDIF (EQQI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2644 CPU (h_zbit
) = opval
;
2645 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2647 SET_H_CBIT_MOVE (0);
2648 SET_H_VBIT_MOVE (0);
2652 CPU (h_xbit
) = opval
;
2653 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2657 SET_H_INSN_PREFIXED_P (opval
);
2658 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2664 abuf
->written
= written
;
2669 CASE (sem
, INSN_MOVE_M_W_M
) : /* move-m.w [${Rs}${inc}],${Rd} */
2671 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2672 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2673 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2674 int UNUSED written
= 0;
2675 IADDR UNUSED pc
= abuf
->addr
;
2676 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2680 tmp_tmp
= ({ SI tmp_addr
;
2683 tmp_postinc
= FLD (f_memmode
);
2684 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2685 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2686 ; if (NEBI (tmp_postinc
, 0)) {
2688 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2689 tmp_addr
= ADDSI (tmp_addr
, 2);
2692 SI opval
= tmp_addr
;
2693 SET_H_GR (FLD (f_operand1
), opval
);
2694 written
|= (1 << 10);
2695 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2702 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2704 SI opval
= ORSI (ANDSI (tmp_tmp
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
2705 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2706 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2711 BI opval
= LTHI (tmp_tmp
, 0);
2712 CPU (h_nbit
) = opval
;
2713 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2716 BI opval
= ANDIF (EQHI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2717 CPU (h_zbit
) = opval
;
2718 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2720 SET_H_CBIT_MOVE (0);
2721 SET_H_VBIT_MOVE (0);
2725 CPU (h_xbit
) = opval
;
2726 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2730 SET_H_INSN_PREFIXED_P (opval
);
2731 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2737 abuf
->written
= written
;
2742 CASE (sem
, INSN_MOVE_M_D_M
) : /* move-m.d [${Rs}${inc}],${Rd} */
2744 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2745 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2746 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2747 int UNUSED written
= 0;
2748 IADDR UNUSED pc
= abuf
->addr
;
2749 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2753 tmp_tmp
= ({ SI tmp_addr
;
2756 tmp_postinc
= FLD (f_memmode
);
2757 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2758 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
2759 ; if (NEBI (tmp_postinc
, 0)) {
2761 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2762 tmp_addr
= ADDSI (tmp_addr
, 4);
2765 SI opval
= tmp_addr
;
2766 SET_H_GR (FLD (f_operand1
), opval
);
2767 written
|= (1 << 9);
2768 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2775 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2776 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2780 BI opval
= LTSI (tmp_tmp
, 0);
2781 CPU (h_nbit
) = opval
;
2782 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2785 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2786 CPU (h_zbit
) = opval
;
2787 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2789 SET_H_CBIT_MOVE (0);
2790 SET_H_VBIT_MOVE (0);
2794 CPU (h_xbit
) = opval
;
2795 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2799 SET_H_INSN_PREFIXED_P (opval
);
2800 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2806 abuf
->written
= written
;
2811 CASE (sem
, INSN_MOVS_M_B_M
) : /* movs-m.b [${Rs}${inc}],${Rd} */
2813 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2814 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2815 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2816 int UNUSED written
= 0;
2817 IADDR UNUSED pc
= abuf
->addr
;
2818 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2822 tmp_tmp
= EXTQISI (({ SI tmp_addr
;
2825 tmp_postinc
= FLD (f_memmode
);
2826 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2827 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2828 ; if (NEBI (tmp_postinc
, 0)) {
2830 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2831 tmp_addr
= ADDSI (tmp_addr
, 1);
2834 SI opval
= tmp_addr
;
2835 SET_H_GR (FLD (f_operand1
), opval
);
2836 written
|= (1 << 8);
2837 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2842 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2845 SET_H_GR (FLD (f_operand1
), opval
);
2846 written
|= (1 << 8);
2847 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2852 SET_H_GR (FLD (f_operand2
), opval
);
2853 written
|= (1 << 7);
2854 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2859 BI opval
= LTSI (tmp_tmp
, 0);
2860 CPU (h_nbit
) = opval
;
2861 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2864 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2865 CPU (h_zbit
) = opval
;
2866 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2868 SET_H_CBIT_MOVE (0);
2869 SET_H_VBIT_MOVE (0);
2873 CPU (h_xbit
) = opval
;
2874 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2878 SET_H_INSN_PREFIXED_P (opval
);
2879 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2885 abuf
->written
= written
;
2890 CASE (sem
, INSN_MOVS_M_W_M
) : /* movs-m.w [${Rs}${inc}],${Rd} */
2892 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2893 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2894 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2895 int UNUSED written
= 0;
2896 IADDR UNUSED pc
= abuf
->addr
;
2897 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2901 tmp_tmp
= EXTHISI (({ SI tmp_addr
;
2904 tmp_postinc
= FLD (f_memmode
);
2905 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2906 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2907 ; if (NEBI (tmp_postinc
, 0)) {
2909 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2910 tmp_addr
= ADDSI (tmp_addr
, 2);
2913 SI opval
= tmp_addr
;
2914 SET_H_GR (FLD (f_operand1
), opval
);
2915 written
|= (1 << 8);
2916 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2921 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2924 SET_H_GR (FLD (f_operand1
), opval
);
2925 written
|= (1 << 8);
2926 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2931 SET_H_GR (FLD (f_operand2
), opval
);
2932 written
|= (1 << 7);
2933 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2938 BI opval
= LTSI (tmp_tmp
, 0);
2939 CPU (h_nbit
) = opval
;
2940 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2943 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2944 CPU (h_zbit
) = opval
;
2945 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2947 SET_H_CBIT_MOVE (0);
2948 SET_H_VBIT_MOVE (0);
2952 CPU (h_xbit
) = opval
;
2953 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2957 SET_H_INSN_PREFIXED_P (opval
);
2958 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2964 abuf
->written
= written
;
2969 CASE (sem
, INSN_MOVU_M_B_M
) : /* movu-m.b [${Rs}${inc}],${Rd} */
2971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2972 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2973 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2974 int UNUSED written
= 0;
2975 IADDR UNUSED pc
= abuf
->addr
;
2976 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2980 tmp_tmp
= ZEXTQISI (({ SI tmp_addr
;
2983 tmp_postinc
= FLD (f_memmode
);
2984 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2985 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2986 ; if (NEBI (tmp_postinc
, 0)) {
2988 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2989 tmp_addr
= ADDSI (tmp_addr
, 1);
2992 SI opval
= tmp_addr
;
2993 SET_H_GR (FLD (f_operand1
), opval
);
2994 written
|= (1 << 8);
2995 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3000 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3003 SET_H_GR (FLD (f_operand1
), opval
);
3004 written
|= (1 << 8);
3005 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3010 SET_H_GR (FLD (f_operand2
), opval
);
3011 written
|= (1 << 7);
3012 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3017 BI opval
= LTSI (tmp_tmp
, 0);
3018 CPU (h_nbit
) = opval
;
3019 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3022 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3023 CPU (h_zbit
) = opval
;
3024 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3026 SET_H_CBIT_MOVE (0);
3027 SET_H_VBIT_MOVE (0);
3031 CPU (h_xbit
) = opval
;
3032 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3036 SET_H_INSN_PREFIXED_P (opval
);
3037 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3043 abuf
->written
= written
;
3048 CASE (sem
, INSN_MOVU_M_W_M
) : /* movu-m.w [${Rs}${inc}],${Rd} */
3050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3052 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
3053 int UNUSED written
= 0;
3054 IADDR UNUSED pc
= abuf
->addr
;
3055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3059 tmp_tmp
= ZEXTHISI (({ SI tmp_addr
;
3062 tmp_postinc
= FLD (f_memmode
);
3063 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3064 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
3065 ; if (NEBI (tmp_postinc
, 0)) {
3067 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3068 tmp_addr
= ADDSI (tmp_addr
, 2);
3071 SI opval
= tmp_addr
;
3072 SET_H_GR (FLD (f_operand1
), opval
);
3073 written
|= (1 << 8);
3074 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3079 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3082 SET_H_GR (FLD (f_operand1
), opval
);
3083 written
|= (1 << 8);
3084 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3089 SET_H_GR (FLD (f_operand2
), opval
);
3090 written
|= (1 << 7);
3091 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3096 BI opval
= LTSI (tmp_tmp
, 0);
3097 CPU (h_nbit
) = opval
;
3098 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3101 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3102 CPU (h_zbit
) = opval
;
3103 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3105 SET_H_CBIT_MOVE (0);
3106 SET_H_VBIT_MOVE (0);
3110 CPU (h_xbit
) = opval
;
3111 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3115 SET_H_INSN_PREFIXED_P (opval
);
3116 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3122 abuf
->written
= written
;
3127 CASE (sem
, INSN_MOVE_R_SPRV10
) : /* move ${Rs},${Pd} */
3129 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3130 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3131 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3132 int UNUSED written
= 0;
3133 IADDR UNUSED pc
= abuf
->addr
;
3134 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3139 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
3140 tmp_rno
= FLD (f_operand2
);
3141 if (ORIF (ORIF (EQSI (tmp_rno
, 0), EQSI (tmp_rno
, 1)), ORIF (EQSI (tmp_rno
, 4), EQSI (tmp_rno
, 8)))) {
3142 cgen_rtx_error (current_cpu
, "move-r-spr: trying to set a read-only special register");
3147 SET_H_SR (FLD (f_operand2
), opval
);
3148 written
|= (1 << 2);
3149 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3155 CPU (h_xbit
) = opval
;
3156 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3160 SET_H_INSN_PREFIXED_P (opval
);
3161 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3166 abuf
->written
= written
;
3171 CASE (sem
, INSN_MOVE_SPR_RV10
) : /* move ${Ps},${Rd-sfield} */
3173 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3174 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3175 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3176 int UNUSED written
= 0;
3177 IADDR UNUSED pc
= abuf
->addr
;
3178 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3184 tmp_prno
= FLD (f_operand2
);
3185 tmp_newval
= GET_H_SR (FLD (f_operand2
));
3186 if (EQSI (tmp_prno
, 0)) {
3189 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3191 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3192 SET_H_GR (FLD (f_operand1
), opval
);
3193 written
|= (1 << 4);
3194 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3198 else if (EQSI (tmp_prno
, 1)) {
3201 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3203 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3204 SET_H_GR (FLD (f_operand1
), opval
);
3205 written
|= (1 << 4);
3206 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3210 else if (EQSI (tmp_prno
, 4)) {
3213 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3215 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3216 SET_H_GR (FLD (f_operand1
), opval
);
3217 written
|= (1 << 4);
3218 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3222 else if (EQSI (tmp_prno
, 5)) {
3225 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3227 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3228 SET_H_GR (FLD (f_operand1
), opval
);
3229 written
|= (1 << 4);
3230 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3234 else if (EQSI (tmp_prno
, 8)) {
3236 SI opval
= tmp_newval
;
3237 SET_H_GR (FLD (f_operand1
), opval
);
3238 written
|= (1 << 4);
3239 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3242 else if (EQSI (tmp_prno
, 9)) {
3244 SI opval
= tmp_newval
;
3245 SET_H_GR (FLD (f_operand1
), opval
);
3246 written
|= (1 << 4);
3247 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3250 else if (EQSI (tmp_prno
, 10)) {
3252 SI opval
= tmp_newval
;
3253 SET_H_GR (FLD (f_operand1
), opval
);
3254 written
|= (1 << 4);
3255 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3258 else if (EQSI (tmp_prno
, 11)) {
3260 SI opval
= tmp_newval
;
3261 SET_H_GR (FLD (f_operand1
), opval
);
3262 written
|= (1 << 4);
3263 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3266 else if (EQSI (tmp_prno
, 12)) {
3268 SI opval
= tmp_newval
;
3269 SET_H_GR (FLD (f_operand1
), opval
);
3270 written
|= (1 << 4);
3271 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3274 else if (EQSI (tmp_prno
, 13)) {
3276 SI opval
= tmp_newval
;
3277 SET_H_GR (FLD (f_operand1
), opval
);
3278 written
|= (1 << 4);
3279 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3282 else if (EQSI (tmp_prno
, 7)) {
3284 SI opval
= tmp_newval
;
3285 SET_H_GR (FLD (f_operand1
), opval
);
3286 written
|= (1 << 4);
3287 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3290 else if (EQSI (tmp_prno
, 14)) {
3292 SI opval
= tmp_newval
;
3293 SET_H_GR (FLD (f_operand1
), opval
);
3294 written
|= (1 << 4);
3295 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3298 else if (EQSI (tmp_prno
, 15)) {
3300 SI opval
= tmp_newval
;
3301 SET_H_GR (FLD (f_operand1
), opval
);
3302 written
|= (1 << 4);
3303 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3307 cgen_rtx_error (current_cpu
, "move-spr-r from unimplemented register");
3312 CPU (h_xbit
) = opval
;
3313 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3317 SET_H_INSN_PREFIXED_P (opval
);
3318 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3323 abuf
->written
= written
;
3328 CASE (sem
, INSN_RET_TYPE
) : /* ret/reti/retb */
3330 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3331 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3332 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3333 int UNUSED written
= 0;
3334 IADDR UNUSED pc
= abuf
->addr
;
3336 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3340 tmp_retaddr
= GET_H_SR (FLD (f_operand2
));
3344 CPU (h_xbit
) = opval
;
3345 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3349 SET_H_INSN_PREFIXED_P (opval
);
3350 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3355 USI opval
= tmp_retaddr
;
3356 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
3357 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3362 SEM_BRANCH_FINI (vpc
);
3367 CASE (sem
, INSN_MOVE_M_SPRV10
) : /* move [${Rs}${inc}],${Pd} */
3369 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3370 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3371 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3372 int UNUSED written
= 0;
3373 IADDR UNUSED pc
= abuf
->addr
;
3374 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3379 tmp_rno
= FLD (f_operand2
);
3380 if (EQSI (tmp_rno
, 0)) {
3381 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3384 tmp_postinc
= FLD (f_memmode
);
3385 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3386 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3387 ; if (NEBI (tmp_postinc
, 0)) {
3389 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3390 tmp_addr
= ADDSI (tmp_addr
, 1);
3393 SI opval
= tmp_addr
;
3394 SET_H_GR (FLD (f_operand1
), opval
);
3395 written
|= (1 << 9);
3396 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3402 else if (EQSI (tmp_rno
, 1)) {
3403 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3406 tmp_postinc
= FLD (f_memmode
);
3407 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3408 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3409 ; if (NEBI (tmp_postinc
, 0)) {
3411 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3412 tmp_addr
= ADDSI (tmp_addr
, 1);
3415 SI opval
= tmp_addr
;
3416 SET_H_GR (FLD (f_operand1
), opval
);
3417 written
|= (1 << 9);
3418 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3424 else if (EQSI (tmp_rno
, 4)) {
3425 tmp_newval
= EXTHISI (({ SI tmp_addr
;
3428 tmp_postinc
= FLD (f_memmode
);
3429 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3430 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
3431 ; if (NEBI (tmp_postinc
, 0)) {
3433 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3434 tmp_addr
= ADDSI (tmp_addr
, 2);
3437 SI opval
= tmp_addr
;
3438 SET_H_GR (FLD (f_operand1
), opval
);
3439 written
|= (1 << 9);
3440 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3446 else if (EQSI (tmp_rno
, 5)) {
3447 tmp_newval
= EXTHISI (({ SI tmp_addr
;
3450 tmp_postinc
= FLD (f_memmode
);
3451 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3452 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
3453 ; if (NEBI (tmp_postinc
, 0)) {
3455 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3456 tmp_addr
= ADDSI (tmp_addr
, 2);
3459 SI opval
= tmp_addr
;
3460 SET_H_GR (FLD (f_operand1
), opval
);
3461 written
|= (1 << 9);
3462 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3468 else if (EQSI (tmp_rno
, 8)) {
3469 tmp_newval
= ({ SI tmp_addr
;
3472 tmp_postinc
= FLD (f_memmode
);
3473 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3474 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3475 ; if (NEBI (tmp_postinc
, 0)) {
3477 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3478 tmp_addr
= ADDSI (tmp_addr
, 4);
3481 SI opval
= tmp_addr
;
3482 SET_H_GR (FLD (f_operand1
), opval
);
3483 written
|= (1 << 9);
3484 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3490 else if (EQSI (tmp_rno
, 9)) {
3491 tmp_newval
= ({ SI tmp_addr
;
3494 tmp_postinc
= FLD (f_memmode
);
3495 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3496 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3497 ; if (NEBI (tmp_postinc
, 0)) {
3499 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3500 tmp_addr
= ADDSI (tmp_addr
, 4);
3503 SI opval
= tmp_addr
;
3504 SET_H_GR (FLD (f_operand1
), opval
);
3505 written
|= (1 << 9);
3506 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3512 else if (EQSI (tmp_rno
, 10)) {
3513 tmp_newval
= ({ SI tmp_addr
;
3516 tmp_postinc
= FLD (f_memmode
);
3517 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3518 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3519 ; if (NEBI (tmp_postinc
, 0)) {
3521 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3522 tmp_addr
= ADDSI (tmp_addr
, 4);
3525 SI opval
= tmp_addr
;
3526 SET_H_GR (FLD (f_operand1
), opval
);
3527 written
|= (1 << 9);
3528 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3534 else if (EQSI (tmp_rno
, 11)) {
3535 tmp_newval
= ({ SI tmp_addr
;
3538 tmp_postinc
= FLD (f_memmode
);
3539 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3540 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3541 ; if (NEBI (tmp_postinc
, 0)) {
3543 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3544 tmp_addr
= ADDSI (tmp_addr
, 4);
3547 SI opval
= tmp_addr
;
3548 SET_H_GR (FLD (f_operand1
), opval
);
3549 written
|= (1 << 9);
3550 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3556 else if (EQSI (tmp_rno
, 12)) {
3557 tmp_newval
= ({ SI tmp_addr
;
3560 tmp_postinc
= FLD (f_memmode
);
3561 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3562 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3563 ; if (NEBI (tmp_postinc
, 0)) {
3565 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3566 tmp_addr
= ADDSI (tmp_addr
, 4);
3569 SI opval
= tmp_addr
;
3570 SET_H_GR (FLD (f_operand1
), opval
);
3571 written
|= (1 << 9);
3572 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3578 else if (EQSI (tmp_rno
, 13)) {
3579 tmp_newval
= ({ SI tmp_addr
;
3582 tmp_postinc
= FLD (f_memmode
);
3583 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3584 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3585 ; if (NEBI (tmp_postinc
, 0)) {
3587 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3588 tmp_addr
= ADDSI (tmp_addr
, 4);
3591 SI opval
= tmp_addr
;
3592 SET_H_GR (FLD (f_operand1
), opval
);
3593 written
|= (1 << 9);
3594 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3600 else if (EQSI (tmp_rno
, 7)) {
3601 tmp_newval
= ({ SI tmp_addr
;
3604 tmp_postinc
= FLD (f_memmode
);
3605 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3606 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3607 ; if (NEBI (tmp_postinc
, 0)) {
3609 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3610 tmp_addr
= ADDSI (tmp_addr
, 4);
3613 SI opval
= tmp_addr
;
3614 SET_H_GR (FLD (f_operand1
), opval
);
3615 written
|= (1 << 9);
3616 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3622 else if (EQSI (tmp_rno
, 14)) {
3623 tmp_newval
= ({ SI tmp_addr
;
3626 tmp_postinc
= FLD (f_memmode
);
3627 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3628 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3629 ; if (NEBI (tmp_postinc
, 0)) {
3631 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3632 tmp_addr
= ADDSI (tmp_addr
, 4);
3635 SI opval
= tmp_addr
;
3636 SET_H_GR (FLD (f_operand1
), opval
);
3637 written
|= (1 << 9);
3638 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3644 else if (EQSI (tmp_rno
, 15)) {
3645 tmp_newval
= ({ SI tmp_addr
;
3648 tmp_postinc
= FLD (f_memmode
);
3649 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3650 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3651 ; if (NEBI (tmp_postinc
, 0)) {
3653 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3654 tmp_addr
= ADDSI (tmp_addr
, 4);
3657 SI opval
= tmp_addr
;
3658 SET_H_GR (FLD (f_operand1
), opval
);
3659 written
|= (1 << 9);
3660 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3667 cgen_rtx_error (current_cpu
, "Trying to set unimplemented special register");
3670 SI opval
= tmp_newval
;
3671 SET_H_SR (FLD (f_operand2
), opval
);
3672 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3677 CPU (h_xbit
) = opval
;
3678 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3682 SET_H_INSN_PREFIXED_P (opval
);
3683 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3688 abuf
->written
= written
;
3693 CASE (sem
, INSN_MOVE_C_SPRV10_P0
) : /* move ${sconst8},${Pd} */
3695 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3696 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3697 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p0.f
3698 int UNUSED written
= 0;
3699 IADDR UNUSED pc
= abuf
->addr
;
3700 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3704 SI opval
= FLD (f_indir_pc__byte
);
3705 SET_H_SR (FLD (f_operand2
), opval
);
3706 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3711 CPU (h_xbit
) = opval
;
3712 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3716 SET_H_INSN_PREFIXED_P (opval
);
3717 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3726 CASE (sem
, INSN_MOVE_C_SPRV10_P1
) : /* move ${sconst8},${Pd} */
3728 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3730 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p0.f
3731 int UNUSED written
= 0;
3732 IADDR UNUSED pc
= abuf
->addr
;
3733 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3737 SI opval
= FLD (f_indir_pc__byte
);
3738 SET_H_SR (FLD (f_operand2
), opval
);
3739 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3744 CPU (h_xbit
) = opval
;
3745 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3749 SET_H_INSN_PREFIXED_P (opval
);
3750 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3759 CASE (sem
, INSN_MOVE_C_SPRV10_P4
) : /* move ${sconst16},${Pd} */
3761 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3762 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3763 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p4.f
3764 int UNUSED written
= 0;
3765 IADDR UNUSED pc
= abuf
->addr
;
3766 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3770 SI opval
= FLD (f_indir_pc__word
);
3771 SET_H_SR (FLD (f_operand2
), opval
);
3772 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3777 CPU (h_xbit
) = opval
;
3778 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3782 SET_H_INSN_PREFIXED_P (opval
);
3783 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3792 CASE (sem
, INSN_MOVE_C_SPRV10_P5
) : /* move ${sconst16},${Pd} */
3794 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3795 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3796 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p4.f
3797 int UNUSED written
= 0;
3798 IADDR UNUSED pc
= abuf
->addr
;
3799 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3803 SI opval
= FLD (f_indir_pc__word
);
3804 SET_H_SR (FLD (f_operand2
), opval
);
3805 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3810 CPU (h_xbit
) = opval
;
3811 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3815 SET_H_INSN_PREFIXED_P (opval
);
3816 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3825 CASE (sem
, INSN_MOVE_C_SPRV10_P8
) : /* move ${const32},${Pd} */
3827 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3828 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3829 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
3830 int UNUSED written
= 0;
3831 IADDR UNUSED pc
= abuf
->addr
;
3832 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3836 SI opval
= FLD (f_indir_pc__dword
);
3837 SET_H_SR (FLD (f_operand2
), opval
);
3838 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3843 CPU (h_xbit
) = opval
;
3844 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3848 SET_H_INSN_PREFIXED_P (opval
);
3849 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3858 CASE (sem
, INSN_MOVE_C_SPRV10_P9
) : /* move ${const32},${Pd} */
3860 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3861 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3862 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
3863 int UNUSED written
= 0;
3864 IADDR UNUSED pc
= abuf
->addr
;
3865 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3869 SI opval
= FLD (f_indir_pc__dword
);
3870 SET_H_SR (FLD (f_operand2
), opval
);
3871 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3876 CPU (h_xbit
) = opval
;
3877 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3881 SET_H_INSN_PREFIXED_P (opval
);
3882 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3891 CASE (sem
, INSN_MOVE_C_SPRV10_P10
) : /* move ${const32},${Pd} */
3893 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3894 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3895 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
3896 int UNUSED written
= 0;
3897 IADDR UNUSED pc
= abuf
->addr
;
3898 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3902 SI opval
= FLD (f_indir_pc__dword
);
3903 SET_H_SR (FLD (f_operand2
), opval
);
3904 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3909 CPU (h_xbit
) = opval
;
3910 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3914 SET_H_INSN_PREFIXED_P (opval
);
3915 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3924 CASE (sem
, INSN_MOVE_C_SPRV10_P11
) : /* move ${const32},${Pd} */
3926 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3927 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3928 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
3929 int UNUSED written
= 0;
3930 IADDR UNUSED pc
= abuf
->addr
;
3931 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3935 SI opval
= FLD (f_indir_pc__dword
);
3936 SET_H_SR (FLD (f_operand2
), opval
);
3937 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3942 CPU (h_xbit
) = opval
;
3943 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3947 SET_H_INSN_PREFIXED_P (opval
);
3948 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3957 CASE (sem
, INSN_MOVE_C_SPRV10_P12
) : /* move ${const32},${Pd} */
3959 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3960 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3961 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
3962 int UNUSED written
= 0;
3963 IADDR UNUSED pc
= abuf
->addr
;
3964 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3968 SI opval
= FLD (f_indir_pc__dword
);
3969 SET_H_SR (FLD (f_operand2
), opval
);
3970 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3975 CPU (h_xbit
) = opval
;
3976 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3980 SET_H_INSN_PREFIXED_P (opval
);
3981 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3990 CASE (sem
, INSN_MOVE_C_SPRV10_P13
) : /* move ${const32},${Pd} */
3992 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3993 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3994 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
3995 int UNUSED written
= 0;
3996 IADDR UNUSED pc
= abuf
->addr
;
3997 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4001 SI opval
= FLD (f_indir_pc__dword
);
4002 SET_H_SR (FLD (f_operand2
), opval
);
4003 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4008 CPU (h_xbit
) = opval
;
4009 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4013 SET_H_INSN_PREFIXED_P (opval
);
4014 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4023 CASE (sem
, INSN_MOVE_C_SPRV10_P7
) : /* move ${const32},${Pd} */
4025 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4026 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4027 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
4028 int UNUSED written
= 0;
4029 IADDR UNUSED pc
= abuf
->addr
;
4030 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4034 SI opval
= FLD (f_indir_pc__dword
);
4035 SET_H_SR (FLD (f_operand2
), opval
);
4036 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4041 CPU (h_xbit
) = opval
;
4042 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4046 SET_H_INSN_PREFIXED_P (opval
);
4047 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4056 CASE (sem
, INSN_MOVE_C_SPRV10_P14
) : /* move ${const32},${Pd} */
4058 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4059 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4060 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
4061 int UNUSED written
= 0;
4062 IADDR UNUSED pc
= abuf
->addr
;
4063 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4067 SI opval
= FLD (f_indir_pc__dword
);
4068 SET_H_SR (FLD (f_operand2
), opval
);
4069 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4074 CPU (h_xbit
) = opval
;
4075 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4079 SET_H_INSN_PREFIXED_P (opval
);
4080 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4089 CASE (sem
, INSN_MOVE_C_SPRV10_P15
) : /* move ${const32},${Pd} */
4091 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4092 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4093 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
4094 int UNUSED written
= 0;
4095 IADDR UNUSED pc
= abuf
->addr
;
4096 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4100 SI opval
= FLD (f_indir_pc__dword
);
4101 SET_H_SR (FLD (f_operand2
), opval
);
4102 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4107 CPU (h_xbit
) = opval
;
4108 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4112 SET_H_INSN_PREFIXED_P (opval
);
4113 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4122 CASE (sem
, INSN_MOVE_SPR_MV10
) : /* move ${Ps},[${Rd-sfield}${inc}] */
4124 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4126 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
4127 int UNUSED written
= 0;
4128 IADDR UNUSED pc
= abuf
->addr
;
4129 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4133 tmp_rno
= FLD (f_operand2
);
4134 if (EQSI (tmp_rno
, 0)) {
4138 tmp_postinc
= FLD (f_memmode
);
4139 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4140 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4141 if (EQBI (CPU (h_pbit
), 0)) {
4144 QI opval
= GET_H_SR (FLD (f_operand2
));
4145 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4146 written
|= (1 << 12);
4147 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4150 BI opval
= CPU (h_pbit
);
4151 CPU (h_cbit
) = opval
;
4152 written
|= (1 << 10);
4153 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4159 CPU (h_cbit
) = opval
;
4160 written
|= (1 << 10);
4161 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4166 QI opval
= GET_H_SR (FLD (f_operand2
));
4167 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4168 written
|= (1 << 12);
4169 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4172 if (NEBI (tmp_postinc
, 0)) {
4174 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4175 tmp_addr
= ADDSI (tmp_addr
, 1);
4178 SI opval
= tmp_addr
;
4179 SET_H_GR (FLD (f_operand1
), opval
);
4180 written
|= (1 << 9);
4181 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4187 else if (EQSI (tmp_rno
, 1)) {
4191 tmp_postinc
= FLD (f_memmode
);
4192 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4193 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4194 if (EQBI (CPU (h_pbit
), 0)) {
4197 QI opval
= GET_H_SR (FLD (f_operand2
));
4198 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4199 written
|= (1 << 12);
4200 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4203 BI opval
= CPU (h_pbit
);
4204 CPU (h_cbit
) = opval
;
4205 written
|= (1 << 10);
4206 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4212 CPU (h_cbit
) = opval
;
4213 written
|= (1 << 10);
4214 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4219 QI opval
= GET_H_SR (FLD (f_operand2
));
4220 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4221 written
|= (1 << 12);
4222 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4225 if (NEBI (tmp_postinc
, 0)) {
4227 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4228 tmp_addr
= ADDSI (tmp_addr
, 1);
4231 SI opval
= tmp_addr
;
4232 SET_H_GR (FLD (f_operand1
), opval
);
4233 written
|= (1 << 9);
4234 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4240 else if (EQSI (tmp_rno
, 4)) {
4244 tmp_postinc
= FLD (f_memmode
);
4245 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4246 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4247 if (EQBI (CPU (h_pbit
), 0)) {
4250 HI opval
= GET_H_SR (FLD (f_operand2
));
4251 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4252 written
|= (1 << 11);
4253 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4256 BI opval
= CPU (h_pbit
);
4257 CPU (h_cbit
) = opval
;
4258 written
|= (1 << 10);
4259 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4265 CPU (h_cbit
) = opval
;
4266 written
|= (1 << 10);
4267 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4272 HI opval
= GET_H_SR (FLD (f_operand2
));
4273 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4274 written
|= (1 << 11);
4275 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4278 if (NEBI (tmp_postinc
, 0)) {
4280 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4281 tmp_addr
= ADDSI (tmp_addr
, 2);
4284 SI opval
= tmp_addr
;
4285 SET_H_GR (FLD (f_operand1
), opval
);
4286 written
|= (1 << 9);
4287 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4293 else if (EQSI (tmp_rno
, 5)) {
4297 tmp_postinc
= FLD (f_memmode
);
4298 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4299 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4300 if (EQBI (CPU (h_pbit
), 0)) {
4303 HI opval
= GET_H_SR (FLD (f_operand2
));
4304 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4305 written
|= (1 << 11);
4306 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4309 BI opval
= CPU (h_pbit
);
4310 CPU (h_cbit
) = opval
;
4311 written
|= (1 << 10);
4312 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4318 CPU (h_cbit
) = opval
;
4319 written
|= (1 << 10);
4320 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4325 HI opval
= GET_H_SR (FLD (f_operand2
));
4326 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4327 written
|= (1 << 11);
4328 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4331 if (NEBI (tmp_postinc
, 0)) {
4333 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4334 tmp_addr
= ADDSI (tmp_addr
, 2);
4337 SI opval
= tmp_addr
;
4338 SET_H_GR (FLD (f_operand1
), opval
);
4339 written
|= (1 << 9);
4340 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4346 else if (EQSI (tmp_rno
, 8)) {
4350 tmp_postinc
= FLD (f_memmode
);
4351 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4352 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4353 if (EQBI (CPU (h_pbit
), 0)) {
4356 SI opval
= GET_H_SR (FLD (f_operand2
));
4357 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4358 written
|= (1 << 13);
4359 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4362 BI opval
= CPU (h_pbit
);
4363 CPU (h_cbit
) = opval
;
4364 written
|= (1 << 10);
4365 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4371 CPU (h_cbit
) = opval
;
4372 written
|= (1 << 10);
4373 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4378 SI opval
= GET_H_SR (FLD (f_operand2
));
4379 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4380 written
|= (1 << 13);
4381 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4384 if (NEBI (tmp_postinc
, 0)) {
4386 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4387 tmp_addr
= ADDSI (tmp_addr
, 4);
4390 SI opval
= tmp_addr
;
4391 SET_H_GR (FLD (f_operand1
), opval
);
4392 written
|= (1 << 9);
4393 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4399 else if (EQSI (tmp_rno
, 9)) {
4403 tmp_postinc
= FLD (f_memmode
);
4404 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4405 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4406 if (EQBI (CPU (h_pbit
), 0)) {
4409 SI opval
= GET_H_SR (FLD (f_operand2
));
4410 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4411 written
|= (1 << 13);
4412 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4415 BI opval
= CPU (h_pbit
);
4416 CPU (h_cbit
) = opval
;
4417 written
|= (1 << 10);
4418 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4424 CPU (h_cbit
) = opval
;
4425 written
|= (1 << 10);
4426 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4431 SI opval
= GET_H_SR (FLD (f_operand2
));
4432 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4433 written
|= (1 << 13);
4434 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4437 if (NEBI (tmp_postinc
, 0)) {
4439 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4440 tmp_addr
= ADDSI (tmp_addr
, 4);
4443 SI opval
= tmp_addr
;
4444 SET_H_GR (FLD (f_operand1
), opval
);
4445 written
|= (1 << 9);
4446 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4452 else if (EQSI (tmp_rno
, 10)) {
4456 tmp_postinc
= FLD (f_memmode
);
4457 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4458 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4459 if (EQBI (CPU (h_pbit
), 0)) {
4462 SI opval
= GET_H_SR (FLD (f_operand2
));
4463 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4464 written
|= (1 << 13);
4465 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4468 BI opval
= CPU (h_pbit
);
4469 CPU (h_cbit
) = opval
;
4470 written
|= (1 << 10);
4471 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4477 CPU (h_cbit
) = opval
;
4478 written
|= (1 << 10);
4479 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4484 SI opval
= GET_H_SR (FLD (f_operand2
));
4485 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4486 written
|= (1 << 13);
4487 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4490 if (NEBI (tmp_postinc
, 0)) {
4492 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4493 tmp_addr
= ADDSI (tmp_addr
, 4);
4496 SI opval
= tmp_addr
;
4497 SET_H_GR (FLD (f_operand1
), opval
);
4498 written
|= (1 << 9);
4499 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4505 else if (EQSI (tmp_rno
, 11)) {
4509 tmp_postinc
= FLD (f_memmode
);
4510 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4511 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4512 if (EQBI (CPU (h_pbit
), 0)) {
4515 SI opval
= GET_H_SR (FLD (f_operand2
));
4516 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4517 written
|= (1 << 13);
4518 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4521 BI opval
= CPU (h_pbit
);
4522 CPU (h_cbit
) = opval
;
4523 written
|= (1 << 10);
4524 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4530 CPU (h_cbit
) = opval
;
4531 written
|= (1 << 10);
4532 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4537 SI opval
= GET_H_SR (FLD (f_operand2
));
4538 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4539 written
|= (1 << 13);
4540 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4543 if (NEBI (tmp_postinc
, 0)) {
4545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4546 tmp_addr
= ADDSI (tmp_addr
, 4);
4549 SI opval
= tmp_addr
;
4550 SET_H_GR (FLD (f_operand1
), opval
);
4551 written
|= (1 << 9);
4552 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4558 else if (EQSI (tmp_rno
, 12)) {
4562 tmp_postinc
= FLD (f_memmode
);
4563 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4564 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4565 if (EQBI (CPU (h_pbit
), 0)) {
4568 SI opval
= GET_H_SR (FLD (f_operand2
));
4569 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4570 written
|= (1 << 13);
4571 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4574 BI opval
= CPU (h_pbit
);
4575 CPU (h_cbit
) = opval
;
4576 written
|= (1 << 10);
4577 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4583 CPU (h_cbit
) = opval
;
4584 written
|= (1 << 10);
4585 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4590 SI opval
= GET_H_SR (FLD (f_operand2
));
4591 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4592 written
|= (1 << 13);
4593 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4596 if (NEBI (tmp_postinc
, 0)) {
4598 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4599 tmp_addr
= ADDSI (tmp_addr
, 4);
4602 SI opval
= tmp_addr
;
4603 SET_H_GR (FLD (f_operand1
), opval
);
4604 written
|= (1 << 9);
4605 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4611 else if (EQSI (tmp_rno
, 13)) {
4615 tmp_postinc
= FLD (f_memmode
);
4616 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4617 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4618 if (EQBI (CPU (h_pbit
), 0)) {
4621 SI opval
= GET_H_SR (FLD (f_operand2
));
4622 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4623 written
|= (1 << 13);
4624 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4627 BI opval
= CPU (h_pbit
);
4628 CPU (h_cbit
) = opval
;
4629 written
|= (1 << 10);
4630 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4636 CPU (h_cbit
) = opval
;
4637 written
|= (1 << 10);
4638 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4643 SI opval
= GET_H_SR (FLD (f_operand2
));
4644 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4645 written
|= (1 << 13);
4646 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4649 if (NEBI (tmp_postinc
, 0)) {
4651 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4652 tmp_addr
= ADDSI (tmp_addr
, 4);
4655 SI opval
= tmp_addr
;
4656 SET_H_GR (FLD (f_operand1
), opval
);
4657 written
|= (1 << 9);
4658 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4664 else if (EQSI (tmp_rno
, 7)) {
4668 tmp_postinc
= FLD (f_memmode
);
4669 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4670 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4671 if (EQBI (CPU (h_pbit
), 0)) {
4674 SI opval
= GET_H_SR (FLD (f_operand2
));
4675 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4676 written
|= (1 << 13);
4677 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4680 BI opval
= CPU (h_pbit
);
4681 CPU (h_cbit
) = opval
;
4682 written
|= (1 << 10);
4683 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4689 CPU (h_cbit
) = opval
;
4690 written
|= (1 << 10);
4691 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4696 SI opval
= GET_H_SR (FLD (f_operand2
));
4697 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4698 written
|= (1 << 13);
4699 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4702 if (NEBI (tmp_postinc
, 0)) {
4704 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4705 tmp_addr
= ADDSI (tmp_addr
, 4);
4708 SI opval
= tmp_addr
;
4709 SET_H_GR (FLD (f_operand1
), opval
);
4710 written
|= (1 << 9);
4711 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4717 else if (EQSI (tmp_rno
, 14)) {
4721 tmp_postinc
= FLD (f_memmode
);
4722 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4723 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4724 if (EQBI (CPU (h_pbit
), 0)) {
4727 SI opval
= GET_H_SR (FLD (f_operand2
));
4728 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4729 written
|= (1 << 13);
4730 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4733 BI opval
= CPU (h_pbit
);
4734 CPU (h_cbit
) = opval
;
4735 written
|= (1 << 10);
4736 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4742 CPU (h_cbit
) = opval
;
4743 written
|= (1 << 10);
4744 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4749 SI opval
= GET_H_SR (FLD (f_operand2
));
4750 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4751 written
|= (1 << 13);
4752 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4755 if (NEBI (tmp_postinc
, 0)) {
4757 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4758 tmp_addr
= ADDSI (tmp_addr
, 4);
4761 SI opval
= tmp_addr
;
4762 SET_H_GR (FLD (f_operand1
), opval
);
4763 written
|= (1 << 9);
4764 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4770 else if (EQSI (tmp_rno
, 15)) {
4774 tmp_postinc
= FLD (f_memmode
);
4775 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4776 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4777 if (EQBI (CPU (h_pbit
), 0)) {
4780 SI opval
= GET_H_SR (FLD (f_operand2
));
4781 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4782 written
|= (1 << 13);
4783 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4786 BI opval
= CPU (h_pbit
);
4787 CPU (h_cbit
) = opval
;
4788 written
|= (1 << 10);
4789 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4795 CPU (h_cbit
) = opval
;
4796 written
|= (1 << 10);
4797 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4802 SI opval
= GET_H_SR (FLD (f_operand2
));
4803 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4804 written
|= (1 << 13);
4805 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4808 if (NEBI (tmp_postinc
, 0)) {
4810 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4811 tmp_addr
= ADDSI (tmp_addr
, 4);
4814 SI opval
= tmp_addr
;
4815 SET_H_GR (FLD (f_operand1
), opval
);
4816 written
|= (1 << 9);
4817 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4824 cgen_rtx_error (current_cpu
, "write from unimplemented special register");
4829 CPU (h_xbit
) = opval
;
4830 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4834 SET_H_INSN_PREFIXED_P (opval
);
4835 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4840 abuf
->written
= written
;
4845 CASE (sem
, INSN_SBFS
) : /* sbfs [${Rd-sfield}${inc}] */
4847 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4848 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4849 #define FLD(f) abuf->fields.fmt_empty.f
4850 int UNUSED written
= 0;
4851 IADDR UNUSED pc
= abuf
->addr
;
4852 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4854 cgen_rtx_error (current_cpu
, "SBFS isn't implemented");
4860 CASE (sem
, INSN_MOVEM_R_M
) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4862 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4863 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4864 #define FLD(f) abuf->fields.sfmt_movem_r_m.f
4865 int UNUSED written
= 0;
4866 IADDR UNUSED pc
= abuf
->addr
;
4867 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4872 tmp_postinc
= FLD (f_memmode
);
4875 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
4877 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4879 if (GESI (FLD (f_operand2
), 15)) {
4882 tmp_tmp
= GET_H_GR (((UINT
) 15));
4885 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4886 written
|= (1 << 23);
4887 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4889 tmp_addr
= ADDSI (tmp_addr
, 4);
4892 if (GESI (FLD (f_operand2
), 14)) {
4895 tmp_tmp
= GET_H_GR (((UINT
) 14));
4898 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4899 written
|= (1 << 23);
4900 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4902 tmp_addr
= ADDSI (tmp_addr
, 4);
4905 if (GESI (FLD (f_operand2
), 13)) {
4908 tmp_tmp
= GET_H_GR (((UINT
) 13));
4911 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4912 written
|= (1 << 23);
4913 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4915 tmp_addr
= ADDSI (tmp_addr
, 4);
4918 if (GESI (FLD (f_operand2
), 12)) {
4921 tmp_tmp
= GET_H_GR (((UINT
) 12));
4924 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4925 written
|= (1 << 23);
4926 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4928 tmp_addr
= ADDSI (tmp_addr
, 4);
4931 if (GESI (FLD (f_operand2
), 11)) {
4934 tmp_tmp
= GET_H_GR (((UINT
) 11));
4937 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4938 written
|= (1 << 23);
4939 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4941 tmp_addr
= ADDSI (tmp_addr
, 4);
4944 if (GESI (FLD (f_operand2
), 10)) {
4947 tmp_tmp
= GET_H_GR (((UINT
) 10));
4950 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4951 written
|= (1 << 23);
4952 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4954 tmp_addr
= ADDSI (tmp_addr
, 4);
4957 if (GESI (FLD (f_operand2
), 9)) {
4960 tmp_tmp
= GET_H_GR (((UINT
) 9));
4963 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4964 written
|= (1 << 23);
4965 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4967 tmp_addr
= ADDSI (tmp_addr
, 4);
4970 if (GESI (FLD (f_operand2
), 8)) {
4973 tmp_tmp
= GET_H_GR (((UINT
) 8));
4976 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4977 written
|= (1 << 23);
4978 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4980 tmp_addr
= ADDSI (tmp_addr
, 4);
4983 if (GESI (FLD (f_operand2
), 7)) {
4986 tmp_tmp
= GET_H_GR (((UINT
) 7));
4989 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4990 written
|= (1 << 23);
4991 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4993 tmp_addr
= ADDSI (tmp_addr
, 4);
4996 if (GESI (FLD (f_operand2
), 6)) {
4999 tmp_tmp
= GET_H_GR (((UINT
) 6));
5002 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5003 written
|= (1 << 23);
5004 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5006 tmp_addr
= ADDSI (tmp_addr
, 4);
5009 if (GESI (FLD (f_operand2
), 5)) {
5012 tmp_tmp
= GET_H_GR (((UINT
) 5));
5015 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5016 written
|= (1 << 23);
5017 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5019 tmp_addr
= ADDSI (tmp_addr
, 4);
5022 if (GESI (FLD (f_operand2
), 4)) {
5025 tmp_tmp
= GET_H_GR (((UINT
) 4));
5028 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5029 written
|= (1 << 23);
5030 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5032 tmp_addr
= ADDSI (tmp_addr
, 4);
5035 if (GESI (FLD (f_operand2
), 3)) {
5038 tmp_tmp
= GET_H_GR (((UINT
) 3));
5041 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5042 written
|= (1 << 23);
5043 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5045 tmp_addr
= ADDSI (tmp_addr
, 4);
5048 if (GESI (FLD (f_operand2
), 2)) {
5051 tmp_tmp
= GET_H_GR (((UINT
) 2));
5054 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5055 written
|= (1 << 23);
5056 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5058 tmp_addr
= ADDSI (tmp_addr
, 4);
5061 if (GESI (FLD (f_operand2
), 1)) {
5064 tmp_tmp
= GET_H_GR (((UINT
) 1));
5067 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5068 written
|= (1 << 23);
5069 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5071 tmp_addr
= ADDSI (tmp_addr
, 4);
5074 if (GESI (FLD (f_operand2
), 0)) {
5077 tmp_tmp
= GET_H_GR (((UINT
) 0));
5080 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5081 written
|= (1 << 23);
5082 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5084 tmp_addr
= ADDSI (tmp_addr
, 4);
5088 if (NEBI (tmp_postinc
, 0)) {
5090 SI opval
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr
) : (CPU (h_prefixreg_pre_v32
)));
5091 SET_H_GR (FLD (f_operand1
), opval
);
5092 written
|= (1 << 22);
5093 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5099 CPU (h_xbit
) = opval
;
5100 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5104 SET_H_INSN_PREFIXED_P (opval
);
5105 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5110 abuf
->written
= written
;
5115 CASE (sem
, INSN_MOVEM_M_R
) : /* movem [${Rs}${inc}],${Rd} */
5117 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5118 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5119 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
5120 int UNUSED written
= 0;
5121 IADDR UNUSED pc
= abuf
->addr
;
5122 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5127 tmp_postinc
= FLD (f_memmode
);
5128 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5131 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
5134 if (GESI (FLD (f_operand2
), 14)) {
5137 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5140 SET_H_GR (((UINT
) 14), opval
);
5141 written
|= (1 << 14);
5142 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5144 tmp_addr
= ADDSI (tmp_addr
, 4);
5147 if (GESI (FLD (f_operand2
), 13)) {
5150 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5153 SET_H_GR (((UINT
) 13), opval
);
5154 written
|= (1 << 13);
5155 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5157 tmp_addr
= ADDSI (tmp_addr
, 4);
5160 if (GESI (FLD (f_operand2
), 12)) {
5163 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5166 SET_H_GR (((UINT
) 12), opval
);
5167 written
|= (1 << 12);
5168 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5170 tmp_addr
= ADDSI (tmp_addr
, 4);
5173 if (GESI (FLD (f_operand2
), 11)) {
5176 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5179 SET_H_GR (((UINT
) 11), opval
);
5180 written
|= (1 << 11);
5181 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5183 tmp_addr
= ADDSI (tmp_addr
, 4);
5186 if (GESI (FLD (f_operand2
), 10)) {
5189 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5192 SET_H_GR (((UINT
) 10), opval
);
5193 written
|= (1 << 10);
5194 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5196 tmp_addr
= ADDSI (tmp_addr
, 4);
5199 if (GESI (FLD (f_operand2
), 9)) {
5202 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5205 SET_H_GR (((UINT
) 9), opval
);
5206 written
|= (1 << 22);
5207 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5209 tmp_addr
= ADDSI (tmp_addr
, 4);
5212 if (GESI (FLD (f_operand2
), 8)) {
5215 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5218 SET_H_GR (((UINT
) 8), opval
);
5219 written
|= (1 << 21);
5220 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5222 tmp_addr
= ADDSI (tmp_addr
, 4);
5225 if (GESI (FLD (f_operand2
), 7)) {
5228 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5231 SET_H_GR (((UINT
) 7), opval
);
5232 written
|= (1 << 20);
5233 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5235 tmp_addr
= ADDSI (tmp_addr
, 4);
5238 if (GESI (FLD (f_operand2
), 6)) {
5241 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5244 SET_H_GR (((UINT
) 6), opval
);
5245 written
|= (1 << 19);
5246 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5248 tmp_addr
= ADDSI (tmp_addr
, 4);
5251 if (GESI (FLD (f_operand2
), 5)) {
5254 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5257 SET_H_GR (((UINT
) 5), opval
);
5258 written
|= (1 << 18);
5259 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5261 tmp_addr
= ADDSI (tmp_addr
, 4);
5264 if (GESI (FLD (f_operand2
), 4)) {
5267 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5270 SET_H_GR (((UINT
) 4), opval
);
5271 written
|= (1 << 17);
5272 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5274 tmp_addr
= ADDSI (tmp_addr
, 4);
5277 if (GESI (FLD (f_operand2
), 3)) {
5280 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5283 SET_H_GR (((UINT
) 3), opval
);
5284 written
|= (1 << 16);
5285 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5287 tmp_addr
= ADDSI (tmp_addr
, 4);
5290 if (GESI (FLD (f_operand2
), 2)) {
5293 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5296 SET_H_GR (((UINT
) 2), opval
);
5297 written
|= (1 << 15);
5298 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5300 tmp_addr
= ADDSI (tmp_addr
, 4);
5303 if (GESI (FLD (f_operand2
), 1)) {
5306 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5309 SET_H_GR (((UINT
) 1), opval
);
5310 written
|= (1 << 9);
5311 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5313 tmp_addr
= ADDSI (tmp_addr
, 4);
5316 if (GESI (FLD (f_operand2
), 0)) {
5319 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5322 SET_H_GR (((UINT
) 0), opval
);
5323 written
|= (1 << 8);
5324 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5326 tmp_addr
= ADDSI (tmp_addr
, 4);
5330 if (NEBI (tmp_postinc
, 0)) {
5332 SI opval
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr
) : (CPU (h_prefixreg_pre_v32
)));
5333 SET_H_GR (FLD (f_operand1
), opval
);
5334 written
|= (1 << 7);
5335 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5341 CPU (h_xbit
) = opval
;
5342 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5346 SET_H_INSN_PREFIXED_P (opval
);
5347 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5352 abuf
->written
= written
;
5357 CASE (sem
, INSN_MOVEM_M_PC
) : /* movem [${Rs}${inc}],${Rd} */
5359 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5360 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5361 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
5362 int UNUSED written
= 0;
5363 IADDR UNUSED pc
= abuf
->addr
;
5365 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5370 tmp_postinc
= FLD (f_memmode
);
5371 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5374 USI opval
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5375 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
5376 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
5378 tmp_addr
= ADDSI (tmp_addr
, 4);
5381 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5384 SET_H_GR (((UINT
) 14), opval
);
5385 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5387 tmp_addr
= ADDSI (tmp_addr
, 4);
5391 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5394 SET_H_GR (((UINT
) 13), opval
);
5395 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5397 tmp_addr
= ADDSI (tmp_addr
, 4);
5401 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5404 SET_H_GR (((UINT
) 12), opval
);
5405 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5407 tmp_addr
= ADDSI (tmp_addr
, 4);
5411 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5414 SET_H_GR (((UINT
) 11), opval
);
5415 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5417 tmp_addr
= ADDSI (tmp_addr
, 4);
5421 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5424 SET_H_GR (((UINT
) 10), opval
);
5425 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5427 tmp_addr
= ADDSI (tmp_addr
, 4);
5431 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5434 SET_H_GR (((UINT
) 9), opval
);
5435 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5437 tmp_addr
= ADDSI (tmp_addr
, 4);
5441 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5444 SET_H_GR (((UINT
) 8), opval
);
5445 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5447 tmp_addr
= ADDSI (tmp_addr
, 4);
5451 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5454 SET_H_GR (((UINT
) 7), opval
);
5455 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5457 tmp_addr
= ADDSI (tmp_addr
, 4);
5461 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5464 SET_H_GR (((UINT
) 6), opval
);
5465 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5467 tmp_addr
= ADDSI (tmp_addr
, 4);
5471 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5474 SET_H_GR (((UINT
) 5), opval
);
5475 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5477 tmp_addr
= ADDSI (tmp_addr
, 4);
5481 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5484 SET_H_GR (((UINT
) 4), opval
);
5485 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5487 tmp_addr
= ADDSI (tmp_addr
, 4);
5491 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5494 SET_H_GR (((UINT
) 3), opval
);
5495 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5497 tmp_addr
= ADDSI (tmp_addr
, 4);
5501 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5504 SET_H_GR (((UINT
) 2), opval
);
5505 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5507 tmp_addr
= ADDSI (tmp_addr
, 4);
5511 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5514 SET_H_GR (((UINT
) 1), opval
);
5515 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5517 tmp_addr
= ADDSI (tmp_addr
, 4);
5521 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5524 SET_H_GR (((UINT
) 0), opval
);
5525 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5527 tmp_addr
= ADDSI (tmp_addr
, 4);
5530 if (NEBI (tmp_postinc
, 0)) {
5532 SI opval
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr
) : (CPU (h_prefixreg_pre_v32
)));
5533 SET_H_GR (FLD (f_operand1
), opval
);
5534 written
|= (1 << 5);
5535 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5541 CPU (h_xbit
) = opval
;
5542 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5546 SET_H_INSN_PREFIXED_P (opval
);
5547 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5552 abuf
->written
= written
;
5553 SEM_BRANCH_FINI (vpc
);
5558 CASE (sem
, INSN_ADD_B_R
) : /* add.b $Rs,$Rd */
5560 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5561 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5562 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5563 int UNUSED written
= 0;
5564 IADDR UNUSED pc
= abuf
->addr
;
5565 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5572 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5573 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5574 tmp_carry
= CPU (h_cbit
);
5575 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5578 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
5580 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5581 SET_H_GR (FLD (f_operand2
), opval
);
5582 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5587 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))));
5588 CPU (h_cbit
) = opval
;
5589 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5592 BI opval
= LTQI (tmp_newval
, 0);
5593 CPU (h_nbit
) = opval
;
5594 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5597 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5598 CPU (h_zbit
) = opval
;
5599 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5602 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)));
5603 CPU (h_vbit
) = opval
;
5604 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5609 CPU (h_xbit
) = opval
;
5610 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5614 SET_H_INSN_PREFIXED_P (opval
);
5615 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5625 CASE (sem
, INSN_ADD_W_R
) : /* add.w $Rs,$Rd */
5627 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5628 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5629 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5630 int UNUSED written
= 0;
5631 IADDR UNUSED pc
= abuf
->addr
;
5632 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5639 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5640 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5641 tmp_carry
= CPU (h_cbit
);
5642 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5645 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
5647 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5648 SET_H_GR (FLD (f_operand2
), opval
);
5649 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5654 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))));
5655 CPU (h_cbit
) = opval
;
5656 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5659 BI opval
= LTHI (tmp_newval
, 0);
5660 CPU (h_nbit
) = opval
;
5661 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5664 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5665 CPU (h_zbit
) = opval
;
5666 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5669 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)));
5670 CPU (h_vbit
) = opval
;
5671 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5676 CPU (h_xbit
) = opval
;
5677 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5681 SET_H_INSN_PREFIXED_P (opval
);
5682 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5692 CASE (sem
, INSN_ADD_D_R
) : /* add.d $Rs,$Rd */
5694 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5695 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5696 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5697 int UNUSED written
= 0;
5698 IADDR UNUSED pc
= abuf
->addr
;
5699 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5706 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5707 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5708 tmp_carry
= CPU (h_cbit
);
5709 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5711 SI opval
= tmp_newval
;
5712 SET_H_GR (FLD (f_operand2
), opval
);
5713 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5717 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))));
5718 CPU (h_cbit
) = opval
;
5719 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5722 BI opval
= LTSI (tmp_newval
, 0);
5723 CPU (h_nbit
) = opval
;
5724 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5727 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5728 CPU (h_zbit
) = opval
;
5729 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5732 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)));
5733 CPU (h_vbit
) = opval
;
5734 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5739 CPU (h_xbit
) = opval
;
5740 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5744 SET_H_INSN_PREFIXED_P (opval
);
5745 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5755 CASE (sem
, INSN_ADD_M_B_M
) : /* add-m.b [${Rs}${inc}],${Rd} */
5757 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5758 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5759 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5760 int UNUSED written
= 0;
5761 IADDR UNUSED pc
= abuf
->addr
;
5762 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5769 tmp_tmpops
= ({ SI tmp_addr
;
5772 tmp_postinc
= FLD (f_memmode
);
5773 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5774 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
5775 ; if (NEBI (tmp_postinc
, 0)) {
5777 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5778 tmp_addr
= ADDSI (tmp_addr
, 1);
5781 SI opval
= tmp_addr
;
5782 SET_H_GR (FLD (f_operand1
), opval
);
5783 written
|= (1 << 12);
5784 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5789 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5790 tmp_carry
= CPU (h_cbit
);
5791 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5794 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5796 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5797 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5798 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5803 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))));
5804 CPU (h_cbit
) = opval
;
5805 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5808 BI opval
= LTQI (tmp_newval
, 0);
5809 CPU (h_nbit
) = opval
;
5810 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5813 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5814 CPU (h_zbit
) = opval
;
5815 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5818 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)));
5819 CPU (h_vbit
) = opval
;
5820 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5825 CPU (h_xbit
) = opval
;
5826 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5830 SET_H_INSN_PREFIXED_P (opval
);
5831 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5837 abuf
->written
= written
;
5842 CASE (sem
, INSN_ADD_M_W_M
) : /* add-m.w [${Rs}${inc}],${Rd} */
5844 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5845 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5846 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5847 int UNUSED written
= 0;
5848 IADDR UNUSED pc
= abuf
->addr
;
5849 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5856 tmp_tmpops
= ({ SI tmp_addr
;
5859 tmp_postinc
= FLD (f_memmode
);
5860 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5861 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
5862 ; if (NEBI (tmp_postinc
, 0)) {
5864 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5865 tmp_addr
= ADDSI (tmp_addr
, 2);
5868 SI opval
= tmp_addr
;
5869 SET_H_GR (FLD (f_operand1
), opval
);
5870 written
|= (1 << 12);
5871 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5876 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5877 tmp_carry
= CPU (h_cbit
);
5878 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5881 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5883 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5884 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5885 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5890 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTHI (tmp_tmpopd
, 0), GEHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_newval
, 0))));
5891 CPU (h_cbit
) = opval
;
5892 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5895 BI opval
= LTHI (tmp_newval
, 0);
5896 CPU (h_nbit
) = opval
;
5897 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5900 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5901 CPU (h_zbit
) = opval
;
5902 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5905 BI opval
= ORIF (ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
5906 CPU (h_vbit
) = opval
;
5907 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5912 CPU (h_xbit
) = opval
;
5913 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5917 SET_H_INSN_PREFIXED_P (opval
);
5918 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5924 abuf
->written
= written
;
5929 CASE (sem
, INSN_ADD_M_D_M
) : /* add-m.d [${Rs}${inc}],${Rd} */
5931 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5932 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5933 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5934 int UNUSED written
= 0;
5935 IADDR UNUSED pc
= abuf
->addr
;
5936 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5943 tmp_tmpops
= ({ SI tmp_addr
;
5946 tmp_postinc
= FLD (f_memmode
);
5947 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5948 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5949 ; if (NEBI (tmp_postinc
, 0)) {
5951 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5952 tmp_addr
= ADDSI (tmp_addr
, 4);
5955 SI opval
= tmp_addr
;
5956 SET_H_GR (FLD (f_operand1
), opval
);
5957 written
|= (1 << 11);
5958 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5963 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5964 tmp_carry
= CPU (h_cbit
);
5965 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5967 SI opval
= tmp_newval
;
5968 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5969 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5973 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))));
5974 CPU (h_cbit
) = opval
;
5975 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5978 BI opval
= LTSI (tmp_newval
, 0);
5979 CPU (h_nbit
) = opval
;
5980 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5983 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5984 CPU (h_zbit
) = opval
;
5985 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5988 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)));
5989 CPU (h_vbit
) = opval
;
5990 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5995 CPU (h_xbit
) = opval
;
5996 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6000 SET_H_INSN_PREFIXED_P (opval
);
6001 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6007 abuf
->written
= written
;
6012 CASE (sem
, INSN_ADDCBR
) : /* add.b ${sconst8}],${Rd} */
6014 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6015 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6016 #define FLD(f) abuf->fields.sfmt_addcbr.f
6017 int UNUSED written
= 0;
6018 IADDR UNUSED pc
= abuf
->addr
;
6019 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6026 tmp_tmpops
= FLD (f_indir_pc__byte
);
6027 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6028 tmp_carry
= CPU (h_cbit
);
6029 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6032 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
6034 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
6035 SET_H_GR (FLD (f_operand2
), opval
);
6036 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6041 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))));
6042 CPU (h_cbit
) = opval
;
6043 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6046 BI opval
= LTQI (tmp_newval
, 0);
6047 CPU (h_nbit
) = opval
;
6048 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6051 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6052 CPU (h_zbit
) = opval
;
6053 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6056 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)));
6057 CPU (h_vbit
) = opval
;
6058 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6063 CPU (h_xbit
) = opval
;
6064 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6068 SET_H_INSN_PREFIXED_P (opval
);
6069 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6079 CASE (sem
, INSN_ADDCWR
) : /* add.w ${sconst16}],${Rd} */
6081 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6082 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6083 #define FLD(f) abuf->fields.sfmt_addcwr.f
6084 int UNUSED written
= 0;
6085 IADDR UNUSED pc
= abuf
->addr
;
6086 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6093 tmp_tmpops
= FLD (f_indir_pc__word
);
6094 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6095 tmp_carry
= CPU (h_cbit
);
6096 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6099 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
6101 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
6102 SET_H_GR (FLD (f_operand2
), opval
);
6103 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6108 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))));
6109 CPU (h_cbit
) = opval
;
6110 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6113 BI opval
= LTHI (tmp_newval
, 0);
6114 CPU (h_nbit
) = opval
;
6115 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6118 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6119 CPU (h_zbit
) = opval
;
6120 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6123 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)));
6124 CPU (h_vbit
) = opval
;
6125 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6130 CPU (h_xbit
) = opval
;
6131 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6135 SET_H_INSN_PREFIXED_P (opval
);
6136 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6146 CASE (sem
, INSN_ADDCDR
) : /* add.d ${const32}],${Rd} */
6148 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6149 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6150 #define FLD(f) abuf->fields.sfmt_addcdr.f
6151 int UNUSED written
= 0;
6152 IADDR UNUSED pc
= abuf
->addr
;
6153 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6160 tmp_tmpops
= FLD (f_indir_pc__dword
);
6161 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6162 tmp_carry
= CPU (h_cbit
);
6163 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6165 SI opval
= tmp_newval
;
6166 SET_H_GR (FLD (f_operand2
), opval
);
6167 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6171 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))));
6172 CPU (h_cbit
) = opval
;
6173 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6176 BI opval
= LTSI (tmp_newval
, 0);
6177 CPU (h_nbit
) = opval
;
6178 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6181 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6182 CPU (h_zbit
) = opval
;
6183 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6186 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)));
6187 CPU (h_vbit
) = opval
;
6188 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6193 CPU (h_xbit
) = opval
;
6194 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6198 SET_H_INSN_PREFIXED_P (opval
);
6199 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6209 CASE (sem
, INSN_ADDCPC
) : /* add.d ${sconst32},PC */
6211 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6212 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6213 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
6214 int UNUSED written
= 0;
6215 IADDR UNUSED pc
= abuf
->addr
;
6217 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6223 tmp_offs
= FLD (f_indir_pc__dword
);
6224 tmp_oldpc
= ADDSI (pc
, 6);
6225 tmp_newpc
= ADDSI (tmp_oldpc
, tmp_offs
);
6227 USI opval
= tmp_newpc
;
6228 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
6229 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
6233 BI opval
= ORIF (ANDIF (LTSI (tmp_offs
, 0), LTSI (tmp_oldpc
, 0)), ORIF (ANDIF (LTSI (tmp_oldpc
, 0), GESI (tmp_newpc
, 0)), ANDIF (LTSI (tmp_offs
, 0), GESI (tmp_newpc
, 0))));
6234 CPU (h_cbit
) = opval
;
6235 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6238 BI opval
= LTSI (tmp_newpc
, 0);
6239 CPU (h_nbit
) = opval
;
6240 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6243 BI opval
= ANDIF (EQSI (tmp_newpc
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6244 CPU (h_zbit
) = opval
;
6245 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6248 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_offs
, 0), LTSI (tmp_oldpc
, 0)), GESI (tmp_newpc
, 0)), ANDIF (ANDIF (GESI (tmp_offs
, 0), GESI (tmp_oldpc
, 0)), LTSI (tmp_newpc
, 0)));
6249 CPU (h_vbit
) = opval
;
6250 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6255 CPU (h_xbit
) = opval
;
6256 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6260 SET_H_INSN_PREFIXED_P (opval
);
6261 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6267 SEM_BRANCH_FINI (vpc
);
6272 CASE (sem
, INSN_ADDS_B_R
) : /* adds.b $Rs,$Rd */
6274 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6275 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6276 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6277 int UNUSED written
= 0;
6278 IADDR UNUSED pc
= abuf
->addr
;
6279 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6286 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6287 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6288 tmp_carry
= CPU (h_cbit
);
6289 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6291 SI opval
= tmp_newval
;
6292 SET_H_GR (FLD (f_operand2
), opval
);
6293 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6297 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))));
6298 CPU (h_cbit
) = opval
;
6299 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6302 BI opval
= LTSI (tmp_newval
, 0);
6303 CPU (h_nbit
) = opval
;
6304 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6307 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6308 CPU (h_zbit
) = opval
;
6309 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6312 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)));
6313 CPU (h_vbit
) = opval
;
6314 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6319 CPU (h_xbit
) = opval
;
6320 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6324 SET_H_INSN_PREFIXED_P (opval
);
6325 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6335 CASE (sem
, INSN_ADDS_W_R
) : /* adds.w $Rs,$Rd */
6337 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6338 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6339 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6340 int UNUSED written
= 0;
6341 IADDR UNUSED pc
= abuf
->addr
;
6342 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6349 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6350 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6351 tmp_carry
= CPU (h_cbit
);
6352 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6354 SI opval
= tmp_newval
;
6355 SET_H_GR (FLD (f_operand2
), opval
);
6356 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6360 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))));
6361 CPU (h_cbit
) = opval
;
6362 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6365 BI opval
= LTSI (tmp_newval
, 0);
6366 CPU (h_nbit
) = opval
;
6367 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6370 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6371 CPU (h_zbit
) = opval
;
6372 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6375 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)));
6376 CPU (h_vbit
) = opval
;
6377 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6382 CPU (h_xbit
) = opval
;
6383 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6387 SET_H_INSN_PREFIXED_P (opval
);
6388 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6398 CASE (sem
, INSN_ADDS_M_B_M
) : /* adds-m.b [${Rs}${inc}],$Rd */
6400 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6401 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6402 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6403 int UNUSED written
= 0;
6404 IADDR UNUSED pc
= abuf
->addr
;
6405 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6412 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
6415 tmp_postinc
= FLD (f_memmode
);
6416 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6417 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6418 ; if (NEBI (tmp_postinc
, 0)) {
6420 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6421 tmp_addr
= ADDSI (tmp_addr
, 1);
6424 SI opval
= tmp_addr
;
6425 SET_H_GR (FLD (f_operand1
), opval
);
6426 written
|= (1 << 11);
6427 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6432 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6433 tmp_carry
= CPU (h_cbit
);
6434 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6436 SI opval
= tmp_newval
;
6437 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6438 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6442 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))));
6443 CPU (h_cbit
) = opval
;
6444 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6447 BI opval
= LTSI (tmp_newval
, 0);
6448 CPU (h_nbit
) = opval
;
6449 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6452 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6453 CPU (h_zbit
) = opval
;
6454 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6457 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)));
6458 CPU (h_vbit
) = opval
;
6459 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6464 CPU (h_xbit
) = opval
;
6465 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6469 SET_H_INSN_PREFIXED_P (opval
);
6470 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6476 abuf
->written
= written
;
6481 CASE (sem
, INSN_ADDS_M_W_M
) : /* adds-m.w [${Rs}${inc}],$Rd */
6483 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6484 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6485 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6486 int UNUSED written
= 0;
6487 IADDR UNUSED pc
= abuf
->addr
;
6488 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6495 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
6498 tmp_postinc
= FLD (f_memmode
);
6499 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6500 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6501 ; if (NEBI (tmp_postinc
, 0)) {
6503 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6504 tmp_addr
= ADDSI (tmp_addr
, 2);
6507 SI opval
= tmp_addr
;
6508 SET_H_GR (FLD (f_operand1
), opval
);
6509 written
|= (1 << 11);
6510 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6515 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6516 tmp_carry
= CPU (h_cbit
);
6517 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6519 SI opval
= tmp_newval
;
6520 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6521 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6525 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))));
6526 CPU (h_cbit
) = opval
;
6527 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6530 BI opval
= LTSI (tmp_newval
, 0);
6531 CPU (h_nbit
) = opval
;
6532 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6535 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6536 CPU (h_zbit
) = opval
;
6537 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6540 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)));
6541 CPU (h_vbit
) = opval
;
6542 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6547 CPU (h_xbit
) = opval
;
6548 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6552 SET_H_INSN_PREFIXED_P (opval
);
6553 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6559 abuf
->written
= written
;
6564 CASE (sem
, INSN_ADDSCBR
) : /* [${Rs}${inc}],$Rd */
6566 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6567 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6568 #define FLD(f) abuf->fields.sfmt_addcbr.f
6569 int UNUSED written
= 0;
6570 IADDR UNUSED pc
= abuf
->addr
;
6571 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6578 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6579 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6580 tmp_carry
= CPU (h_cbit
);
6581 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6583 SI opval
= tmp_newval
;
6584 SET_H_GR (FLD (f_operand2
), opval
);
6585 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6589 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))));
6590 CPU (h_cbit
) = opval
;
6591 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6594 BI opval
= LTSI (tmp_newval
, 0);
6595 CPU (h_nbit
) = opval
;
6596 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6599 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6600 CPU (h_zbit
) = opval
;
6601 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6604 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)));
6605 CPU (h_vbit
) = opval
;
6606 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6611 CPU (h_xbit
) = opval
;
6612 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6616 SET_H_INSN_PREFIXED_P (opval
);
6617 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6627 CASE (sem
, INSN_ADDSCWR
) : /* [${Rs}${inc}],$Rd */
6629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6631 #define FLD(f) abuf->fields.sfmt_addcwr.f
6632 int UNUSED written
= 0;
6633 IADDR UNUSED pc
= abuf
->addr
;
6634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6641 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6642 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6643 tmp_carry
= CPU (h_cbit
);
6644 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6646 SI opval
= tmp_newval
;
6647 SET_H_GR (FLD (f_operand2
), opval
);
6648 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6652 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))));
6653 CPU (h_cbit
) = opval
;
6654 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6657 BI opval
= LTSI (tmp_newval
, 0);
6658 CPU (h_nbit
) = opval
;
6659 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6662 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6663 CPU (h_zbit
) = opval
;
6664 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6667 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)));
6668 CPU (h_vbit
) = opval
;
6669 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6674 CPU (h_xbit
) = opval
;
6675 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6679 SET_H_INSN_PREFIXED_P (opval
);
6680 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6690 CASE (sem
, INSN_ADDSPCPC
) : /* adds.w [PC],PC */
6692 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6693 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6694 #define FLD(f) abuf->fields.fmt_empty.f
6695 int UNUSED written
= 0;
6696 IADDR UNUSED pc
= abuf
->addr
;
6698 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6704 if (NOTBI (GET_H_INSN_PREFIXED_P ())) {
6705 cgen_rtx_error (current_cpu
, "Unexpected adds.w [PC],PC without prefix");
6707 tmp_offs
= GETMEMHI (current_cpu
, pc
, CPU (h_prefixreg_pre_v32
));
6708 tmp_oldpc
= ADDSI (pc
, 2);
6709 tmp_newpc
= ADDSI (tmp_oldpc
, tmp_offs
);
6711 USI opval
= tmp_newpc
;
6712 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
6713 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
6717 BI opval
= ORIF (ANDIF (LTSI (EXTHISI (tmp_offs
), 0), LTSI (tmp_oldpc
, 0)), ORIF (ANDIF (LTSI (tmp_oldpc
, 0), GESI (tmp_newpc
, 0)), ANDIF (LTSI (EXTHISI (tmp_offs
), 0), GESI (tmp_newpc
, 0))));
6718 CPU (h_cbit
) = opval
;
6719 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6722 BI opval
= LTSI (tmp_newpc
, 0);
6723 CPU (h_nbit
) = opval
;
6724 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6727 BI opval
= ANDIF (EQSI (tmp_newpc
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6728 CPU (h_zbit
) = opval
;
6729 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6732 BI opval
= ORIF (ANDIF (ANDIF (LTSI (EXTHISI (tmp_offs
), 0), LTSI (tmp_oldpc
, 0)), GESI (tmp_newpc
, 0)), ANDIF (ANDIF (GESI (EXTHISI (tmp_offs
), 0), GESI (tmp_oldpc
, 0)), LTSI (tmp_newpc
, 0)));
6733 CPU (h_vbit
) = opval
;
6734 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6739 CPU (h_xbit
) = opval
;
6740 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6744 SET_H_INSN_PREFIXED_P (opval
);
6745 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6751 SEM_BRANCH_FINI (vpc
);
6756 CASE (sem
, INSN_ADDU_B_R
) : /* addu.b $Rs,$Rd */
6758 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6759 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6760 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6761 int UNUSED written
= 0;
6762 IADDR UNUSED pc
= abuf
->addr
;
6763 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6770 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6771 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6772 tmp_carry
= CPU (h_cbit
);
6773 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6775 SI opval
= tmp_newval
;
6776 SET_H_GR (FLD (f_operand2
), opval
);
6777 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6781 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))));
6782 CPU (h_cbit
) = opval
;
6783 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6786 BI opval
= LTSI (tmp_newval
, 0);
6787 CPU (h_nbit
) = opval
;
6788 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6791 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6792 CPU (h_zbit
) = opval
;
6793 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6796 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)));
6797 CPU (h_vbit
) = opval
;
6798 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6803 CPU (h_xbit
) = opval
;
6804 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6808 SET_H_INSN_PREFIXED_P (opval
);
6809 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6819 CASE (sem
, INSN_ADDU_W_R
) : /* addu.w $Rs,$Rd */
6821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6823 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6824 int UNUSED written
= 0;
6825 IADDR UNUSED pc
= abuf
->addr
;
6826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6833 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6834 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6835 tmp_carry
= CPU (h_cbit
);
6836 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6838 SI opval
= tmp_newval
;
6839 SET_H_GR (FLD (f_operand2
), opval
);
6840 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6844 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))));
6845 CPU (h_cbit
) = opval
;
6846 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6849 BI opval
= LTSI (tmp_newval
, 0);
6850 CPU (h_nbit
) = opval
;
6851 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6854 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6855 CPU (h_zbit
) = opval
;
6856 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6859 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)));
6860 CPU (h_vbit
) = opval
;
6861 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6866 CPU (h_xbit
) = opval
;
6867 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6871 SET_H_INSN_PREFIXED_P (opval
);
6872 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6882 CASE (sem
, INSN_ADDU_M_B_M
) : /* addu-m.b [${Rs}${inc}],$Rd */
6884 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6885 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6886 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6887 int UNUSED written
= 0;
6888 IADDR UNUSED pc
= abuf
->addr
;
6889 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6896 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
6899 tmp_postinc
= FLD (f_memmode
);
6900 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6901 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6902 ; if (NEBI (tmp_postinc
, 0)) {
6904 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6905 tmp_addr
= ADDSI (tmp_addr
, 1);
6908 SI opval
= tmp_addr
;
6909 SET_H_GR (FLD (f_operand1
), opval
);
6910 written
|= (1 << 11);
6911 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6916 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6917 tmp_carry
= CPU (h_cbit
);
6918 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6920 SI opval
= tmp_newval
;
6921 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6922 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6926 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))));
6927 CPU (h_cbit
) = opval
;
6928 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6931 BI opval
= LTSI (tmp_newval
, 0);
6932 CPU (h_nbit
) = opval
;
6933 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6936 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6937 CPU (h_zbit
) = opval
;
6938 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6941 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)));
6942 CPU (h_vbit
) = opval
;
6943 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6948 CPU (h_xbit
) = opval
;
6949 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6953 SET_H_INSN_PREFIXED_P (opval
);
6954 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6960 abuf
->written
= written
;
6965 CASE (sem
, INSN_ADDU_M_W_M
) : /* addu-m.w [${Rs}${inc}],$Rd */
6967 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6968 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6969 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6970 int UNUSED written
= 0;
6971 IADDR UNUSED pc
= abuf
->addr
;
6972 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6979 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
6982 tmp_postinc
= FLD (f_memmode
);
6983 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6984 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6985 ; if (NEBI (tmp_postinc
, 0)) {
6987 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6988 tmp_addr
= ADDSI (tmp_addr
, 2);
6991 SI opval
= tmp_addr
;
6992 SET_H_GR (FLD (f_operand1
), opval
);
6993 written
|= (1 << 11);
6994 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6999 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7000 tmp_carry
= CPU (h_cbit
);
7001 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7003 SI opval
= tmp_newval
;
7004 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7005 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7009 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))));
7010 CPU (h_cbit
) = opval
;
7011 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7014 BI opval
= LTSI (tmp_newval
, 0);
7015 CPU (h_nbit
) = opval
;
7016 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7019 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7020 CPU (h_zbit
) = opval
;
7021 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7024 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)));
7025 CPU (h_vbit
) = opval
;
7026 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7031 CPU (h_xbit
) = opval
;
7032 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7036 SET_H_INSN_PREFIXED_P (opval
);
7037 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7043 abuf
->written
= written
;
7048 CASE (sem
, INSN_ADDUCBR
) : /* [${Rs}${inc}],$Rd */
7050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7052 #define FLD(f) abuf->fields.sfmt_addcbr.f
7053 int UNUSED written
= 0;
7054 IADDR UNUSED pc
= abuf
->addr
;
7055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7062 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
7063 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7064 tmp_carry
= CPU (h_cbit
);
7065 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7067 SI opval
= tmp_newval
;
7068 SET_H_GR (FLD (f_operand2
), opval
);
7069 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7073 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))));
7074 CPU (h_cbit
) = opval
;
7075 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7078 BI opval
= LTSI (tmp_newval
, 0);
7079 CPU (h_nbit
) = opval
;
7080 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7083 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7084 CPU (h_zbit
) = opval
;
7085 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7088 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)));
7089 CPU (h_vbit
) = opval
;
7090 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7095 CPU (h_xbit
) = opval
;
7096 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7100 SET_H_INSN_PREFIXED_P (opval
);
7101 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7111 CASE (sem
, INSN_ADDUCWR
) : /* [${Rs}${inc}],$Rd */
7113 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7114 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7115 #define FLD(f) abuf->fields.sfmt_addcwr.f
7116 int UNUSED written
= 0;
7117 IADDR UNUSED pc
= abuf
->addr
;
7118 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7125 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
7126 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7127 tmp_carry
= CPU (h_cbit
);
7128 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7130 SI opval
= tmp_newval
;
7131 SET_H_GR (FLD (f_operand2
), opval
);
7132 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7136 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))));
7137 CPU (h_cbit
) = opval
;
7138 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7141 BI opval
= LTSI (tmp_newval
, 0);
7142 CPU (h_nbit
) = opval
;
7143 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7146 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7147 CPU (h_zbit
) = opval
;
7148 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7151 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)));
7152 CPU (h_vbit
) = opval
;
7153 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7158 CPU (h_xbit
) = opval
;
7159 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7163 SET_H_INSN_PREFIXED_P (opval
);
7164 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7174 CASE (sem
, INSN_SUB_B_R
) : /* sub.b $Rs,$Rd */
7176 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7177 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7178 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7179 int UNUSED written
= 0;
7180 IADDR UNUSED pc
= abuf
->addr
;
7181 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7188 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7189 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7190 tmp_carry
= CPU (h_cbit
);
7191 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7194 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7196 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7197 SET_H_GR (FLD (f_operand2
), opval
);
7198 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7203 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))));
7204 CPU (h_cbit
) = opval
;
7205 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7208 BI opval
= LTQI (tmp_newval
, 0);
7209 CPU (h_nbit
) = opval
;
7210 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7213 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7214 CPU (h_zbit
) = opval
;
7215 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7218 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)));
7219 CPU (h_vbit
) = opval
;
7220 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7225 CPU (h_xbit
) = opval
;
7226 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7230 SET_H_INSN_PREFIXED_P (opval
);
7231 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7241 CASE (sem
, INSN_SUB_W_R
) : /* sub.w $Rs,$Rd */
7243 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7244 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7245 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7246 int UNUSED written
= 0;
7247 IADDR UNUSED pc
= abuf
->addr
;
7248 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7255 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7256 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7257 tmp_carry
= CPU (h_cbit
);
7258 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7261 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7263 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7264 SET_H_GR (FLD (f_operand2
), opval
);
7265 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7270 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))));
7271 CPU (h_cbit
) = opval
;
7272 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7275 BI opval
= LTHI (tmp_newval
, 0);
7276 CPU (h_nbit
) = opval
;
7277 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7280 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7281 CPU (h_zbit
) = opval
;
7282 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7285 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)));
7286 CPU (h_vbit
) = opval
;
7287 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7292 CPU (h_xbit
) = opval
;
7293 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7297 SET_H_INSN_PREFIXED_P (opval
);
7298 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7308 CASE (sem
, INSN_SUB_D_R
) : /* sub.d $Rs,$Rd */
7310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7312 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7313 int UNUSED written
= 0;
7314 IADDR UNUSED pc
= abuf
->addr
;
7315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7322 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7323 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7324 tmp_carry
= CPU (h_cbit
);
7325 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7327 SI opval
= tmp_newval
;
7328 SET_H_GR (FLD (f_operand2
), opval
);
7329 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7333 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))));
7334 CPU (h_cbit
) = opval
;
7335 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7338 BI opval
= LTSI (tmp_newval
, 0);
7339 CPU (h_nbit
) = opval
;
7340 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7343 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7344 CPU (h_zbit
) = opval
;
7345 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7348 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)));
7349 CPU (h_vbit
) = opval
;
7350 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7355 CPU (h_xbit
) = opval
;
7356 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7360 SET_H_INSN_PREFIXED_P (opval
);
7361 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7371 CASE (sem
, INSN_SUB_M_B_M
) : /* sub-m.b [${Rs}${inc}],${Rd} */
7373 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7374 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7375 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7376 int UNUSED written
= 0;
7377 IADDR UNUSED pc
= abuf
->addr
;
7378 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7385 tmp_tmpops
= ({ SI tmp_addr
;
7388 tmp_postinc
= FLD (f_memmode
);
7389 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7390 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7391 ; if (NEBI (tmp_postinc
, 0)) {
7393 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7394 tmp_addr
= ADDSI (tmp_addr
, 1);
7397 SI opval
= tmp_addr
;
7398 SET_H_GR (FLD (f_operand1
), opval
);
7399 written
|= (1 << 12);
7400 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7405 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7406 tmp_carry
= CPU (h_cbit
);
7407 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7410 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7412 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7413 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7414 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7419 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))));
7420 CPU (h_cbit
) = opval
;
7421 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7424 BI opval
= LTQI (tmp_newval
, 0);
7425 CPU (h_nbit
) = opval
;
7426 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7429 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7430 CPU (h_zbit
) = opval
;
7431 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7434 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)));
7435 CPU (h_vbit
) = opval
;
7436 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7441 CPU (h_xbit
) = opval
;
7442 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7446 SET_H_INSN_PREFIXED_P (opval
);
7447 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7453 abuf
->written
= written
;
7458 CASE (sem
, INSN_SUB_M_W_M
) : /* sub-m.w [${Rs}${inc}],${Rd} */
7460 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7461 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7462 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7463 int UNUSED written
= 0;
7464 IADDR UNUSED pc
= abuf
->addr
;
7465 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7472 tmp_tmpops
= ({ SI tmp_addr
;
7475 tmp_postinc
= FLD (f_memmode
);
7476 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7477 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7478 ; if (NEBI (tmp_postinc
, 0)) {
7480 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7481 tmp_addr
= ADDSI (tmp_addr
, 2);
7484 SI opval
= tmp_addr
;
7485 SET_H_GR (FLD (f_operand1
), opval
);
7486 written
|= (1 << 12);
7487 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7492 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7493 tmp_carry
= CPU (h_cbit
);
7494 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7497 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7499 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7500 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7501 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7506 BI opval
= ORIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEHI (tmp_tmpopd
, 0), LTHI (tmp_newval
, 0)), ANDIF (LTHI (tmp_tmpops
, 0), LTHI (tmp_newval
, 0))));
7507 CPU (h_cbit
) = opval
;
7508 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7511 BI opval
= LTHI (tmp_newval
, 0);
7512 CPU (h_nbit
) = opval
;
7513 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7516 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7517 CPU (h_zbit
) = opval
;
7518 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7521 BI opval
= ORIF (ANDIF (ANDIF (GEHI (tmp_tmpops
, 0), LTHI (tmp_tmpopd
, 0)), GEHI (tmp_newval
, 0)), ANDIF (ANDIF (LTHI (tmp_tmpops
, 0), GEHI (tmp_tmpopd
, 0)), LTHI (tmp_newval
, 0)));
7522 CPU (h_vbit
) = opval
;
7523 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7528 CPU (h_xbit
) = opval
;
7529 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7533 SET_H_INSN_PREFIXED_P (opval
);
7534 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7540 abuf
->written
= written
;
7545 CASE (sem
, INSN_SUB_M_D_M
) : /* sub-m.d [${Rs}${inc}],${Rd} */
7547 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7548 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7549 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7550 int UNUSED written
= 0;
7551 IADDR UNUSED pc
= abuf
->addr
;
7552 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7559 tmp_tmpops
= ({ SI tmp_addr
;
7562 tmp_postinc
= FLD (f_memmode
);
7563 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7564 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
7565 ; if (NEBI (tmp_postinc
, 0)) {
7567 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7568 tmp_addr
= ADDSI (tmp_addr
, 4);
7571 SI opval
= tmp_addr
;
7572 SET_H_GR (FLD (f_operand1
), opval
);
7573 written
|= (1 << 11);
7574 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7579 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7580 tmp_carry
= CPU (h_cbit
);
7581 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7583 SI opval
= tmp_newval
;
7584 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7585 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7589 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))));
7590 CPU (h_cbit
) = opval
;
7591 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7594 BI opval
= LTSI (tmp_newval
, 0);
7595 CPU (h_nbit
) = opval
;
7596 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7599 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7600 CPU (h_zbit
) = opval
;
7601 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7604 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)));
7605 CPU (h_vbit
) = opval
;
7606 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7611 CPU (h_xbit
) = opval
;
7612 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7616 SET_H_INSN_PREFIXED_P (opval
);
7617 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7623 abuf
->written
= written
;
7628 CASE (sem
, INSN_SUBCBR
) : /* sub.b ${sconst8}],${Rd} */
7630 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7631 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7632 #define FLD(f) abuf->fields.sfmt_addcbr.f
7633 int UNUSED written
= 0;
7634 IADDR UNUSED pc
= abuf
->addr
;
7635 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7642 tmp_tmpops
= FLD (f_indir_pc__byte
);
7643 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7644 tmp_carry
= CPU (h_cbit
);
7645 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7648 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7650 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7651 SET_H_GR (FLD (f_operand2
), opval
);
7652 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7657 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))));
7658 CPU (h_cbit
) = opval
;
7659 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7662 BI opval
= LTQI (tmp_newval
, 0);
7663 CPU (h_nbit
) = opval
;
7664 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7667 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7668 CPU (h_zbit
) = opval
;
7669 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7672 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)));
7673 CPU (h_vbit
) = opval
;
7674 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7679 CPU (h_xbit
) = opval
;
7680 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7684 SET_H_INSN_PREFIXED_P (opval
);
7685 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7695 CASE (sem
, INSN_SUBCWR
) : /* sub.w ${sconst16}],${Rd} */
7697 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7698 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7699 #define FLD(f) abuf->fields.sfmt_addcwr.f
7700 int UNUSED written
= 0;
7701 IADDR UNUSED pc
= abuf
->addr
;
7702 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7709 tmp_tmpops
= FLD (f_indir_pc__word
);
7710 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7711 tmp_carry
= CPU (h_cbit
);
7712 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7715 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7717 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7718 SET_H_GR (FLD (f_operand2
), opval
);
7719 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7724 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))));
7725 CPU (h_cbit
) = opval
;
7726 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7729 BI opval
= LTHI (tmp_newval
, 0);
7730 CPU (h_nbit
) = opval
;
7731 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7734 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7735 CPU (h_zbit
) = opval
;
7736 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7739 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)));
7740 CPU (h_vbit
) = opval
;
7741 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7746 CPU (h_xbit
) = opval
;
7747 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7751 SET_H_INSN_PREFIXED_P (opval
);
7752 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7762 CASE (sem
, INSN_SUBCDR
) : /* sub.d ${const32}],${Rd} */
7764 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7765 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7766 #define FLD(f) abuf->fields.sfmt_addcdr.f
7767 int UNUSED written
= 0;
7768 IADDR UNUSED pc
= abuf
->addr
;
7769 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
7776 tmp_tmpops
= FLD (f_indir_pc__dword
);
7777 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7778 tmp_carry
= CPU (h_cbit
);
7779 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7781 SI opval
= tmp_newval
;
7782 SET_H_GR (FLD (f_operand2
), opval
);
7783 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7787 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))));
7788 CPU (h_cbit
) = opval
;
7789 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7792 BI opval
= LTSI (tmp_newval
, 0);
7793 CPU (h_nbit
) = opval
;
7794 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7797 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7798 CPU (h_zbit
) = opval
;
7799 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7802 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)));
7803 CPU (h_vbit
) = opval
;
7804 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7809 CPU (h_xbit
) = opval
;
7810 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7814 SET_H_INSN_PREFIXED_P (opval
);
7815 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7825 CASE (sem
, INSN_SUBS_B_R
) : /* subs.b $Rs,$Rd */
7827 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7828 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7829 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7830 int UNUSED written
= 0;
7831 IADDR UNUSED pc
= abuf
->addr
;
7832 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7839 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
7840 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7841 tmp_carry
= CPU (h_cbit
);
7842 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7844 SI opval
= tmp_newval
;
7845 SET_H_GR (FLD (f_operand2
), opval
);
7846 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7850 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))));
7851 CPU (h_cbit
) = opval
;
7852 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7855 BI opval
= LTSI (tmp_newval
, 0);
7856 CPU (h_nbit
) = opval
;
7857 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7860 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7861 CPU (h_zbit
) = opval
;
7862 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7865 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)));
7866 CPU (h_vbit
) = opval
;
7867 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7872 CPU (h_xbit
) = opval
;
7873 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7877 SET_H_INSN_PREFIXED_P (opval
);
7878 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7888 CASE (sem
, INSN_SUBS_W_R
) : /* subs.w $Rs,$Rd */
7890 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7891 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7892 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7893 int UNUSED written
= 0;
7894 IADDR UNUSED pc
= abuf
->addr
;
7895 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7902 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
7903 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7904 tmp_carry
= CPU (h_cbit
);
7905 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7907 SI opval
= tmp_newval
;
7908 SET_H_GR (FLD (f_operand2
), opval
);
7909 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7913 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))));
7914 CPU (h_cbit
) = opval
;
7915 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7918 BI opval
= LTSI (tmp_newval
, 0);
7919 CPU (h_nbit
) = opval
;
7920 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7923 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7924 CPU (h_zbit
) = opval
;
7925 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7928 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)));
7929 CPU (h_vbit
) = opval
;
7930 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7935 CPU (h_xbit
) = opval
;
7936 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7940 SET_H_INSN_PREFIXED_P (opval
);
7941 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7951 CASE (sem
, INSN_SUBS_M_B_M
) : /* subs-m.b [${Rs}${inc}],$Rd */
7953 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7954 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7955 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7956 int UNUSED written
= 0;
7957 IADDR UNUSED pc
= abuf
->addr
;
7958 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7965 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
7968 tmp_postinc
= FLD (f_memmode
);
7969 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7970 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7971 ; if (NEBI (tmp_postinc
, 0)) {
7973 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7974 tmp_addr
= ADDSI (tmp_addr
, 1);
7977 SI opval
= tmp_addr
;
7978 SET_H_GR (FLD (f_operand1
), opval
);
7979 written
|= (1 << 11);
7980 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7985 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7986 tmp_carry
= CPU (h_cbit
);
7987 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7989 SI opval
= tmp_newval
;
7990 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7991 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7995 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))));
7996 CPU (h_cbit
) = opval
;
7997 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8000 BI opval
= LTSI (tmp_newval
, 0);
8001 CPU (h_nbit
) = opval
;
8002 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8005 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8006 CPU (h_zbit
) = opval
;
8007 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8010 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)));
8011 CPU (h_vbit
) = opval
;
8012 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8017 CPU (h_xbit
) = opval
;
8018 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8022 SET_H_INSN_PREFIXED_P (opval
);
8023 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8029 abuf
->written
= written
;
8034 CASE (sem
, INSN_SUBS_M_W_M
) : /* subs-m.w [${Rs}${inc}],$Rd */
8036 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8037 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8038 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8039 int UNUSED written
= 0;
8040 IADDR UNUSED pc
= abuf
->addr
;
8041 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8048 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
8051 tmp_postinc
= FLD (f_memmode
);
8052 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8053 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8054 ; if (NEBI (tmp_postinc
, 0)) {
8056 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8057 tmp_addr
= ADDSI (tmp_addr
, 2);
8060 SI opval
= tmp_addr
;
8061 SET_H_GR (FLD (f_operand1
), opval
);
8062 written
|= (1 << 11);
8063 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8068 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8069 tmp_carry
= CPU (h_cbit
);
8070 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8072 SI opval
= tmp_newval
;
8073 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8074 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8078 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))));
8079 CPU (h_cbit
) = opval
;
8080 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8083 BI opval
= LTSI (tmp_newval
, 0);
8084 CPU (h_nbit
) = opval
;
8085 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8088 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8089 CPU (h_zbit
) = opval
;
8090 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8093 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)));
8094 CPU (h_vbit
) = opval
;
8095 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8100 CPU (h_xbit
) = opval
;
8101 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8105 SET_H_INSN_PREFIXED_P (opval
);
8106 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8112 abuf
->written
= written
;
8117 CASE (sem
, INSN_SUBSCBR
) : /* [${Rs}${inc}],$Rd */
8119 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8120 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8121 #define FLD(f) abuf->fields.sfmt_addcbr.f
8122 int UNUSED written
= 0;
8123 IADDR UNUSED pc
= abuf
->addr
;
8124 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8131 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8132 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8133 tmp_carry
= CPU (h_cbit
);
8134 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8136 SI opval
= tmp_newval
;
8137 SET_H_GR (FLD (f_operand2
), opval
);
8138 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8142 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))));
8143 CPU (h_cbit
) = opval
;
8144 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8147 BI opval
= LTSI (tmp_newval
, 0);
8148 CPU (h_nbit
) = opval
;
8149 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8152 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8153 CPU (h_zbit
) = opval
;
8154 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8157 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)));
8158 CPU (h_vbit
) = opval
;
8159 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8164 CPU (h_xbit
) = opval
;
8165 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8169 SET_H_INSN_PREFIXED_P (opval
);
8170 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8180 CASE (sem
, INSN_SUBSCWR
) : /* [${Rs}${inc}],$Rd */
8182 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8183 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8184 #define FLD(f) abuf->fields.sfmt_addcwr.f
8185 int UNUSED written
= 0;
8186 IADDR UNUSED pc
= abuf
->addr
;
8187 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8194 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8195 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8196 tmp_carry
= CPU (h_cbit
);
8197 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8199 SI opval
= tmp_newval
;
8200 SET_H_GR (FLD (f_operand2
), opval
);
8201 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8205 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))));
8206 CPU (h_cbit
) = opval
;
8207 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8210 BI opval
= LTSI (tmp_newval
, 0);
8211 CPU (h_nbit
) = opval
;
8212 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8215 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8216 CPU (h_zbit
) = opval
;
8217 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8220 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)));
8221 CPU (h_vbit
) = opval
;
8222 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8227 CPU (h_xbit
) = opval
;
8228 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8232 SET_H_INSN_PREFIXED_P (opval
);
8233 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8243 CASE (sem
, INSN_SUBU_B_R
) : /* subu.b $Rs,$Rd */
8245 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8247 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8248 int UNUSED written
= 0;
8249 IADDR UNUSED pc
= abuf
->addr
;
8250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8257 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
8258 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8259 tmp_carry
= CPU (h_cbit
);
8260 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8262 SI opval
= tmp_newval
;
8263 SET_H_GR (FLD (f_operand2
), opval
);
8264 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8268 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))));
8269 CPU (h_cbit
) = opval
;
8270 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8273 BI opval
= LTSI (tmp_newval
, 0);
8274 CPU (h_nbit
) = opval
;
8275 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8278 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8279 CPU (h_zbit
) = opval
;
8280 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8283 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)));
8284 CPU (h_vbit
) = opval
;
8285 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8290 CPU (h_xbit
) = opval
;
8291 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8295 SET_H_INSN_PREFIXED_P (opval
);
8296 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8306 CASE (sem
, INSN_SUBU_W_R
) : /* subu.w $Rs,$Rd */
8308 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8309 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8310 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8311 int UNUSED written
= 0;
8312 IADDR UNUSED pc
= abuf
->addr
;
8313 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8320 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
8321 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8322 tmp_carry
= CPU (h_cbit
);
8323 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8325 SI opval
= tmp_newval
;
8326 SET_H_GR (FLD (f_operand2
), opval
);
8327 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8331 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))));
8332 CPU (h_cbit
) = opval
;
8333 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8336 BI opval
= LTSI (tmp_newval
, 0);
8337 CPU (h_nbit
) = opval
;
8338 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8341 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8342 CPU (h_zbit
) = opval
;
8343 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8346 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)));
8347 CPU (h_vbit
) = opval
;
8348 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8353 CPU (h_xbit
) = opval
;
8354 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8358 SET_H_INSN_PREFIXED_P (opval
);
8359 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8369 CASE (sem
, INSN_SUBU_M_B_M
) : /* subu-m.b [${Rs}${inc}],$Rd */
8371 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8372 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8373 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8374 int UNUSED written
= 0;
8375 IADDR UNUSED pc
= abuf
->addr
;
8376 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8383 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
8386 tmp_postinc
= FLD (f_memmode
);
8387 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8388 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8389 ; if (NEBI (tmp_postinc
, 0)) {
8391 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8392 tmp_addr
= ADDSI (tmp_addr
, 1);
8395 SI opval
= tmp_addr
;
8396 SET_H_GR (FLD (f_operand1
), opval
);
8397 written
|= (1 << 11);
8398 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8403 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8404 tmp_carry
= CPU (h_cbit
);
8405 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8407 SI opval
= tmp_newval
;
8408 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8409 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8413 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))));
8414 CPU (h_cbit
) = opval
;
8415 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8418 BI opval
= LTSI (tmp_newval
, 0);
8419 CPU (h_nbit
) = opval
;
8420 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8423 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8424 CPU (h_zbit
) = opval
;
8425 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8428 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)));
8429 CPU (h_vbit
) = opval
;
8430 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8435 CPU (h_xbit
) = opval
;
8436 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8440 SET_H_INSN_PREFIXED_P (opval
);
8441 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8447 abuf
->written
= written
;
8452 CASE (sem
, INSN_SUBU_M_W_M
) : /* subu-m.w [${Rs}${inc}],$Rd */
8454 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8455 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8456 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8457 int UNUSED written
= 0;
8458 IADDR UNUSED pc
= abuf
->addr
;
8459 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8466 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
8469 tmp_postinc
= FLD (f_memmode
);
8470 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8471 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8472 ; if (NEBI (tmp_postinc
, 0)) {
8474 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8475 tmp_addr
= ADDSI (tmp_addr
, 2);
8478 SI opval
= tmp_addr
;
8479 SET_H_GR (FLD (f_operand1
), opval
);
8480 written
|= (1 << 11);
8481 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8486 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8487 tmp_carry
= CPU (h_cbit
);
8488 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8490 SI opval
= tmp_newval
;
8491 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8492 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8496 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))));
8497 CPU (h_cbit
) = opval
;
8498 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8501 BI opval
= LTSI (tmp_newval
, 0);
8502 CPU (h_nbit
) = opval
;
8503 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8506 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8507 CPU (h_zbit
) = opval
;
8508 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8511 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)));
8512 CPU (h_vbit
) = opval
;
8513 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8518 CPU (h_xbit
) = opval
;
8519 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8523 SET_H_INSN_PREFIXED_P (opval
);
8524 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8530 abuf
->written
= written
;
8535 CASE (sem
, INSN_SUBUCBR
) : /* [${Rs}${inc}],$Rd */
8537 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8539 #define FLD(f) abuf->fields.sfmt_addcbr.f
8540 int UNUSED written
= 0;
8541 IADDR UNUSED pc
= abuf
->addr
;
8542 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8549 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8550 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8551 tmp_carry
= CPU (h_cbit
);
8552 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8554 SI opval
= tmp_newval
;
8555 SET_H_GR (FLD (f_operand2
), opval
);
8556 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8560 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))));
8561 CPU (h_cbit
) = opval
;
8562 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8565 BI opval
= LTSI (tmp_newval
, 0);
8566 CPU (h_nbit
) = opval
;
8567 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8570 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8571 CPU (h_zbit
) = opval
;
8572 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8575 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)));
8576 CPU (h_vbit
) = opval
;
8577 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8582 CPU (h_xbit
) = opval
;
8583 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8587 SET_H_INSN_PREFIXED_P (opval
);
8588 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8598 CASE (sem
, INSN_SUBUCWR
) : /* [${Rs}${inc}],$Rd */
8600 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8601 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8602 #define FLD(f) abuf->fields.sfmt_addcwr.f
8603 int UNUSED written
= 0;
8604 IADDR UNUSED pc
= abuf
->addr
;
8605 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8612 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8613 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8614 tmp_carry
= CPU (h_cbit
);
8615 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8617 SI opval
= tmp_newval
;
8618 SET_H_GR (FLD (f_operand2
), opval
);
8619 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8623 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))));
8624 CPU (h_cbit
) = opval
;
8625 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8628 BI opval
= LTSI (tmp_newval
, 0);
8629 CPU (h_nbit
) = opval
;
8630 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8633 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8634 CPU (h_zbit
) = opval
;
8635 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8638 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)));
8639 CPU (h_vbit
) = opval
;
8640 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8645 CPU (h_xbit
) = opval
;
8646 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8650 SET_H_INSN_PREFIXED_P (opval
);
8651 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8661 CASE (sem
, INSN_ADDI_B_R
) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8663 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8664 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8665 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8666 int UNUSED written
= 0;
8667 IADDR UNUSED pc
= abuf
->addr
;
8668 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8672 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
8673 SET_H_GR (FLD (f_operand1
), opval
);
8674 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8679 CPU (h_xbit
) = opval
;
8680 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8684 SET_H_INSN_PREFIXED_P (opval
);
8685 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8694 CASE (sem
, INSN_ADDI_W_R
) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8696 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8697 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8698 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8699 int UNUSED written
= 0;
8700 IADDR UNUSED pc
= abuf
->addr
;
8701 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8705 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
8706 SET_H_GR (FLD (f_operand1
), opval
);
8707 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8712 CPU (h_xbit
) = opval
;
8713 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8717 SET_H_INSN_PREFIXED_P (opval
);
8718 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8727 CASE (sem
, INSN_ADDI_D_R
) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8729 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8730 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8731 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8732 int UNUSED written
= 0;
8733 IADDR UNUSED pc
= abuf
->addr
;
8734 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8738 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
8739 SET_H_GR (FLD (f_operand1
), opval
);
8740 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8745 CPU (h_xbit
) = opval
;
8746 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8750 SET_H_INSN_PREFIXED_P (opval
);
8751 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8760 CASE (sem
, INSN_NEG_B_R
) : /* neg.b $Rs,$Rd */
8762 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8764 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8765 int UNUSED written
= 0;
8766 IADDR UNUSED pc
= abuf
->addr
;
8767 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8774 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8776 tmp_carry
= CPU (h_cbit
);
8777 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8780 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
8782 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
8783 SET_H_GR (FLD (f_operand2
), opval
);
8784 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8789 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))));
8790 CPU (h_cbit
) = opval
;
8791 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8794 BI opval
= LTQI (tmp_newval
, 0);
8795 CPU (h_nbit
) = opval
;
8796 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8799 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8800 CPU (h_zbit
) = opval
;
8801 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8804 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)));
8805 CPU (h_vbit
) = opval
;
8806 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8811 CPU (h_xbit
) = opval
;
8812 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8816 SET_H_INSN_PREFIXED_P (opval
);
8817 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8827 CASE (sem
, INSN_NEG_W_R
) : /* neg.w $Rs,$Rd */
8829 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8830 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8831 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8832 int UNUSED written
= 0;
8833 IADDR UNUSED pc
= abuf
->addr
;
8834 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8841 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8843 tmp_carry
= CPU (h_cbit
);
8844 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8847 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
8849 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
8850 SET_H_GR (FLD (f_operand2
), opval
);
8851 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8856 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))));
8857 CPU (h_cbit
) = opval
;
8858 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8861 BI opval
= LTHI (tmp_newval
, 0);
8862 CPU (h_nbit
) = opval
;
8863 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8866 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8867 CPU (h_zbit
) = opval
;
8868 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8871 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)));
8872 CPU (h_vbit
) = opval
;
8873 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8878 CPU (h_xbit
) = opval
;
8879 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8883 SET_H_INSN_PREFIXED_P (opval
);
8884 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8894 CASE (sem
, INSN_NEG_D_R
) : /* neg.d $Rs,$Rd */
8896 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8898 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8899 int UNUSED written
= 0;
8900 IADDR UNUSED pc
= abuf
->addr
;
8901 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8908 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8910 tmp_carry
= CPU (h_cbit
);
8911 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8913 SI opval
= tmp_newval
;
8914 SET_H_GR (FLD (f_operand2
), opval
);
8915 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8919 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))));
8920 CPU (h_cbit
) = opval
;
8921 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8924 BI opval
= LTSI (tmp_newval
, 0);
8925 CPU (h_nbit
) = opval
;
8926 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8929 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8930 CPU (h_zbit
) = opval
;
8931 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8934 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)));
8935 CPU (h_vbit
) = opval
;
8936 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8941 CPU (h_xbit
) = opval
;
8942 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8946 SET_H_INSN_PREFIXED_P (opval
);
8947 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8957 CASE (sem
, INSN_TEST_M_B_M
) : /* test-m.b [${Rs}${inc}] */
8959 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8960 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8961 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8962 int UNUSED written
= 0;
8963 IADDR UNUSED pc
= abuf
->addr
;
8964 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8968 tmp_tmpd
= ({ SI tmp_addr
;
8971 tmp_postinc
= FLD (f_memmode
);
8972 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8973 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8974 ; if (NEBI (tmp_postinc
, 0)) {
8976 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8977 tmp_addr
= ADDSI (tmp_addr
, 1);
8980 SI opval
= tmp_addr
;
8981 SET_H_GR (FLD (f_operand1
), opval
);
8982 written
|= (1 << 8);
8983 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8994 tmp_tmpopd
= tmp_tmpd
;
8995 tmp_carry
= CPU (h_cbit
);
8996 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9000 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))));
9001 CPU (h_cbit
) = opval
;
9002 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9005 BI opval
= LTQI (tmp_newval
, 0);
9006 CPU (h_nbit
) = opval
;
9007 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9010 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9011 CPU (h_zbit
) = opval
;
9012 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9015 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)));
9016 CPU (h_vbit
) = opval
;
9017 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9022 CPU (h_xbit
) = opval
;
9023 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9027 SET_H_INSN_PREFIXED_P (opval
);
9028 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9035 abuf
->written
= written
;
9040 CASE (sem
, INSN_TEST_M_W_M
) : /* test-m.w [${Rs}${inc}] */
9042 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9043 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9044 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
9045 int UNUSED written
= 0;
9046 IADDR UNUSED pc
= abuf
->addr
;
9047 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9051 tmp_tmpd
= ({ SI tmp_addr
;
9054 tmp_postinc
= FLD (f_memmode
);
9055 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9056 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
9057 ; if (NEBI (tmp_postinc
, 0)) {
9059 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9060 tmp_addr
= ADDSI (tmp_addr
, 2);
9063 SI opval
= tmp_addr
;
9064 SET_H_GR (FLD (f_operand1
), opval
);
9065 written
|= (1 << 8);
9066 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9077 tmp_tmpopd
= tmp_tmpd
;
9078 tmp_carry
= CPU (h_cbit
);
9079 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9083 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))));
9084 CPU (h_cbit
) = opval
;
9085 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9088 BI opval
= LTHI (tmp_newval
, 0);
9089 CPU (h_nbit
) = opval
;
9090 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9093 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9094 CPU (h_zbit
) = opval
;
9095 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9098 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)));
9099 CPU (h_vbit
) = opval
;
9100 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9105 CPU (h_xbit
) = opval
;
9106 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9110 SET_H_INSN_PREFIXED_P (opval
);
9111 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9118 abuf
->written
= written
;
9123 CASE (sem
, INSN_TEST_M_D_M
) : /* test-m.d [${Rs}${inc}] */
9125 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9126 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9127 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
9128 int UNUSED written
= 0;
9129 IADDR UNUSED pc
= abuf
->addr
;
9130 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9134 tmp_tmpd
= ({ SI tmp_addr
;
9137 tmp_postinc
= FLD (f_memmode
);
9138 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9139 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
9140 ; if (NEBI (tmp_postinc
, 0)) {
9142 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9143 tmp_addr
= ADDSI (tmp_addr
, 4);
9146 SI opval
= tmp_addr
;
9147 SET_H_GR (FLD (f_operand1
), opval
);
9148 written
|= (1 << 8);
9149 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9160 tmp_tmpopd
= tmp_tmpd
;
9161 tmp_carry
= CPU (h_cbit
);
9162 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9166 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))));
9167 CPU (h_cbit
) = opval
;
9168 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9171 BI opval
= LTSI (tmp_newval
, 0);
9172 CPU (h_nbit
) = opval
;
9173 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9176 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9177 CPU (h_zbit
) = opval
;
9178 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9181 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)));
9182 CPU (h_vbit
) = opval
;
9183 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9188 CPU (h_xbit
) = opval
;
9189 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9193 SET_H_INSN_PREFIXED_P (opval
);
9194 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9201 abuf
->written
= written
;
9206 CASE (sem
, INSN_MOVE_R_M_B_M
) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9208 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9209 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9210 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9211 int UNUSED written
= 0;
9212 IADDR UNUSED pc
= abuf
->addr
;
9213 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9217 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9221 tmp_postinc
= FLD (f_memmode
);
9222 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9223 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
9224 if (EQBI (CPU (h_pbit
), 0)) {
9227 QI opval
= tmp_tmpd
;
9228 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9229 written
|= (1 << 10);
9230 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9233 BI opval
= CPU (h_pbit
);
9234 CPU (h_cbit
) = opval
;
9235 written
|= (1 << 9);
9236 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9242 CPU (h_cbit
) = opval
;
9243 written
|= (1 << 9);
9244 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9249 QI opval
= tmp_tmpd
;
9250 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9251 written
|= (1 << 10);
9252 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9255 if (NEBI (tmp_postinc
, 0)) {
9257 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9258 tmp_addr
= ADDSI (tmp_addr
, 1);
9261 SI opval
= tmp_addr
;
9262 SET_H_GR (FLD (f_operand1
), opval
);
9263 written
|= (1 << 8);
9264 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9272 CPU (h_xbit
) = opval
;
9273 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9277 SET_H_INSN_PREFIXED_P (opval
);
9278 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9283 abuf
->written
= written
;
9288 CASE (sem
, INSN_MOVE_R_M_W_M
) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9290 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9291 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9292 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9293 int UNUSED written
= 0;
9294 IADDR UNUSED pc
= abuf
->addr
;
9295 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9299 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9303 tmp_postinc
= FLD (f_memmode
);
9304 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9305 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
9306 if (EQBI (CPU (h_pbit
), 0)) {
9309 HI opval
= tmp_tmpd
;
9310 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9311 written
|= (1 << 10);
9312 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9315 BI opval
= CPU (h_pbit
);
9316 CPU (h_cbit
) = opval
;
9317 written
|= (1 << 9);
9318 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9324 CPU (h_cbit
) = opval
;
9325 written
|= (1 << 9);
9326 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9331 HI opval
= tmp_tmpd
;
9332 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9333 written
|= (1 << 10);
9334 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9337 if (NEBI (tmp_postinc
, 0)) {
9339 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9340 tmp_addr
= ADDSI (tmp_addr
, 2);
9343 SI opval
= tmp_addr
;
9344 SET_H_GR (FLD (f_operand1
), opval
);
9345 written
|= (1 << 8);
9346 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9354 CPU (h_xbit
) = opval
;
9355 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9359 SET_H_INSN_PREFIXED_P (opval
);
9360 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9365 abuf
->written
= written
;
9370 CASE (sem
, INSN_MOVE_R_M_D_M
) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9372 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9373 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9374 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9375 int UNUSED written
= 0;
9376 IADDR UNUSED pc
= abuf
->addr
;
9377 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9381 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9385 tmp_postinc
= FLD (f_memmode
);
9386 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9387 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
9388 if (EQBI (CPU (h_pbit
), 0)) {
9391 SI opval
= tmp_tmpd
;
9392 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9393 written
|= (1 << 10);
9394 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9397 BI opval
= CPU (h_pbit
);
9398 CPU (h_cbit
) = opval
;
9399 written
|= (1 << 9);
9400 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9406 CPU (h_cbit
) = opval
;
9407 written
|= (1 << 9);
9408 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9413 SI opval
= tmp_tmpd
;
9414 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9415 written
|= (1 << 10);
9416 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9419 if (NEBI (tmp_postinc
, 0)) {
9421 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9422 tmp_addr
= ADDSI (tmp_addr
, 4);
9425 SI opval
= tmp_addr
;
9426 SET_H_GR (FLD (f_operand1
), opval
);
9427 written
|= (1 << 8);
9428 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9436 CPU (h_xbit
) = opval
;
9437 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9441 SET_H_INSN_PREFIXED_P (opval
);
9442 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9447 abuf
->written
= written
;
9452 CASE (sem
, INSN_MULS_B
) : /* muls.b $Rs,$Rd */
9454 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9455 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9456 #define FLD(f) abuf->fields.sfmt_muls_b.f
9457 int UNUSED written
= 0;
9458 IADDR UNUSED pc
= abuf
->addr
;
9459 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9465 tmp_src1
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9466 tmp_src2
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9467 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9469 SI opval
= TRUNCDISI (tmp_tmpr
);
9470 SET_H_GR (FLD (f_operand2
), opval
);
9471 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9474 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9475 SET_H_SR (((UINT
) 7), opval
);
9476 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9480 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9481 CPU (h_cbit
) = opval
;
9482 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9485 BI opval
= LTDI (tmp_tmpr
, 0);
9486 CPU (h_nbit
) = opval
;
9487 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9490 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9491 CPU (h_zbit
) = opval
;
9492 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9495 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9496 CPU (h_vbit
) = opval
;
9497 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9502 CPU (h_xbit
) = opval
;
9503 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9507 SET_H_INSN_PREFIXED_P (opval
);
9508 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9518 CASE (sem
, INSN_MULS_W
) : /* muls.w $Rs,$Rd */
9520 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9521 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9522 #define FLD(f) abuf->fields.sfmt_muls_b.f
9523 int UNUSED written
= 0;
9524 IADDR UNUSED pc
= abuf
->addr
;
9525 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9531 tmp_src1
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9532 tmp_src2
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9533 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9535 SI opval
= TRUNCDISI (tmp_tmpr
);
9536 SET_H_GR (FLD (f_operand2
), opval
);
9537 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9540 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9541 SET_H_SR (((UINT
) 7), opval
);
9542 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9546 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9547 CPU (h_cbit
) = opval
;
9548 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9551 BI opval
= LTDI (tmp_tmpr
, 0);
9552 CPU (h_nbit
) = opval
;
9553 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9556 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9557 CPU (h_zbit
) = opval
;
9558 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9561 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9562 CPU (h_vbit
) = opval
;
9563 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9568 CPU (h_xbit
) = opval
;
9569 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9573 SET_H_INSN_PREFIXED_P (opval
);
9574 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9584 CASE (sem
, INSN_MULS_D
) : /* muls.d $Rs,$Rd */
9586 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9587 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9588 #define FLD(f) abuf->fields.sfmt_muls_b.f
9589 int UNUSED written
= 0;
9590 IADDR UNUSED pc
= abuf
->addr
;
9591 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9597 tmp_src1
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9598 tmp_src2
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9599 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9601 SI opval
= TRUNCDISI (tmp_tmpr
);
9602 SET_H_GR (FLD (f_operand2
), opval
);
9603 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9606 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9607 SET_H_SR (((UINT
) 7), opval
);
9608 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9612 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9613 CPU (h_cbit
) = opval
;
9614 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9617 BI opval
= LTDI (tmp_tmpr
, 0);
9618 CPU (h_nbit
) = opval
;
9619 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9622 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9623 CPU (h_zbit
) = opval
;
9624 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9627 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9628 CPU (h_vbit
) = opval
;
9629 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9634 CPU (h_xbit
) = opval
;
9635 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9639 SET_H_INSN_PREFIXED_P (opval
);
9640 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9650 CASE (sem
, INSN_MULU_B
) : /* mulu.b $Rs,$Rd */
9652 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9653 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9654 #define FLD(f) abuf->fields.sfmt_muls_b.f
9655 int UNUSED written
= 0;
9656 IADDR UNUSED pc
= abuf
->addr
;
9657 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9663 tmp_src1
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9664 tmp_src2
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9665 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9667 SI opval
= TRUNCDISI (tmp_tmpr
);
9668 SET_H_GR (FLD (f_operand2
), opval
);
9669 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9672 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9673 SET_H_SR (((UINT
) 7), opval
);
9674 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9678 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9679 CPU (h_cbit
) = opval
;
9680 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9683 BI opval
= LTDI (tmp_tmpr
, 0);
9684 CPU (h_nbit
) = opval
;
9685 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9688 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9689 CPU (h_zbit
) = opval
;
9690 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9693 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9694 CPU (h_vbit
) = opval
;
9695 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9700 CPU (h_xbit
) = opval
;
9701 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9705 SET_H_INSN_PREFIXED_P (opval
);
9706 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9716 CASE (sem
, INSN_MULU_W
) : /* mulu.w $Rs,$Rd */
9718 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9719 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9720 #define FLD(f) abuf->fields.sfmt_muls_b.f
9721 int UNUSED written
= 0;
9722 IADDR UNUSED pc
= abuf
->addr
;
9723 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9729 tmp_src1
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9730 tmp_src2
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9731 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9733 SI opval
= TRUNCDISI (tmp_tmpr
);
9734 SET_H_GR (FLD (f_operand2
), opval
);
9735 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9738 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9739 SET_H_SR (((UINT
) 7), opval
);
9740 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9744 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9745 CPU (h_cbit
) = opval
;
9746 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9749 BI opval
= LTDI (tmp_tmpr
, 0);
9750 CPU (h_nbit
) = opval
;
9751 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9754 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9755 CPU (h_zbit
) = opval
;
9756 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9759 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9760 CPU (h_vbit
) = opval
;
9761 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9766 CPU (h_xbit
) = opval
;
9767 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9771 SET_H_INSN_PREFIXED_P (opval
);
9772 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9782 CASE (sem
, INSN_MULU_D
) : /* mulu.d $Rs,$Rd */
9784 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9785 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9786 #define FLD(f) abuf->fields.sfmt_muls_b.f
9787 int UNUSED written
= 0;
9788 IADDR UNUSED pc
= abuf
->addr
;
9789 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9795 tmp_src1
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9796 tmp_src2
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9797 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9799 SI opval
= TRUNCDISI (tmp_tmpr
);
9800 SET_H_GR (FLD (f_operand2
), opval
);
9801 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9804 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9805 SET_H_SR (((UINT
) 7), opval
);
9806 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9810 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9811 CPU (h_cbit
) = opval
;
9812 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9815 BI opval
= LTDI (tmp_tmpr
, 0);
9816 CPU (h_nbit
) = opval
;
9817 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9820 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9821 CPU (h_zbit
) = opval
;
9822 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9825 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9826 CPU (h_vbit
) = opval
;
9827 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9832 CPU (h_xbit
) = opval
;
9833 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9837 SET_H_INSN_PREFIXED_P (opval
);
9838 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9848 CASE (sem
, INSN_MSTEP
) : /* mstep $Rs,$Rd */
9850 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9851 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9852 #define FLD(f) abuf->fields.sfmt_muls_b.f
9853 int UNUSED written
= 0;
9854 IADDR UNUSED pc
= abuf
->addr
;
9855 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9860 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9861 tmp_tmpd
= ADDSI (SLLSI (GET_H_GR (FLD (f_operand2
)), 1), ((CPU (h_nbit
)) ? (tmp_tmps
) : (0)));
9863 SI opval
= tmp_tmpd
;
9864 SET_H_GR (FLD (f_operand2
), opval
);
9865 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9869 BI opval
= LTSI (tmp_tmpd
, 0);
9870 CPU (h_nbit
) = opval
;
9871 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9874 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9875 CPU (h_zbit
) = opval
;
9876 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9878 SET_H_CBIT_MOVE (0);
9879 SET_H_VBIT_MOVE (0);
9883 CPU (h_xbit
) = opval
;
9884 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9888 SET_H_INSN_PREFIXED_P (opval
);
9889 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9899 CASE (sem
, INSN_DSTEP
) : /* dstep $Rs,$Rd */
9901 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9902 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9903 #define FLD(f) abuf->fields.sfmt_muls_b.f
9904 int UNUSED written
= 0;
9905 IADDR UNUSED pc
= abuf
->addr
;
9906 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9912 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9913 tmp_tmp
= SLLSI (GET_H_GR (FLD (f_operand2
)), 1);
9914 tmp_tmpd
= ((GEUSI (tmp_tmp
, tmp_tmps
)) ? (SUBSI (tmp_tmp
, tmp_tmps
)) : (tmp_tmp
));
9916 SI opval
= tmp_tmpd
;
9917 SET_H_GR (FLD (f_operand2
), opval
);
9918 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9922 BI opval
= LTSI (tmp_tmpd
, 0);
9923 CPU (h_nbit
) = opval
;
9924 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9927 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9928 CPU (h_zbit
) = opval
;
9929 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9931 SET_H_CBIT_MOVE (0);
9932 SET_H_VBIT_MOVE (0);
9936 CPU (h_xbit
) = opval
;
9937 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9941 SET_H_INSN_PREFIXED_P (opval
);
9942 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9952 CASE (sem
, INSN_ABS
) : /* abs $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);
9963 tmp_tmpd
= ABSSI (GET_H_GR (FLD (f_operand1
)));
9965 SI opval
= tmp_tmpd
;
9966 SET_H_GR (FLD (f_operand2
), opval
);
9967 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9971 BI opval
= LTSI (tmp_tmpd
, 0);
9972 CPU (h_nbit
) = opval
;
9973 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9976 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9977 CPU (h_zbit
) = opval
;
9978 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9980 SET_H_CBIT_MOVE (0);
9981 SET_H_VBIT_MOVE (0);
9985 CPU (h_xbit
) = opval
;
9986 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9990 SET_H_INSN_PREFIXED_P (opval
);
9991 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10001 CASE (sem
, INSN_AND_B_R
) : /* and.b $Rs,$Rd */
10003 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10004 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10005 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10006 int UNUSED written
= 0;
10007 IADDR UNUSED pc
= abuf
->addr
;
10008 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10012 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10015 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10017 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10018 SET_H_GR (FLD (f_operand2
), opval
);
10019 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10024 BI opval
= LTQI (tmp_tmpd
, 0);
10025 CPU (h_nbit
) = opval
;
10026 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10029 BI opval
= ANDIF (EQQI (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_W_R
) : /* and.w $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_add_b_r.f
10059 int UNUSED written
= 0;
10060 IADDR UNUSED pc
= abuf
->addr
;
10061 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10065 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10068 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10070 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10071 SET_H_GR (FLD (f_operand2
), opval
);
10072 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10077 BI opval
= LTHI (tmp_tmpd
, 0);
10078 CPU (h_nbit
) = opval
;
10079 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10082 BI opval
= ANDIF (EQHI (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_D_R
) : /* and.d $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_add_b_r.f
10112 int UNUSED written
= 0;
10113 IADDR UNUSED pc
= abuf
->addr
;
10114 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10118 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10120 SI opval
= tmp_tmpd
;
10121 SET_H_GR (FLD (f_operand2
), opval
);
10122 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10126 BI opval
= LTSI (tmp_tmpd
, 0);
10127 CPU (h_nbit
) = opval
;
10128 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10131 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10132 CPU (h_zbit
) = opval
;
10133 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10135 SET_H_CBIT_MOVE (0);
10136 SET_H_VBIT_MOVE (0);
10140 CPU (h_xbit
) = opval
;
10141 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10145 SET_H_INSN_PREFIXED_P (opval
);
10146 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10156 CASE (sem
, INSN_AND_M_B_M
) : /* and-m.b [${Rs}${inc}],${Rd} */
10158 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10159 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10160 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10161 int UNUSED written
= 0;
10162 IADDR UNUSED pc
= abuf
->addr
;
10163 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10167 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10170 tmp_postinc
= FLD (f_memmode
);
10171 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10172 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10173 ; if (NEBI (tmp_postinc
, 0)) {
10175 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10176 tmp_addr
= ADDSI (tmp_addr
, 1);
10179 SI opval
= tmp_addr
;
10180 SET_H_GR (FLD (f_operand1
), opval
);
10181 written
|= (1 << 11);
10182 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10186 ; tmp_tmp_mem
; }));
10189 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10191 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10192 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10193 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10198 BI opval
= LTQI (tmp_tmpd
, 0);
10199 CPU (h_nbit
) = opval
;
10200 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10203 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10204 CPU (h_zbit
) = opval
;
10205 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10207 SET_H_CBIT_MOVE (0);
10208 SET_H_VBIT_MOVE (0);
10212 CPU (h_xbit
) = opval
;
10213 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10217 SET_H_INSN_PREFIXED_P (opval
);
10218 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10224 abuf
->written
= written
;
10229 CASE (sem
, INSN_AND_M_W_M
) : /* and-m.w [${Rs}${inc}],${Rd} */
10231 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10232 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10233 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10234 int UNUSED written
= 0;
10235 IADDR UNUSED pc
= abuf
->addr
;
10236 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10240 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10243 tmp_postinc
= FLD (f_memmode
);
10244 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10245 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10246 ; if (NEBI (tmp_postinc
, 0)) {
10248 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10249 tmp_addr
= ADDSI (tmp_addr
, 2);
10252 SI opval
= tmp_addr
;
10253 SET_H_GR (FLD (f_operand1
), opval
);
10254 written
|= (1 << 11);
10255 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10259 ; tmp_tmp_mem
; }));
10262 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10264 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10265 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10266 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10271 BI opval
= LTHI (tmp_tmpd
, 0);
10272 CPU (h_nbit
) = opval
;
10273 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10276 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10277 CPU (h_zbit
) = opval
;
10278 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10280 SET_H_CBIT_MOVE (0);
10281 SET_H_VBIT_MOVE (0);
10285 CPU (h_xbit
) = opval
;
10286 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10290 SET_H_INSN_PREFIXED_P (opval
);
10291 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10297 abuf
->written
= written
;
10302 CASE (sem
, INSN_AND_M_D_M
) : /* and-m.d [${Rs}${inc}],${Rd} */
10304 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10305 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10306 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10307 int UNUSED written
= 0;
10308 IADDR UNUSED pc
= abuf
->addr
;
10309 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10313 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10316 tmp_postinc
= FLD (f_memmode
);
10317 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10318 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10319 ; if (NEBI (tmp_postinc
, 0)) {
10321 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10322 tmp_addr
= ADDSI (tmp_addr
, 4);
10325 SI opval
= tmp_addr
;
10326 SET_H_GR (FLD (f_operand1
), opval
);
10327 written
|= (1 << 10);
10328 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10332 ; tmp_tmp_mem
; }));
10334 SI opval
= tmp_tmpd
;
10335 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10336 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10340 BI opval
= LTSI (tmp_tmpd
, 0);
10341 CPU (h_nbit
) = opval
;
10342 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10345 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10346 CPU (h_zbit
) = opval
;
10347 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10349 SET_H_CBIT_MOVE (0);
10350 SET_H_VBIT_MOVE (0);
10354 CPU (h_xbit
) = opval
;
10355 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10359 SET_H_INSN_PREFIXED_P (opval
);
10360 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10366 abuf
->written
= written
;
10371 CASE (sem
, INSN_ANDCBR
) : /* and.b ${sconst8}],${Rd} */
10373 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10374 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10375 #define FLD(f) abuf->fields.sfmt_addcbr.f
10376 int UNUSED written
= 0;
10377 IADDR UNUSED pc
= abuf
->addr
;
10378 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10382 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10385 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10387 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10388 SET_H_GR (FLD (f_operand2
), opval
);
10389 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10394 BI opval
= LTQI (tmp_tmpd
, 0);
10395 CPU (h_nbit
) = opval
;
10396 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10399 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10400 CPU (h_zbit
) = opval
;
10401 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10403 SET_H_CBIT_MOVE (0);
10404 SET_H_VBIT_MOVE (0);
10408 CPU (h_xbit
) = opval
;
10409 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10413 SET_H_INSN_PREFIXED_P (opval
);
10414 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10424 CASE (sem
, INSN_ANDCWR
) : /* and.w ${sconst16}],${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_addcwr.f
10429 int UNUSED written
= 0;
10430 IADDR UNUSED pc
= abuf
->addr
;
10431 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10435 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10438 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10440 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10441 SET_H_GR (FLD (f_operand2
), opval
);
10442 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10447 BI opval
= LTHI (tmp_tmpd
, 0);
10448 CPU (h_nbit
) = opval
;
10449 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10452 BI opval
= ANDIF (EQHI (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_ANDCDR
) : /* and.d ${const32}],${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_addcdr.f
10482 int UNUSED written
= 0;
10483 IADDR UNUSED pc
= abuf
->addr
;
10484 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10488 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10490 SI opval
= tmp_tmpd
;
10491 SET_H_GR (FLD (f_operand2
), opval
);
10492 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10496 BI opval
= LTSI (tmp_tmpd
, 0);
10497 CPU (h_nbit
) = opval
;
10498 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10501 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10502 CPU (h_zbit
) = opval
;
10503 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10505 SET_H_CBIT_MOVE (0);
10506 SET_H_VBIT_MOVE (0);
10510 CPU (h_xbit
) = opval
;
10511 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10515 SET_H_INSN_PREFIXED_P (opval
);
10516 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10526 CASE (sem
, INSN_ANDQ
) : /* andq $i,$Rd */
10528 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10529 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10530 #define FLD(f) abuf->fields.sfmt_andq.f
10531 int UNUSED written
= 0;
10532 IADDR UNUSED pc
= abuf
->addr
;
10533 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10537 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10539 SI opval
= tmp_tmpd
;
10540 SET_H_GR (FLD (f_operand2
), opval
);
10541 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10545 BI opval
= LTSI (tmp_tmpd
, 0);
10546 CPU (h_nbit
) = opval
;
10547 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10550 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10551 CPU (h_zbit
) = opval
;
10552 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10554 SET_H_CBIT_MOVE (0);
10555 SET_H_VBIT_MOVE (0);
10559 CPU (h_xbit
) = opval
;
10560 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10564 SET_H_INSN_PREFIXED_P (opval
);
10565 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10575 CASE (sem
, INSN_ORR_B_R
) : /* orr.b $Rs,$Rd */
10577 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10578 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10579 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10580 int UNUSED written
= 0;
10581 IADDR UNUSED pc
= abuf
->addr
;
10582 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10586 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10589 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10591 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10592 SET_H_GR (FLD (f_operand2
), opval
);
10593 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10598 BI opval
= LTQI (tmp_tmpd
, 0);
10599 CPU (h_nbit
) = opval
;
10600 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10603 BI opval
= ANDIF (EQQI (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_W_R
) : /* orr.w $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_add_b_r.f
10633 int UNUSED written
= 0;
10634 IADDR UNUSED pc
= abuf
->addr
;
10635 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10639 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10642 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10644 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10645 SET_H_GR (FLD (f_operand2
), opval
);
10646 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10651 BI opval
= LTHI (tmp_tmpd
, 0);
10652 CPU (h_nbit
) = opval
;
10653 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10656 BI opval
= ANDIF (EQHI (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_D_R
) : /* orr.d $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_add_b_r.f
10686 int UNUSED written
= 0;
10687 IADDR UNUSED pc
= abuf
->addr
;
10688 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10692 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10694 SI opval
= tmp_tmpd
;
10695 SET_H_GR (FLD (f_operand2
), opval
);
10696 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10700 BI opval
= LTSI (tmp_tmpd
, 0);
10701 CPU (h_nbit
) = opval
;
10702 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10705 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10706 CPU (h_zbit
) = opval
;
10707 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10709 SET_H_CBIT_MOVE (0);
10710 SET_H_VBIT_MOVE (0);
10714 CPU (h_xbit
) = opval
;
10715 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10719 SET_H_INSN_PREFIXED_P (opval
);
10720 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10730 CASE (sem
, INSN_OR_M_B_M
) : /* or-m.b [${Rs}${inc}],${Rd} */
10732 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10733 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10734 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10735 int UNUSED written
= 0;
10736 IADDR UNUSED pc
= abuf
->addr
;
10737 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10741 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10744 tmp_postinc
= FLD (f_memmode
);
10745 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10746 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10747 ; if (NEBI (tmp_postinc
, 0)) {
10749 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10750 tmp_addr
= ADDSI (tmp_addr
, 1);
10753 SI opval
= tmp_addr
;
10754 SET_H_GR (FLD (f_operand1
), opval
);
10755 written
|= (1 << 11);
10756 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10760 ; tmp_tmp_mem
; }));
10763 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10765 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10766 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10767 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10772 BI opval
= LTQI (tmp_tmpd
, 0);
10773 CPU (h_nbit
) = opval
;
10774 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10777 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10778 CPU (h_zbit
) = opval
;
10779 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10781 SET_H_CBIT_MOVE (0);
10782 SET_H_VBIT_MOVE (0);
10786 CPU (h_xbit
) = opval
;
10787 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10791 SET_H_INSN_PREFIXED_P (opval
);
10792 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10798 abuf
->written
= written
;
10803 CASE (sem
, INSN_OR_M_W_M
) : /* or-m.w [${Rs}${inc}],${Rd} */
10805 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10806 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10807 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10808 int UNUSED written
= 0;
10809 IADDR UNUSED pc
= abuf
->addr
;
10810 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10814 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10817 tmp_postinc
= FLD (f_memmode
);
10818 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10819 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10820 ; if (NEBI (tmp_postinc
, 0)) {
10822 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10823 tmp_addr
= ADDSI (tmp_addr
, 2);
10826 SI opval
= tmp_addr
;
10827 SET_H_GR (FLD (f_operand1
), opval
);
10828 written
|= (1 << 11);
10829 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10833 ; tmp_tmp_mem
; }));
10836 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10838 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10839 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10840 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10845 BI opval
= LTHI (tmp_tmpd
, 0);
10846 CPU (h_nbit
) = opval
;
10847 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10850 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10851 CPU (h_zbit
) = opval
;
10852 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10854 SET_H_CBIT_MOVE (0);
10855 SET_H_VBIT_MOVE (0);
10859 CPU (h_xbit
) = opval
;
10860 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10864 SET_H_INSN_PREFIXED_P (opval
);
10865 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10871 abuf
->written
= written
;
10876 CASE (sem
, INSN_OR_M_D_M
) : /* or-m.d [${Rs}${inc}],${Rd} */
10878 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10879 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10880 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10881 int UNUSED written
= 0;
10882 IADDR UNUSED pc
= abuf
->addr
;
10883 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10887 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10890 tmp_postinc
= FLD (f_memmode
);
10891 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10892 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10893 ; if (NEBI (tmp_postinc
, 0)) {
10895 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10896 tmp_addr
= ADDSI (tmp_addr
, 4);
10899 SI opval
= tmp_addr
;
10900 SET_H_GR (FLD (f_operand1
), opval
);
10901 written
|= (1 << 10);
10902 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10906 ; tmp_tmp_mem
; }));
10908 SI opval
= tmp_tmpd
;
10909 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10910 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10914 BI opval
= LTSI (tmp_tmpd
, 0);
10915 CPU (h_nbit
) = opval
;
10916 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10919 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10920 CPU (h_zbit
) = opval
;
10921 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10923 SET_H_CBIT_MOVE (0);
10924 SET_H_VBIT_MOVE (0);
10928 CPU (h_xbit
) = opval
;
10929 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10933 SET_H_INSN_PREFIXED_P (opval
);
10934 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10940 abuf
->written
= written
;
10945 CASE (sem
, INSN_ORCBR
) : /* or.b ${sconst8}],${Rd} */
10947 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10948 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10949 #define FLD(f) abuf->fields.sfmt_addcbr.f
10950 int UNUSED written
= 0;
10951 IADDR UNUSED pc
= abuf
->addr
;
10952 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10956 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10959 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10961 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10962 SET_H_GR (FLD (f_operand2
), opval
);
10963 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10968 BI opval
= LTQI (tmp_tmpd
, 0);
10969 CPU (h_nbit
) = opval
;
10970 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10973 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10974 CPU (h_zbit
) = opval
;
10975 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10977 SET_H_CBIT_MOVE (0);
10978 SET_H_VBIT_MOVE (0);
10982 CPU (h_xbit
) = opval
;
10983 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10987 SET_H_INSN_PREFIXED_P (opval
);
10988 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10998 CASE (sem
, INSN_ORCWR
) : /* or.w ${sconst16}],${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_addcwr.f
11003 int UNUSED written
= 0;
11004 IADDR UNUSED pc
= abuf
->addr
;
11005 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11009 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
11012 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11014 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11015 SET_H_GR (FLD (f_operand2
), opval
);
11016 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11021 BI opval
= LTHI (tmp_tmpd
, 0);
11022 CPU (h_nbit
) = opval
;
11023 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11026 BI opval
= ANDIF (EQHI (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_ORCDR
) : /* or.d ${const32}],${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_addcdr.f
11056 int UNUSED written
= 0;
11057 IADDR UNUSED pc
= abuf
->addr
;
11058 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
11062 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
11064 SI opval
= tmp_tmpd
;
11065 SET_H_GR (FLD (f_operand2
), opval
);
11066 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11070 BI opval
= LTSI (tmp_tmpd
, 0);
11071 CPU (h_nbit
) = opval
;
11072 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11075 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11076 CPU (h_zbit
) = opval
;
11077 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11079 SET_H_CBIT_MOVE (0);
11080 SET_H_VBIT_MOVE (0);
11084 CPU (h_xbit
) = opval
;
11085 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11089 SET_H_INSN_PREFIXED_P (opval
);
11090 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11100 CASE (sem
, INSN_ORQ
) : /* orq $i,$Rd */
11102 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11103 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11104 #define FLD(f) abuf->fields.sfmt_andq.f
11105 int UNUSED written
= 0;
11106 IADDR UNUSED pc
= abuf
->addr
;
11107 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11111 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
11113 SI opval
= tmp_tmpd
;
11114 SET_H_GR (FLD (f_operand2
), opval
);
11115 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11119 BI opval
= LTSI (tmp_tmpd
, 0);
11120 CPU (h_nbit
) = opval
;
11121 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11124 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11125 CPU (h_zbit
) = opval
;
11126 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11128 SET_H_CBIT_MOVE (0);
11129 SET_H_VBIT_MOVE (0);
11133 CPU (h_xbit
) = opval
;
11134 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11138 SET_H_INSN_PREFIXED_P (opval
);
11139 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11149 CASE (sem
, INSN_XOR
) : /* xor $Rs,$Rd */
11151 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11152 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11153 #define FLD(f) abuf->fields.sfmt_muls_b.f
11154 int UNUSED written
= 0;
11155 IADDR UNUSED pc
= abuf
->addr
;
11156 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11160 tmp_tmpd
= XORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
11162 SI opval
= tmp_tmpd
;
11163 SET_H_GR (FLD (f_operand2
), opval
);
11164 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11168 BI opval
= LTSI (tmp_tmpd
, 0);
11169 CPU (h_nbit
) = opval
;
11170 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11173 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11174 CPU (h_zbit
) = opval
;
11175 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11177 SET_H_CBIT_MOVE (0);
11178 SET_H_VBIT_MOVE (0);
11182 CPU (h_xbit
) = opval
;
11183 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11187 SET_H_INSN_PREFIXED_P (opval
);
11188 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11198 CASE (sem
, INSN_SWAP
) : /* swap${swapoption} ${Rs} */
11200 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11201 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11202 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
11203 int UNUSED written
= 0;
11204 IADDR UNUSED pc
= abuf
->addr
;
11205 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11210 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
11211 tmp_tmpd
= ({ SI tmp_tmpcode
;
11214 tmp_tmpcode
= FLD (f_operand2
);
11215 ; tmp_tmpval
= tmp_tmps
;
11216 ; if (EQSI (tmp_tmpcode
, 0)) {
11217 tmp_tmpres
= (cgen_rtx_error (current_cpu
, "SWAP without swap modifier isn't implemented"), 0);
11219 else if (EQSI (tmp_tmpcode
, 1)) {
11220 tmp_tmpres
= ({ SI tmp_tmpr
;
11221 tmp_tmpr
= tmp_tmpval
;
11222 ; 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)))))))); });
11224 else if (EQSI (tmp_tmpcode
, 2)) {
11225 tmp_tmpres
= ({ SI tmp_tmpb
;
11226 tmp_tmpb
= tmp_tmpval
;
11227 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11229 else if (EQSI (tmp_tmpcode
, 3)) {
11230 tmp_tmpres
= ({ SI tmp_tmpr
;
11231 tmp_tmpr
= ({ SI tmp_tmpb
;
11232 tmp_tmpb
= tmp_tmpval
;
11233 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11234 ; 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)))))))); });
11236 else if (EQSI (tmp_tmpcode
, 4)) {
11237 tmp_tmpres
= ({ SI tmp_tmpb
;
11238 tmp_tmpb
= tmp_tmpval
;
11239 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11241 else if (EQSI (tmp_tmpcode
, 5)) {
11242 tmp_tmpres
= ({ SI tmp_tmpr
;
11243 tmp_tmpr
= ({ SI tmp_tmpb
;
11244 tmp_tmpb
= tmp_tmpval
;
11245 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11246 ; 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)))))))); });
11248 else if (EQSI (tmp_tmpcode
, 6)) {
11249 tmp_tmpres
= ({ SI tmp_tmpb
;
11250 tmp_tmpb
= ({ SI tmp_tmpb
;
11251 tmp_tmpb
= tmp_tmpval
;
11252 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11253 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11255 else if (EQSI (tmp_tmpcode
, 7)) {
11256 tmp_tmpres
= ({ SI tmp_tmpr
;
11257 tmp_tmpr
= ({ SI tmp_tmpb
;
11258 tmp_tmpb
= ({ SI tmp_tmpb
;
11259 tmp_tmpb
= tmp_tmpval
;
11260 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11261 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11262 ; 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)))))))); });
11264 else if (EQSI (tmp_tmpcode
, 8)) {
11265 tmp_tmpres
= INVSI (tmp_tmpval
);
11267 else if (EQSI (tmp_tmpcode
, 9)) {
11268 tmp_tmpres
= ({ SI tmp_tmpr
;
11269 tmp_tmpr
= INVSI (tmp_tmpval
);
11270 ; 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)))))))); });
11272 else if (EQSI (tmp_tmpcode
, 10)) {
11273 tmp_tmpres
= ({ SI tmp_tmpb
;
11274 tmp_tmpb
= INVSI (tmp_tmpval
);
11275 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11277 else if (EQSI (tmp_tmpcode
, 11)) {
11278 tmp_tmpres
= ({ SI tmp_tmpr
;
11279 tmp_tmpr
= ({ SI tmp_tmpb
;
11280 tmp_tmpb
= INVSI (tmp_tmpval
);
11281 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11282 ; 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)))))))); });
11284 else if (EQSI (tmp_tmpcode
, 12)) {
11285 tmp_tmpres
= ({ SI tmp_tmpb
;
11286 tmp_tmpb
= INVSI (tmp_tmpval
);
11287 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11289 else if (EQSI (tmp_tmpcode
, 13)) {
11290 tmp_tmpres
= ({ SI tmp_tmpr
;
11291 tmp_tmpr
= ({ SI tmp_tmpb
;
11292 tmp_tmpb
= INVSI (tmp_tmpval
);
11293 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11294 ; 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)))))))); });
11296 else if (EQSI (tmp_tmpcode
, 14)) {
11297 tmp_tmpres
= ({ SI tmp_tmpb
;
11298 tmp_tmpb
= ({ SI tmp_tmpb
;
11299 tmp_tmpb
= INVSI (tmp_tmpval
);
11300 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11301 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11303 else if (EQSI (tmp_tmpcode
, 15)) {
11304 tmp_tmpres
= ({ SI tmp_tmpr
;
11305 tmp_tmpr
= ({ SI tmp_tmpb
;
11306 tmp_tmpb
= ({ SI tmp_tmpb
;
11307 tmp_tmpb
= INVSI (tmp_tmpval
);
11308 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11309 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11310 ; 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)))))))); });
11314 SI opval
= tmp_tmpd
;
11315 SET_H_GR (FLD (f_operand1
), opval
);
11316 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11320 BI opval
= LTSI (tmp_tmpd
, 0);
11321 CPU (h_nbit
) = opval
;
11322 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11325 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11326 CPU (h_zbit
) = opval
;
11327 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11329 SET_H_CBIT_MOVE (0);
11330 SET_H_VBIT_MOVE (0);
11334 CPU (h_xbit
) = opval
;
11335 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11339 SET_H_INSN_PREFIXED_P (opval
);
11340 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11350 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11352 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11354 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11355 int UNUSED written
= 0;
11356 IADDR UNUSED pc
= abuf
->addr
;
11357 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11363 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11364 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11365 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11368 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11370 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11371 SET_H_GR (FLD (f_operand2
), opval
);
11372 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11377 BI opval
= LTQI (tmp_tmpd
, 0);
11378 CPU (h_nbit
) = opval
;
11379 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11382 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11383 CPU (h_zbit
) = opval
;
11384 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11386 SET_H_CBIT_MOVE (0);
11387 SET_H_VBIT_MOVE (0);
11391 CPU (h_xbit
) = opval
;
11392 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11396 SET_H_INSN_PREFIXED_P (opval
);
11397 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11407 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11409 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11410 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11411 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11412 int UNUSED written
= 0;
11413 IADDR UNUSED pc
= abuf
->addr
;
11414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11420 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11421 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11422 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11425 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11427 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11428 SET_H_GR (FLD (f_operand2
), opval
);
11429 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11434 BI opval
= LTHI (tmp_tmpd
, 0);
11435 CPU (h_nbit
) = opval
;
11436 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11439 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11440 CPU (h_zbit
) = opval
;
11441 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11443 SET_H_CBIT_MOVE (0);
11444 SET_H_VBIT_MOVE (0);
11448 CPU (h_xbit
) = opval
;
11449 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11453 SET_H_INSN_PREFIXED_P (opval
);
11454 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11464 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11466 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11467 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11468 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11469 int UNUSED written
= 0;
11470 IADDR UNUSED pc
= abuf
->addr
;
11471 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11477 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11478 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11479 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11481 SI opval
= tmp_tmpd
;
11482 SET_H_GR (FLD (f_operand2
), opval
);
11483 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11487 BI opval
= LTSI (tmp_tmpd
, 0);
11488 CPU (h_nbit
) = opval
;
11489 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11492 BI opval
= ANDIF (EQSI (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_ASRQ
) : /* asrq $c,${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_asrq.f
11522 int UNUSED written
= 0;
11523 IADDR UNUSED pc
= abuf
->addr
;
11524 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11528 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11530 SI opval
= tmp_tmpd
;
11531 SET_H_GR (FLD (f_operand2
), opval
);
11532 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11536 BI opval
= LTSI (tmp_tmpd
, 0);
11537 CPU (h_nbit
) = opval
;
11538 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11541 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11542 CPU (h_zbit
) = opval
;
11543 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11545 SET_H_CBIT_MOVE (0);
11546 SET_H_VBIT_MOVE (0);
11550 CPU (h_xbit
) = opval
;
11551 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11555 SET_H_INSN_PREFIXED_P (opval
);
11556 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11566 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11568 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11569 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11570 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11571 int UNUSED written
= 0;
11572 IADDR UNUSED pc
= abuf
->addr
;
11573 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11578 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11579 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11582 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11584 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11585 SET_H_GR (FLD (f_operand2
), opval
);
11586 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11591 BI opval
= LTQI (tmp_tmpd
, 0);
11592 CPU (h_nbit
) = opval
;
11593 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11596 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11597 CPU (h_zbit
) = opval
;
11598 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11600 SET_H_CBIT_MOVE (0);
11601 SET_H_VBIT_MOVE (0);
11605 CPU (h_xbit
) = opval
;
11606 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11610 SET_H_INSN_PREFIXED_P (opval
);
11611 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11621 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11623 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11624 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11625 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11626 int UNUSED written
= 0;
11627 IADDR UNUSED pc
= abuf
->addr
;
11628 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11633 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11634 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11637 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11639 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11640 SET_H_GR (FLD (f_operand2
), opval
);
11641 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11646 BI opval
= LTHI (tmp_tmpd
, 0);
11647 CPU (h_nbit
) = opval
;
11648 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11651 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11652 CPU (h_zbit
) = opval
;
11653 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11655 SET_H_CBIT_MOVE (0);
11656 SET_H_VBIT_MOVE (0);
11660 CPU (h_xbit
) = opval
;
11661 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11665 SET_H_INSN_PREFIXED_P (opval
);
11666 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11676 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11678 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11679 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11680 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11681 int UNUSED written
= 0;
11682 IADDR UNUSED pc
= abuf
->addr
;
11683 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11688 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11689 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11691 SI opval
= tmp_tmpd
;
11692 SET_H_GR (FLD (f_operand2
), opval
);
11693 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11697 BI opval
= LTSI (tmp_tmpd
, 0);
11698 CPU (h_nbit
) = opval
;
11699 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11702 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11703 CPU (h_zbit
) = opval
;
11704 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11706 SET_H_CBIT_MOVE (0);
11707 SET_H_VBIT_MOVE (0);
11711 CPU (h_xbit
) = opval
;
11712 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11716 SET_H_INSN_PREFIXED_P (opval
);
11717 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11727 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
11729 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11730 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11731 #define FLD(f) abuf->fields.sfmt_asrq.f
11732 int UNUSED written
= 0;
11733 IADDR UNUSED pc
= abuf
->addr
;
11734 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11738 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11740 SI opval
= tmp_tmpd
;
11741 SET_H_GR (FLD (f_operand2
), opval
);
11742 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11746 BI opval
= LTSI (tmp_tmpd
, 0);
11747 CPU (h_nbit
) = opval
;
11748 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11751 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11752 CPU (h_zbit
) = opval
;
11753 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11755 SET_H_CBIT_MOVE (0);
11756 SET_H_VBIT_MOVE (0);
11760 CPU (h_xbit
) = opval
;
11761 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11765 SET_H_INSN_PREFIXED_P (opval
);
11766 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11776 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
11778 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11779 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11780 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11781 int UNUSED written
= 0;
11782 IADDR UNUSED pc
= abuf
->addr
;
11783 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11788 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11789 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11792 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11794 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11795 SET_H_GR (FLD (f_operand2
), opval
);
11796 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11801 BI opval
= LTQI (tmp_tmpd
, 0);
11802 CPU (h_nbit
) = opval
;
11803 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11806 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11807 CPU (h_zbit
) = opval
;
11808 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11810 SET_H_CBIT_MOVE (0);
11811 SET_H_VBIT_MOVE (0);
11815 CPU (h_xbit
) = opval
;
11816 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11820 SET_H_INSN_PREFIXED_P (opval
);
11821 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11831 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
11833 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11835 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11836 int UNUSED written
= 0;
11837 IADDR UNUSED pc
= abuf
->addr
;
11838 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11843 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11844 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11847 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11849 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11850 SET_H_GR (FLD (f_operand2
), opval
);
11851 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11856 BI opval
= LTHI (tmp_tmpd
, 0);
11857 CPU (h_nbit
) = opval
;
11858 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11861 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11862 CPU (h_zbit
) = opval
;
11863 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11865 SET_H_CBIT_MOVE (0);
11866 SET_H_VBIT_MOVE (0);
11870 CPU (h_xbit
) = opval
;
11871 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11875 SET_H_INSN_PREFIXED_P (opval
);
11876 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11886 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
11888 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11889 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11890 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11891 int UNUSED written
= 0;
11892 IADDR UNUSED pc
= abuf
->addr
;
11893 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11898 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11899 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11901 SI opval
= tmp_tmpd
;
11902 SET_H_GR (FLD (f_operand2
), opval
);
11903 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11907 BI opval
= LTSI (tmp_tmpd
, 0);
11908 CPU (h_nbit
) = opval
;
11909 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11912 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11913 CPU (h_zbit
) = opval
;
11914 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11916 SET_H_CBIT_MOVE (0);
11917 SET_H_VBIT_MOVE (0);
11921 CPU (h_xbit
) = opval
;
11922 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11926 SET_H_INSN_PREFIXED_P (opval
);
11927 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11937 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
11939 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11940 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11941 #define FLD(f) abuf->fields.sfmt_asrq.f
11942 int UNUSED written
= 0;
11943 IADDR UNUSED pc
= abuf
->addr
;
11944 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11948 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11950 SI opval
= tmp_tmpd
;
11951 SET_H_GR (FLD (f_operand2
), opval
);
11952 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11956 BI opval
= LTSI (tmp_tmpd
, 0);
11957 CPU (h_nbit
) = opval
;
11958 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11961 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11962 CPU (h_zbit
) = opval
;
11963 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11965 SET_H_CBIT_MOVE (0);
11966 SET_H_VBIT_MOVE (0);
11970 CPU (h_xbit
) = opval
;
11971 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11975 SET_H_INSN_PREFIXED_P (opval
);
11976 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11986 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
11988 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11989 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11990 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11991 int UNUSED written
= 0;
11992 IADDR UNUSED pc
= abuf
->addr
;
11993 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11998 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31)));
12001 BI opval
= LTSI (tmp_tmpd
, 0);
12002 CPU (h_nbit
) = opval
;
12003 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12006 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12007 CPU (h_zbit
) = opval
;
12008 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12010 SET_H_CBIT_MOVE (0);
12011 SET_H_VBIT_MOVE (0);
12015 CPU (h_xbit
) = opval
;
12016 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12020 SET_H_INSN_PREFIXED_P (opval
);
12021 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12031 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
12033 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12034 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12035 #define FLD(f) abuf->fields.sfmt_asrq.f
12036 int UNUSED written
= 0;
12037 IADDR UNUSED pc
= abuf
->addr
;
12038 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12042 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
12045 BI opval
= LTSI (tmp_tmpd
, 0);
12046 CPU (h_nbit
) = opval
;
12047 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12050 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12051 CPU (h_zbit
) = opval
;
12052 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12054 SET_H_CBIT_MOVE (0);
12055 SET_H_VBIT_MOVE (0);
12059 CPU (h_xbit
) = opval
;
12060 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12064 SET_H_INSN_PREFIXED_P (opval
);
12065 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12075 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
12077 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12078 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12079 #define FLD(f) abuf->fields.sfmt_setf.f
12080 int UNUSED written
= 0;
12081 IADDR UNUSED pc
= abuf
->addr
;
12082 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12086 tmp_tmp
= FLD (f_dstsrc
);
12087 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12090 CPU (h_cbit
) = opval
;
12091 written
|= (1 << 1);
12092 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12095 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12098 CPU (h_vbit
) = opval
;
12099 written
|= (1 << 7);
12100 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12103 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12106 CPU (h_zbit
) = opval
;
12107 written
|= (1 << 9);
12108 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12111 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12114 CPU (h_nbit
) = opval
;
12115 written
|= (1 << 3);
12116 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12119 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12122 CPU (h_xbit
) = opval
;
12123 written
|= (1 << 8);
12124 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12127 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12130 SET_H_IBIT (opval
);
12131 written
|= (1 << 2);
12132 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12135 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12138 SET_H_UBIT (opval
);
12139 written
|= (1 << 6);
12140 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12143 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12146 CPU (h_pbit
) = opval
;
12147 written
|= (1 << 4);
12148 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12153 SET_H_INSN_PREFIXED_P (opval
);
12154 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12156 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12159 CPU (h_xbit
) = opval
;
12160 written
|= (1 << 8);
12161 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12166 abuf
->written
= written
;
12171 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
12173 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12174 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12175 #define FLD(f) abuf->fields.sfmt_setf.f
12176 int UNUSED written
= 0;
12177 IADDR UNUSED pc
= abuf
->addr
;
12178 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12182 tmp_tmp
= FLD (f_dstsrc
);
12183 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12186 CPU (h_cbit
) = opval
;
12187 written
|= (1 << 1);
12188 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12191 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12194 CPU (h_vbit
) = opval
;
12195 written
|= (1 << 7);
12196 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12199 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12202 CPU (h_zbit
) = opval
;
12203 written
|= (1 << 9);
12204 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12207 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12210 CPU (h_nbit
) = opval
;
12211 written
|= (1 << 3);
12212 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12215 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12218 CPU (h_xbit
) = opval
;
12219 written
|= (1 << 8);
12220 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12223 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12226 SET_H_IBIT (opval
);
12227 written
|= (1 << 2);
12228 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12231 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12234 SET_H_UBIT (opval
);
12235 written
|= (1 << 6);
12236 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12239 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12242 CPU (h_pbit
) = opval
;
12243 written
|= (1 << 4);
12244 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12250 CPU (h_xbit
) = opval
;
12251 written
|= (1 << 8);
12252 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12256 SET_H_INSN_PREFIXED_P (opval
);
12257 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12262 abuf
->written
= written
;
12267 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12269 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12270 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12271 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12272 int UNUSED written
= 0;
12273 IADDR UNUSED pc
= abuf
->addr
;
12275 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12279 tmp_truthval
= ({ SI tmp_tmpcond
;
12281 tmp_tmpcond
= FLD (f_operand2
);
12282 ; if (EQSI (tmp_tmpcond
, 0)) {
12283 tmp_condres
= NOTBI (CPU (h_cbit
));
12285 else if (EQSI (tmp_tmpcond
, 1)) {
12286 tmp_condres
= CPU (h_cbit
);
12288 else if (EQSI (tmp_tmpcond
, 2)) {
12289 tmp_condres
= NOTBI (CPU (h_zbit
));
12291 else if (EQSI (tmp_tmpcond
, 3)) {
12292 tmp_condres
= CPU (h_zbit
);
12294 else if (EQSI (tmp_tmpcond
, 4)) {
12295 tmp_condres
= NOTBI (CPU (h_vbit
));
12297 else if (EQSI (tmp_tmpcond
, 5)) {
12298 tmp_condres
= CPU (h_vbit
);
12300 else if (EQSI (tmp_tmpcond
, 6)) {
12301 tmp_condres
= NOTBI (CPU (h_nbit
));
12303 else if (EQSI (tmp_tmpcond
, 7)) {
12304 tmp_condres
= CPU (h_nbit
);
12306 else if (EQSI (tmp_tmpcond
, 8)) {
12307 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12309 else if (EQSI (tmp_tmpcond
, 9)) {
12310 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12312 else if (EQSI (tmp_tmpcond
, 10)) {
12313 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12315 else if (EQSI (tmp_tmpcond
, 11)) {
12316 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12318 else if (EQSI (tmp_tmpcond
, 12)) {
12319 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12321 else if (EQSI (tmp_tmpcond
, 13)) {
12322 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12324 else if (EQSI (tmp_tmpcond
, 14)) {
12327 else if (EQSI (tmp_tmpcond
, 15)) {
12328 tmp_condres
= CPU (h_pbit
);
12331 crisv10f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12335 CPU (h_xbit
) = opval
;
12336 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12340 SET_H_INSN_PREFIXED_P (opval
);
12341 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12344 if (tmp_truthval
) {
12347 USI opval
= FLD (i_o_pcrel
);
12348 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12349 written
|= (1 << 8);
12350 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12356 abuf
->written
= written
;
12357 SEM_BRANCH_FINI (vpc
);
12362 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12364 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12365 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12366 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12367 int UNUSED written
= 0;
12368 IADDR UNUSED pc
= abuf
->addr
;
12370 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12376 CPU (h_xbit
) = opval
;
12377 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12381 SET_H_INSN_PREFIXED_P (opval
);
12382 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12387 USI opval
= FLD (i_o_pcrel
);
12388 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12389 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12394 SEM_BRANCH_FINI (vpc
);
12399 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12401 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12403 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12404 int UNUSED written
= 0;
12405 IADDR UNUSED pc
= abuf
->addr
;
12407 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12411 tmp_truthval
= ({ SI tmp_tmpcond
;
12413 tmp_tmpcond
= FLD (f_operand2
);
12414 ; if (EQSI (tmp_tmpcond
, 0)) {
12415 tmp_condres
= NOTBI (CPU (h_cbit
));
12417 else if (EQSI (tmp_tmpcond
, 1)) {
12418 tmp_condres
= CPU (h_cbit
);
12420 else if (EQSI (tmp_tmpcond
, 2)) {
12421 tmp_condres
= NOTBI (CPU (h_zbit
));
12423 else if (EQSI (tmp_tmpcond
, 3)) {
12424 tmp_condres
= CPU (h_zbit
);
12426 else if (EQSI (tmp_tmpcond
, 4)) {
12427 tmp_condres
= NOTBI (CPU (h_vbit
));
12429 else if (EQSI (tmp_tmpcond
, 5)) {
12430 tmp_condres
= CPU (h_vbit
);
12432 else if (EQSI (tmp_tmpcond
, 6)) {
12433 tmp_condres
= NOTBI (CPU (h_nbit
));
12435 else if (EQSI (tmp_tmpcond
, 7)) {
12436 tmp_condres
= CPU (h_nbit
);
12438 else if (EQSI (tmp_tmpcond
, 8)) {
12439 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12441 else if (EQSI (tmp_tmpcond
, 9)) {
12442 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12444 else if (EQSI (tmp_tmpcond
, 10)) {
12445 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12447 else if (EQSI (tmp_tmpcond
, 11)) {
12448 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12450 else if (EQSI (tmp_tmpcond
, 12)) {
12451 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12453 else if (EQSI (tmp_tmpcond
, 13)) {
12454 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12456 else if (EQSI (tmp_tmpcond
, 14)) {
12459 else if (EQSI (tmp_tmpcond
, 15)) {
12460 tmp_condres
= CPU (h_pbit
);
12463 crisv10f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12467 CPU (h_xbit
) = opval
;
12468 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12472 SET_H_INSN_PREFIXED_P (opval
);
12473 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12476 if (tmp_truthval
) {
12479 USI opval
= FLD (i_o_word_pcrel
);
12480 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12481 written
|= (1 << 8);
12482 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12488 abuf
->written
= written
;
12489 SEM_BRANCH_FINI (vpc
);
12494 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12496 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12497 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12498 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12499 int UNUSED written
= 0;
12500 IADDR UNUSED pc
= abuf
->addr
;
12502 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12508 CPU (h_xbit
) = opval
;
12509 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12513 SET_H_INSN_PREFIXED_P (opval
);
12514 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12519 USI opval
= FLD (i_o_word_pcrel
);
12520 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12521 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12526 SEM_BRANCH_FINI (vpc
);
12531 CASE (sem
, INSN_JUMP_R
) : /* jump/jsr/jir ${Rs} */
12533 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12534 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12535 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12536 int UNUSED written
= 0;
12537 IADDR UNUSED pc
= abuf
->addr
;
12539 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12543 SI opval
= ADDSI (pc
, 2);
12544 SET_H_SR (FLD (f_operand2
), opval
);
12545 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12548 USI opval
= GET_H_GR (FLD (f_operand1
));
12549 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12550 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12555 CPU (h_xbit
) = opval
;
12556 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12560 SET_H_INSN_PREFIXED_P (opval
);
12561 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12566 SEM_BRANCH_FINI (vpc
);
12571 CASE (sem
, INSN_JUMP_M
) : /* jump/jsr/jir [${Rs}${inc}] */
12573 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12574 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12575 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12576 int UNUSED written
= 0;
12577 IADDR UNUSED pc
= abuf
->addr
;
12579 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12583 SI opval
= ADDSI (pc
, 2);
12584 SET_H_SR (FLD (f_operand2
), opval
);
12585 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12588 USI opval
= ({ SI tmp_addr
;
12591 tmp_postinc
= FLD (f_memmode
);
12592 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12593 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
12594 ; if (NEBI (tmp_postinc
, 0)) {
12596 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12597 tmp_addr
= ADDSI (tmp_addr
, 4);
12600 SI opval
= tmp_addr
;
12601 SET_H_GR (FLD (f_operand1
), opval
);
12602 written
|= (1 << 7);
12603 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12608 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12609 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12614 CPU (h_xbit
) = opval
;
12615 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12619 SET_H_INSN_PREFIXED_P (opval
);
12620 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12625 abuf
->written
= written
;
12626 SEM_BRANCH_FINI (vpc
);
12631 CASE (sem
, INSN_JUMP_C
) : /* jump/jsr/jir ${const32} */
12633 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12634 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12635 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
12636 int UNUSED written
= 0;
12637 IADDR UNUSED pc
= abuf
->addr
;
12639 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12643 SI opval
= ADDSI (pc
, 6);
12644 SET_H_SR (FLD (f_operand2
), opval
);
12645 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12648 USI opval
= FLD (f_indir_pc__dword
);
12649 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12650 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12655 CPU (h_xbit
) = opval
;
12656 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12660 SET_H_INSN_PREFIXED_P (opval
);
12661 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12666 SEM_BRANCH_FINI (vpc
);
12671 CASE (sem
, INSN_BREAK
) : /* break $n */
12673 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12674 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12675 #define FLD(f) abuf->fields.sfmt_break.f
12676 int UNUSED written
= 0;
12677 IADDR UNUSED pc
= abuf
->addr
;
12679 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12685 CPU (h_xbit
) = opval
;
12686 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12690 SET_H_INSN_PREFIXED_P (opval
);
12691 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12695 USI opval
= crisv10f_break_handler (current_cpu
, FLD (f_u4
), pc
);
12696 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12697 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12701 SEM_BRANCH_FINI (vpc
);
12706 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
12708 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12709 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12710 #define FLD(f) abuf->fields.sfmt_muls_b.f
12711 int UNUSED written
= 0;
12712 IADDR UNUSED pc
= abuf
->addr
;
12713 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12719 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
12720 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12721 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12723 SI opval
= tmp_newval
;
12724 SET_H_GR (FLD (f_operand2
), opval
);
12725 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12729 BI opval
= LTSI (tmp_newval
, 0);
12730 CPU (h_nbit
) = opval
;
12731 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12734 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12735 CPU (h_zbit
) = opval
;
12736 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12738 SET_H_CBIT_MOVE (0);
12739 SET_H_VBIT_MOVE (0);
12743 CPU (h_xbit
) = opval
;
12744 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12748 SET_H_INSN_PREFIXED_P (opval
);
12749 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12759 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
12761 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12762 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12763 #define FLD(f) abuf->fields.sfmt_muls_b.f
12764 int UNUSED written
= 0;
12765 IADDR UNUSED pc
= abuf
->addr
;
12766 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12772 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
12773 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12774 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12776 SI opval
= tmp_newval
;
12777 SET_H_GR (FLD (f_operand2
), opval
);
12778 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12782 BI opval
= LTSI (tmp_newval
, 0);
12783 CPU (h_nbit
) = opval
;
12784 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12787 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12788 CPU (h_zbit
) = opval
;
12789 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12791 SET_H_CBIT_MOVE (0);
12792 SET_H_VBIT_MOVE (0);
12796 CPU (h_xbit
) = opval
;
12797 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12801 SET_H_INSN_PREFIXED_P (opval
);
12802 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12812 CASE (sem
, INSN_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
12814 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12815 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12816 #define FLD(f) abuf->fields.sfmt_muls_b.f
12817 int UNUSED written
= 0;
12818 IADDR UNUSED pc
= abuf
->addr
;
12819 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12825 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
12826 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12827 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12829 SI opval
= tmp_newval
;
12830 SET_H_GR (FLD (f_operand2
), opval
);
12831 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12835 BI opval
= LTSI (tmp_newval
, 0);
12836 CPU (h_nbit
) = opval
;
12837 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12840 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12841 CPU (h_zbit
) = opval
;
12842 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12844 SET_H_CBIT_MOVE (0);
12845 SET_H_VBIT_MOVE (0);
12849 CPU (h_xbit
) = opval
;
12850 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12854 SET_H_INSN_PREFIXED_P (opval
);
12855 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12865 CASE (sem
, INSN_BOUND_M_B_M
) : /* bound-m.b [${Rs}${inc}],${Rd} */
12867 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12868 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12869 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12870 int UNUSED written
= 0;
12871 IADDR UNUSED pc
= abuf
->addr
;
12872 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12878 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
12881 tmp_postinc
= FLD (f_memmode
);
12882 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12883 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
12884 ; if (NEBI (tmp_postinc
, 0)) {
12886 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12887 tmp_addr
= ADDSI (tmp_addr
, 1);
12890 SI opval
= tmp_addr
;
12891 SET_H_GR (FLD (f_operand1
), opval
);
12892 written
|= (1 << 9);
12893 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12897 ; tmp_tmp_mem
; }));
12898 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12899 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12900 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
12902 SI opval
= tmp_newval
;
12903 SET_H_GR (FLD (f_operand1
), opval
);
12904 written
|= (1 << 9);
12905 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12909 SI opval
= tmp_newval
;
12910 SET_H_GR (FLD (f_operand2
), opval
);
12911 written
|= (1 << 8);
12912 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12917 BI opval
= LTSI (tmp_newval
, 0);
12918 CPU (h_nbit
) = opval
;
12919 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12922 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12923 CPU (h_zbit
) = opval
;
12924 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12926 SET_H_CBIT_MOVE (0);
12927 SET_H_VBIT_MOVE (0);
12931 CPU (h_xbit
) = opval
;
12932 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12936 SET_H_INSN_PREFIXED_P (opval
);
12937 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12943 abuf
->written
= written
;
12948 CASE (sem
, INSN_BOUND_M_W_M
) : /* bound-m.w [${Rs}${inc}],${Rd} */
12950 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12951 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12952 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12953 int UNUSED written
= 0;
12954 IADDR UNUSED pc
= abuf
->addr
;
12955 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12961 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
12964 tmp_postinc
= FLD (f_memmode
);
12965 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12966 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
12967 ; if (NEBI (tmp_postinc
, 0)) {
12969 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12970 tmp_addr
= ADDSI (tmp_addr
, 2);
12973 SI opval
= tmp_addr
;
12974 SET_H_GR (FLD (f_operand1
), opval
);
12975 written
|= (1 << 9);
12976 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12980 ; tmp_tmp_mem
; }));
12981 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12982 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12983 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
12985 SI opval
= tmp_newval
;
12986 SET_H_GR (FLD (f_operand1
), opval
);
12987 written
|= (1 << 9);
12988 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12992 SI opval
= tmp_newval
;
12993 SET_H_GR (FLD (f_operand2
), opval
);
12994 written
|= (1 << 8);
12995 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13000 BI opval
= LTSI (tmp_newval
, 0);
13001 CPU (h_nbit
) = opval
;
13002 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13005 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13006 CPU (h_zbit
) = opval
;
13007 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13009 SET_H_CBIT_MOVE (0);
13010 SET_H_VBIT_MOVE (0);
13014 CPU (h_xbit
) = opval
;
13015 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13019 SET_H_INSN_PREFIXED_P (opval
);
13020 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13026 abuf
->written
= written
;
13031 CASE (sem
, INSN_BOUND_M_D_M
) : /* bound-m.d [${Rs}${inc}],${Rd} */
13033 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13034 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13035 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13036 int UNUSED written
= 0;
13037 IADDR UNUSED pc
= abuf
->addr
;
13038 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13044 tmp_tmpops
= ({ SI tmp_addr
;
13047 tmp_postinc
= FLD (f_memmode
);
13048 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13049 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13050 ; if (NEBI (tmp_postinc
, 0)) {
13052 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13053 tmp_addr
= ADDSI (tmp_addr
, 4);
13056 SI opval
= tmp_addr
;
13057 SET_H_GR (FLD (f_operand1
), opval
);
13058 written
|= (1 << 9);
13059 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13064 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13065 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13066 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
13068 SI opval
= tmp_newval
;
13069 SET_H_GR (FLD (f_operand1
), opval
);
13070 written
|= (1 << 9);
13071 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13075 SI opval
= tmp_newval
;
13076 SET_H_GR (FLD (f_operand2
), opval
);
13077 written
|= (1 << 8);
13078 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13083 BI opval
= LTSI (tmp_newval
, 0);
13084 CPU (h_nbit
) = opval
;
13085 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13088 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13089 CPU (h_zbit
) = opval
;
13090 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13092 SET_H_CBIT_MOVE (0);
13093 SET_H_VBIT_MOVE (0);
13097 CPU (h_xbit
) = opval
;
13098 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13102 SET_H_INSN_PREFIXED_P (opval
);
13103 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13109 abuf
->written
= written
;
13114 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
13116 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13117 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13118 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13119 int UNUSED written
= 0;
13120 IADDR UNUSED pc
= abuf
->addr
;
13121 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13127 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
13128 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13129 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13131 SI opval
= tmp_newval
;
13132 SET_H_GR (FLD (f_operand2
), opval
);
13133 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13137 BI opval
= LTSI (tmp_newval
, 0);
13138 CPU (h_nbit
) = opval
;
13139 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13142 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13143 CPU (h_zbit
) = opval
;
13144 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13146 SET_H_CBIT_MOVE (0);
13147 SET_H_VBIT_MOVE (0);
13151 CPU (h_xbit
) = opval
;
13152 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13156 SET_H_INSN_PREFIXED_P (opval
);
13157 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13167 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
13169 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13170 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13171 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13172 int UNUSED written
= 0;
13173 IADDR UNUSED pc
= abuf
->addr
;
13174 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13180 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
13181 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13182 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13184 SI opval
= tmp_newval
;
13185 SET_H_GR (FLD (f_operand2
), opval
);
13186 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13190 BI opval
= LTSI (tmp_newval
, 0);
13191 CPU (h_nbit
) = opval
;
13192 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13195 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13196 CPU (h_zbit
) = opval
;
13197 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13199 SET_H_CBIT_MOVE (0);
13200 SET_H_VBIT_MOVE (0);
13204 CPU (h_xbit
) = opval
;
13205 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13209 SET_H_INSN_PREFIXED_P (opval
);
13210 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13220 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13222 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13223 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13224 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13225 int UNUSED written
= 0;
13226 IADDR UNUSED pc
= abuf
->addr
;
13227 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13233 tmp_tmpops
= FLD (f_indir_pc__dword
);
13234 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13235 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13237 SI opval
= tmp_newval
;
13238 SET_H_GR (FLD (f_operand2
), opval
);
13239 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13243 BI opval
= LTSI (tmp_newval
, 0);
13244 CPU (h_nbit
) = opval
;
13245 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13248 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13249 CPU (h_zbit
) = opval
;
13250 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13252 SET_H_CBIT_MOVE (0);
13253 SET_H_VBIT_MOVE (0);
13257 CPU (h_xbit
) = opval
;
13258 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13262 SET_H_INSN_PREFIXED_P (opval
);
13263 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13273 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13275 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13276 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13277 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13278 int UNUSED written
= 0;
13279 IADDR UNUSED pc
= abuf
->addr
;
13280 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13284 tmp_truthval
= ({ SI tmp_tmpcond
;
13286 tmp_tmpcond
= FLD (f_operand2
);
13287 ; if (EQSI (tmp_tmpcond
, 0)) {
13288 tmp_condres
= NOTBI (CPU (h_cbit
));
13290 else if (EQSI (tmp_tmpcond
, 1)) {
13291 tmp_condres
= CPU (h_cbit
);
13293 else if (EQSI (tmp_tmpcond
, 2)) {
13294 tmp_condres
= NOTBI (CPU (h_zbit
));
13296 else if (EQSI (tmp_tmpcond
, 3)) {
13297 tmp_condres
= CPU (h_zbit
);
13299 else if (EQSI (tmp_tmpcond
, 4)) {
13300 tmp_condres
= NOTBI (CPU (h_vbit
));
13302 else if (EQSI (tmp_tmpcond
, 5)) {
13303 tmp_condres
= CPU (h_vbit
);
13305 else if (EQSI (tmp_tmpcond
, 6)) {
13306 tmp_condres
= NOTBI (CPU (h_nbit
));
13308 else if (EQSI (tmp_tmpcond
, 7)) {
13309 tmp_condres
= CPU (h_nbit
);
13311 else if (EQSI (tmp_tmpcond
, 8)) {
13312 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13314 else if (EQSI (tmp_tmpcond
, 9)) {
13315 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13317 else if (EQSI (tmp_tmpcond
, 10)) {
13318 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13320 else if (EQSI (tmp_tmpcond
, 11)) {
13321 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13323 else if (EQSI (tmp_tmpcond
, 12)) {
13324 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13326 else if (EQSI (tmp_tmpcond
, 13)) {
13327 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13329 else if (EQSI (tmp_tmpcond
, 14)) {
13332 else if (EQSI (tmp_tmpcond
, 15)) {
13333 tmp_condres
= CPU (h_pbit
);
13337 SI opval
= ZEXTBISI (tmp_truthval
);
13338 SET_H_GR (FLD (f_operand1
), opval
);
13339 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13344 CPU (h_xbit
) = opval
;
13345 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13349 SET_H_INSN_PREFIXED_P (opval
);
13350 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13359 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13361 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13363 #define FLD(f) abuf->fields.sfmt_muls_b.f
13364 int UNUSED written
= 0;
13365 IADDR UNUSED pc
= abuf
->addr
;
13366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13371 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13374 if (GESI (tmp_tmp
, 0)) {
13376 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13377 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13380 if (GESI (tmp_tmp
, 0)) {
13382 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13383 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13386 if (GESI (tmp_tmp
, 0)) {
13388 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13389 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13392 if (GESI (tmp_tmp
, 0)) {
13394 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13395 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13398 if (GESI (tmp_tmp
, 0)) {
13400 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13401 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13404 if (GESI (tmp_tmp
, 0)) {
13406 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13407 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13410 if (GESI (tmp_tmp
, 0)) {
13412 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13413 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13416 if (GESI (tmp_tmp
, 0)) {
13418 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13419 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13422 if (GESI (tmp_tmp
, 0)) {
13424 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13425 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13428 if (GESI (tmp_tmp
, 0)) {
13430 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13431 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13434 if (GESI (tmp_tmp
, 0)) {
13436 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13437 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13440 if (GESI (tmp_tmp
, 0)) {
13442 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13443 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13446 if (GESI (tmp_tmp
, 0)) {
13448 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13449 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13452 if (GESI (tmp_tmp
, 0)) {
13454 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13455 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13458 if (GESI (tmp_tmp
, 0)) {
13460 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13461 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13464 if (GESI (tmp_tmp
, 0)) {
13466 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13467 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13470 if (GESI (tmp_tmp
, 0)) {
13472 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13473 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13476 if (GESI (tmp_tmp
, 0)) {
13478 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13479 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13482 if (GESI (tmp_tmp
, 0)) {
13484 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13485 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13488 if (GESI (tmp_tmp
, 0)) {
13490 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13491 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13494 if (GESI (tmp_tmp
, 0)) {
13496 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13497 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13500 if (GESI (tmp_tmp
, 0)) {
13502 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13503 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13506 if (GESI (tmp_tmp
, 0)) {
13508 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13509 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13512 if (GESI (tmp_tmp
, 0)) {
13514 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13515 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13518 if (GESI (tmp_tmp
, 0)) {
13520 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13521 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13524 if (GESI (tmp_tmp
, 0)) {
13526 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13527 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13530 if (GESI (tmp_tmp
, 0)) {
13532 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13533 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13536 if (GESI (tmp_tmp
, 0)) {
13538 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13539 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13542 if (GESI (tmp_tmp
, 0)) {
13544 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13545 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13548 if (GESI (tmp_tmp
, 0)) {
13550 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13551 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13554 if (GESI (tmp_tmp
, 0)) {
13556 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13557 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13560 if (GESI (tmp_tmp
, 0)) {
13562 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13563 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13568 SI opval
= tmp_tmpd
;
13569 SET_H_GR (FLD (f_operand2
), opval
);
13570 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13574 BI opval
= LTSI (tmp_tmpd
, 0);
13575 CPU (h_nbit
) = opval
;
13576 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13579 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13580 CPU (h_zbit
) = opval
;
13581 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13583 SET_H_CBIT_MOVE (0);
13584 SET_H_VBIT_MOVE (0);
13588 CPU (h_xbit
) = opval
;
13589 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13593 SET_H_INSN_PREFIXED_P (opval
);
13594 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13604 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13606 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13607 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13608 #define FLD(f) abuf->fields.sfmt_addoq.f
13609 int UNUSED written
= 0;
13610 IADDR UNUSED pc
= abuf
->addr
;
13611 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13615 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13616 CPU (h_prefixreg_pre_v32
) = opval
;
13617 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13621 SET_H_INSN_PREFIXED_P (opval
);
13622 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13630 CASE (sem
, INSN_BDAPQPC
) : /* bdapq $o,PC */
13632 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13633 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13634 #define FLD(f) abuf->fields.sfmt_addoq.f
13635 int UNUSED written
= 0;
13636 IADDR UNUSED pc
= abuf
->addr
;
13638 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13642 SI opval
= ADDSI (ADDSI (pc
, 2), FLD (f_s8
));
13643 CPU (h_prefixreg_pre_v32
) = opval
;
13644 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13648 SET_H_INSN_PREFIXED_P (opval
);
13649 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13651 cris_flush_simulator_decode_cache (current_cpu
, pc
);
13654 SEM_BRANCH_FINI (vpc
);
13659 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13661 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13662 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13663 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13664 int UNUSED written
= 0;
13665 IADDR UNUSED pc
= abuf
->addr
;
13666 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13670 tmp_tmps
= ({ SI tmp_addr
;
13673 tmp_postinc
= FLD (f_memmode
);
13674 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13675 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13676 ; if (NEBI (tmp_postinc
, 0)) {
13678 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13679 tmp_addr
= ADDSI (tmp_addr
, 1);
13682 SI opval
= tmp_addr
;
13683 SET_H_GR (FLD (f_operand1
), opval
);
13684 written
|= (1 << 6);
13685 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13691 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13692 CPU (h_prefixreg_pre_v32
) = opval
;
13693 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13697 SET_H_INSN_PREFIXED_P (opval
);
13698 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13702 abuf
->written
= written
;
13707 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13709 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13710 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13711 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13712 int UNUSED written
= 0;
13713 IADDR UNUSED pc
= abuf
->addr
;
13714 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13718 tmp_tmps
= ({ SI tmp_addr
;
13721 tmp_postinc
= FLD (f_memmode
);
13722 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13723 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
13724 ; if (NEBI (tmp_postinc
, 0)) {
13726 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13727 tmp_addr
= ADDSI (tmp_addr
, 2);
13730 SI opval
= tmp_addr
;
13731 SET_H_GR (FLD (f_operand1
), opval
);
13732 written
|= (1 << 6);
13733 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13739 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
13740 CPU (h_prefixreg_pre_v32
) = opval
;
13741 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13745 SET_H_INSN_PREFIXED_P (opval
);
13746 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13750 abuf
->written
= written
;
13755 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13757 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13758 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13759 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13760 int UNUSED written
= 0;
13761 IADDR UNUSED pc
= abuf
->addr
;
13762 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13766 tmp_tmps
= ({ SI tmp_addr
;
13769 tmp_postinc
= FLD (f_memmode
);
13770 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13771 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13772 ; if (NEBI (tmp_postinc
, 0)) {
13774 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13775 tmp_addr
= ADDSI (tmp_addr
, 4);
13778 SI opval
= tmp_addr
;
13779 SET_H_GR (FLD (f_operand1
), opval
);
13780 written
|= (1 << 6);
13781 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13787 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
13788 CPU (h_prefixreg_pre_v32
) = opval
;
13789 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13793 SET_H_INSN_PREFIXED_P (opval
);
13794 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13798 abuf
->written
= written
;
13803 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
13805 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13806 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13807 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13808 int UNUSED written
= 0;
13809 IADDR UNUSED pc
= abuf
->addr
;
13810 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13814 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
13815 CPU (h_prefixreg_pre_v32
) = opval
;
13816 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13820 SET_H_INSN_PREFIXED_P (opval
);
13821 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13829 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
13831 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13832 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13833 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13834 int UNUSED written
= 0;
13835 IADDR UNUSED pc
= abuf
->addr
;
13836 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13840 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
13841 CPU (h_prefixreg_pre_v32
) = opval
;
13842 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13846 SET_H_INSN_PREFIXED_P (opval
);
13847 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13855 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
13857 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13858 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13859 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13860 int UNUSED written
= 0;
13861 IADDR UNUSED pc
= abuf
->addr
;
13862 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13866 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
13867 CPU (h_prefixreg_pre_v32
) = opval
;
13868 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13872 SET_H_INSN_PREFIXED_P (opval
);
13873 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13881 CASE (sem
, INSN_DIP_M
) : /* dip [${Rs}${inc}] */
13883 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13884 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13885 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13886 int UNUSED written
= 0;
13887 IADDR UNUSED pc
= abuf
->addr
;
13888 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13892 tmp_tmps
= ({ SI tmp_addr
;
13895 tmp_postinc
= FLD (f_memmode
);
13896 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13897 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13898 ; if (NEBI (tmp_postinc
, 0)) {
13900 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13901 tmp_addr
= ADDSI (tmp_addr
, 4);
13904 SI opval
= tmp_addr
;
13905 SET_H_GR (FLD (f_operand1
), opval
);
13906 written
|= (1 << 5);
13907 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13913 SI opval
= tmp_tmps
;
13914 CPU (h_prefixreg_pre_v32
) = opval
;
13915 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13919 SET_H_INSN_PREFIXED_P (opval
);
13920 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13924 abuf
->written
= written
;
13929 CASE (sem
, INSN_DIP_C
) : /* dip [PC+] */
13931 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13932 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13933 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p8.f
13934 int UNUSED written
= 0;
13935 IADDR UNUSED pc
= abuf
->addr
;
13936 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13940 SI opval
= FLD (f_indir_pc__dword
);
13941 CPU (h_prefixreg_pre_v32
) = opval
;
13942 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13946 SET_H_INSN_PREFIXED_P (opval
);
13947 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13955 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13957 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13958 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13959 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13960 int UNUSED written
= 0;
13961 IADDR UNUSED pc
= abuf
->addr
;
13962 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13966 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13967 CPU (h_prefixreg_pre_v32
) = opval
;
13968 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13972 SET_H_INSN_PREFIXED_P (opval
);
13973 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13981 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13983 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13984 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13985 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13986 int UNUSED written
= 0;
13987 IADDR UNUSED pc
= abuf
->addr
;
13988 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13992 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
13993 CPU (h_prefixreg_pre_v32
) = opval
;
13994 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13998 SET_H_INSN_PREFIXED_P (opval
);
13999 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14007 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14009 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14010 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14011 #define FLD(f) abuf->fields.sfmt_add_b_r.f
14012 int UNUSED written
= 0;
14013 IADDR UNUSED pc
= abuf
->addr
;
14014 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14018 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14019 CPU (h_prefixreg_pre_v32
) = opval
;
14020 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14024 SET_H_INSN_PREFIXED_P (opval
);
14025 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14033 CASE (sem
, INSN_BIAP_PC_B_R
) : /* biap-pc.b ${Rs-dfield}.m,PC */
14035 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14036 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14037 #define FLD(f) abuf->fields.sfmt_addoq.f
14038 int UNUSED written
= 0;
14039 IADDR UNUSED pc
= abuf
->addr
;
14040 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14044 SI opval
= ADDSI (ADDSI (pc
, 4), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
14045 CPU (h_prefixreg_pre_v32
) = opval
;
14046 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14050 SET_H_INSN_PREFIXED_P (opval
);
14051 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14059 CASE (sem
, INSN_BIAP_PC_W_R
) : /* biap-pc.w ${Rs-dfield}.m,PC */
14061 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14062 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14063 #define FLD(f) abuf->fields.sfmt_addoq.f
14064 int UNUSED written
= 0;
14065 IADDR UNUSED pc
= abuf
->addr
;
14066 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14070 SI opval
= ADDSI (ADDSI (pc
, 4), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
14071 CPU (h_prefixreg_pre_v32
) = opval
;
14072 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14076 SET_H_INSN_PREFIXED_P (opval
);
14077 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14085 CASE (sem
, INSN_BIAP_PC_D_R
) : /* biap-pc.d ${Rs-dfield}.m,PC */
14087 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14088 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14089 #define FLD(f) abuf->fields.sfmt_addoq.f
14090 int UNUSED written
= 0;
14091 IADDR UNUSED pc
= abuf
->addr
;
14092 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14096 SI opval
= ADDSI (ADDSI (pc
, 4), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14097 CPU (h_prefixreg_pre_v32
) = opval
;
14098 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14102 SET_H_INSN_PREFIXED_P (opval
);
14103 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14113 ENDSWITCH (sem
) /* End of semantic switch. */
14115 /* At this point `vpc' contains the next insn to execute. */
14118 #undef DEFINE_SWITCH
14119 #endif /* DEFINE_SWITCH */