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_P5
, && case_sem_INSN_MOVE_C_SPRV10_P5
},
90 { CRISV10F_INSN_MOVE_C_SPRV10_P9
, && case_sem_INSN_MOVE_C_SPRV10_P9
},
91 { CRISV10F_INSN_MOVE_C_SPRV10_P10
, && case_sem_INSN_MOVE_C_SPRV10_P10
},
92 { CRISV10F_INSN_MOVE_C_SPRV10_P11
, && case_sem_INSN_MOVE_C_SPRV10_P11
},
93 { CRISV10F_INSN_MOVE_C_SPRV10_P12
, && case_sem_INSN_MOVE_C_SPRV10_P12
},
94 { CRISV10F_INSN_MOVE_C_SPRV10_P13
, && case_sem_INSN_MOVE_C_SPRV10_P13
},
95 { CRISV10F_INSN_MOVE_C_SPRV10_P7
, && case_sem_INSN_MOVE_C_SPRV10_P7
},
96 { CRISV10F_INSN_MOVE_C_SPRV10_P14
, && case_sem_INSN_MOVE_C_SPRV10_P14
},
97 { CRISV10F_INSN_MOVE_C_SPRV10_P15
, && case_sem_INSN_MOVE_C_SPRV10_P15
},
98 { CRISV10F_INSN_MOVE_SPR_MV10
, && case_sem_INSN_MOVE_SPR_MV10
},
99 { CRISV10F_INSN_SBFS
, && case_sem_INSN_SBFS
},
100 { CRISV10F_INSN_MOVEM_R_M
, && case_sem_INSN_MOVEM_R_M
},
101 { CRISV10F_INSN_MOVEM_M_R
, && case_sem_INSN_MOVEM_M_R
},
102 { CRISV10F_INSN_MOVEM_M_PC
, && case_sem_INSN_MOVEM_M_PC
},
103 { CRISV10F_INSN_ADD_B_R
, && case_sem_INSN_ADD_B_R
},
104 { CRISV10F_INSN_ADD_W_R
, && case_sem_INSN_ADD_W_R
},
105 { CRISV10F_INSN_ADD_D_R
, && case_sem_INSN_ADD_D_R
},
106 { CRISV10F_INSN_ADD_M_B_M
, && case_sem_INSN_ADD_M_B_M
},
107 { CRISV10F_INSN_ADD_M_W_M
, && case_sem_INSN_ADD_M_W_M
},
108 { CRISV10F_INSN_ADD_M_D_M
, && case_sem_INSN_ADD_M_D_M
},
109 { CRISV10F_INSN_ADDCBR
, && case_sem_INSN_ADDCBR
},
110 { CRISV10F_INSN_ADDCWR
, && case_sem_INSN_ADDCWR
},
111 { CRISV10F_INSN_ADDCDR
, && case_sem_INSN_ADDCDR
},
112 { CRISV10F_INSN_ADDCPC
, && case_sem_INSN_ADDCPC
},
113 { CRISV10F_INSN_ADDS_B_R
, && case_sem_INSN_ADDS_B_R
},
114 { CRISV10F_INSN_ADDS_W_R
, && case_sem_INSN_ADDS_W_R
},
115 { CRISV10F_INSN_ADDS_M_B_M
, && case_sem_INSN_ADDS_M_B_M
},
116 { CRISV10F_INSN_ADDS_M_W_M
, && case_sem_INSN_ADDS_M_W_M
},
117 { CRISV10F_INSN_ADDSCBR
, && case_sem_INSN_ADDSCBR
},
118 { CRISV10F_INSN_ADDSCWR
, && case_sem_INSN_ADDSCWR
},
119 { CRISV10F_INSN_ADDSPCPC
, && case_sem_INSN_ADDSPCPC
},
120 { CRISV10F_INSN_ADDU_B_R
, && case_sem_INSN_ADDU_B_R
},
121 { CRISV10F_INSN_ADDU_W_R
, && case_sem_INSN_ADDU_W_R
},
122 { CRISV10F_INSN_ADDU_M_B_M
, && case_sem_INSN_ADDU_M_B_M
},
123 { CRISV10F_INSN_ADDU_M_W_M
, && case_sem_INSN_ADDU_M_W_M
},
124 { CRISV10F_INSN_ADDUCBR
, && case_sem_INSN_ADDUCBR
},
125 { CRISV10F_INSN_ADDUCWR
, && case_sem_INSN_ADDUCWR
},
126 { CRISV10F_INSN_SUB_B_R
, && case_sem_INSN_SUB_B_R
},
127 { CRISV10F_INSN_SUB_W_R
, && case_sem_INSN_SUB_W_R
},
128 { CRISV10F_INSN_SUB_D_R
, && case_sem_INSN_SUB_D_R
},
129 { CRISV10F_INSN_SUB_M_B_M
, && case_sem_INSN_SUB_M_B_M
},
130 { CRISV10F_INSN_SUB_M_W_M
, && case_sem_INSN_SUB_M_W_M
},
131 { CRISV10F_INSN_SUB_M_D_M
, && case_sem_INSN_SUB_M_D_M
},
132 { CRISV10F_INSN_SUBCBR
, && case_sem_INSN_SUBCBR
},
133 { CRISV10F_INSN_SUBCWR
, && case_sem_INSN_SUBCWR
},
134 { CRISV10F_INSN_SUBCDR
, && case_sem_INSN_SUBCDR
},
135 { CRISV10F_INSN_SUBS_B_R
, && case_sem_INSN_SUBS_B_R
},
136 { CRISV10F_INSN_SUBS_W_R
, && case_sem_INSN_SUBS_W_R
},
137 { CRISV10F_INSN_SUBS_M_B_M
, && case_sem_INSN_SUBS_M_B_M
},
138 { CRISV10F_INSN_SUBS_M_W_M
, && case_sem_INSN_SUBS_M_W_M
},
139 { CRISV10F_INSN_SUBSCBR
, && case_sem_INSN_SUBSCBR
},
140 { CRISV10F_INSN_SUBSCWR
, && case_sem_INSN_SUBSCWR
},
141 { CRISV10F_INSN_SUBU_B_R
, && case_sem_INSN_SUBU_B_R
},
142 { CRISV10F_INSN_SUBU_W_R
, && case_sem_INSN_SUBU_W_R
},
143 { CRISV10F_INSN_SUBU_M_B_M
, && case_sem_INSN_SUBU_M_B_M
},
144 { CRISV10F_INSN_SUBU_M_W_M
, && case_sem_INSN_SUBU_M_W_M
},
145 { CRISV10F_INSN_SUBUCBR
, && case_sem_INSN_SUBUCBR
},
146 { CRISV10F_INSN_SUBUCWR
, && case_sem_INSN_SUBUCWR
},
147 { CRISV10F_INSN_ADDI_B_R
, && case_sem_INSN_ADDI_B_R
},
148 { CRISV10F_INSN_ADDI_W_R
, && case_sem_INSN_ADDI_W_R
},
149 { CRISV10F_INSN_ADDI_D_R
, && case_sem_INSN_ADDI_D_R
},
150 { CRISV10F_INSN_NEG_B_R
, && case_sem_INSN_NEG_B_R
},
151 { CRISV10F_INSN_NEG_W_R
, && case_sem_INSN_NEG_W_R
},
152 { CRISV10F_INSN_NEG_D_R
, && case_sem_INSN_NEG_D_R
},
153 { CRISV10F_INSN_TEST_M_B_M
, && case_sem_INSN_TEST_M_B_M
},
154 { CRISV10F_INSN_TEST_M_W_M
, && case_sem_INSN_TEST_M_W_M
},
155 { CRISV10F_INSN_TEST_M_D_M
, && case_sem_INSN_TEST_M_D_M
},
156 { CRISV10F_INSN_MOVE_R_M_B_M
, && case_sem_INSN_MOVE_R_M_B_M
},
157 { CRISV10F_INSN_MOVE_R_M_W_M
, && case_sem_INSN_MOVE_R_M_W_M
},
158 { CRISV10F_INSN_MOVE_R_M_D_M
, && case_sem_INSN_MOVE_R_M_D_M
},
159 { CRISV10F_INSN_MULS_B
, && case_sem_INSN_MULS_B
},
160 { CRISV10F_INSN_MULS_W
, && case_sem_INSN_MULS_W
},
161 { CRISV10F_INSN_MULS_D
, && case_sem_INSN_MULS_D
},
162 { CRISV10F_INSN_MULU_B
, && case_sem_INSN_MULU_B
},
163 { CRISV10F_INSN_MULU_W
, && case_sem_INSN_MULU_W
},
164 { CRISV10F_INSN_MULU_D
, && case_sem_INSN_MULU_D
},
165 { CRISV10F_INSN_MSTEP
, && case_sem_INSN_MSTEP
},
166 { CRISV10F_INSN_DSTEP
, && case_sem_INSN_DSTEP
},
167 { CRISV10F_INSN_ABS
, && case_sem_INSN_ABS
},
168 { CRISV10F_INSN_AND_B_R
, && case_sem_INSN_AND_B_R
},
169 { CRISV10F_INSN_AND_W_R
, && case_sem_INSN_AND_W_R
},
170 { CRISV10F_INSN_AND_D_R
, && case_sem_INSN_AND_D_R
},
171 { CRISV10F_INSN_AND_M_B_M
, && case_sem_INSN_AND_M_B_M
},
172 { CRISV10F_INSN_AND_M_W_M
, && case_sem_INSN_AND_M_W_M
},
173 { CRISV10F_INSN_AND_M_D_M
, && case_sem_INSN_AND_M_D_M
},
174 { CRISV10F_INSN_ANDCBR
, && case_sem_INSN_ANDCBR
},
175 { CRISV10F_INSN_ANDCWR
, && case_sem_INSN_ANDCWR
},
176 { CRISV10F_INSN_ANDCDR
, && case_sem_INSN_ANDCDR
},
177 { CRISV10F_INSN_ANDQ
, && case_sem_INSN_ANDQ
},
178 { CRISV10F_INSN_ORR_B_R
, && case_sem_INSN_ORR_B_R
},
179 { CRISV10F_INSN_ORR_W_R
, && case_sem_INSN_ORR_W_R
},
180 { CRISV10F_INSN_ORR_D_R
, && case_sem_INSN_ORR_D_R
},
181 { CRISV10F_INSN_OR_M_B_M
, && case_sem_INSN_OR_M_B_M
},
182 { CRISV10F_INSN_OR_M_W_M
, && case_sem_INSN_OR_M_W_M
},
183 { CRISV10F_INSN_OR_M_D_M
, && case_sem_INSN_OR_M_D_M
},
184 { CRISV10F_INSN_ORCBR
, && case_sem_INSN_ORCBR
},
185 { CRISV10F_INSN_ORCWR
, && case_sem_INSN_ORCWR
},
186 { CRISV10F_INSN_ORCDR
, && case_sem_INSN_ORCDR
},
187 { CRISV10F_INSN_ORQ
, && case_sem_INSN_ORQ
},
188 { CRISV10F_INSN_XOR
, && case_sem_INSN_XOR
},
189 { CRISV10F_INSN_SWAP
, && case_sem_INSN_SWAP
},
190 { CRISV10F_INSN_ASRR_B_R
, && case_sem_INSN_ASRR_B_R
},
191 { CRISV10F_INSN_ASRR_W_R
, && case_sem_INSN_ASRR_W_R
},
192 { CRISV10F_INSN_ASRR_D_R
, && case_sem_INSN_ASRR_D_R
},
193 { CRISV10F_INSN_ASRQ
, && case_sem_INSN_ASRQ
},
194 { CRISV10F_INSN_LSRR_B_R
, && case_sem_INSN_LSRR_B_R
},
195 { CRISV10F_INSN_LSRR_W_R
, && case_sem_INSN_LSRR_W_R
},
196 { CRISV10F_INSN_LSRR_D_R
, && case_sem_INSN_LSRR_D_R
},
197 { CRISV10F_INSN_LSRQ
, && case_sem_INSN_LSRQ
},
198 { CRISV10F_INSN_LSLR_B_R
, && case_sem_INSN_LSLR_B_R
},
199 { CRISV10F_INSN_LSLR_W_R
, && case_sem_INSN_LSLR_W_R
},
200 { CRISV10F_INSN_LSLR_D_R
, && case_sem_INSN_LSLR_D_R
},
201 { CRISV10F_INSN_LSLQ
, && case_sem_INSN_LSLQ
},
202 { CRISV10F_INSN_BTST
, && case_sem_INSN_BTST
},
203 { CRISV10F_INSN_BTSTQ
, && case_sem_INSN_BTSTQ
},
204 { CRISV10F_INSN_SETF
, && case_sem_INSN_SETF
},
205 { CRISV10F_INSN_CLEARF
, && case_sem_INSN_CLEARF
},
206 { CRISV10F_INSN_BCC_B
, && case_sem_INSN_BCC_B
},
207 { CRISV10F_INSN_BA_B
, && case_sem_INSN_BA_B
},
208 { CRISV10F_INSN_BCC_W
, && case_sem_INSN_BCC_W
},
209 { CRISV10F_INSN_BA_W
, && case_sem_INSN_BA_W
},
210 { CRISV10F_INSN_JUMP_R
, && case_sem_INSN_JUMP_R
},
211 { CRISV10F_INSN_JUMP_M
, && case_sem_INSN_JUMP_M
},
212 { CRISV10F_INSN_JUMP_C
, && case_sem_INSN_JUMP_C
},
213 { CRISV10F_INSN_BREAK
, && case_sem_INSN_BREAK
},
214 { CRISV10F_INSN_BOUND_R_B_R
, && case_sem_INSN_BOUND_R_B_R
},
215 { CRISV10F_INSN_BOUND_R_W_R
, && case_sem_INSN_BOUND_R_W_R
},
216 { CRISV10F_INSN_BOUND_R_D_R
, && case_sem_INSN_BOUND_R_D_R
},
217 { CRISV10F_INSN_BOUND_M_B_M
, && case_sem_INSN_BOUND_M_B_M
},
218 { CRISV10F_INSN_BOUND_M_W_M
, && case_sem_INSN_BOUND_M_W_M
},
219 { CRISV10F_INSN_BOUND_M_D_M
, && case_sem_INSN_BOUND_M_D_M
},
220 { CRISV10F_INSN_BOUND_CB
, && case_sem_INSN_BOUND_CB
},
221 { CRISV10F_INSN_BOUND_CW
, && case_sem_INSN_BOUND_CW
},
222 { CRISV10F_INSN_BOUND_CD
, && case_sem_INSN_BOUND_CD
},
223 { CRISV10F_INSN_SCC
, && case_sem_INSN_SCC
},
224 { CRISV10F_INSN_LZ
, && case_sem_INSN_LZ
},
225 { CRISV10F_INSN_ADDOQ
, && case_sem_INSN_ADDOQ
},
226 { CRISV10F_INSN_BDAPQPC
, && case_sem_INSN_BDAPQPC
},
227 { CRISV10F_INSN_BDAP_32_PC
, && case_sem_INSN_BDAP_32_PC
},
228 { CRISV10F_INSN_MOVE_M_PCPLUS_P0
, && case_sem_INSN_MOVE_M_PCPLUS_P0
},
229 { CRISV10F_INSN_MOVE_M_SPPLUS_P8
, && case_sem_INSN_MOVE_M_SPPLUS_P8
},
230 { CRISV10F_INSN_ADDO_M_B_M
, && case_sem_INSN_ADDO_M_B_M
},
231 { CRISV10F_INSN_ADDO_M_W_M
, && case_sem_INSN_ADDO_M_W_M
},
232 { CRISV10F_INSN_ADDO_M_D_M
, && case_sem_INSN_ADDO_M_D_M
},
233 { CRISV10F_INSN_ADDO_CB
, && case_sem_INSN_ADDO_CB
},
234 { CRISV10F_INSN_ADDO_CW
, && case_sem_INSN_ADDO_CW
},
235 { CRISV10F_INSN_ADDO_CD
, && case_sem_INSN_ADDO_CD
},
236 { CRISV10F_INSN_DIP_M
, && case_sem_INSN_DIP_M
},
237 { CRISV10F_INSN_DIP_C
, && case_sem_INSN_DIP_C
},
238 { CRISV10F_INSN_ADDI_ACR_B_R
, && case_sem_INSN_ADDI_ACR_B_R
},
239 { CRISV10F_INSN_ADDI_ACR_W_R
, && case_sem_INSN_ADDI_ACR_W_R
},
240 { CRISV10F_INSN_ADDI_ACR_D_R
, && case_sem_INSN_ADDI_ACR_D_R
},
241 { CRISV10F_INSN_BIAP_PC_B_R
, && case_sem_INSN_BIAP_PC_B_R
},
242 { CRISV10F_INSN_BIAP_PC_W_R
, && case_sem_INSN_BIAP_PC_W_R
},
243 { CRISV10F_INSN_BIAP_PC_D_R
, && case_sem_INSN_BIAP_PC_D_R
},
248 for (i
= 0; labels
[i
].label
!= 0; ++i
)
251 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
253 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
258 #endif /* DEFINE_LABELS */
262 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
263 off frills like tracing and profiling. */
264 /* FIXME: A better way would be to have TRACE_RESULT check for something
265 that can cause it to be optimized out. Another way would be to emit
266 special handlers into the instruction "stream". */
270 #define TRACE_RESULT(cpu, abuf, name, type, val)
274 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
275 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
277 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
284 /* Branch to next handler without going around main loop. */
285 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
286 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
288 #else /* ! WITH_SCACHE_PBB */
290 #define NEXT(vpc) BREAK (sem)
293 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
295 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
298 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
301 #endif /* ! WITH_SCACHE_PBB */
305 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
307 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
308 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
309 #define FLD(f) abuf->fields.fmt_empty.f
310 int UNUSED written
= 0;
311 IADDR UNUSED pc
= abuf
->addr
;
312 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
315 /* Update the recorded pc in the cpu state struct.
316 Only necessary for WITH_SCACHE case, but to avoid the
317 conditional compilation .... */
319 /* Virtual insns have zero size. Overwrite vpc with address of next insn
320 using the default-insn-bitsize spec. When executing insns in parallel
321 we may want to queue the fault and continue execution. */
322 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
323 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
330 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
334 #define FLD(f) abuf->fields.fmt_empty.f
335 int UNUSED written
= 0;
336 IADDR UNUSED pc
= abuf
->addr
;
337 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
340 #if WITH_SCACHE_PBB_CRISV10F
341 crisv10f_pbb_after (current_cpu
, sem_arg
);
349 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
351 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
352 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
353 #define FLD(f) abuf->fields.fmt_empty.f
354 int UNUSED written
= 0;
355 IADDR UNUSED pc
= abuf
->addr
;
356 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
359 #if WITH_SCACHE_PBB_CRISV10F
360 crisv10f_pbb_before (current_cpu
, sem_arg
);
368 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
370 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
371 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
372 #define FLD(f) abuf->fields.fmt_empty.f
373 int UNUSED written
= 0;
374 IADDR UNUSED pc
= abuf
->addr
;
375 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
378 #if WITH_SCACHE_PBB_CRISV10F
380 vpc
= crisv10f_pbb_cti_chain (current_cpu
, sem_arg
,
381 pbb_br_type
, pbb_br_npc
);
384 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
385 vpc
= crisv10f_pbb_cti_chain (current_cpu
, sem_arg
,
386 CPU_PBB_BR_TYPE (current_cpu
),
387 CPU_PBB_BR_NPC (current_cpu
));
396 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
398 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
399 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
400 #define FLD(f) abuf->fields.fmt_empty.f
401 int UNUSED written
= 0;
402 IADDR UNUSED pc
= abuf
->addr
;
403 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
406 #if WITH_SCACHE_PBB_CRISV10F
407 vpc
= crisv10f_pbb_chain (current_cpu
, sem_arg
);
418 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
420 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
421 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
422 #define FLD(f) abuf->fields.fmt_empty.f
423 int UNUSED written
= 0;
424 IADDR UNUSED pc
= abuf
->addr
;
425 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
428 #if WITH_SCACHE_PBB_CRISV10F
429 #if defined DEFINE_SWITCH || defined FAST_P
430 /* In the switch case FAST_P is a constant, allowing several optimizations
431 in any called inline functions. */
432 vpc
= crisv10f_pbb_begin (current_cpu
, FAST_P
);
434 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
435 vpc
= crisv10f_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
437 vpc
= crisv10f_pbb_begin (current_cpu
, 0);
447 CASE (sem
, INSN_NOP
) : /* nop */
449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
451 #define FLD(f) abuf->fields.fmt_empty.f
452 int UNUSED written
= 0;
453 IADDR UNUSED pc
= abuf
->addr
;
454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
459 CPU (h_xbit
) = opval
;
460 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
464 SET_H_INSN_PREFIXED_P (opval
);
465 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
473 CASE (sem
, INSN_MOVE_B_R
) : /* move.b move.m ${Rs},${Rd} */
475 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
476 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
477 #define FLD(f) abuf->fields.sfmt_add_b_r.f
478 int UNUSED written
= 0;
479 IADDR UNUSED pc
= abuf
->addr
;
480 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
484 tmp_newval
= GET_H_GR (FLD (f_operand1
));
487 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
489 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
490 SET_H_GR (FLD (f_operand2
), opval
);
491 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
496 BI opval
= LTQI (tmp_newval
, 0);
497 CPU (h_nbit
) = opval
;
498 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
501 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
502 CPU (h_zbit
) = opval
;
503 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
510 CPU (h_xbit
) = opval
;
511 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
515 SET_H_INSN_PREFIXED_P (opval
);
516 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
526 CASE (sem
, INSN_MOVE_W_R
) : /* move.w move.m ${Rs},${Rd} */
528 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
529 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
530 #define FLD(f) abuf->fields.sfmt_add_b_r.f
531 int UNUSED written
= 0;
532 IADDR UNUSED pc
= abuf
->addr
;
533 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
537 tmp_newval
= GET_H_GR (FLD (f_operand1
));
540 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
542 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
543 SET_H_GR (FLD (f_operand2
), opval
);
544 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
549 BI opval
= LTHI (tmp_newval
, 0);
550 CPU (h_nbit
) = opval
;
551 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
554 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
555 CPU (h_zbit
) = opval
;
556 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
563 CPU (h_xbit
) = opval
;
564 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
568 SET_H_INSN_PREFIXED_P (opval
);
569 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
579 CASE (sem
, INSN_MOVE_D_R
) : /* move.d move.m ${Rs},${Rd} */
581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
582 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
583 #define FLD(f) abuf->fields.sfmt_add_b_r.f
584 int UNUSED written
= 0;
585 IADDR UNUSED pc
= abuf
->addr
;
586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
590 tmp_newval
= GET_H_GR (FLD (f_operand1
));
592 SI opval
= tmp_newval
;
593 SET_H_GR (FLD (f_operand2
), opval
);
594 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
598 BI opval
= LTSI (tmp_newval
, 0);
599 CPU (h_nbit
) = opval
;
600 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
603 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
604 CPU (h_zbit
) = opval
;
605 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
612 CPU (h_xbit
) = opval
;
613 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
617 SET_H_INSN_PREFIXED_P (opval
);
618 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
628 CASE (sem
, INSN_MOVEPCR
) : /* move.d PC,${Rd} */
630 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
631 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
632 #define FLD(f) abuf->fields.sfmt_moveq.f
633 int UNUSED written
= 0;
634 IADDR UNUSED pc
= abuf
->addr
;
636 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
640 tmp_pcval
= ADDSI (pc
, 2);
642 SI opval
= tmp_pcval
;
643 SET_H_GR (FLD (f_operand2
), opval
);
644 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
648 BI opval
= LTSI (tmp_pcval
, 0);
649 CPU (h_nbit
) = opval
;
650 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
653 BI opval
= ANDIF (EQSI (tmp_pcval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
654 CPU (h_zbit
) = opval
;
655 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
662 CPU (h_xbit
) = opval
;
663 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
667 SET_H_INSN_PREFIXED_P (opval
);
668 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
674 SEM_BRANCH_FINI (vpc
);
679 CASE (sem
, INSN_MOVEQ
) : /* moveq $i,$Rd */
681 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
682 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
683 #define FLD(f) abuf->fields.sfmt_moveq.f
684 int UNUSED written
= 0;
685 IADDR UNUSED pc
= abuf
->addr
;
686 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
690 tmp_newval
= FLD (f_s6
);
692 SI opval
= tmp_newval
;
693 SET_H_GR (FLD (f_operand2
), opval
);
694 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
697 SET_H_NBIT_MOVE (LTSI (tmp_newval
, 0));
698 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1))));
704 CPU (h_xbit
) = opval
;
705 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
709 SET_H_INSN_PREFIXED_P (opval
);
710 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
720 CASE (sem
, INSN_MOVS_B_R
) : /* movs.b movs.m ${Rs},${Rd} */
722 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
723 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
724 #define FLD(f) abuf->fields.sfmt_muls_b.f
725 int UNUSED written
= 0;
726 IADDR UNUSED pc
= abuf
->addr
;
727 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
731 tmp_newval
= GET_H_GR (FLD (f_operand1
));
733 SI opval
= EXTQISI (tmp_newval
);
734 SET_H_GR (FLD (f_operand2
), opval
);
735 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
739 BI opval
= LTSI (tmp_newval
, 0);
740 CPU (h_nbit
) = opval
;
741 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
744 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
745 CPU (h_zbit
) = opval
;
746 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
753 CPU (h_xbit
) = opval
;
754 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
758 SET_H_INSN_PREFIXED_P (opval
);
759 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
769 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
771 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
772 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
773 #define FLD(f) abuf->fields.sfmt_muls_b.f
774 int UNUSED written
= 0;
775 IADDR UNUSED pc
= abuf
->addr
;
776 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
780 tmp_newval
= GET_H_GR (FLD (f_operand1
));
782 SI opval
= EXTHISI (tmp_newval
);
783 SET_H_GR (FLD (f_operand2
), opval
);
784 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
788 BI opval
= LTSI (tmp_newval
, 0);
789 CPU (h_nbit
) = opval
;
790 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
793 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
794 CPU (h_zbit
) = opval
;
795 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
802 CPU (h_xbit
) = opval
;
803 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
807 SET_H_INSN_PREFIXED_P (opval
);
808 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
818 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
820 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
821 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
822 #define FLD(f) abuf->fields.sfmt_muls_b.f
823 int UNUSED written
= 0;
824 IADDR UNUSED pc
= abuf
->addr
;
825 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
829 tmp_newval
= GET_H_GR (FLD (f_operand1
));
831 SI opval
= ZEXTQISI (tmp_newval
);
832 SET_H_GR (FLD (f_operand2
), opval
);
833 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
837 BI opval
= LTSI (tmp_newval
, 0);
838 CPU (h_nbit
) = opval
;
839 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
842 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
843 CPU (h_zbit
) = opval
;
844 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
851 CPU (h_xbit
) = opval
;
852 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
856 SET_H_INSN_PREFIXED_P (opval
);
857 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
867 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
869 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
870 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
871 #define FLD(f) abuf->fields.sfmt_muls_b.f
872 int UNUSED written
= 0;
873 IADDR UNUSED pc
= abuf
->addr
;
874 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
878 tmp_newval
= GET_H_GR (FLD (f_operand1
));
880 SI opval
= ZEXTHISI (tmp_newval
);
881 SET_H_GR (FLD (f_operand2
), opval
);
882 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
886 BI opval
= LTSI (tmp_newval
, 0);
887 CPU (h_nbit
) = opval
;
888 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
891 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
892 CPU (h_zbit
) = opval
;
893 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
900 CPU (h_xbit
) = opval
;
901 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
905 SET_H_INSN_PREFIXED_P (opval
);
906 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
916 CASE (sem
, INSN_MOVECBR
) : /* move.b ${sconst8},${Rd} */
918 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
919 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
920 #define FLD(f) abuf->fields.sfmt_addcbr.f
921 int UNUSED written
= 0;
922 IADDR UNUSED pc
= abuf
->addr
;
923 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
927 tmp_newval
= FLD (f_indir_pc__byte
);
930 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
932 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
933 SET_H_GR (FLD (f_operand2
), opval
);
934 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
939 BI opval
= LTQI (tmp_newval
, 0);
940 CPU (h_nbit
) = opval
;
941 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
944 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
945 CPU (h_zbit
) = opval
;
946 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
953 CPU (h_xbit
) = opval
;
954 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
958 SET_H_INSN_PREFIXED_P (opval
);
959 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
969 CASE (sem
, INSN_MOVECWR
) : /* move.w ${sconst16},${Rd} */
971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
972 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
973 #define FLD(f) abuf->fields.sfmt_addcwr.f
974 int UNUSED written
= 0;
975 IADDR UNUSED pc
= abuf
->addr
;
976 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
980 tmp_newval
= FLD (f_indir_pc__word
);
983 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
985 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
986 SET_H_GR (FLD (f_operand2
), opval
);
987 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
992 BI opval
= LTHI (tmp_newval
, 0);
993 CPU (h_nbit
) = opval
;
994 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
997 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
998 CPU (h_zbit
) = opval
;
999 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1001 SET_H_CBIT_MOVE (0);
1002 SET_H_VBIT_MOVE (0);
1006 CPU (h_xbit
) = opval
;
1007 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1011 SET_H_INSN_PREFIXED_P (opval
);
1012 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1022 CASE (sem
, INSN_MOVECDR
) : /* move.d ${const32},${Rd} */
1024 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1025 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1026 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1027 int UNUSED written
= 0;
1028 IADDR UNUSED pc
= abuf
->addr
;
1029 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1033 tmp_newval
= FLD (f_indir_pc__dword
);
1035 SI opval
= tmp_newval
;
1036 SET_H_GR (FLD (f_operand2
), opval
);
1037 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1041 BI opval
= LTSI (tmp_newval
, 0);
1042 CPU (h_nbit
) = opval
;
1043 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1046 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1047 CPU (h_zbit
) = opval
;
1048 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1050 SET_H_CBIT_MOVE (0);
1051 SET_H_VBIT_MOVE (0);
1055 CPU (h_xbit
) = opval
;
1056 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1060 SET_H_INSN_PREFIXED_P (opval
);
1061 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1071 CASE (sem
, INSN_MOVSCBR
) : /* movs.b ${sconst8},${Rd} */
1073 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1074 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1075 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1076 int UNUSED written
= 0;
1077 IADDR UNUSED pc
= abuf
->addr
;
1078 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1082 tmp_newval
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1084 SI opval
= tmp_newval
;
1085 SET_H_GR (FLD (f_operand2
), opval
);
1086 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1090 BI opval
= LTSI (tmp_newval
, 0);
1091 CPU (h_nbit
) = opval
;
1092 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1095 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1096 CPU (h_zbit
) = opval
;
1097 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1099 SET_H_CBIT_MOVE (0);
1100 SET_H_VBIT_MOVE (0);
1104 CPU (h_xbit
) = opval
;
1105 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1109 SET_H_INSN_PREFIXED_P (opval
);
1110 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1120 CASE (sem
, INSN_MOVSCWR
) : /* movs.w ${sconst16},${Rd} */
1122 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1123 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1124 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1125 int UNUSED written
= 0;
1126 IADDR UNUSED pc
= abuf
->addr
;
1127 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1131 tmp_newval
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1133 SI opval
= tmp_newval
;
1134 SET_H_GR (FLD (f_operand2
), opval
);
1135 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1139 BI opval
= LTSI (tmp_newval
, 0);
1140 CPU (h_nbit
) = opval
;
1141 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1144 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1145 CPU (h_zbit
) = opval
;
1146 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1148 SET_H_CBIT_MOVE (0);
1149 SET_H_VBIT_MOVE (0);
1153 CPU (h_xbit
) = opval
;
1154 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1158 SET_H_INSN_PREFIXED_P (opval
);
1159 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1169 CASE (sem
, INSN_MOVUCBR
) : /* movu.b ${uconst8},${Rd} */
1171 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1172 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1173 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1174 int UNUSED written
= 0;
1175 IADDR UNUSED pc
= abuf
->addr
;
1176 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1180 tmp_newval
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1182 SI opval
= tmp_newval
;
1183 SET_H_GR (FLD (f_operand2
), opval
);
1184 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1188 BI opval
= LTSI (tmp_newval
, 0);
1189 CPU (h_nbit
) = opval
;
1190 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1193 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1194 CPU (h_zbit
) = opval
;
1195 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1197 SET_H_CBIT_MOVE (0);
1198 SET_H_VBIT_MOVE (0);
1202 CPU (h_xbit
) = opval
;
1203 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1207 SET_H_INSN_PREFIXED_P (opval
);
1208 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1218 CASE (sem
, INSN_MOVUCWR
) : /* movu.w ${uconst16},${Rd} */
1220 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1221 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1222 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1223 int UNUSED written
= 0;
1224 IADDR UNUSED pc
= abuf
->addr
;
1225 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1229 tmp_newval
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1231 SI opval
= tmp_newval
;
1232 SET_H_GR (FLD (f_operand2
), opval
);
1233 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1237 BI opval
= LTSI (tmp_newval
, 0);
1238 CPU (h_nbit
) = opval
;
1239 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1242 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1243 CPU (h_zbit
) = opval
;
1244 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1246 SET_H_CBIT_MOVE (0);
1247 SET_H_VBIT_MOVE (0);
1251 CPU (h_xbit
) = opval
;
1252 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1256 SET_H_INSN_PREFIXED_P (opval
);
1257 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1267 CASE (sem
, INSN_ADDQ
) : /* addq $j,$Rd */
1269 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1270 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1271 #define FLD(f) abuf->fields.sfmt_addq.f
1272 int UNUSED written
= 0;
1273 IADDR UNUSED pc
= abuf
->addr
;
1274 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1281 tmp_tmpops
= FLD (f_u6
);
1282 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1283 tmp_carry
= CPU (h_cbit
);
1284 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1286 SI opval
= tmp_newval
;
1287 SET_H_GR (FLD (f_operand2
), opval
);
1288 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1292 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))));
1293 CPU (h_cbit
) = opval
;
1294 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1297 BI opval
= LTSI (tmp_newval
, 0);
1298 CPU (h_nbit
) = opval
;
1299 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1302 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1303 CPU (h_zbit
) = opval
;
1304 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1307 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)));
1308 CPU (h_vbit
) = opval
;
1309 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1314 CPU (h_xbit
) = opval
;
1315 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1319 SET_H_INSN_PREFIXED_P (opval
);
1320 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1330 CASE (sem
, INSN_SUBQ
) : /* subq $j,$Rd */
1332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1334 #define FLD(f) abuf->fields.sfmt_addq.f
1335 int UNUSED written
= 0;
1336 IADDR UNUSED pc
= abuf
->addr
;
1337 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1344 tmp_tmpops
= FLD (f_u6
);
1345 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1346 tmp_carry
= CPU (h_cbit
);
1347 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1349 SI opval
= tmp_newval
;
1350 SET_H_GR (FLD (f_operand2
), opval
);
1351 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1355 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))));
1356 CPU (h_cbit
) = opval
;
1357 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1360 BI opval
= LTSI (tmp_newval
, 0);
1361 CPU (h_nbit
) = opval
;
1362 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1365 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1366 CPU (h_zbit
) = opval
;
1367 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1370 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)));
1371 CPU (h_vbit
) = opval
;
1372 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1377 CPU (h_xbit
) = opval
;
1378 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1382 SET_H_INSN_PREFIXED_P (opval
);
1383 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1393 CASE (sem
, INSN_CMP_R_B_R
) : /* cmp-r.b $Rs,$Rd */
1395 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1396 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1397 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1398 int UNUSED written
= 0;
1399 IADDR UNUSED pc
= abuf
->addr
;
1400 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1407 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1408 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1409 tmp_carry
= CPU (h_cbit
);
1410 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1414 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))));
1415 CPU (h_cbit
) = opval
;
1416 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1419 BI opval
= LTQI (tmp_newval
, 0);
1420 CPU (h_nbit
) = opval
;
1421 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1424 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1425 CPU (h_zbit
) = opval
;
1426 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1429 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)));
1430 CPU (h_vbit
) = opval
;
1431 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1436 CPU (h_xbit
) = opval
;
1437 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1441 SET_H_INSN_PREFIXED_P (opval
);
1442 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1452 CASE (sem
, INSN_CMP_R_W_R
) : /* cmp-r.w $Rs,$Rd */
1454 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1455 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1456 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1457 int UNUSED written
= 0;
1458 IADDR UNUSED pc
= abuf
->addr
;
1459 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1466 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1467 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1468 tmp_carry
= CPU (h_cbit
);
1469 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1473 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))));
1474 CPU (h_cbit
) = opval
;
1475 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1478 BI opval
= LTHI (tmp_newval
, 0);
1479 CPU (h_nbit
) = opval
;
1480 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1483 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1484 CPU (h_zbit
) = opval
;
1485 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1488 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)));
1489 CPU (h_vbit
) = opval
;
1490 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1495 CPU (h_xbit
) = opval
;
1496 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1500 SET_H_INSN_PREFIXED_P (opval
);
1501 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1511 CASE (sem
, INSN_CMP_R_D_R
) : /* cmp-r.d $Rs,$Rd */
1513 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1514 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1515 #define FLD(f) abuf->fields.sfmt_add_b_r.f
1516 int UNUSED written
= 0;
1517 IADDR UNUSED pc
= abuf
->addr
;
1518 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1525 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1526 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1527 tmp_carry
= CPU (h_cbit
);
1528 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1532 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))));
1533 CPU (h_cbit
) = opval
;
1534 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1537 BI opval
= LTSI (tmp_newval
, 0);
1538 CPU (h_nbit
) = opval
;
1539 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1542 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1543 CPU (h_zbit
) = opval
;
1544 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1547 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)));
1548 CPU (h_vbit
) = opval
;
1549 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1554 CPU (h_xbit
) = opval
;
1555 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1559 SET_H_INSN_PREFIXED_P (opval
);
1560 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1570 CASE (sem
, INSN_CMP_M_B_M
) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1574 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1575 int UNUSED written
= 0;
1576 IADDR UNUSED pc
= abuf
->addr
;
1577 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1584 tmp_tmpops
= ({ SI tmp_addr
;
1587 tmp_postinc
= FLD (f_memmode
);
1588 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
1589 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1590 ; if (NEBI (tmp_postinc
, 0)) {
1592 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1593 tmp_addr
= ADDSI (tmp_addr
, 1);
1596 SI opval
= tmp_addr
;
1597 SET_H_GR (FLD (f_operand1
), opval
);
1598 written
|= (1 << 9);
1599 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1604 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1605 tmp_carry
= CPU (h_cbit
);
1606 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1610 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))));
1611 CPU (h_cbit
) = opval
;
1612 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1615 BI opval
= LTQI (tmp_newval
, 0);
1616 CPU (h_nbit
) = opval
;
1617 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1620 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1621 CPU (h_zbit
) = opval
;
1622 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1625 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)));
1626 CPU (h_vbit
) = opval
;
1627 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1632 CPU (h_xbit
) = opval
;
1633 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1637 SET_H_INSN_PREFIXED_P (opval
);
1638 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1644 abuf
->written
= written
;
1649 CASE (sem
, INSN_CMP_M_W_M
) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1651 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1652 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1653 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1654 int UNUSED written
= 0;
1655 IADDR UNUSED pc
= abuf
->addr
;
1656 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1663 tmp_tmpops
= ({ SI tmp_addr
;
1666 tmp_postinc
= FLD (f_memmode
);
1667 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
1668 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
1669 ; if (NEBI (tmp_postinc
, 0)) {
1671 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1672 tmp_addr
= ADDSI (tmp_addr
, 2);
1675 SI opval
= tmp_addr
;
1676 SET_H_GR (FLD (f_operand1
), opval
);
1677 written
|= (1 << 9);
1678 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1683 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1684 tmp_carry
= CPU (h_cbit
);
1685 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1689 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))));
1690 CPU (h_cbit
) = opval
;
1691 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1694 BI opval
= LTHI (tmp_newval
, 0);
1695 CPU (h_nbit
) = opval
;
1696 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1699 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1700 CPU (h_zbit
) = opval
;
1701 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1704 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)));
1705 CPU (h_vbit
) = opval
;
1706 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1711 CPU (h_xbit
) = opval
;
1712 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1716 SET_H_INSN_PREFIXED_P (opval
);
1717 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1723 abuf
->written
= written
;
1728 CASE (sem
, INSN_CMP_M_D_M
) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1730 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1731 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1732 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
1733 int UNUSED written
= 0;
1734 IADDR UNUSED pc
= abuf
->addr
;
1735 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1742 tmp_tmpops
= ({ SI tmp_addr
;
1745 tmp_postinc
= FLD (f_memmode
);
1746 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
1747 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
1748 ; if (NEBI (tmp_postinc
, 0)) {
1750 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1751 tmp_addr
= ADDSI (tmp_addr
, 4);
1754 SI opval
= tmp_addr
;
1755 SET_H_GR (FLD (f_operand1
), opval
);
1756 written
|= (1 << 9);
1757 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1762 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1763 tmp_carry
= CPU (h_cbit
);
1764 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1768 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))));
1769 CPU (h_cbit
) = opval
;
1770 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1773 BI opval
= LTSI (tmp_newval
, 0);
1774 CPU (h_nbit
) = opval
;
1775 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1778 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1779 CPU (h_zbit
) = opval
;
1780 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1783 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)));
1784 CPU (h_vbit
) = opval
;
1785 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1790 CPU (h_xbit
) = opval
;
1791 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1795 SET_H_INSN_PREFIXED_P (opval
);
1796 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1802 abuf
->written
= written
;
1807 CASE (sem
, INSN_CMPCBR
) : /* cmp.b $sconst8,$Rd */
1809 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1810 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1811 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1812 int UNUSED written
= 0;
1813 IADDR UNUSED pc
= abuf
->addr
;
1814 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1821 tmp_tmpops
= TRUNCSIQI (FLD (f_indir_pc__byte
));
1822 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1823 tmp_carry
= CPU (h_cbit
);
1824 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1828 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))));
1829 CPU (h_cbit
) = opval
;
1830 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1833 BI opval
= LTQI (tmp_newval
, 0);
1834 CPU (h_nbit
) = opval
;
1835 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1838 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1839 CPU (h_zbit
) = opval
;
1840 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1843 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)));
1844 CPU (h_vbit
) = opval
;
1845 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1850 CPU (h_xbit
) = opval
;
1851 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1855 SET_H_INSN_PREFIXED_P (opval
);
1856 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1866 CASE (sem
, INSN_CMPCWR
) : /* cmp.w $sconst16,$Rd */
1868 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1869 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1870 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1871 int UNUSED written
= 0;
1872 IADDR UNUSED pc
= abuf
->addr
;
1873 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1880 tmp_tmpops
= TRUNCSIHI (FLD (f_indir_pc__word
));
1881 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1882 tmp_carry
= CPU (h_cbit
);
1883 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1887 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))));
1888 CPU (h_cbit
) = opval
;
1889 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1892 BI opval
= LTHI (tmp_newval
, 0);
1893 CPU (h_nbit
) = opval
;
1894 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1897 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1898 CPU (h_zbit
) = opval
;
1899 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1902 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)));
1903 CPU (h_vbit
) = opval
;
1904 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1909 CPU (h_xbit
) = opval
;
1910 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1914 SET_H_INSN_PREFIXED_P (opval
);
1915 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1925 CASE (sem
, INSN_CMPCDR
) : /* cmp.d $const32,$Rd */
1927 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1929 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1930 int UNUSED written
= 0;
1931 IADDR UNUSED pc
= abuf
->addr
;
1932 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1939 tmp_tmpops
= FLD (f_indir_pc__dword
);
1940 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1941 tmp_carry
= CPU (h_cbit
);
1942 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1946 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))));
1947 CPU (h_cbit
) = opval
;
1948 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1951 BI opval
= LTSI (tmp_newval
, 0);
1952 CPU (h_nbit
) = opval
;
1953 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1956 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1957 CPU (h_zbit
) = opval
;
1958 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1961 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)));
1962 CPU (h_vbit
) = opval
;
1963 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1968 CPU (h_xbit
) = opval
;
1969 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1973 SET_H_INSN_PREFIXED_P (opval
);
1974 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1984 CASE (sem
, INSN_CMPQ
) : /* cmpq $i,$Rd */
1986 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1987 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1988 #define FLD(f) abuf->fields.sfmt_andq.f
1989 int UNUSED written
= 0;
1990 IADDR UNUSED pc
= abuf
->addr
;
1991 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1998 tmp_tmpops
= FLD (f_s6
);
1999 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2000 tmp_carry
= CPU (h_cbit
);
2001 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2005 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))));
2006 CPU (h_cbit
) = opval
;
2007 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2010 BI opval
= LTSI (tmp_newval
, 0);
2011 CPU (h_nbit
) = opval
;
2012 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2015 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2016 CPU (h_zbit
) = opval
;
2017 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2020 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)));
2021 CPU (h_vbit
) = opval
;
2022 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2027 CPU (h_xbit
) = opval
;
2028 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2032 SET_H_INSN_PREFIXED_P (opval
);
2033 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2043 CASE (sem
, INSN_CMPS_M_B_M
) : /* cmps-m.b [${Rs}${inc}],$Rd */
2045 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2046 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2047 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2048 int UNUSED written
= 0;
2049 IADDR UNUSED pc
= abuf
->addr
;
2050 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2057 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
2060 tmp_postinc
= FLD (f_memmode
);
2061 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2062 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2063 ; if (NEBI (tmp_postinc
, 0)) {
2065 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2066 tmp_addr
= ADDSI (tmp_addr
, 1);
2069 SI opval
= tmp_addr
;
2070 SET_H_GR (FLD (f_operand1
), opval
);
2071 written
|= (1 << 9);
2072 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2077 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2078 tmp_carry
= CPU (h_cbit
);
2079 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2083 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))));
2084 CPU (h_cbit
) = opval
;
2085 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2088 BI opval
= LTSI (tmp_newval
, 0);
2089 CPU (h_nbit
) = opval
;
2090 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2093 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2094 CPU (h_zbit
) = opval
;
2095 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2098 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)));
2099 CPU (h_vbit
) = opval
;
2100 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2105 CPU (h_xbit
) = opval
;
2106 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2110 SET_H_INSN_PREFIXED_P (opval
);
2111 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2117 abuf
->written
= written
;
2122 CASE (sem
, INSN_CMPS_M_W_M
) : /* cmps-m.w [${Rs}${inc}],$Rd */
2124 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2126 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2127 int UNUSED written
= 0;
2128 IADDR UNUSED pc
= abuf
->addr
;
2129 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2136 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
2139 tmp_postinc
= FLD (f_memmode
);
2140 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2141 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2142 ; if (NEBI (tmp_postinc
, 0)) {
2144 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2145 tmp_addr
= ADDSI (tmp_addr
, 2);
2148 SI opval
= tmp_addr
;
2149 SET_H_GR (FLD (f_operand1
), opval
);
2150 written
|= (1 << 9);
2151 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2156 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2157 tmp_carry
= CPU (h_cbit
);
2158 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2162 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))));
2163 CPU (h_cbit
) = opval
;
2164 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2167 BI opval
= LTSI (tmp_newval
, 0);
2168 CPU (h_nbit
) = opval
;
2169 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2172 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2173 CPU (h_zbit
) = opval
;
2174 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2177 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)));
2178 CPU (h_vbit
) = opval
;
2179 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2184 CPU (h_xbit
) = opval
;
2185 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2189 SET_H_INSN_PREFIXED_P (opval
);
2190 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2196 abuf
->written
= written
;
2201 CASE (sem
, INSN_CMPSCBR
) : /* [${Rs}${inc}],$Rd */
2203 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2204 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2205 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2206 int UNUSED written
= 0;
2207 IADDR UNUSED pc
= abuf
->addr
;
2208 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2215 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2216 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2217 tmp_carry
= CPU (h_cbit
);
2218 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2222 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))));
2223 CPU (h_cbit
) = opval
;
2224 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2227 BI opval
= LTSI (tmp_newval
, 0);
2228 CPU (h_nbit
) = opval
;
2229 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2232 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2233 CPU (h_zbit
) = opval
;
2234 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2237 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)));
2238 CPU (h_vbit
) = opval
;
2239 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2244 CPU (h_xbit
) = opval
;
2245 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2249 SET_H_INSN_PREFIXED_P (opval
);
2250 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2260 CASE (sem
, INSN_CMPSCWR
) : /* [${Rs}${inc}],$Rd */
2262 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2263 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2264 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2265 int UNUSED written
= 0;
2266 IADDR UNUSED pc
= abuf
->addr
;
2267 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2274 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2275 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2276 tmp_carry
= CPU (h_cbit
);
2277 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2281 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))));
2282 CPU (h_cbit
) = opval
;
2283 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2286 BI opval
= LTSI (tmp_newval
, 0);
2287 CPU (h_nbit
) = opval
;
2288 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2291 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2292 CPU (h_zbit
) = opval
;
2293 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2296 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)));
2297 CPU (h_vbit
) = opval
;
2298 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2303 CPU (h_xbit
) = opval
;
2304 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2308 SET_H_INSN_PREFIXED_P (opval
);
2309 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2319 CASE (sem
, INSN_CMPU_M_B_M
) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2321 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2322 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2323 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2324 int UNUSED written
= 0;
2325 IADDR UNUSED pc
= abuf
->addr
;
2326 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2333 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
2336 tmp_postinc
= FLD (f_memmode
);
2337 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2338 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2339 ; if (NEBI (tmp_postinc
, 0)) {
2341 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2342 tmp_addr
= ADDSI (tmp_addr
, 1);
2345 SI opval
= tmp_addr
;
2346 SET_H_GR (FLD (f_operand1
), opval
);
2347 written
|= (1 << 9);
2348 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2353 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2354 tmp_carry
= CPU (h_cbit
);
2355 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2359 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))));
2360 CPU (h_cbit
) = opval
;
2361 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2364 BI opval
= LTSI (tmp_newval
, 0);
2365 CPU (h_nbit
) = opval
;
2366 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2369 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2370 CPU (h_zbit
) = opval
;
2371 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2374 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)));
2375 CPU (h_vbit
) = opval
;
2376 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2381 CPU (h_xbit
) = opval
;
2382 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2386 SET_H_INSN_PREFIXED_P (opval
);
2387 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2393 abuf
->written
= written
;
2398 CASE (sem
, INSN_CMPU_M_W_M
) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2400 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2401 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2402 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2403 int UNUSED written
= 0;
2404 IADDR UNUSED pc
= abuf
->addr
;
2405 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2412 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
2415 tmp_postinc
= FLD (f_memmode
);
2416 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2417 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2418 ; if (NEBI (tmp_postinc
, 0)) {
2420 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2421 tmp_addr
= ADDSI (tmp_addr
, 2);
2424 SI opval
= tmp_addr
;
2425 SET_H_GR (FLD (f_operand1
), opval
);
2426 written
|= (1 << 9);
2427 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2432 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2433 tmp_carry
= CPU (h_cbit
);
2434 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2438 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))));
2439 CPU (h_cbit
) = opval
;
2440 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2443 BI opval
= LTSI (tmp_newval
, 0);
2444 CPU (h_nbit
) = opval
;
2445 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2448 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2449 CPU (h_zbit
) = opval
;
2450 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2453 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)));
2454 CPU (h_vbit
) = opval
;
2455 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2460 CPU (h_xbit
) = opval
;
2461 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2465 SET_H_INSN_PREFIXED_P (opval
);
2466 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2472 abuf
->written
= written
;
2477 CASE (sem
, INSN_CMPUCBR
) : /* [${Rs}${inc}],$Rd */
2479 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2480 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2481 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2482 int UNUSED written
= 0;
2483 IADDR UNUSED pc
= abuf
->addr
;
2484 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2491 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2492 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2493 tmp_carry
= CPU (h_cbit
);
2494 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2498 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))));
2499 CPU (h_cbit
) = opval
;
2500 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2503 BI opval
= LTSI (tmp_newval
, 0);
2504 CPU (h_nbit
) = opval
;
2505 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2508 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2509 CPU (h_zbit
) = opval
;
2510 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2513 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)));
2514 CPU (h_vbit
) = opval
;
2515 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2520 CPU (h_xbit
) = opval
;
2521 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2525 SET_H_INSN_PREFIXED_P (opval
);
2526 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2536 CASE (sem
, INSN_CMPUCWR
) : /* [${Rs}${inc}],$Rd */
2538 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2539 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2540 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2541 int UNUSED written
= 0;
2542 IADDR UNUSED pc
= abuf
->addr
;
2543 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2550 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2551 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2552 tmp_carry
= CPU (h_cbit
);
2553 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2557 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))));
2558 CPU (h_cbit
) = opval
;
2559 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2562 BI opval
= LTSI (tmp_newval
, 0);
2563 CPU (h_nbit
) = opval
;
2564 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2567 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2568 CPU (h_zbit
) = opval
;
2569 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2572 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)));
2573 CPU (h_vbit
) = opval
;
2574 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2579 CPU (h_xbit
) = opval
;
2580 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2584 SET_H_INSN_PREFIXED_P (opval
);
2585 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2595 CASE (sem
, INSN_MOVE_M_B_M
) : /* move-m.b [${Rs}${inc}],${Rd} */
2597 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2598 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2599 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2600 int UNUSED written
= 0;
2601 IADDR UNUSED pc
= abuf
->addr
;
2602 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2606 tmp_tmp
= ({ SI tmp_addr
;
2609 tmp_postinc
= FLD (f_memmode
);
2610 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2611 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2612 ; if (NEBI (tmp_postinc
, 0)) {
2614 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2615 tmp_addr
= ADDSI (tmp_addr
, 1);
2618 SI opval
= tmp_addr
;
2619 SET_H_GR (FLD (f_operand1
), opval
);
2620 written
|= (1 << 10);
2621 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2628 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2630 SI opval
= ORSI (ANDSI (tmp_tmp
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
2631 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2632 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2637 BI opval
= LTQI (tmp_tmp
, 0);
2638 CPU (h_nbit
) = opval
;
2639 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2642 BI opval
= ANDIF (EQQI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2643 CPU (h_zbit
) = opval
;
2644 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2646 SET_H_CBIT_MOVE (0);
2647 SET_H_VBIT_MOVE (0);
2651 CPU (h_xbit
) = opval
;
2652 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2656 SET_H_INSN_PREFIXED_P (opval
);
2657 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2663 abuf
->written
= written
;
2668 CASE (sem
, INSN_MOVE_M_W_M
) : /* move-m.w [${Rs}${inc}],${Rd} */
2670 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2671 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2672 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2673 int UNUSED written
= 0;
2674 IADDR UNUSED pc
= abuf
->addr
;
2675 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2679 tmp_tmp
= ({ SI tmp_addr
;
2682 tmp_postinc
= FLD (f_memmode
);
2683 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2684 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2685 ; if (NEBI (tmp_postinc
, 0)) {
2687 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2688 tmp_addr
= ADDSI (tmp_addr
, 2);
2691 SI opval
= tmp_addr
;
2692 SET_H_GR (FLD (f_operand1
), opval
);
2693 written
|= (1 << 10);
2694 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2701 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2703 SI opval
= ORSI (ANDSI (tmp_tmp
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
2704 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2705 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2710 BI opval
= LTHI (tmp_tmp
, 0);
2711 CPU (h_nbit
) = opval
;
2712 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2715 BI opval
= ANDIF (EQHI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2716 CPU (h_zbit
) = opval
;
2717 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2719 SET_H_CBIT_MOVE (0);
2720 SET_H_VBIT_MOVE (0);
2724 CPU (h_xbit
) = opval
;
2725 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2729 SET_H_INSN_PREFIXED_P (opval
);
2730 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2736 abuf
->written
= written
;
2741 CASE (sem
, INSN_MOVE_M_D_M
) : /* move-m.d [${Rs}${inc}],${Rd} */
2743 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2744 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2745 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2746 int UNUSED written
= 0;
2747 IADDR UNUSED pc
= abuf
->addr
;
2748 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2752 tmp_tmp
= ({ SI tmp_addr
;
2755 tmp_postinc
= FLD (f_memmode
);
2756 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2757 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
2758 ; if (NEBI (tmp_postinc
, 0)) {
2760 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2761 tmp_addr
= ADDSI (tmp_addr
, 4);
2764 SI opval
= tmp_addr
;
2765 SET_H_GR (FLD (f_operand1
), opval
);
2766 written
|= (1 << 9);
2767 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2774 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2775 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2779 BI opval
= LTSI (tmp_tmp
, 0);
2780 CPU (h_nbit
) = opval
;
2781 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2784 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2785 CPU (h_zbit
) = opval
;
2786 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2788 SET_H_CBIT_MOVE (0);
2789 SET_H_VBIT_MOVE (0);
2793 CPU (h_xbit
) = opval
;
2794 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2798 SET_H_INSN_PREFIXED_P (opval
);
2799 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2805 abuf
->written
= written
;
2810 CASE (sem
, INSN_MOVS_M_B_M
) : /* movs-m.b [${Rs}${inc}],${Rd} */
2812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2814 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2815 int UNUSED written
= 0;
2816 IADDR UNUSED pc
= abuf
->addr
;
2817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2821 tmp_tmp
= EXTQISI (({ SI tmp_addr
;
2824 tmp_postinc
= FLD (f_memmode
);
2825 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2826 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2827 ; if (NEBI (tmp_postinc
, 0)) {
2829 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2830 tmp_addr
= ADDSI (tmp_addr
, 1);
2833 SI opval
= tmp_addr
;
2834 SET_H_GR (FLD (f_operand1
), opval
);
2835 written
|= (1 << 8);
2836 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2841 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2844 SET_H_GR (FLD (f_operand1
), opval
);
2845 written
|= (1 << 8);
2846 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2851 SET_H_GR (FLD (f_operand2
), opval
);
2852 written
|= (1 << 7);
2853 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2858 BI opval
= LTSI (tmp_tmp
, 0);
2859 CPU (h_nbit
) = opval
;
2860 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2863 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2864 CPU (h_zbit
) = opval
;
2865 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2867 SET_H_CBIT_MOVE (0);
2868 SET_H_VBIT_MOVE (0);
2872 CPU (h_xbit
) = opval
;
2873 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2877 SET_H_INSN_PREFIXED_P (opval
);
2878 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2884 abuf
->written
= written
;
2889 CASE (sem
, INSN_MOVS_M_W_M
) : /* movs-m.w [${Rs}${inc}],${Rd} */
2891 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2892 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2893 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2894 int UNUSED written
= 0;
2895 IADDR UNUSED pc
= abuf
->addr
;
2896 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2900 tmp_tmp
= EXTHISI (({ SI tmp_addr
;
2903 tmp_postinc
= FLD (f_memmode
);
2904 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2905 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2906 ; if (NEBI (tmp_postinc
, 0)) {
2908 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2909 tmp_addr
= ADDSI (tmp_addr
, 2);
2912 SI opval
= tmp_addr
;
2913 SET_H_GR (FLD (f_operand1
), opval
);
2914 written
|= (1 << 8);
2915 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2920 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2923 SET_H_GR (FLD (f_operand1
), opval
);
2924 written
|= (1 << 8);
2925 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2930 SET_H_GR (FLD (f_operand2
), opval
);
2931 written
|= (1 << 7);
2932 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2937 BI opval
= LTSI (tmp_tmp
, 0);
2938 CPU (h_nbit
) = opval
;
2939 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2942 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2943 CPU (h_zbit
) = opval
;
2944 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2946 SET_H_CBIT_MOVE (0);
2947 SET_H_VBIT_MOVE (0);
2951 CPU (h_xbit
) = opval
;
2952 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2956 SET_H_INSN_PREFIXED_P (opval
);
2957 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2963 abuf
->written
= written
;
2968 CASE (sem
, INSN_MOVU_M_B_M
) : /* movu-m.b [${Rs}${inc}],${Rd} */
2970 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2971 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2972 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
2973 int UNUSED written
= 0;
2974 IADDR UNUSED pc
= abuf
->addr
;
2975 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2979 tmp_tmp
= ZEXTQISI (({ SI tmp_addr
;
2982 tmp_postinc
= FLD (f_memmode
);
2983 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
2984 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2985 ; if (NEBI (tmp_postinc
, 0)) {
2987 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2988 tmp_addr
= ADDSI (tmp_addr
, 1);
2991 SI opval
= tmp_addr
;
2992 SET_H_GR (FLD (f_operand1
), opval
);
2993 written
|= (1 << 8);
2994 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2999 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3002 SET_H_GR (FLD (f_operand1
), opval
);
3003 written
|= (1 << 8);
3004 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3009 SET_H_GR (FLD (f_operand2
), opval
);
3010 written
|= (1 << 7);
3011 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3016 BI opval
= LTSI (tmp_tmp
, 0);
3017 CPU (h_nbit
) = opval
;
3018 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3021 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3022 CPU (h_zbit
) = opval
;
3023 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3025 SET_H_CBIT_MOVE (0);
3026 SET_H_VBIT_MOVE (0);
3030 CPU (h_xbit
) = opval
;
3031 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3035 SET_H_INSN_PREFIXED_P (opval
);
3036 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3042 abuf
->written
= written
;
3047 CASE (sem
, INSN_MOVU_M_W_M
) : /* movu-m.w [${Rs}${inc}],${Rd} */
3049 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3050 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3051 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
3052 int UNUSED written
= 0;
3053 IADDR UNUSED pc
= abuf
->addr
;
3054 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3058 tmp_tmp
= ZEXTHISI (({ SI tmp_addr
;
3061 tmp_postinc
= FLD (f_memmode
);
3062 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3063 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
3064 ; if (NEBI (tmp_postinc
, 0)) {
3066 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3067 tmp_addr
= ADDSI (tmp_addr
, 2);
3070 SI opval
= tmp_addr
;
3071 SET_H_GR (FLD (f_operand1
), opval
);
3072 written
|= (1 << 8);
3073 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3078 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3081 SET_H_GR (FLD (f_operand1
), opval
);
3082 written
|= (1 << 8);
3083 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3088 SET_H_GR (FLD (f_operand2
), opval
);
3089 written
|= (1 << 7);
3090 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3095 BI opval
= LTSI (tmp_tmp
, 0);
3096 CPU (h_nbit
) = opval
;
3097 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3100 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3101 CPU (h_zbit
) = opval
;
3102 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3104 SET_H_CBIT_MOVE (0);
3105 SET_H_VBIT_MOVE (0);
3109 CPU (h_xbit
) = opval
;
3110 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3114 SET_H_INSN_PREFIXED_P (opval
);
3115 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3121 abuf
->written
= written
;
3126 CASE (sem
, INSN_MOVE_R_SPRV10
) : /* move ${Rs},${Pd} */
3128 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3129 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3130 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3131 int UNUSED written
= 0;
3132 IADDR UNUSED pc
= abuf
->addr
;
3133 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3138 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
3139 tmp_rno
= FLD (f_operand2
);
3140 if (ORIF (ORIF (EQSI (tmp_rno
, 0), EQSI (tmp_rno
, 1)), ORIF (EQSI (tmp_rno
, 4), EQSI (tmp_rno
, 8)))) {
3141 cgen_rtx_error (current_cpu
, "move-r-spr: trying to set a read-only special register");
3146 SET_H_SR (FLD (f_operand2
), opval
);
3147 written
|= (1 << 2);
3148 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3154 CPU (h_xbit
) = opval
;
3155 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3159 SET_H_INSN_PREFIXED_P (opval
);
3160 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3165 abuf
->written
= written
;
3170 CASE (sem
, INSN_MOVE_SPR_RV10
) : /* move ${Ps},${Rd-sfield} */
3172 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3173 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3174 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3175 int UNUSED written
= 0;
3176 IADDR UNUSED pc
= abuf
->addr
;
3177 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3183 tmp_prno
= FLD (f_operand2
);
3184 tmp_newval
= GET_H_SR (FLD (f_operand2
));
3185 if (EQSI (tmp_prno
, 5)) {
3188 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3190 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3191 SET_H_GR (FLD (f_operand1
), opval
);
3192 written
|= (1 << 4);
3193 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3197 else if (EQSI (tmp_prno
, 9)) {
3199 SI opval
= tmp_newval
;
3200 SET_H_GR (FLD (f_operand1
), opval
);
3201 written
|= (1 << 4);
3202 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3205 else if (EQSI (tmp_prno
, 10)) {
3207 SI opval
= tmp_newval
;
3208 SET_H_GR (FLD (f_operand1
), opval
);
3209 written
|= (1 << 4);
3210 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3213 else if (EQSI (tmp_prno
, 11)) {
3215 SI opval
= tmp_newval
;
3216 SET_H_GR (FLD (f_operand1
), opval
);
3217 written
|= (1 << 4);
3218 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3221 else if (EQSI (tmp_prno
, 12)) {
3223 SI opval
= tmp_newval
;
3224 SET_H_GR (FLD (f_operand1
), opval
);
3225 written
|= (1 << 4);
3226 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3229 else if (EQSI (tmp_prno
, 13)) {
3231 SI opval
= tmp_newval
;
3232 SET_H_GR (FLD (f_operand1
), opval
);
3233 written
|= (1 << 4);
3234 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3237 else if (EQSI (tmp_prno
, 0)) {
3240 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3242 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3243 SET_H_GR (FLD (f_operand1
), opval
);
3244 written
|= (1 << 4);
3245 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3249 else if (EQSI (tmp_prno
, 1)) {
3252 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3254 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3255 SET_H_GR (FLD (f_operand1
), opval
);
3256 written
|= (1 << 4);
3257 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3261 else if (EQSI (tmp_prno
, 4)) {
3264 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand1
));
3266 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3267 SET_H_GR (FLD (f_operand1
), opval
);
3268 written
|= (1 << 4);
3269 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3273 else if (EQSI (tmp_prno
, 8)) {
3275 SI opval
= tmp_newval
;
3276 SET_H_GR (FLD (f_operand1
), opval
);
3277 written
|= (1 << 4);
3278 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3281 else if (EQSI (tmp_prno
, 7)) {
3283 SI opval
= tmp_newval
;
3284 SET_H_GR (FLD (f_operand1
), opval
);
3285 written
|= (1 << 4);
3286 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3289 else if (EQSI (tmp_prno
, 14)) {
3291 SI opval
= tmp_newval
;
3292 SET_H_GR (FLD (f_operand1
), opval
);
3293 written
|= (1 << 4);
3294 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3297 else if (EQSI (tmp_prno
, 15)) {
3299 SI opval
= tmp_newval
;
3300 SET_H_GR (FLD (f_operand1
), opval
);
3301 written
|= (1 << 4);
3302 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3306 cgen_rtx_error (current_cpu
, "move-spr-r from unimplemented register");
3311 CPU (h_xbit
) = opval
;
3312 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3316 SET_H_INSN_PREFIXED_P (opval
);
3317 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3322 abuf
->written
= written
;
3327 CASE (sem
, INSN_RET_TYPE
) : /* ret/reti/retb */
3329 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3330 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3331 #define FLD(f) abuf->fields.sfmt_move_spr_rv10.f
3332 int UNUSED written
= 0;
3333 IADDR UNUSED pc
= abuf
->addr
;
3335 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3339 tmp_retaddr
= GET_H_SR (FLD (f_operand2
));
3343 CPU (h_xbit
) = opval
;
3344 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3348 SET_H_INSN_PREFIXED_P (opval
);
3349 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3354 USI opval
= tmp_retaddr
;
3355 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
3356 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3361 SEM_BRANCH_FINI (vpc
);
3366 CASE (sem
, INSN_MOVE_M_SPRV10
) : /* move [${Rs}${inc}],${Pd} */
3368 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3369 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3370 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
3371 int UNUSED written
= 0;
3372 IADDR UNUSED pc
= abuf
->addr
;
3373 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3378 tmp_rno
= FLD (f_operand2
);
3379 if (EQSI (tmp_rno
, 5)) {
3380 tmp_newval
= EXTHISI (({ SI tmp_addr
;
3383 tmp_postinc
= FLD (f_memmode
);
3384 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3385 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
3386 ; if (NEBI (tmp_postinc
, 0)) {
3388 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3389 tmp_addr
= ADDSI (tmp_addr
, 2);
3392 SI opval
= tmp_addr
;
3393 SET_H_GR (FLD (f_operand1
), opval
);
3394 written
|= (1 << 8);
3395 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3401 else if (EQSI (tmp_rno
, 9)) {
3402 tmp_newval
= ({ SI tmp_addr
;
3405 tmp_postinc
= FLD (f_memmode
);
3406 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3407 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3408 ; if (NEBI (tmp_postinc
, 0)) {
3410 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3411 tmp_addr
= ADDSI (tmp_addr
, 4);
3414 SI opval
= tmp_addr
;
3415 SET_H_GR (FLD (f_operand1
), opval
);
3416 written
|= (1 << 8);
3417 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3423 else if (EQSI (tmp_rno
, 10)) {
3424 tmp_newval
= ({ SI tmp_addr
;
3427 tmp_postinc
= FLD (f_memmode
);
3428 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3429 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3430 ; if (NEBI (tmp_postinc
, 0)) {
3432 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3433 tmp_addr
= ADDSI (tmp_addr
, 4);
3436 SI opval
= tmp_addr
;
3437 SET_H_GR (FLD (f_operand1
), opval
);
3438 written
|= (1 << 8);
3439 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3445 else if (EQSI (tmp_rno
, 11)) {
3446 tmp_newval
= ({ SI tmp_addr
;
3449 tmp_postinc
= FLD (f_memmode
);
3450 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3451 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3452 ; if (NEBI (tmp_postinc
, 0)) {
3454 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3455 tmp_addr
= ADDSI (tmp_addr
, 4);
3458 SI opval
= tmp_addr
;
3459 SET_H_GR (FLD (f_operand1
), opval
);
3460 written
|= (1 << 8);
3461 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3467 else if (EQSI (tmp_rno
, 12)) {
3468 tmp_newval
= ({ SI tmp_addr
;
3471 tmp_postinc
= FLD (f_memmode
);
3472 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3473 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3474 ; if (NEBI (tmp_postinc
, 0)) {
3476 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3477 tmp_addr
= ADDSI (tmp_addr
, 4);
3480 SI opval
= tmp_addr
;
3481 SET_H_GR (FLD (f_operand1
), opval
);
3482 written
|= (1 << 8);
3483 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3489 else if (EQSI (tmp_rno
, 13)) {
3490 tmp_newval
= ({ SI tmp_addr
;
3493 tmp_postinc
= FLD (f_memmode
);
3494 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3495 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3496 ; if (NEBI (tmp_postinc
, 0)) {
3498 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3499 tmp_addr
= ADDSI (tmp_addr
, 4);
3502 SI opval
= tmp_addr
;
3503 SET_H_GR (FLD (f_operand1
), opval
);
3504 written
|= (1 << 8);
3505 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3511 else if (EQSI (tmp_rno
, 7)) {
3512 tmp_newval
= ({ SI tmp_addr
;
3515 tmp_postinc
= FLD (f_memmode
);
3516 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3517 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3518 ; if (NEBI (tmp_postinc
, 0)) {
3520 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3521 tmp_addr
= ADDSI (tmp_addr
, 4);
3524 SI opval
= tmp_addr
;
3525 SET_H_GR (FLD (f_operand1
), opval
);
3526 written
|= (1 << 8);
3527 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3533 else if (EQSI (tmp_rno
, 14)) {
3534 tmp_newval
= ({ SI tmp_addr
;
3537 tmp_postinc
= FLD (f_memmode
);
3538 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3539 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3540 ; if (NEBI (tmp_postinc
, 0)) {
3542 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3543 tmp_addr
= ADDSI (tmp_addr
, 4);
3546 SI opval
= tmp_addr
;
3547 SET_H_GR (FLD (f_operand1
), opval
);
3548 written
|= (1 << 8);
3549 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3555 else if (EQSI (tmp_rno
, 15)) {
3556 tmp_newval
= ({ SI tmp_addr
;
3559 tmp_postinc
= FLD (f_memmode
);
3560 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3561 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3562 ; if (NEBI (tmp_postinc
, 0)) {
3564 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3565 tmp_addr
= ADDSI (tmp_addr
, 4);
3568 SI opval
= tmp_addr
;
3569 SET_H_GR (FLD (f_operand1
), opval
);
3570 written
|= (1 << 8);
3571 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3578 cgen_rtx_error (current_cpu
, "Trying to set unimplemented special register");
3581 SI opval
= tmp_newval
;
3582 SET_H_SR (FLD (f_operand2
), opval
);
3583 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3588 CPU (h_xbit
) = opval
;
3589 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3593 SET_H_INSN_PREFIXED_P (opval
);
3594 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3599 abuf
->written
= written
;
3604 CASE (sem
, INSN_MOVE_C_SPRV10_P5
) : /* move ${sconst16},${Pd} */
3606 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3607 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3608 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p5.f
3609 int UNUSED written
= 0;
3610 IADDR UNUSED pc
= abuf
->addr
;
3611 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3615 SI opval
= FLD (f_indir_pc__word
);
3616 SET_H_SR (FLD (f_operand2
), opval
);
3617 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3622 CPU (h_xbit
) = opval
;
3623 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3627 SET_H_INSN_PREFIXED_P (opval
);
3628 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3637 CASE (sem
, INSN_MOVE_C_SPRV10_P9
) : /* move ${const32},${Pd} */
3639 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3640 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3641 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3642 int UNUSED written
= 0;
3643 IADDR UNUSED pc
= abuf
->addr
;
3644 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3648 SI opval
= FLD (f_indir_pc__dword
);
3649 SET_H_SR (FLD (f_operand2
), opval
);
3650 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3655 CPU (h_xbit
) = opval
;
3656 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3660 SET_H_INSN_PREFIXED_P (opval
);
3661 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3670 CASE (sem
, INSN_MOVE_C_SPRV10_P10
) : /* move ${const32},${Pd} */
3672 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3674 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3675 int UNUSED written
= 0;
3676 IADDR UNUSED pc
= abuf
->addr
;
3677 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3681 SI opval
= FLD (f_indir_pc__dword
);
3682 SET_H_SR (FLD (f_operand2
), opval
);
3683 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3688 CPU (h_xbit
) = opval
;
3689 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3693 SET_H_INSN_PREFIXED_P (opval
);
3694 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3703 CASE (sem
, INSN_MOVE_C_SPRV10_P11
) : /* move ${const32},${Pd} */
3705 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3706 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3707 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3708 int UNUSED written
= 0;
3709 IADDR UNUSED pc
= abuf
->addr
;
3710 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3714 SI opval
= FLD (f_indir_pc__dword
);
3715 SET_H_SR (FLD (f_operand2
), opval
);
3716 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3721 CPU (h_xbit
) = opval
;
3722 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3726 SET_H_INSN_PREFIXED_P (opval
);
3727 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3736 CASE (sem
, INSN_MOVE_C_SPRV10_P12
) : /* move ${const32},${Pd} */
3738 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3740 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3741 int UNUSED written
= 0;
3742 IADDR UNUSED pc
= abuf
->addr
;
3743 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3747 SI opval
= FLD (f_indir_pc__dword
);
3748 SET_H_SR (FLD (f_operand2
), opval
);
3749 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3754 CPU (h_xbit
) = opval
;
3755 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3759 SET_H_INSN_PREFIXED_P (opval
);
3760 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3769 CASE (sem
, INSN_MOVE_C_SPRV10_P13
) : /* move ${const32},${Pd} */
3771 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3772 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3773 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3774 int UNUSED written
= 0;
3775 IADDR UNUSED pc
= abuf
->addr
;
3776 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3780 SI opval
= FLD (f_indir_pc__dword
);
3781 SET_H_SR (FLD (f_operand2
), opval
);
3782 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3787 CPU (h_xbit
) = opval
;
3788 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3792 SET_H_INSN_PREFIXED_P (opval
);
3793 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3802 CASE (sem
, INSN_MOVE_C_SPRV10_P7
) : /* move ${const32},${Pd} */
3804 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3805 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3806 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3807 int UNUSED written
= 0;
3808 IADDR UNUSED pc
= abuf
->addr
;
3809 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3813 SI opval
= FLD (f_indir_pc__dword
);
3814 SET_H_SR (FLD (f_operand2
), opval
);
3815 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3820 CPU (h_xbit
) = opval
;
3821 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3825 SET_H_INSN_PREFIXED_P (opval
);
3826 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3835 CASE (sem
, INSN_MOVE_C_SPRV10_P14
) : /* move ${const32},${Pd} */
3837 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3838 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3839 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3840 int UNUSED written
= 0;
3841 IADDR UNUSED pc
= abuf
->addr
;
3842 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3846 SI opval
= FLD (f_indir_pc__dword
);
3847 SET_H_SR (FLD (f_operand2
), opval
);
3848 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3853 CPU (h_xbit
) = opval
;
3854 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3858 SET_H_INSN_PREFIXED_P (opval
);
3859 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3868 CASE (sem
, INSN_MOVE_C_SPRV10_P15
) : /* move ${const32},${Pd} */
3870 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3871 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3872 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
3873 int UNUSED written
= 0;
3874 IADDR UNUSED pc
= abuf
->addr
;
3875 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3879 SI opval
= FLD (f_indir_pc__dword
);
3880 SET_H_SR (FLD (f_operand2
), opval
);
3881 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3886 CPU (h_xbit
) = opval
;
3887 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3891 SET_H_INSN_PREFIXED_P (opval
);
3892 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3901 CASE (sem
, INSN_MOVE_SPR_MV10
) : /* move ${Ps},[${Rd-sfield}${inc}] */
3903 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3904 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3905 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
3906 int UNUSED written
= 0;
3907 IADDR UNUSED pc
= abuf
->addr
;
3908 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3912 tmp_rno
= FLD (f_operand2
);
3913 if (EQSI (tmp_rno
, 5)) {
3917 tmp_postinc
= FLD (f_memmode
);
3918 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3919 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
3920 if (EQBI (CPU (h_pbit
), 0)) {
3923 HI opval
= GET_H_SR (FLD (f_operand2
));
3924 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
3925 written
|= (1 << 11);
3926 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3929 BI opval
= CPU (h_pbit
);
3930 CPU (h_cbit
) = opval
;
3931 written
|= (1 << 10);
3932 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
3938 CPU (h_cbit
) = opval
;
3939 written
|= (1 << 10);
3940 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
3945 HI opval
= GET_H_SR (FLD (f_operand2
));
3946 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
3947 written
|= (1 << 11);
3948 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3951 if (NEBI (tmp_postinc
, 0)) {
3953 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3954 tmp_addr
= ADDSI (tmp_addr
, 2);
3957 SI opval
= tmp_addr
;
3958 SET_H_GR (FLD (f_operand1
), opval
);
3959 written
|= (1 << 9);
3960 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3966 else if (EQSI (tmp_rno
, 9)) {
3970 tmp_postinc
= FLD (f_memmode
);
3971 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
3972 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
3973 if (EQBI (CPU (h_pbit
), 0)) {
3976 SI opval
= GET_H_SR (FLD (f_operand2
));
3977 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
3978 written
|= (1 << 13);
3979 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3982 BI opval
= CPU (h_pbit
);
3983 CPU (h_cbit
) = opval
;
3984 written
|= (1 << 10);
3985 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
3991 CPU (h_cbit
) = opval
;
3992 written
|= (1 << 10);
3993 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
3998 SI opval
= GET_H_SR (FLD (f_operand2
));
3999 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4000 written
|= (1 << 13);
4001 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4004 if (NEBI (tmp_postinc
, 0)) {
4006 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4007 tmp_addr
= ADDSI (tmp_addr
, 4);
4010 SI opval
= tmp_addr
;
4011 SET_H_GR (FLD (f_operand1
), opval
);
4012 written
|= (1 << 9);
4013 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4019 else if (EQSI (tmp_rno
, 10)) {
4023 tmp_postinc
= FLD (f_memmode
);
4024 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4025 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4026 if (EQBI (CPU (h_pbit
), 0)) {
4029 SI opval
= GET_H_SR (FLD (f_operand2
));
4030 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4031 written
|= (1 << 13);
4032 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4035 BI opval
= CPU (h_pbit
);
4036 CPU (h_cbit
) = opval
;
4037 written
|= (1 << 10);
4038 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4044 CPU (h_cbit
) = opval
;
4045 written
|= (1 << 10);
4046 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4051 SI opval
= GET_H_SR (FLD (f_operand2
));
4052 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4053 written
|= (1 << 13);
4054 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4057 if (NEBI (tmp_postinc
, 0)) {
4059 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4060 tmp_addr
= ADDSI (tmp_addr
, 4);
4063 SI opval
= tmp_addr
;
4064 SET_H_GR (FLD (f_operand1
), opval
);
4065 written
|= (1 << 9);
4066 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4072 else if (EQSI (tmp_rno
, 11)) {
4076 tmp_postinc
= FLD (f_memmode
);
4077 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4078 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4079 if (EQBI (CPU (h_pbit
), 0)) {
4082 SI opval
= GET_H_SR (FLD (f_operand2
));
4083 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4084 written
|= (1 << 13);
4085 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4088 BI opval
= CPU (h_pbit
);
4089 CPU (h_cbit
) = opval
;
4090 written
|= (1 << 10);
4091 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4097 CPU (h_cbit
) = opval
;
4098 written
|= (1 << 10);
4099 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4104 SI opval
= GET_H_SR (FLD (f_operand2
));
4105 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4106 written
|= (1 << 13);
4107 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4110 if (NEBI (tmp_postinc
, 0)) {
4112 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4113 tmp_addr
= ADDSI (tmp_addr
, 4);
4116 SI opval
= tmp_addr
;
4117 SET_H_GR (FLD (f_operand1
), opval
);
4118 written
|= (1 << 9);
4119 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4125 else if (EQSI (tmp_rno
, 12)) {
4129 tmp_postinc
= FLD (f_memmode
);
4130 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4131 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4132 if (EQBI (CPU (h_pbit
), 0)) {
4135 SI opval
= GET_H_SR (FLD (f_operand2
));
4136 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4137 written
|= (1 << 13);
4138 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4141 BI opval
= CPU (h_pbit
);
4142 CPU (h_cbit
) = opval
;
4143 written
|= (1 << 10);
4144 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4150 CPU (h_cbit
) = opval
;
4151 written
|= (1 << 10);
4152 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4157 SI opval
= GET_H_SR (FLD (f_operand2
));
4158 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4159 written
|= (1 << 13);
4160 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4163 if (NEBI (tmp_postinc
, 0)) {
4165 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4166 tmp_addr
= ADDSI (tmp_addr
, 4);
4169 SI opval
= tmp_addr
;
4170 SET_H_GR (FLD (f_operand1
), opval
);
4171 written
|= (1 << 9);
4172 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4178 else if (EQSI (tmp_rno
, 13)) {
4182 tmp_postinc
= FLD (f_memmode
);
4183 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4184 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4185 if (EQBI (CPU (h_pbit
), 0)) {
4188 SI opval
= GET_H_SR (FLD (f_operand2
));
4189 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4190 written
|= (1 << 13);
4191 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4194 BI opval
= CPU (h_pbit
);
4195 CPU (h_cbit
) = opval
;
4196 written
|= (1 << 10);
4197 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4203 CPU (h_cbit
) = opval
;
4204 written
|= (1 << 10);
4205 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4210 SI opval
= GET_H_SR (FLD (f_operand2
));
4211 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4212 written
|= (1 << 13);
4213 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4216 if (NEBI (tmp_postinc
, 0)) {
4218 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4219 tmp_addr
= ADDSI (tmp_addr
, 4);
4222 SI opval
= tmp_addr
;
4223 SET_H_GR (FLD (f_operand1
), opval
);
4224 written
|= (1 << 9);
4225 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4231 else if (EQSI (tmp_rno
, 0)) {
4235 tmp_postinc
= FLD (f_memmode
);
4236 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4237 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4238 if (EQBI (CPU (h_pbit
), 0)) {
4241 QI opval
= GET_H_SR (FLD (f_operand2
));
4242 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4243 written
|= (1 << 12);
4244 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4247 BI opval
= CPU (h_pbit
);
4248 CPU (h_cbit
) = opval
;
4249 written
|= (1 << 10);
4250 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4256 CPU (h_cbit
) = opval
;
4257 written
|= (1 << 10);
4258 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4263 QI opval
= GET_H_SR (FLD (f_operand2
));
4264 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4265 written
|= (1 << 12);
4266 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4269 if (NEBI (tmp_postinc
, 0)) {
4271 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4272 tmp_addr
= ADDSI (tmp_addr
, 1);
4275 SI opval
= tmp_addr
;
4276 SET_H_GR (FLD (f_operand1
), opval
);
4277 written
|= (1 << 9);
4278 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4284 else if (EQSI (tmp_rno
, 1)) {
4288 tmp_postinc
= FLD (f_memmode
);
4289 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4290 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4291 if (EQBI (CPU (h_pbit
), 0)) {
4294 QI opval
= GET_H_SR (FLD (f_operand2
));
4295 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4296 written
|= (1 << 12);
4297 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4300 BI opval
= CPU (h_pbit
);
4301 CPU (h_cbit
) = opval
;
4302 written
|= (1 << 10);
4303 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4309 CPU (h_cbit
) = opval
;
4310 written
|= (1 << 10);
4311 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4316 QI opval
= GET_H_SR (FLD (f_operand2
));
4317 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4318 written
|= (1 << 12);
4319 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4322 if (NEBI (tmp_postinc
, 0)) {
4324 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4325 tmp_addr
= ADDSI (tmp_addr
, 1);
4328 SI opval
= tmp_addr
;
4329 SET_H_GR (FLD (f_operand1
), opval
);
4330 written
|= (1 << 9);
4331 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4337 else if (EQSI (tmp_rno
, 4)) {
4341 tmp_postinc
= FLD (f_memmode
);
4342 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4343 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4344 if (EQBI (CPU (h_pbit
), 0)) {
4347 HI opval
= GET_H_SR (FLD (f_operand2
));
4348 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4349 written
|= (1 << 11);
4350 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4353 BI opval
= CPU (h_pbit
);
4354 CPU (h_cbit
) = opval
;
4355 written
|= (1 << 10);
4356 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4362 CPU (h_cbit
) = opval
;
4363 written
|= (1 << 10);
4364 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4369 HI opval
= GET_H_SR (FLD (f_operand2
));
4370 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4371 written
|= (1 << 11);
4372 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4375 if (NEBI (tmp_postinc
, 0)) {
4377 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4378 tmp_addr
= ADDSI (tmp_addr
, 2);
4381 SI opval
= tmp_addr
;
4382 SET_H_GR (FLD (f_operand1
), opval
);
4383 written
|= (1 << 9);
4384 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4390 else if (EQSI (tmp_rno
, 8)) {
4394 tmp_postinc
= FLD (f_memmode
);
4395 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4396 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4397 if (EQBI (CPU (h_pbit
), 0)) {
4400 SI opval
= GET_H_SR (FLD (f_operand2
));
4401 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4402 written
|= (1 << 13);
4403 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4406 BI opval
= CPU (h_pbit
);
4407 CPU (h_cbit
) = opval
;
4408 written
|= (1 << 10);
4409 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4415 CPU (h_cbit
) = opval
;
4416 written
|= (1 << 10);
4417 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4422 SI opval
= GET_H_SR (FLD (f_operand2
));
4423 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4424 written
|= (1 << 13);
4425 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4428 if (NEBI (tmp_postinc
, 0)) {
4430 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4431 tmp_addr
= ADDSI (tmp_addr
, 4);
4434 SI opval
= tmp_addr
;
4435 SET_H_GR (FLD (f_operand1
), opval
);
4436 written
|= (1 << 9);
4437 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4443 else if (EQSI (tmp_rno
, 7)) {
4447 tmp_postinc
= FLD (f_memmode
);
4448 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4449 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4450 if (EQBI (CPU (h_pbit
), 0)) {
4453 SI opval
= GET_H_SR (FLD (f_operand2
));
4454 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4455 written
|= (1 << 13);
4456 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4459 BI opval
= CPU (h_pbit
);
4460 CPU (h_cbit
) = opval
;
4461 written
|= (1 << 10);
4462 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4468 CPU (h_cbit
) = opval
;
4469 written
|= (1 << 10);
4470 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4475 SI opval
= GET_H_SR (FLD (f_operand2
));
4476 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4477 written
|= (1 << 13);
4478 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4481 if (NEBI (tmp_postinc
, 0)) {
4483 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4484 tmp_addr
= ADDSI (tmp_addr
, 4);
4487 SI opval
= tmp_addr
;
4488 SET_H_GR (FLD (f_operand1
), opval
);
4489 written
|= (1 << 9);
4490 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4496 else if (EQSI (tmp_rno
, 14)) {
4500 tmp_postinc
= FLD (f_memmode
);
4501 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4502 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4503 if (EQBI (CPU (h_pbit
), 0)) {
4506 SI opval
= GET_H_SR (FLD (f_operand2
));
4507 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4508 written
|= (1 << 13);
4509 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4512 BI opval
= CPU (h_pbit
);
4513 CPU (h_cbit
) = opval
;
4514 written
|= (1 << 10);
4515 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4521 CPU (h_cbit
) = opval
;
4522 written
|= (1 << 10);
4523 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4528 SI opval
= GET_H_SR (FLD (f_operand2
));
4529 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4530 written
|= (1 << 13);
4531 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4534 if (NEBI (tmp_postinc
, 0)) {
4536 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4537 tmp_addr
= ADDSI (tmp_addr
, 4);
4540 SI opval
= tmp_addr
;
4541 SET_H_GR (FLD (f_operand1
), opval
);
4542 written
|= (1 << 9);
4543 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4549 else if (EQSI (tmp_rno
, 15)) {
4553 tmp_postinc
= FLD (f_memmode
);
4554 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4555 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
4556 if (EQBI (CPU (h_pbit
), 0)) {
4559 SI opval
= GET_H_SR (FLD (f_operand2
));
4560 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4561 written
|= (1 << 13);
4562 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4565 BI opval
= CPU (h_pbit
);
4566 CPU (h_cbit
) = opval
;
4567 written
|= (1 << 10);
4568 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4574 CPU (h_cbit
) = opval
;
4575 written
|= (1 << 10);
4576 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4581 SI opval
= GET_H_SR (FLD (f_operand2
));
4582 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4583 written
|= (1 << 13);
4584 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4587 if (NEBI (tmp_postinc
, 0)) {
4589 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4590 tmp_addr
= ADDSI (tmp_addr
, 4);
4593 SI opval
= tmp_addr
;
4594 SET_H_GR (FLD (f_operand1
), opval
);
4595 written
|= (1 << 9);
4596 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4603 cgen_rtx_error (current_cpu
, "write from unimplemented special register");
4608 CPU (h_xbit
) = opval
;
4609 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4613 SET_H_INSN_PREFIXED_P (opval
);
4614 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4619 abuf
->written
= written
;
4624 CASE (sem
, INSN_SBFS
) : /* sbfs [${Rd-sfield}${inc}] */
4626 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4628 #define FLD(f) abuf->fields.fmt_empty.f
4629 int UNUSED written
= 0;
4630 IADDR UNUSED pc
= abuf
->addr
;
4631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4633 cgen_rtx_error (current_cpu
, "SBFS isn't implemented");
4639 CASE (sem
, INSN_MOVEM_R_M
) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4641 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4642 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4643 #define FLD(f) abuf->fields.sfmt_movem_r_m.f
4644 int UNUSED written
= 0;
4645 IADDR UNUSED pc
= abuf
->addr
;
4646 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4651 tmp_postinc
= FLD (f_memmode
);
4654 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
4656 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4658 if (GESI (FLD (f_operand2
), 15)) {
4661 tmp_tmp
= GET_H_GR (((UINT
) 15));
4664 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4665 written
|= (1 << 23);
4666 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4668 tmp_addr
= ADDSI (tmp_addr
, 4);
4671 if (GESI (FLD (f_operand2
), 14)) {
4674 tmp_tmp
= GET_H_GR (((UINT
) 14));
4677 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4678 written
|= (1 << 23);
4679 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4681 tmp_addr
= ADDSI (tmp_addr
, 4);
4684 if (GESI (FLD (f_operand2
), 13)) {
4687 tmp_tmp
= GET_H_GR (((UINT
) 13));
4690 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4691 written
|= (1 << 23);
4692 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4694 tmp_addr
= ADDSI (tmp_addr
, 4);
4697 if (GESI (FLD (f_operand2
), 12)) {
4700 tmp_tmp
= GET_H_GR (((UINT
) 12));
4703 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4704 written
|= (1 << 23);
4705 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4707 tmp_addr
= ADDSI (tmp_addr
, 4);
4710 if (GESI (FLD (f_operand2
), 11)) {
4713 tmp_tmp
= GET_H_GR (((UINT
) 11));
4716 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4717 written
|= (1 << 23);
4718 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4720 tmp_addr
= ADDSI (tmp_addr
, 4);
4723 if (GESI (FLD (f_operand2
), 10)) {
4726 tmp_tmp
= GET_H_GR (((UINT
) 10));
4729 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4730 written
|= (1 << 23);
4731 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4733 tmp_addr
= ADDSI (tmp_addr
, 4);
4736 if (GESI (FLD (f_operand2
), 9)) {
4739 tmp_tmp
= GET_H_GR (((UINT
) 9));
4742 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4743 written
|= (1 << 23);
4744 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4746 tmp_addr
= ADDSI (tmp_addr
, 4);
4749 if (GESI (FLD (f_operand2
), 8)) {
4752 tmp_tmp
= GET_H_GR (((UINT
) 8));
4755 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4756 written
|= (1 << 23);
4757 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4759 tmp_addr
= ADDSI (tmp_addr
, 4);
4762 if (GESI (FLD (f_operand2
), 7)) {
4765 tmp_tmp
= GET_H_GR (((UINT
) 7));
4768 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4769 written
|= (1 << 23);
4770 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4772 tmp_addr
= ADDSI (tmp_addr
, 4);
4775 if (GESI (FLD (f_operand2
), 6)) {
4778 tmp_tmp
= GET_H_GR (((UINT
) 6));
4781 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4782 written
|= (1 << 23);
4783 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4785 tmp_addr
= ADDSI (tmp_addr
, 4);
4788 if (GESI (FLD (f_operand2
), 5)) {
4791 tmp_tmp
= GET_H_GR (((UINT
) 5));
4794 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4795 written
|= (1 << 23);
4796 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4798 tmp_addr
= ADDSI (tmp_addr
, 4);
4801 if (GESI (FLD (f_operand2
), 4)) {
4804 tmp_tmp
= GET_H_GR (((UINT
) 4));
4807 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4808 written
|= (1 << 23);
4809 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4811 tmp_addr
= ADDSI (tmp_addr
, 4);
4814 if (GESI (FLD (f_operand2
), 3)) {
4817 tmp_tmp
= GET_H_GR (((UINT
) 3));
4820 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4821 written
|= (1 << 23);
4822 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4824 tmp_addr
= ADDSI (tmp_addr
, 4);
4827 if (GESI (FLD (f_operand2
), 2)) {
4830 tmp_tmp
= GET_H_GR (((UINT
) 2));
4833 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4834 written
|= (1 << 23);
4835 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4837 tmp_addr
= ADDSI (tmp_addr
, 4);
4840 if (GESI (FLD (f_operand2
), 1)) {
4843 tmp_tmp
= GET_H_GR (((UINT
) 1));
4846 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4847 written
|= (1 << 23);
4848 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4850 tmp_addr
= ADDSI (tmp_addr
, 4);
4853 if (GESI (FLD (f_operand2
), 0)) {
4856 tmp_tmp
= GET_H_GR (((UINT
) 0));
4859 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4860 written
|= (1 << 23);
4861 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4863 tmp_addr
= ADDSI (tmp_addr
, 4);
4867 if (NEBI (tmp_postinc
, 0)) {
4869 SI opval
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr
) : (CPU (h_prefixreg_pre_v32
)));
4870 SET_H_GR (FLD (f_operand1
), opval
);
4871 written
|= (1 << 22);
4872 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4878 CPU (h_xbit
) = opval
;
4879 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4883 SET_H_INSN_PREFIXED_P (opval
);
4884 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4889 abuf
->written
= written
;
4894 CASE (sem
, INSN_MOVEM_M_R
) : /* movem [${Rs}${inc}],${Rd} */
4896 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4898 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
4899 int UNUSED written
= 0;
4900 IADDR UNUSED pc
= abuf
->addr
;
4901 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4906 tmp_postinc
= FLD (f_memmode
);
4907 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
4910 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
4913 if (GESI (FLD (f_operand2
), 14)) {
4916 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4919 SET_H_GR (((UINT
) 14), opval
);
4920 written
|= (1 << 14);
4921 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4923 tmp_addr
= ADDSI (tmp_addr
, 4);
4926 if (GESI (FLD (f_operand2
), 13)) {
4929 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4932 SET_H_GR (((UINT
) 13), opval
);
4933 written
|= (1 << 13);
4934 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4936 tmp_addr
= ADDSI (tmp_addr
, 4);
4939 if (GESI (FLD (f_operand2
), 12)) {
4942 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4945 SET_H_GR (((UINT
) 12), opval
);
4946 written
|= (1 << 12);
4947 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4949 tmp_addr
= ADDSI (tmp_addr
, 4);
4952 if (GESI (FLD (f_operand2
), 11)) {
4955 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4958 SET_H_GR (((UINT
) 11), opval
);
4959 written
|= (1 << 11);
4960 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4962 tmp_addr
= ADDSI (tmp_addr
, 4);
4965 if (GESI (FLD (f_operand2
), 10)) {
4968 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4971 SET_H_GR (((UINT
) 10), opval
);
4972 written
|= (1 << 10);
4973 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4975 tmp_addr
= ADDSI (tmp_addr
, 4);
4978 if (GESI (FLD (f_operand2
), 9)) {
4981 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4984 SET_H_GR (((UINT
) 9), opval
);
4985 written
|= (1 << 22);
4986 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4988 tmp_addr
= ADDSI (tmp_addr
, 4);
4991 if (GESI (FLD (f_operand2
), 8)) {
4994 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
4997 SET_H_GR (((UINT
) 8), opval
);
4998 written
|= (1 << 21);
4999 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5001 tmp_addr
= ADDSI (tmp_addr
, 4);
5004 if (GESI (FLD (f_operand2
), 7)) {
5007 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5010 SET_H_GR (((UINT
) 7), opval
);
5011 written
|= (1 << 20);
5012 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5014 tmp_addr
= ADDSI (tmp_addr
, 4);
5017 if (GESI (FLD (f_operand2
), 6)) {
5020 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5023 SET_H_GR (((UINT
) 6), opval
);
5024 written
|= (1 << 19);
5025 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5027 tmp_addr
= ADDSI (tmp_addr
, 4);
5030 if (GESI (FLD (f_operand2
), 5)) {
5033 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5036 SET_H_GR (((UINT
) 5), opval
);
5037 written
|= (1 << 18);
5038 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5040 tmp_addr
= ADDSI (tmp_addr
, 4);
5043 if (GESI (FLD (f_operand2
), 4)) {
5046 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5049 SET_H_GR (((UINT
) 4), opval
);
5050 written
|= (1 << 17);
5051 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5053 tmp_addr
= ADDSI (tmp_addr
, 4);
5056 if (GESI (FLD (f_operand2
), 3)) {
5059 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5062 SET_H_GR (((UINT
) 3), opval
);
5063 written
|= (1 << 16);
5064 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5066 tmp_addr
= ADDSI (tmp_addr
, 4);
5069 if (GESI (FLD (f_operand2
), 2)) {
5072 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5075 SET_H_GR (((UINT
) 2), opval
);
5076 written
|= (1 << 15);
5077 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5079 tmp_addr
= ADDSI (tmp_addr
, 4);
5082 if (GESI (FLD (f_operand2
), 1)) {
5085 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5088 SET_H_GR (((UINT
) 1), opval
);
5089 written
|= (1 << 9);
5090 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5092 tmp_addr
= ADDSI (tmp_addr
, 4);
5095 if (GESI (FLD (f_operand2
), 0)) {
5098 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5101 SET_H_GR (((UINT
) 0), opval
);
5102 written
|= (1 << 8);
5103 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5105 tmp_addr
= ADDSI (tmp_addr
, 4);
5109 if (NEBI (tmp_postinc
, 0)) {
5111 SI opval
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr
) : (CPU (h_prefixreg_pre_v32
)));
5112 SET_H_GR (FLD (f_operand1
), opval
);
5113 written
|= (1 << 7);
5114 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5120 CPU (h_xbit
) = opval
;
5121 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5125 SET_H_INSN_PREFIXED_P (opval
);
5126 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5131 abuf
->written
= written
;
5136 CASE (sem
, INSN_MOVEM_M_PC
) : /* movem [${Rs}${inc}],${Rd} */
5138 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5139 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5140 #define FLD(f) abuf->fields.sfmt_movem_m_r.f
5141 int UNUSED written
= 0;
5142 IADDR UNUSED pc
= abuf
->addr
;
5144 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5149 tmp_postinc
= FLD (f_memmode
);
5150 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5153 USI opval
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5154 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
5155 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
5157 tmp_addr
= ADDSI (tmp_addr
, 4);
5160 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5163 SET_H_GR (((UINT
) 14), opval
);
5164 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5166 tmp_addr
= ADDSI (tmp_addr
, 4);
5170 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5173 SET_H_GR (((UINT
) 13), opval
);
5174 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5176 tmp_addr
= ADDSI (tmp_addr
, 4);
5180 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5183 SET_H_GR (((UINT
) 12), opval
);
5184 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5186 tmp_addr
= ADDSI (tmp_addr
, 4);
5190 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5193 SET_H_GR (((UINT
) 11), opval
);
5194 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5196 tmp_addr
= ADDSI (tmp_addr
, 4);
5200 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5203 SET_H_GR (((UINT
) 10), opval
);
5204 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5206 tmp_addr
= ADDSI (tmp_addr
, 4);
5210 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5213 SET_H_GR (((UINT
) 9), opval
);
5214 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5216 tmp_addr
= ADDSI (tmp_addr
, 4);
5220 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5223 SET_H_GR (((UINT
) 8), opval
);
5224 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5226 tmp_addr
= ADDSI (tmp_addr
, 4);
5230 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5233 SET_H_GR (((UINT
) 7), opval
);
5234 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5236 tmp_addr
= ADDSI (tmp_addr
, 4);
5240 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5243 SET_H_GR (((UINT
) 6), opval
);
5244 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5246 tmp_addr
= ADDSI (tmp_addr
, 4);
5250 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5253 SET_H_GR (((UINT
) 5), opval
);
5254 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5256 tmp_addr
= ADDSI (tmp_addr
, 4);
5260 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5263 SET_H_GR (((UINT
) 4), opval
);
5264 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5266 tmp_addr
= ADDSI (tmp_addr
, 4);
5270 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5273 SET_H_GR (((UINT
) 3), opval
);
5274 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5276 tmp_addr
= ADDSI (tmp_addr
, 4);
5280 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5283 SET_H_GR (((UINT
) 2), opval
);
5284 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5286 tmp_addr
= ADDSI (tmp_addr
, 4);
5290 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5293 SET_H_GR (((UINT
) 1), opval
);
5294 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5296 tmp_addr
= ADDSI (tmp_addr
, 4);
5300 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5303 SET_H_GR (((UINT
) 0), opval
);
5304 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5306 tmp_addr
= ADDSI (tmp_addr
, 4);
5309 if (NEBI (tmp_postinc
, 0)) {
5311 SI opval
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (tmp_addr
) : (CPU (h_prefixreg_pre_v32
)));
5312 SET_H_GR (FLD (f_operand1
), opval
);
5313 written
|= (1 << 5);
5314 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5320 CPU (h_xbit
) = opval
;
5321 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5325 SET_H_INSN_PREFIXED_P (opval
);
5326 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5331 abuf
->written
= written
;
5332 SEM_BRANCH_FINI (vpc
);
5337 CASE (sem
, INSN_ADD_B_R
) : /* add.b $Rs,$Rd */
5339 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5340 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5341 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5342 int UNUSED written
= 0;
5343 IADDR UNUSED pc
= abuf
->addr
;
5344 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5351 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5352 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5353 tmp_carry
= CPU (h_cbit
);
5354 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5357 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
5359 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5360 SET_H_GR (FLD (f_operand2
), opval
);
5361 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5366 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))));
5367 CPU (h_cbit
) = opval
;
5368 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5371 BI opval
= LTQI (tmp_newval
, 0);
5372 CPU (h_nbit
) = opval
;
5373 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5376 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5377 CPU (h_zbit
) = opval
;
5378 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5381 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)));
5382 CPU (h_vbit
) = opval
;
5383 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5388 CPU (h_xbit
) = opval
;
5389 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5393 SET_H_INSN_PREFIXED_P (opval
);
5394 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5404 CASE (sem
, INSN_ADD_W_R
) : /* add.w $Rs,$Rd */
5406 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5407 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5408 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5409 int UNUSED written
= 0;
5410 IADDR UNUSED pc
= abuf
->addr
;
5411 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5418 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5419 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5420 tmp_carry
= CPU (h_cbit
);
5421 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5424 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
5426 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5427 SET_H_GR (FLD (f_operand2
), opval
);
5428 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5433 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))));
5434 CPU (h_cbit
) = opval
;
5435 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5438 BI opval
= LTHI (tmp_newval
, 0);
5439 CPU (h_nbit
) = opval
;
5440 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5443 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5444 CPU (h_zbit
) = opval
;
5445 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5448 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)));
5449 CPU (h_vbit
) = opval
;
5450 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5455 CPU (h_xbit
) = opval
;
5456 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5460 SET_H_INSN_PREFIXED_P (opval
);
5461 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5471 CASE (sem
, INSN_ADD_D_R
) : /* add.d $Rs,$Rd */
5473 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5474 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5475 #define FLD(f) abuf->fields.sfmt_add_b_r.f
5476 int UNUSED written
= 0;
5477 IADDR UNUSED pc
= abuf
->addr
;
5478 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5485 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5486 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5487 tmp_carry
= CPU (h_cbit
);
5488 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5490 SI opval
= tmp_newval
;
5491 SET_H_GR (FLD (f_operand2
), opval
);
5492 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5496 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))));
5497 CPU (h_cbit
) = opval
;
5498 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5501 BI opval
= LTSI (tmp_newval
, 0);
5502 CPU (h_nbit
) = opval
;
5503 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5506 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5507 CPU (h_zbit
) = opval
;
5508 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5511 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)));
5512 CPU (h_vbit
) = opval
;
5513 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5518 CPU (h_xbit
) = opval
;
5519 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5523 SET_H_INSN_PREFIXED_P (opval
);
5524 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5534 CASE (sem
, INSN_ADD_M_B_M
) : /* add-m.b [${Rs}${inc}],${Rd} */
5536 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5537 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5538 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5539 int UNUSED written
= 0;
5540 IADDR UNUSED pc
= abuf
->addr
;
5541 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5548 tmp_tmpops
= ({ SI tmp_addr
;
5551 tmp_postinc
= FLD (f_memmode
);
5552 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5553 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
5554 ; if (NEBI (tmp_postinc
, 0)) {
5556 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5557 tmp_addr
= ADDSI (tmp_addr
, 1);
5560 SI opval
= tmp_addr
;
5561 SET_H_GR (FLD (f_operand1
), opval
);
5562 written
|= (1 << 12);
5563 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5568 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5569 tmp_carry
= CPU (h_cbit
);
5570 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5573 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5575 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5576 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5577 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5582 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))));
5583 CPU (h_cbit
) = opval
;
5584 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5587 BI opval
= LTQI (tmp_newval
, 0);
5588 CPU (h_nbit
) = opval
;
5589 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5592 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5593 CPU (h_zbit
) = opval
;
5594 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5597 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)));
5598 CPU (h_vbit
) = opval
;
5599 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5604 CPU (h_xbit
) = opval
;
5605 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5609 SET_H_INSN_PREFIXED_P (opval
);
5610 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5616 abuf
->written
= written
;
5621 CASE (sem
, INSN_ADD_M_W_M
) : /* add-m.w [${Rs}${inc}],${Rd} */
5623 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5624 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5625 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5626 int UNUSED written
= 0;
5627 IADDR UNUSED pc
= abuf
->addr
;
5628 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5635 tmp_tmpops
= ({ SI tmp_addr
;
5638 tmp_postinc
= FLD (f_memmode
);
5639 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5640 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
5641 ; if (NEBI (tmp_postinc
, 0)) {
5643 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5644 tmp_addr
= ADDSI (tmp_addr
, 2);
5647 SI opval
= tmp_addr
;
5648 SET_H_GR (FLD (f_operand1
), opval
);
5649 written
|= (1 << 12);
5650 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5655 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5656 tmp_carry
= CPU (h_cbit
);
5657 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5660 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5662 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5663 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5664 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5669 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))));
5670 CPU (h_cbit
) = opval
;
5671 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5674 BI opval
= LTHI (tmp_newval
, 0);
5675 CPU (h_nbit
) = opval
;
5676 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5679 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5680 CPU (h_zbit
) = opval
;
5681 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5684 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)));
5685 CPU (h_vbit
) = opval
;
5686 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5691 CPU (h_xbit
) = opval
;
5692 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5696 SET_H_INSN_PREFIXED_P (opval
);
5697 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5703 abuf
->written
= written
;
5708 CASE (sem
, INSN_ADD_M_D_M
) : /* add-m.d [${Rs}${inc}],${Rd} */
5710 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5711 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5712 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5713 int UNUSED written
= 0;
5714 IADDR UNUSED pc
= abuf
->addr
;
5715 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5722 tmp_tmpops
= ({ SI tmp_addr
;
5725 tmp_postinc
= FLD (f_memmode
);
5726 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
5727 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5728 ; if (NEBI (tmp_postinc
, 0)) {
5730 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5731 tmp_addr
= ADDSI (tmp_addr
, 4);
5734 SI opval
= tmp_addr
;
5735 SET_H_GR (FLD (f_operand1
), opval
);
5736 written
|= (1 << 11);
5737 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5742 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5743 tmp_carry
= CPU (h_cbit
);
5744 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5746 SI opval
= tmp_newval
;
5747 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5748 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5752 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))));
5753 CPU (h_cbit
) = opval
;
5754 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5757 BI opval
= LTSI (tmp_newval
, 0);
5758 CPU (h_nbit
) = opval
;
5759 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5762 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5763 CPU (h_zbit
) = opval
;
5764 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5767 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)));
5768 CPU (h_vbit
) = opval
;
5769 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5774 CPU (h_xbit
) = opval
;
5775 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5779 SET_H_INSN_PREFIXED_P (opval
);
5780 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5786 abuf
->written
= written
;
5791 CASE (sem
, INSN_ADDCBR
) : /* add.b ${sconst8}],${Rd} */
5793 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5794 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5795 #define FLD(f) abuf->fields.sfmt_addcbr.f
5796 int UNUSED written
= 0;
5797 IADDR UNUSED pc
= abuf
->addr
;
5798 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5805 tmp_tmpops
= FLD (f_indir_pc__byte
);
5806 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5807 tmp_carry
= CPU (h_cbit
);
5808 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5811 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
5813 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5814 SET_H_GR (FLD (f_operand2
), opval
);
5815 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5820 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))));
5821 CPU (h_cbit
) = opval
;
5822 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5825 BI opval
= LTQI (tmp_newval
, 0);
5826 CPU (h_nbit
) = opval
;
5827 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5830 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5831 CPU (h_zbit
) = opval
;
5832 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5835 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)));
5836 CPU (h_vbit
) = opval
;
5837 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5842 CPU (h_xbit
) = opval
;
5843 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5847 SET_H_INSN_PREFIXED_P (opval
);
5848 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5858 CASE (sem
, INSN_ADDCWR
) : /* add.w ${sconst16}],${Rd} */
5860 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5861 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5862 #define FLD(f) abuf->fields.sfmt_addcwr.f
5863 int UNUSED written
= 0;
5864 IADDR UNUSED pc
= abuf
->addr
;
5865 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5872 tmp_tmpops
= FLD (f_indir_pc__word
);
5873 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5874 tmp_carry
= CPU (h_cbit
);
5875 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5878 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
5880 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5881 SET_H_GR (FLD (f_operand2
), opval
);
5882 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5887 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))));
5888 CPU (h_cbit
) = opval
;
5889 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5892 BI opval
= LTHI (tmp_newval
, 0);
5893 CPU (h_nbit
) = opval
;
5894 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5897 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5898 CPU (h_zbit
) = opval
;
5899 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5902 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)));
5903 CPU (h_vbit
) = opval
;
5904 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5909 CPU (h_xbit
) = opval
;
5910 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5914 SET_H_INSN_PREFIXED_P (opval
);
5915 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5925 CASE (sem
, INSN_ADDCDR
) : /* add.d ${const32}],${Rd} */
5927 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5929 #define FLD(f) abuf->fields.sfmt_addcdr.f
5930 int UNUSED written
= 0;
5931 IADDR UNUSED pc
= abuf
->addr
;
5932 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
5939 tmp_tmpops
= FLD (f_indir_pc__dword
);
5940 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5941 tmp_carry
= CPU (h_cbit
);
5942 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5944 SI opval
= tmp_newval
;
5945 SET_H_GR (FLD (f_operand2
), opval
);
5946 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5950 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))));
5951 CPU (h_cbit
) = opval
;
5952 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5955 BI opval
= LTSI (tmp_newval
, 0);
5956 CPU (h_nbit
) = opval
;
5957 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5960 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5961 CPU (h_zbit
) = opval
;
5962 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5965 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)));
5966 CPU (h_vbit
) = opval
;
5967 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5972 CPU (h_xbit
) = opval
;
5973 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5977 SET_H_INSN_PREFIXED_P (opval
);
5978 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5988 CASE (sem
, INSN_ADDCPC
) : /* add.d ${sconst32},PC */
5990 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5991 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5992 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
5993 int UNUSED written
= 0;
5994 IADDR UNUSED pc
= abuf
->addr
;
5996 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6002 tmp_offs
= FLD (f_indir_pc__dword
);
6003 tmp_oldpc
= ADDSI (pc
, 6);
6004 tmp_newpc
= ADDSI (tmp_oldpc
, tmp_offs
);
6006 USI opval
= tmp_newpc
;
6007 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
6008 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
6012 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))));
6013 CPU (h_cbit
) = opval
;
6014 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6017 BI opval
= LTSI (tmp_newpc
, 0);
6018 CPU (h_nbit
) = opval
;
6019 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6022 BI opval
= ANDIF (EQSI (tmp_newpc
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6023 CPU (h_zbit
) = opval
;
6024 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6027 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)));
6028 CPU (h_vbit
) = opval
;
6029 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6034 CPU (h_xbit
) = opval
;
6035 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6039 SET_H_INSN_PREFIXED_P (opval
);
6040 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6046 SEM_BRANCH_FINI (vpc
);
6051 CASE (sem
, INSN_ADDS_B_R
) : /* adds.b $Rs,$Rd */
6053 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6054 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6055 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6056 int UNUSED written
= 0;
6057 IADDR UNUSED pc
= abuf
->addr
;
6058 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6065 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6066 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6067 tmp_carry
= CPU (h_cbit
);
6068 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6070 SI opval
= tmp_newval
;
6071 SET_H_GR (FLD (f_operand2
), opval
);
6072 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6076 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))));
6077 CPU (h_cbit
) = opval
;
6078 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6081 BI opval
= LTSI (tmp_newval
, 0);
6082 CPU (h_nbit
) = opval
;
6083 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6086 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6087 CPU (h_zbit
) = opval
;
6088 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6091 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)));
6092 CPU (h_vbit
) = opval
;
6093 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6098 CPU (h_xbit
) = opval
;
6099 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6103 SET_H_INSN_PREFIXED_P (opval
);
6104 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6114 CASE (sem
, INSN_ADDS_W_R
) : /* adds.w $Rs,$Rd */
6116 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6117 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6118 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6119 int UNUSED written
= 0;
6120 IADDR UNUSED pc
= abuf
->addr
;
6121 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6128 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6129 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6130 tmp_carry
= CPU (h_cbit
);
6131 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6133 SI opval
= tmp_newval
;
6134 SET_H_GR (FLD (f_operand2
), opval
);
6135 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6139 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))));
6140 CPU (h_cbit
) = opval
;
6141 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6144 BI opval
= LTSI (tmp_newval
, 0);
6145 CPU (h_nbit
) = opval
;
6146 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6149 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6150 CPU (h_zbit
) = opval
;
6151 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6154 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)));
6155 CPU (h_vbit
) = opval
;
6156 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6161 CPU (h_xbit
) = opval
;
6162 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6166 SET_H_INSN_PREFIXED_P (opval
);
6167 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6177 CASE (sem
, INSN_ADDS_M_B_M
) : /* adds-m.b [${Rs}${inc}],$Rd */
6179 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6180 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6181 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6182 int UNUSED written
= 0;
6183 IADDR UNUSED pc
= abuf
->addr
;
6184 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6191 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
6194 tmp_postinc
= FLD (f_memmode
);
6195 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6196 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6197 ; if (NEBI (tmp_postinc
, 0)) {
6199 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6200 tmp_addr
= ADDSI (tmp_addr
, 1);
6203 SI opval
= tmp_addr
;
6204 SET_H_GR (FLD (f_operand1
), opval
);
6205 written
|= (1 << 11);
6206 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6211 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6212 tmp_carry
= CPU (h_cbit
);
6213 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6215 SI opval
= tmp_newval
;
6216 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6217 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6221 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))));
6222 CPU (h_cbit
) = opval
;
6223 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6226 BI opval
= LTSI (tmp_newval
, 0);
6227 CPU (h_nbit
) = opval
;
6228 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6231 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6232 CPU (h_zbit
) = opval
;
6233 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6236 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)));
6237 CPU (h_vbit
) = opval
;
6238 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6243 CPU (h_xbit
) = opval
;
6244 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6248 SET_H_INSN_PREFIXED_P (opval
);
6249 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6255 abuf
->written
= written
;
6260 CASE (sem
, INSN_ADDS_M_W_M
) : /* adds-m.w [${Rs}${inc}],$Rd */
6262 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6263 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6264 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6265 int UNUSED written
= 0;
6266 IADDR UNUSED pc
= abuf
->addr
;
6267 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6274 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
6277 tmp_postinc
= FLD (f_memmode
);
6278 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6279 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6280 ; if (NEBI (tmp_postinc
, 0)) {
6282 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6283 tmp_addr
= ADDSI (tmp_addr
, 2);
6286 SI opval
= tmp_addr
;
6287 SET_H_GR (FLD (f_operand1
), opval
);
6288 written
|= (1 << 11);
6289 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6294 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6295 tmp_carry
= CPU (h_cbit
);
6296 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6298 SI opval
= tmp_newval
;
6299 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6300 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6304 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))));
6305 CPU (h_cbit
) = opval
;
6306 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6309 BI opval
= LTSI (tmp_newval
, 0);
6310 CPU (h_nbit
) = opval
;
6311 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6314 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6315 CPU (h_zbit
) = opval
;
6316 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6319 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)));
6320 CPU (h_vbit
) = opval
;
6321 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6326 CPU (h_xbit
) = opval
;
6327 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6331 SET_H_INSN_PREFIXED_P (opval
);
6332 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6338 abuf
->written
= written
;
6343 CASE (sem
, INSN_ADDSCBR
) : /* [${Rs}${inc}],$Rd */
6345 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6346 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6347 #define FLD(f) abuf->fields.sfmt_addcbr.f
6348 int UNUSED written
= 0;
6349 IADDR UNUSED pc
= abuf
->addr
;
6350 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6357 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6358 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6359 tmp_carry
= CPU (h_cbit
);
6360 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6362 SI opval
= tmp_newval
;
6363 SET_H_GR (FLD (f_operand2
), opval
);
6364 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6368 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))));
6369 CPU (h_cbit
) = opval
;
6370 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6373 BI opval
= LTSI (tmp_newval
, 0);
6374 CPU (h_nbit
) = opval
;
6375 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6378 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6379 CPU (h_zbit
) = opval
;
6380 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6383 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)));
6384 CPU (h_vbit
) = opval
;
6385 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6390 CPU (h_xbit
) = opval
;
6391 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6395 SET_H_INSN_PREFIXED_P (opval
);
6396 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6406 CASE (sem
, INSN_ADDSCWR
) : /* [${Rs}${inc}],$Rd */
6408 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6409 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6410 #define FLD(f) abuf->fields.sfmt_addcwr.f
6411 int UNUSED written
= 0;
6412 IADDR UNUSED pc
= abuf
->addr
;
6413 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6420 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6421 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6422 tmp_carry
= CPU (h_cbit
);
6423 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6425 SI opval
= tmp_newval
;
6426 SET_H_GR (FLD (f_operand2
), opval
);
6427 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6431 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))));
6432 CPU (h_cbit
) = opval
;
6433 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6436 BI opval
= LTSI (tmp_newval
, 0);
6437 CPU (h_nbit
) = opval
;
6438 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6441 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6442 CPU (h_zbit
) = opval
;
6443 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6446 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)));
6447 CPU (h_vbit
) = opval
;
6448 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6453 CPU (h_xbit
) = opval
;
6454 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6458 SET_H_INSN_PREFIXED_P (opval
);
6459 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6469 CASE (sem
, INSN_ADDSPCPC
) : /* adds.w [PC],PC */
6471 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6472 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6473 #define FLD(f) abuf->fields.fmt_empty.f
6474 int UNUSED written
= 0;
6475 IADDR UNUSED pc
= abuf
->addr
;
6477 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6483 if (NOTBI (GET_H_INSN_PREFIXED_P ())) {
6484 cgen_rtx_error (current_cpu
, "Unexpected adds.w [PC],PC without prefix");
6486 tmp_offs
= GETMEMHI (current_cpu
, pc
, CPU (h_prefixreg_pre_v32
));
6487 tmp_oldpc
= ADDSI (pc
, 2);
6488 tmp_newpc
= ADDSI (tmp_oldpc
, tmp_offs
);
6490 USI opval
= tmp_newpc
;
6491 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
6492 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
6496 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))));
6497 CPU (h_cbit
) = opval
;
6498 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6501 BI opval
= LTSI (tmp_newpc
, 0);
6502 CPU (h_nbit
) = opval
;
6503 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6506 BI opval
= ANDIF (EQSI (tmp_newpc
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6507 CPU (h_zbit
) = opval
;
6508 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6511 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)));
6512 CPU (h_vbit
) = opval
;
6513 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6518 CPU (h_xbit
) = opval
;
6519 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6523 SET_H_INSN_PREFIXED_P (opval
);
6524 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6530 SEM_BRANCH_FINI (vpc
);
6535 CASE (sem
, INSN_ADDU_B_R
) : /* addu.b $Rs,$Rd */
6537 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6539 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6540 int UNUSED written
= 0;
6541 IADDR UNUSED pc
= abuf
->addr
;
6542 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6549 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6550 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6551 tmp_carry
= CPU (h_cbit
);
6552 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6554 SI opval
= tmp_newval
;
6555 SET_H_GR (FLD (f_operand2
), opval
);
6556 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6560 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))));
6561 CPU (h_cbit
) = opval
;
6562 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6565 BI opval
= LTSI (tmp_newval
, 0);
6566 CPU (h_nbit
) = opval
;
6567 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6570 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6571 CPU (h_zbit
) = opval
;
6572 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6575 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)));
6576 CPU (h_vbit
) = opval
;
6577 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6582 CPU (h_xbit
) = opval
;
6583 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6587 SET_H_INSN_PREFIXED_P (opval
);
6588 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6598 CASE (sem
, INSN_ADDU_W_R
) : /* addu.w $Rs,$Rd */
6600 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6601 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6602 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6603 int UNUSED written
= 0;
6604 IADDR UNUSED pc
= abuf
->addr
;
6605 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6612 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6613 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6614 tmp_carry
= CPU (h_cbit
);
6615 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6617 SI opval
= tmp_newval
;
6618 SET_H_GR (FLD (f_operand2
), opval
);
6619 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6623 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))));
6624 CPU (h_cbit
) = opval
;
6625 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6628 BI opval
= LTSI (tmp_newval
, 0);
6629 CPU (h_nbit
) = opval
;
6630 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6633 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6634 CPU (h_zbit
) = opval
;
6635 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6638 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)));
6639 CPU (h_vbit
) = opval
;
6640 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6645 CPU (h_xbit
) = opval
;
6646 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6650 SET_H_INSN_PREFIXED_P (opval
);
6651 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6661 CASE (sem
, INSN_ADDU_M_B_M
) : /* addu-m.b [${Rs}${inc}],$Rd */
6663 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6664 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6665 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6666 int UNUSED written
= 0;
6667 IADDR UNUSED pc
= abuf
->addr
;
6668 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6675 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
6678 tmp_postinc
= FLD (f_memmode
);
6679 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6680 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6681 ; if (NEBI (tmp_postinc
, 0)) {
6683 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6684 tmp_addr
= ADDSI (tmp_addr
, 1);
6687 SI opval
= tmp_addr
;
6688 SET_H_GR (FLD (f_operand1
), opval
);
6689 written
|= (1 << 11);
6690 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6695 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6696 tmp_carry
= CPU (h_cbit
);
6697 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6699 SI opval
= tmp_newval
;
6700 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6701 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6705 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))));
6706 CPU (h_cbit
) = opval
;
6707 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6710 BI opval
= LTSI (tmp_newval
, 0);
6711 CPU (h_nbit
) = opval
;
6712 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6715 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6716 CPU (h_zbit
) = opval
;
6717 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6720 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)));
6721 CPU (h_vbit
) = opval
;
6722 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6727 CPU (h_xbit
) = opval
;
6728 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6732 SET_H_INSN_PREFIXED_P (opval
);
6733 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6739 abuf
->written
= written
;
6744 CASE (sem
, INSN_ADDU_M_W_M
) : /* addu-m.w [${Rs}${inc}],$Rd */
6746 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6747 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6748 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6749 int UNUSED written
= 0;
6750 IADDR UNUSED pc
= abuf
->addr
;
6751 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6758 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
6761 tmp_postinc
= FLD (f_memmode
);
6762 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
6763 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6764 ; if (NEBI (tmp_postinc
, 0)) {
6766 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6767 tmp_addr
= ADDSI (tmp_addr
, 2);
6770 SI opval
= tmp_addr
;
6771 SET_H_GR (FLD (f_operand1
), opval
);
6772 written
|= (1 << 11);
6773 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6778 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6779 tmp_carry
= CPU (h_cbit
);
6780 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6782 SI opval
= tmp_newval
;
6783 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6784 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6788 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))));
6789 CPU (h_cbit
) = opval
;
6790 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6793 BI opval
= LTSI (tmp_newval
, 0);
6794 CPU (h_nbit
) = opval
;
6795 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6798 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6799 CPU (h_zbit
) = opval
;
6800 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6803 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)));
6804 CPU (h_vbit
) = opval
;
6805 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6810 CPU (h_xbit
) = opval
;
6811 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6815 SET_H_INSN_PREFIXED_P (opval
);
6816 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6822 abuf
->written
= written
;
6827 CASE (sem
, INSN_ADDUCBR
) : /* [${Rs}${inc}],$Rd */
6829 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6830 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6831 #define FLD(f) abuf->fields.sfmt_addcbr.f
6832 int UNUSED written
= 0;
6833 IADDR UNUSED pc
= abuf
->addr
;
6834 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6841 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6842 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6843 tmp_carry
= CPU (h_cbit
);
6844 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6846 SI opval
= tmp_newval
;
6847 SET_H_GR (FLD (f_operand2
), opval
);
6848 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6852 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))));
6853 CPU (h_cbit
) = opval
;
6854 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6857 BI opval
= LTSI (tmp_newval
, 0);
6858 CPU (h_nbit
) = opval
;
6859 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6862 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6863 CPU (h_zbit
) = opval
;
6864 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6867 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)));
6868 CPU (h_vbit
) = opval
;
6869 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6874 CPU (h_xbit
) = opval
;
6875 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6879 SET_H_INSN_PREFIXED_P (opval
);
6880 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6890 CASE (sem
, INSN_ADDUCWR
) : /* [${Rs}${inc}],$Rd */
6892 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6893 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6894 #define FLD(f) abuf->fields.sfmt_addcwr.f
6895 int UNUSED written
= 0;
6896 IADDR UNUSED pc
= abuf
->addr
;
6897 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6904 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6905 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6906 tmp_carry
= CPU (h_cbit
);
6907 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6909 SI opval
= tmp_newval
;
6910 SET_H_GR (FLD (f_operand2
), opval
);
6911 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6915 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))));
6916 CPU (h_cbit
) = opval
;
6917 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6920 BI opval
= LTSI (tmp_newval
, 0);
6921 CPU (h_nbit
) = opval
;
6922 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6925 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6926 CPU (h_zbit
) = opval
;
6927 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6930 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)));
6931 CPU (h_vbit
) = opval
;
6932 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6937 CPU (h_xbit
) = opval
;
6938 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6942 SET_H_INSN_PREFIXED_P (opval
);
6943 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6953 CASE (sem
, INSN_SUB_B_R
) : /* sub.b $Rs,$Rd */
6955 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6957 #define FLD(f) abuf->fields.sfmt_add_b_r.f
6958 int UNUSED written
= 0;
6959 IADDR UNUSED pc
= abuf
->addr
;
6960 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6967 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
6968 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6969 tmp_carry
= CPU (h_cbit
);
6970 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6973 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
6975 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
6976 SET_H_GR (FLD (f_operand2
), opval
);
6977 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6982 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))));
6983 CPU (h_cbit
) = opval
;
6984 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6987 BI opval
= LTQI (tmp_newval
, 0);
6988 CPU (h_nbit
) = opval
;
6989 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6992 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6993 CPU (h_zbit
) = opval
;
6994 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6997 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)));
6998 CPU (h_vbit
) = opval
;
6999 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7004 CPU (h_xbit
) = opval
;
7005 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7009 SET_H_INSN_PREFIXED_P (opval
);
7010 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7020 CASE (sem
, INSN_SUB_W_R
) : /* sub.w $Rs,$Rd */
7022 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7023 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7024 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7025 int UNUSED written
= 0;
7026 IADDR UNUSED pc
= abuf
->addr
;
7027 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7034 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7035 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7036 tmp_carry
= CPU (h_cbit
);
7037 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7040 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7042 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7043 SET_H_GR (FLD (f_operand2
), opval
);
7044 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7049 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))));
7050 CPU (h_cbit
) = opval
;
7051 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7054 BI opval
= LTHI (tmp_newval
, 0);
7055 CPU (h_nbit
) = opval
;
7056 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7059 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7060 CPU (h_zbit
) = opval
;
7061 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7064 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)));
7065 CPU (h_vbit
) = opval
;
7066 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7071 CPU (h_xbit
) = opval
;
7072 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7076 SET_H_INSN_PREFIXED_P (opval
);
7077 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7087 CASE (sem
, INSN_SUB_D_R
) : /* sub.d $Rs,$Rd */
7089 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7090 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7091 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7092 int UNUSED written
= 0;
7093 IADDR UNUSED pc
= abuf
->addr
;
7094 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7101 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7102 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7103 tmp_carry
= CPU (h_cbit
);
7104 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7106 SI opval
= tmp_newval
;
7107 SET_H_GR (FLD (f_operand2
), opval
);
7108 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7112 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))));
7113 CPU (h_cbit
) = opval
;
7114 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7117 BI opval
= LTSI (tmp_newval
, 0);
7118 CPU (h_nbit
) = opval
;
7119 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7122 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7123 CPU (h_zbit
) = opval
;
7124 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7127 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)));
7128 CPU (h_vbit
) = opval
;
7129 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7134 CPU (h_xbit
) = opval
;
7135 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7139 SET_H_INSN_PREFIXED_P (opval
);
7140 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7150 CASE (sem
, INSN_SUB_M_B_M
) : /* sub-m.b [${Rs}${inc}],${Rd} */
7152 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7153 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7154 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7155 int UNUSED written
= 0;
7156 IADDR UNUSED pc
= abuf
->addr
;
7157 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7164 tmp_tmpops
= ({ SI tmp_addr
;
7167 tmp_postinc
= FLD (f_memmode
);
7168 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7169 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7170 ; if (NEBI (tmp_postinc
, 0)) {
7172 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7173 tmp_addr
= ADDSI (tmp_addr
, 1);
7176 SI opval
= tmp_addr
;
7177 SET_H_GR (FLD (f_operand1
), opval
);
7178 written
|= (1 << 12);
7179 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7184 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7185 tmp_carry
= CPU (h_cbit
);
7186 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7189 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7191 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7192 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7193 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7198 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))));
7199 CPU (h_cbit
) = opval
;
7200 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7203 BI opval
= LTQI (tmp_newval
, 0);
7204 CPU (h_nbit
) = opval
;
7205 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7208 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7209 CPU (h_zbit
) = opval
;
7210 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7213 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)));
7214 CPU (h_vbit
) = opval
;
7215 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7220 CPU (h_xbit
) = opval
;
7221 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7225 SET_H_INSN_PREFIXED_P (opval
);
7226 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7232 abuf
->written
= written
;
7237 CASE (sem
, INSN_SUB_M_W_M
) : /* sub-m.w [${Rs}${inc}],${Rd} */
7239 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7240 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7241 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7242 int UNUSED written
= 0;
7243 IADDR UNUSED pc
= abuf
->addr
;
7244 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7251 tmp_tmpops
= ({ SI tmp_addr
;
7254 tmp_postinc
= FLD (f_memmode
);
7255 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7256 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7257 ; if (NEBI (tmp_postinc
, 0)) {
7259 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7260 tmp_addr
= ADDSI (tmp_addr
, 2);
7263 SI opval
= tmp_addr
;
7264 SET_H_GR (FLD (f_operand1
), opval
);
7265 written
|= (1 << 12);
7266 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7271 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7272 tmp_carry
= CPU (h_cbit
);
7273 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7276 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7278 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7279 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7280 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7285 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))));
7286 CPU (h_cbit
) = opval
;
7287 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7290 BI opval
= LTHI (tmp_newval
, 0);
7291 CPU (h_nbit
) = opval
;
7292 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7295 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7296 CPU (h_zbit
) = opval
;
7297 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7300 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)));
7301 CPU (h_vbit
) = opval
;
7302 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7307 CPU (h_xbit
) = opval
;
7308 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7312 SET_H_INSN_PREFIXED_P (opval
);
7313 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7319 abuf
->written
= written
;
7324 CASE (sem
, INSN_SUB_M_D_M
) : /* sub-m.d [${Rs}${inc}],${Rd} */
7326 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7327 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7328 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7329 int UNUSED written
= 0;
7330 IADDR UNUSED pc
= abuf
->addr
;
7331 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7338 tmp_tmpops
= ({ SI tmp_addr
;
7341 tmp_postinc
= FLD (f_memmode
);
7342 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7343 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
7344 ; if (NEBI (tmp_postinc
, 0)) {
7346 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7347 tmp_addr
= ADDSI (tmp_addr
, 4);
7350 SI opval
= tmp_addr
;
7351 SET_H_GR (FLD (f_operand1
), opval
);
7352 written
|= (1 << 11);
7353 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7358 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7359 tmp_carry
= CPU (h_cbit
);
7360 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7362 SI opval
= tmp_newval
;
7363 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7364 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7368 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))));
7369 CPU (h_cbit
) = opval
;
7370 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7373 BI opval
= LTSI (tmp_newval
, 0);
7374 CPU (h_nbit
) = opval
;
7375 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7378 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7379 CPU (h_zbit
) = opval
;
7380 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7383 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)));
7384 CPU (h_vbit
) = opval
;
7385 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7390 CPU (h_xbit
) = opval
;
7391 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7395 SET_H_INSN_PREFIXED_P (opval
);
7396 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7402 abuf
->written
= written
;
7407 CASE (sem
, INSN_SUBCBR
) : /* sub.b ${sconst8}],${Rd} */
7409 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7410 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7411 #define FLD(f) abuf->fields.sfmt_addcbr.f
7412 int UNUSED written
= 0;
7413 IADDR UNUSED pc
= abuf
->addr
;
7414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7421 tmp_tmpops
= FLD (f_indir_pc__byte
);
7422 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7423 tmp_carry
= CPU (h_cbit
);
7424 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7427 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7429 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7430 SET_H_GR (FLD (f_operand2
), opval
);
7431 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7436 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))));
7437 CPU (h_cbit
) = opval
;
7438 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7441 BI opval
= LTQI (tmp_newval
, 0);
7442 CPU (h_nbit
) = opval
;
7443 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7446 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7447 CPU (h_zbit
) = opval
;
7448 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7451 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)));
7452 CPU (h_vbit
) = opval
;
7453 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7458 CPU (h_xbit
) = opval
;
7459 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7463 SET_H_INSN_PREFIXED_P (opval
);
7464 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7474 CASE (sem
, INSN_SUBCWR
) : /* sub.w ${sconst16}],${Rd} */
7476 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7477 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7478 #define FLD(f) abuf->fields.sfmt_addcwr.f
7479 int UNUSED written
= 0;
7480 IADDR UNUSED pc
= abuf
->addr
;
7481 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7488 tmp_tmpops
= FLD (f_indir_pc__word
);
7489 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7490 tmp_carry
= CPU (h_cbit
);
7491 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7494 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
7496 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7497 SET_H_GR (FLD (f_operand2
), opval
);
7498 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7503 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))));
7504 CPU (h_cbit
) = opval
;
7505 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7508 BI opval
= LTHI (tmp_newval
, 0);
7509 CPU (h_nbit
) = opval
;
7510 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7513 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7514 CPU (h_zbit
) = opval
;
7515 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7518 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)));
7519 CPU (h_vbit
) = opval
;
7520 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7525 CPU (h_xbit
) = opval
;
7526 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7530 SET_H_INSN_PREFIXED_P (opval
);
7531 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7541 CASE (sem
, INSN_SUBCDR
) : /* sub.d ${const32}],${Rd} */
7543 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7544 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7545 #define FLD(f) abuf->fields.sfmt_addcdr.f
7546 int UNUSED written
= 0;
7547 IADDR UNUSED pc
= abuf
->addr
;
7548 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
7555 tmp_tmpops
= FLD (f_indir_pc__dword
);
7556 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7557 tmp_carry
= CPU (h_cbit
);
7558 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7560 SI opval
= tmp_newval
;
7561 SET_H_GR (FLD (f_operand2
), opval
);
7562 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7566 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))));
7567 CPU (h_cbit
) = opval
;
7568 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7571 BI opval
= LTSI (tmp_newval
, 0);
7572 CPU (h_nbit
) = opval
;
7573 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7576 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7577 CPU (h_zbit
) = opval
;
7578 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7581 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)));
7582 CPU (h_vbit
) = opval
;
7583 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7588 CPU (h_xbit
) = opval
;
7589 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7593 SET_H_INSN_PREFIXED_P (opval
);
7594 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7604 CASE (sem
, INSN_SUBS_B_R
) : /* subs.b $Rs,$Rd */
7606 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7607 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7608 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7609 int UNUSED written
= 0;
7610 IADDR UNUSED pc
= abuf
->addr
;
7611 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7618 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
7619 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7620 tmp_carry
= CPU (h_cbit
);
7621 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7623 SI opval
= tmp_newval
;
7624 SET_H_GR (FLD (f_operand2
), opval
);
7625 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7629 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))));
7630 CPU (h_cbit
) = opval
;
7631 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7634 BI opval
= LTSI (tmp_newval
, 0);
7635 CPU (h_nbit
) = opval
;
7636 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7639 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7640 CPU (h_zbit
) = opval
;
7641 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7644 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)));
7645 CPU (h_vbit
) = opval
;
7646 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7651 CPU (h_xbit
) = opval
;
7652 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7656 SET_H_INSN_PREFIXED_P (opval
);
7657 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7667 CASE (sem
, INSN_SUBS_W_R
) : /* subs.w $Rs,$Rd */
7669 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7670 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7671 #define FLD(f) abuf->fields.sfmt_add_b_r.f
7672 int UNUSED written
= 0;
7673 IADDR UNUSED pc
= abuf
->addr
;
7674 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7681 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
7682 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7683 tmp_carry
= CPU (h_cbit
);
7684 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7686 SI opval
= tmp_newval
;
7687 SET_H_GR (FLD (f_operand2
), opval
);
7688 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7692 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))));
7693 CPU (h_cbit
) = opval
;
7694 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7697 BI opval
= LTSI (tmp_newval
, 0);
7698 CPU (h_nbit
) = opval
;
7699 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7702 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7703 CPU (h_zbit
) = opval
;
7704 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7707 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)));
7708 CPU (h_vbit
) = opval
;
7709 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7714 CPU (h_xbit
) = opval
;
7715 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7719 SET_H_INSN_PREFIXED_P (opval
);
7720 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7730 CASE (sem
, INSN_SUBS_M_B_M
) : /* subs-m.b [${Rs}${inc}],$Rd */
7732 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7733 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7734 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7735 int UNUSED written
= 0;
7736 IADDR UNUSED pc
= abuf
->addr
;
7737 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7744 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
7747 tmp_postinc
= FLD (f_memmode
);
7748 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7749 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7750 ; if (NEBI (tmp_postinc
, 0)) {
7752 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7753 tmp_addr
= ADDSI (tmp_addr
, 1);
7756 SI opval
= tmp_addr
;
7757 SET_H_GR (FLD (f_operand1
), opval
);
7758 written
|= (1 << 11);
7759 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7764 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7765 tmp_carry
= CPU (h_cbit
);
7766 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7768 SI opval
= tmp_newval
;
7769 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7770 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7774 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))));
7775 CPU (h_cbit
) = opval
;
7776 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7779 BI opval
= LTSI (tmp_newval
, 0);
7780 CPU (h_nbit
) = opval
;
7781 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7784 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7785 CPU (h_zbit
) = opval
;
7786 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7789 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)));
7790 CPU (h_vbit
) = opval
;
7791 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7796 CPU (h_xbit
) = opval
;
7797 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7801 SET_H_INSN_PREFIXED_P (opval
);
7802 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7808 abuf
->written
= written
;
7813 CASE (sem
, INSN_SUBS_M_W_M
) : /* subs-m.w [${Rs}${inc}],$Rd */
7815 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7816 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7817 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7818 int UNUSED written
= 0;
7819 IADDR UNUSED pc
= abuf
->addr
;
7820 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7827 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
7830 tmp_postinc
= FLD (f_memmode
);
7831 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
7832 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7833 ; if (NEBI (tmp_postinc
, 0)) {
7835 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7836 tmp_addr
= ADDSI (tmp_addr
, 2);
7839 SI opval
= tmp_addr
;
7840 SET_H_GR (FLD (f_operand1
), opval
);
7841 written
|= (1 << 11);
7842 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7847 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7848 tmp_carry
= CPU (h_cbit
);
7849 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7851 SI opval
= tmp_newval
;
7852 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7853 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7857 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))));
7858 CPU (h_cbit
) = opval
;
7859 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7862 BI opval
= LTSI (tmp_newval
, 0);
7863 CPU (h_nbit
) = opval
;
7864 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7867 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7868 CPU (h_zbit
) = opval
;
7869 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7872 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)));
7873 CPU (h_vbit
) = opval
;
7874 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7879 CPU (h_xbit
) = opval
;
7880 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7884 SET_H_INSN_PREFIXED_P (opval
);
7885 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7891 abuf
->written
= written
;
7896 CASE (sem
, INSN_SUBSCBR
) : /* [${Rs}${inc}],$Rd */
7898 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7899 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7900 #define FLD(f) abuf->fields.sfmt_addcbr.f
7901 int UNUSED written
= 0;
7902 IADDR UNUSED pc
= abuf
->addr
;
7903 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7910 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
7911 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7912 tmp_carry
= CPU (h_cbit
);
7913 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7915 SI opval
= tmp_newval
;
7916 SET_H_GR (FLD (f_operand2
), opval
);
7917 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7921 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))));
7922 CPU (h_cbit
) = opval
;
7923 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7926 BI opval
= LTSI (tmp_newval
, 0);
7927 CPU (h_nbit
) = opval
;
7928 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7931 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7932 CPU (h_zbit
) = opval
;
7933 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7936 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)));
7937 CPU (h_vbit
) = opval
;
7938 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7943 CPU (h_xbit
) = opval
;
7944 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7948 SET_H_INSN_PREFIXED_P (opval
);
7949 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7959 CASE (sem
, INSN_SUBSCWR
) : /* [${Rs}${inc}],$Rd */
7961 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7962 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7963 #define FLD(f) abuf->fields.sfmt_addcwr.f
7964 int UNUSED written
= 0;
7965 IADDR UNUSED pc
= abuf
->addr
;
7966 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7973 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
7974 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7975 tmp_carry
= CPU (h_cbit
);
7976 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7978 SI opval
= tmp_newval
;
7979 SET_H_GR (FLD (f_operand2
), opval
);
7980 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7984 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))));
7985 CPU (h_cbit
) = opval
;
7986 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7989 BI opval
= LTSI (tmp_newval
, 0);
7990 CPU (h_nbit
) = opval
;
7991 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7994 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7995 CPU (h_zbit
) = opval
;
7996 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7999 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)));
8000 CPU (h_vbit
) = opval
;
8001 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8006 CPU (h_xbit
) = opval
;
8007 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8011 SET_H_INSN_PREFIXED_P (opval
);
8012 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8022 CASE (sem
, INSN_SUBU_B_R
) : /* subu.b $Rs,$Rd */
8024 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8025 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8026 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8027 int UNUSED written
= 0;
8028 IADDR UNUSED pc
= abuf
->addr
;
8029 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8036 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
8037 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8038 tmp_carry
= CPU (h_cbit
);
8039 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8041 SI opval
= tmp_newval
;
8042 SET_H_GR (FLD (f_operand2
), opval
);
8043 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8047 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))));
8048 CPU (h_cbit
) = opval
;
8049 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8052 BI opval
= LTSI (tmp_newval
, 0);
8053 CPU (h_nbit
) = opval
;
8054 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8057 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8058 CPU (h_zbit
) = opval
;
8059 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8062 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)));
8063 CPU (h_vbit
) = opval
;
8064 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8069 CPU (h_xbit
) = opval
;
8070 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8074 SET_H_INSN_PREFIXED_P (opval
);
8075 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8085 CASE (sem
, INSN_SUBU_W_R
) : /* subu.w $Rs,$Rd */
8087 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8088 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8089 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8090 int UNUSED written
= 0;
8091 IADDR UNUSED pc
= abuf
->addr
;
8092 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8099 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
8100 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8101 tmp_carry
= CPU (h_cbit
);
8102 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8104 SI opval
= tmp_newval
;
8105 SET_H_GR (FLD (f_operand2
), opval
);
8106 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8110 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))));
8111 CPU (h_cbit
) = opval
;
8112 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8115 BI opval
= LTSI (tmp_newval
, 0);
8116 CPU (h_nbit
) = opval
;
8117 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8120 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8121 CPU (h_zbit
) = opval
;
8122 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8125 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)));
8126 CPU (h_vbit
) = opval
;
8127 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8132 CPU (h_xbit
) = opval
;
8133 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8137 SET_H_INSN_PREFIXED_P (opval
);
8138 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8148 CASE (sem
, INSN_SUBU_M_B_M
) : /* subu-m.b [${Rs}${inc}],$Rd */
8150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8152 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8153 int UNUSED written
= 0;
8154 IADDR UNUSED pc
= abuf
->addr
;
8155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8162 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
8165 tmp_postinc
= FLD (f_memmode
);
8166 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8167 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8168 ; if (NEBI (tmp_postinc
, 0)) {
8170 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8171 tmp_addr
= ADDSI (tmp_addr
, 1);
8174 SI opval
= tmp_addr
;
8175 SET_H_GR (FLD (f_operand1
), opval
);
8176 written
|= (1 << 11);
8177 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8182 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8183 tmp_carry
= CPU (h_cbit
);
8184 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8186 SI opval
= tmp_newval
;
8187 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8188 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8192 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))));
8193 CPU (h_cbit
) = opval
;
8194 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8197 BI opval
= LTSI (tmp_newval
, 0);
8198 CPU (h_nbit
) = opval
;
8199 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8202 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8203 CPU (h_zbit
) = opval
;
8204 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8207 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)));
8208 CPU (h_vbit
) = opval
;
8209 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8214 CPU (h_xbit
) = opval
;
8215 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8219 SET_H_INSN_PREFIXED_P (opval
);
8220 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8226 abuf
->written
= written
;
8231 CASE (sem
, INSN_SUBU_M_W_M
) : /* subu-m.w [${Rs}${inc}],$Rd */
8233 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8234 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8235 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8236 int UNUSED written
= 0;
8237 IADDR UNUSED pc
= abuf
->addr
;
8238 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8245 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
8248 tmp_postinc
= FLD (f_memmode
);
8249 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8250 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8251 ; if (NEBI (tmp_postinc
, 0)) {
8253 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8254 tmp_addr
= ADDSI (tmp_addr
, 2);
8257 SI opval
= tmp_addr
;
8258 SET_H_GR (FLD (f_operand1
), opval
);
8259 written
|= (1 << 11);
8260 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8265 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8266 tmp_carry
= CPU (h_cbit
);
8267 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8269 SI opval
= tmp_newval
;
8270 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8271 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8275 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))));
8276 CPU (h_cbit
) = opval
;
8277 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8280 BI opval
= LTSI (tmp_newval
, 0);
8281 CPU (h_nbit
) = opval
;
8282 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8285 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8286 CPU (h_zbit
) = opval
;
8287 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8290 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)));
8291 CPU (h_vbit
) = opval
;
8292 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8297 CPU (h_xbit
) = opval
;
8298 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8302 SET_H_INSN_PREFIXED_P (opval
);
8303 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8309 abuf
->written
= written
;
8314 CASE (sem
, INSN_SUBUCBR
) : /* [${Rs}${inc}],$Rd */
8316 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8317 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8318 #define FLD(f) abuf->fields.sfmt_addcbr.f
8319 int UNUSED written
= 0;
8320 IADDR UNUSED pc
= abuf
->addr
;
8321 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8328 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8329 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8330 tmp_carry
= CPU (h_cbit
);
8331 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8333 SI opval
= tmp_newval
;
8334 SET_H_GR (FLD (f_operand2
), opval
);
8335 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8339 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))));
8340 CPU (h_cbit
) = opval
;
8341 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8344 BI opval
= LTSI (tmp_newval
, 0);
8345 CPU (h_nbit
) = opval
;
8346 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8349 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8350 CPU (h_zbit
) = opval
;
8351 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8354 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)));
8355 CPU (h_vbit
) = opval
;
8356 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8361 CPU (h_xbit
) = opval
;
8362 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8366 SET_H_INSN_PREFIXED_P (opval
);
8367 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8377 CASE (sem
, INSN_SUBUCWR
) : /* [${Rs}${inc}],$Rd */
8379 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8380 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8381 #define FLD(f) abuf->fields.sfmt_addcwr.f
8382 int UNUSED written
= 0;
8383 IADDR UNUSED pc
= abuf
->addr
;
8384 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8391 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8392 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8393 tmp_carry
= CPU (h_cbit
);
8394 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8396 SI opval
= tmp_newval
;
8397 SET_H_GR (FLD (f_operand2
), opval
);
8398 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8402 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))));
8403 CPU (h_cbit
) = opval
;
8404 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8407 BI opval
= LTSI (tmp_newval
, 0);
8408 CPU (h_nbit
) = opval
;
8409 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8412 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8413 CPU (h_zbit
) = opval
;
8414 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8417 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)));
8418 CPU (h_vbit
) = opval
;
8419 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8424 CPU (h_xbit
) = opval
;
8425 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8429 SET_H_INSN_PREFIXED_P (opval
);
8430 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8440 CASE (sem
, INSN_ADDI_B_R
) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8442 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8443 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8444 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8445 int UNUSED written
= 0;
8446 IADDR UNUSED pc
= abuf
->addr
;
8447 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8451 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
8452 SET_H_GR (FLD (f_operand1
), opval
);
8453 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8458 CPU (h_xbit
) = opval
;
8459 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8463 SET_H_INSN_PREFIXED_P (opval
);
8464 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8473 CASE (sem
, INSN_ADDI_W_R
) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8475 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8476 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8477 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8478 int UNUSED written
= 0;
8479 IADDR UNUSED pc
= abuf
->addr
;
8480 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8484 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
8485 SET_H_GR (FLD (f_operand1
), opval
);
8486 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8491 CPU (h_xbit
) = opval
;
8492 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8496 SET_H_INSN_PREFIXED_P (opval
);
8497 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8506 CASE (sem
, INSN_ADDI_D_R
) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8508 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8509 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8510 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8511 int UNUSED written
= 0;
8512 IADDR UNUSED pc
= abuf
->addr
;
8513 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8517 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
8518 SET_H_GR (FLD (f_operand1
), opval
);
8519 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8524 CPU (h_xbit
) = opval
;
8525 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8529 SET_H_INSN_PREFIXED_P (opval
);
8530 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8539 CASE (sem
, INSN_NEG_B_R
) : /* neg.b $Rs,$Rd */
8541 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8542 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8543 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8544 int UNUSED written
= 0;
8545 IADDR UNUSED pc
= abuf
->addr
;
8546 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8553 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8555 tmp_carry
= CPU (h_cbit
);
8556 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8559 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
8561 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
8562 SET_H_GR (FLD (f_operand2
), opval
);
8563 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8568 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))));
8569 CPU (h_cbit
) = opval
;
8570 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8573 BI opval
= LTQI (tmp_newval
, 0);
8574 CPU (h_nbit
) = opval
;
8575 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8578 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8579 CPU (h_zbit
) = opval
;
8580 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8583 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)));
8584 CPU (h_vbit
) = opval
;
8585 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8590 CPU (h_xbit
) = opval
;
8591 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8595 SET_H_INSN_PREFIXED_P (opval
);
8596 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8606 CASE (sem
, INSN_NEG_W_R
) : /* neg.w $Rs,$Rd */
8608 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8609 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8610 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8611 int UNUSED written
= 0;
8612 IADDR UNUSED pc
= abuf
->addr
;
8613 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8620 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8622 tmp_carry
= CPU (h_cbit
);
8623 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8626 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
8628 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
8629 SET_H_GR (FLD (f_operand2
), opval
);
8630 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8635 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))));
8636 CPU (h_cbit
) = opval
;
8637 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8640 BI opval
= LTHI (tmp_newval
, 0);
8641 CPU (h_nbit
) = opval
;
8642 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8645 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8646 CPU (h_zbit
) = opval
;
8647 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8650 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)));
8651 CPU (h_vbit
) = opval
;
8652 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8657 CPU (h_xbit
) = opval
;
8658 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8662 SET_H_INSN_PREFIXED_P (opval
);
8663 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8673 CASE (sem
, INSN_NEG_D_R
) : /* neg.d $Rs,$Rd */
8675 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8676 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8677 #define FLD(f) abuf->fields.sfmt_add_b_r.f
8678 int UNUSED written
= 0;
8679 IADDR UNUSED pc
= abuf
->addr
;
8680 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8687 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8689 tmp_carry
= CPU (h_cbit
);
8690 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8692 SI opval
= tmp_newval
;
8693 SET_H_GR (FLD (f_operand2
), opval
);
8694 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8698 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))));
8699 CPU (h_cbit
) = opval
;
8700 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8703 BI opval
= LTSI (tmp_newval
, 0);
8704 CPU (h_nbit
) = opval
;
8705 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8708 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8709 CPU (h_zbit
) = opval
;
8710 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8713 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)));
8714 CPU (h_vbit
) = opval
;
8715 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8720 CPU (h_xbit
) = opval
;
8721 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8725 SET_H_INSN_PREFIXED_P (opval
);
8726 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8736 CASE (sem
, INSN_TEST_M_B_M
) : /* test-m.b [${Rs}${inc}] */
8738 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8740 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8741 int UNUSED written
= 0;
8742 IADDR UNUSED pc
= abuf
->addr
;
8743 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8747 tmp_tmpd
= ({ SI tmp_addr
;
8750 tmp_postinc
= FLD (f_memmode
);
8751 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8752 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8753 ; if (NEBI (tmp_postinc
, 0)) {
8755 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8756 tmp_addr
= ADDSI (tmp_addr
, 1);
8759 SI opval
= tmp_addr
;
8760 SET_H_GR (FLD (f_operand1
), opval
);
8761 written
|= (1 << 8);
8762 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8773 tmp_tmpopd
= tmp_tmpd
;
8774 tmp_carry
= CPU (h_cbit
);
8775 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8779 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))));
8780 CPU (h_cbit
) = opval
;
8781 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8784 BI opval
= LTQI (tmp_newval
, 0);
8785 CPU (h_nbit
) = opval
;
8786 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8789 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8790 CPU (h_zbit
) = opval
;
8791 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8794 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)));
8795 CPU (h_vbit
) = opval
;
8796 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8801 CPU (h_xbit
) = opval
;
8802 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8806 SET_H_INSN_PREFIXED_P (opval
);
8807 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8814 abuf
->written
= written
;
8819 CASE (sem
, INSN_TEST_M_W_M
) : /* test-m.w [${Rs}${inc}] */
8821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8823 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8824 int UNUSED written
= 0;
8825 IADDR UNUSED pc
= abuf
->addr
;
8826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8830 tmp_tmpd
= ({ SI tmp_addr
;
8833 tmp_postinc
= FLD (f_memmode
);
8834 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8835 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8836 ; if (NEBI (tmp_postinc
, 0)) {
8838 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8839 tmp_addr
= ADDSI (tmp_addr
, 2);
8842 SI opval
= tmp_addr
;
8843 SET_H_GR (FLD (f_operand1
), opval
);
8844 written
|= (1 << 8);
8845 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8856 tmp_tmpopd
= tmp_tmpd
;
8857 tmp_carry
= CPU (h_cbit
);
8858 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8862 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))));
8863 CPU (h_cbit
) = opval
;
8864 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8867 BI opval
= LTHI (tmp_newval
, 0);
8868 CPU (h_nbit
) = opval
;
8869 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8872 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8873 CPU (h_zbit
) = opval
;
8874 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8877 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)));
8878 CPU (h_vbit
) = opval
;
8879 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8884 CPU (h_xbit
) = opval
;
8885 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8889 SET_H_INSN_PREFIXED_P (opval
);
8890 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8897 abuf
->written
= written
;
8902 CASE (sem
, INSN_TEST_M_D_M
) : /* test-m.d [${Rs}${inc}] */
8904 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8905 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8906 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
8907 int UNUSED written
= 0;
8908 IADDR UNUSED pc
= abuf
->addr
;
8909 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8913 tmp_tmpd
= ({ SI tmp_addr
;
8916 tmp_postinc
= FLD (f_memmode
);
8917 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
8918 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
8919 ; if (NEBI (tmp_postinc
, 0)) {
8921 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8922 tmp_addr
= ADDSI (tmp_addr
, 4);
8925 SI opval
= tmp_addr
;
8926 SET_H_GR (FLD (f_operand1
), opval
);
8927 written
|= (1 << 8);
8928 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8939 tmp_tmpopd
= tmp_tmpd
;
8940 tmp_carry
= CPU (h_cbit
);
8941 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8945 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))));
8946 CPU (h_cbit
) = opval
;
8947 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8950 BI opval
= LTSI (tmp_newval
, 0);
8951 CPU (h_nbit
) = opval
;
8952 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8955 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8956 CPU (h_zbit
) = opval
;
8957 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8960 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)));
8961 CPU (h_vbit
) = opval
;
8962 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8967 CPU (h_xbit
) = opval
;
8968 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8972 SET_H_INSN_PREFIXED_P (opval
);
8973 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8980 abuf
->written
= written
;
8985 CASE (sem
, INSN_MOVE_R_M_B_M
) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
8987 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8989 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
8990 int UNUSED written
= 0;
8991 IADDR UNUSED pc
= abuf
->addr
;
8992 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8996 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9000 tmp_postinc
= FLD (f_memmode
);
9001 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9002 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
9003 if (EQBI (CPU (h_pbit
), 0)) {
9006 QI opval
= tmp_tmpd
;
9007 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9008 written
|= (1 << 10);
9009 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9012 BI opval
= CPU (h_pbit
);
9013 CPU (h_cbit
) = opval
;
9014 written
|= (1 << 9);
9015 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9021 CPU (h_cbit
) = opval
;
9022 written
|= (1 << 9);
9023 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9028 QI opval
= tmp_tmpd
;
9029 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9030 written
|= (1 << 10);
9031 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9034 if (NEBI (tmp_postinc
, 0)) {
9036 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9037 tmp_addr
= ADDSI (tmp_addr
, 1);
9040 SI opval
= tmp_addr
;
9041 SET_H_GR (FLD (f_operand1
), opval
);
9042 written
|= (1 << 8);
9043 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9051 CPU (h_xbit
) = opval
;
9052 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9056 SET_H_INSN_PREFIXED_P (opval
);
9057 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9062 abuf
->written
= written
;
9067 CASE (sem
, INSN_MOVE_R_M_W_M
) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9069 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9070 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9071 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9072 int UNUSED written
= 0;
9073 IADDR UNUSED pc
= abuf
->addr
;
9074 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9078 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9082 tmp_postinc
= FLD (f_memmode
);
9083 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9084 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
9085 if (EQBI (CPU (h_pbit
), 0)) {
9088 HI opval
= tmp_tmpd
;
9089 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9090 written
|= (1 << 10);
9091 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9094 BI opval
= CPU (h_pbit
);
9095 CPU (h_cbit
) = opval
;
9096 written
|= (1 << 9);
9097 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9103 CPU (h_cbit
) = opval
;
9104 written
|= (1 << 9);
9105 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9110 HI opval
= tmp_tmpd
;
9111 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9112 written
|= (1 << 10);
9113 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9116 if (NEBI (tmp_postinc
, 0)) {
9118 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9119 tmp_addr
= ADDSI (tmp_addr
, 2);
9122 SI opval
= tmp_addr
;
9123 SET_H_GR (FLD (f_operand1
), opval
);
9124 written
|= (1 << 8);
9125 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9133 CPU (h_xbit
) = opval
;
9134 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9138 SET_H_INSN_PREFIXED_P (opval
);
9139 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9144 abuf
->written
= written
;
9149 CASE (sem
, INSN_MOVE_R_M_D_M
) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9151 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9152 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9153 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
9154 int UNUSED written
= 0;
9155 IADDR UNUSED pc
= abuf
->addr
;
9156 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9160 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9164 tmp_postinc
= FLD (f_memmode
);
9165 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9166 if (ANDIF (GET_H_V32_NON_V32 (), NEBI (CPU (h_xbit
), 0))) {
9167 if (EQBI (CPU (h_pbit
), 0)) {
9170 SI opval
= tmp_tmpd
;
9171 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9172 written
|= (1 << 10);
9173 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9176 BI opval
= CPU (h_pbit
);
9177 CPU (h_cbit
) = opval
;
9178 written
|= (1 << 9);
9179 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9185 CPU (h_cbit
) = opval
;
9186 written
|= (1 << 9);
9187 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9192 SI opval
= tmp_tmpd
;
9193 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9194 written
|= (1 << 10);
9195 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9198 if (NEBI (tmp_postinc
, 0)) {
9200 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9201 tmp_addr
= ADDSI (tmp_addr
, 4);
9204 SI opval
= tmp_addr
;
9205 SET_H_GR (FLD (f_operand1
), opval
);
9206 written
|= (1 << 8);
9207 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9215 CPU (h_xbit
) = opval
;
9216 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9220 SET_H_INSN_PREFIXED_P (opval
);
9221 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9226 abuf
->written
= written
;
9231 CASE (sem
, INSN_MULS_B
) : /* muls.b $Rs,$Rd */
9233 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9234 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9235 #define FLD(f) abuf->fields.sfmt_muls_b.f
9236 int UNUSED written
= 0;
9237 IADDR UNUSED pc
= abuf
->addr
;
9238 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9244 tmp_src1
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9245 tmp_src2
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9246 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9248 SI opval
= TRUNCDISI (tmp_tmpr
);
9249 SET_H_GR (FLD (f_operand2
), opval
);
9250 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9253 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9254 SET_H_SR (((UINT
) 7), opval
);
9255 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9259 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9260 CPU (h_cbit
) = opval
;
9261 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9264 BI opval
= LTDI (tmp_tmpr
, 0);
9265 CPU (h_nbit
) = opval
;
9266 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9269 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9270 CPU (h_zbit
) = opval
;
9271 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9274 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9275 CPU (h_vbit
) = opval
;
9276 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9281 CPU (h_xbit
) = opval
;
9282 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9286 SET_H_INSN_PREFIXED_P (opval
);
9287 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9297 CASE (sem
, INSN_MULS_W
) : /* muls.w $Rs,$Rd */
9299 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9300 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9301 #define FLD(f) abuf->fields.sfmt_muls_b.f
9302 int UNUSED written
= 0;
9303 IADDR UNUSED pc
= abuf
->addr
;
9304 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9310 tmp_src1
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9311 tmp_src2
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9312 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9314 SI opval
= TRUNCDISI (tmp_tmpr
);
9315 SET_H_GR (FLD (f_operand2
), opval
);
9316 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9319 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9320 SET_H_SR (((UINT
) 7), opval
);
9321 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9325 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9326 CPU (h_cbit
) = opval
;
9327 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9330 BI opval
= LTDI (tmp_tmpr
, 0);
9331 CPU (h_nbit
) = opval
;
9332 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9335 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9336 CPU (h_zbit
) = opval
;
9337 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9340 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9341 CPU (h_vbit
) = opval
;
9342 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9347 CPU (h_xbit
) = opval
;
9348 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9352 SET_H_INSN_PREFIXED_P (opval
);
9353 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9363 CASE (sem
, INSN_MULS_D
) : /* muls.d $Rs,$Rd */
9365 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9366 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9367 #define FLD(f) abuf->fields.sfmt_muls_b.f
9368 int UNUSED written
= 0;
9369 IADDR UNUSED pc
= abuf
->addr
;
9370 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9376 tmp_src1
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9377 tmp_src2
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9378 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9380 SI opval
= TRUNCDISI (tmp_tmpr
);
9381 SET_H_GR (FLD (f_operand2
), opval
);
9382 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9385 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9386 SET_H_SR (((UINT
) 7), opval
);
9387 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9391 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9392 CPU (h_cbit
) = opval
;
9393 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9396 BI opval
= LTDI (tmp_tmpr
, 0);
9397 CPU (h_nbit
) = opval
;
9398 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9401 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9402 CPU (h_zbit
) = opval
;
9403 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9406 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9407 CPU (h_vbit
) = opval
;
9408 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9413 CPU (h_xbit
) = opval
;
9414 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9418 SET_H_INSN_PREFIXED_P (opval
);
9419 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9429 CASE (sem
, INSN_MULU_B
) : /* mulu.b $Rs,$Rd */
9431 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9432 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9433 #define FLD(f) abuf->fields.sfmt_muls_b.f
9434 int UNUSED written
= 0;
9435 IADDR UNUSED pc
= abuf
->addr
;
9436 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9442 tmp_src1
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9443 tmp_src2
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9444 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9446 SI opval
= TRUNCDISI (tmp_tmpr
);
9447 SET_H_GR (FLD (f_operand2
), opval
);
9448 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9451 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9452 SET_H_SR (((UINT
) 7), opval
);
9453 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9457 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9458 CPU (h_cbit
) = opval
;
9459 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9462 BI opval
= LTDI (tmp_tmpr
, 0);
9463 CPU (h_nbit
) = opval
;
9464 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9467 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9468 CPU (h_zbit
) = opval
;
9469 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9472 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9473 CPU (h_vbit
) = opval
;
9474 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9479 CPU (h_xbit
) = opval
;
9480 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9484 SET_H_INSN_PREFIXED_P (opval
);
9485 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9495 CASE (sem
, INSN_MULU_W
) : /* mulu.w $Rs,$Rd */
9497 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9498 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9499 #define FLD(f) abuf->fields.sfmt_muls_b.f
9500 int UNUSED written
= 0;
9501 IADDR UNUSED pc
= abuf
->addr
;
9502 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9508 tmp_src1
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9509 tmp_src2
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9510 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9512 SI opval
= TRUNCDISI (tmp_tmpr
);
9513 SET_H_GR (FLD (f_operand2
), opval
);
9514 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9517 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9518 SET_H_SR (((UINT
) 7), opval
);
9519 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9523 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9524 CPU (h_cbit
) = opval
;
9525 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9528 BI opval
= LTDI (tmp_tmpr
, 0);
9529 CPU (h_nbit
) = opval
;
9530 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9533 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9534 CPU (h_zbit
) = opval
;
9535 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9538 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9539 CPU (h_vbit
) = opval
;
9540 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9545 CPU (h_xbit
) = opval
;
9546 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9550 SET_H_INSN_PREFIXED_P (opval
);
9551 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9561 CASE (sem
, INSN_MULU_D
) : /* mulu.d $Rs,$Rd */
9563 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9564 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9565 #define FLD(f) abuf->fields.sfmt_muls_b.f
9566 int UNUSED written
= 0;
9567 IADDR UNUSED pc
= abuf
->addr
;
9568 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9574 tmp_src1
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9575 tmp_src2
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9576 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9578 SI opval
= TRUNCDISI (tmp_tmpr
);
9579 SET_H_GR (FLD (f_operand2
), opval
);
9580 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9583 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9584 SET_H_SR (((UINT
) 7), opval
);
9585 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9589 BI opval
= ANDIF (GET_H_V32_NON_V32 (), CPU (h_cbit
));
9590 CPU (h_cbit
) = opval
;
9591 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9594 BI opval
= LTDI (tmp_tmpr
, 0);
9595 CPU (h_nbit
) = opval
;
9596 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9599 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9600 CPU (h_zbit
) = opval
;
9601 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9604 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9605 CPU (h_vbit
) = opval
;
9606 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9611 CPU (h_xbit
) = opval
;
9612 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9616 SET_H_INSN_PREFIXED_P (opval
);
9617 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9627 CASE (sem
, INSN_MSTEP
) : /* mstep $Rs,$Rd */
9629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9631 #define FLD(f) abuf->fields.sfmt_muls_b.f
9632 int UNUSED written
= 0;
9633 IADDR UNUSED pc
= abuf
->addr
;
9634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9639 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9640 tmp_tmpd
= ADDSI (SLLSI (GET_H_GR (FLD (f_operand2
)), 1), ((CPU (h_nbit
)) ? (tmp_tmps
) : (0)));
9642 SI opval
= tmp_tmpd
;
9643 SET_H_GR (FLD (f_operand2
), opval
);
9644 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9648 BI opval
= LTSI (tmp_tmpd
, 0);
9649 CPU (h_nbit
) = opval
;
9650 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9653 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9654 CPU (h_zbit
) = opval
;
9655 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9657 SET_H_CBIT_MOVE (0);
9658 SET_H_VBIT_MOVE (0);
9662 CPU (h_xbit
) = opval
;
9663 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9667 SET_H_INSN_PREFIXED_P (opval
);
9668 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9678 CASE (sem
, INSN_DSTEP
) : /* dstep $Rs,$Rd */
9680 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9681 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9682 #define FLD(f) abuf->fields.sfmt_muls_b.f
9683 int UNUSED written
= 0;
9684 IADDR UNUSED pc
= abuf
->addr
;
9685 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9691 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9692 tmp_tmp
= SLLSI (GET_H_GR (FLD (f_operand2
)), 1);
9693 tmp_tmpd
= ((GEUSI (tmp_tmp
, tmp_tmps
)) ? (SUBSI (tmp_tmp
, tmp_tmps
)) : (tmp_tmp
));
9695 SI opval
= tmp_tmpd
;
9696 SET_H_GR (FLD (f_operand2
), opval
);
9697 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9701 BI opval
= LTSI (tmp_tmpd
, 0);
9702 CPU (h_nbit
) = opval
;
9703 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9706 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9707 CPU (h_zbit
) = opval
;
9708 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9710 SET_H_CBIT_MOVE (0);
9711 SET_H_VBIT_MOVE (0);
9715 CPU (h_xbit
) = opval
;
9716 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9720 SET_H_INSN_PREFIXED_P (opval
);
9721 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9731 CASE (sem
, INSN_ABS
) : /* abs $Rs,$Rd */
9733 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9734 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9735 #define FLD(f) abuf->fields.sfmt_muls_b.f
9736 int UNUSED written
= 0;
9737 IADDR UNUSED pc
= abuf
->addr
;
9738 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9742 tmp_tmpd
= ABSSI (GET_H_GR (FLD (f_operand1
)));
9744 SI opval
= tmp_tmpd
;
9745 SET_H_GR (FLD (f_operand2
), opval
);
9746 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9750 BI opval
= LTSI (tmp_tmpd
, 0);
9751 CPU (h_nbit
) = opval
;
9752 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9755 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9756 CPU (h_zbit
) = opval
;
9757 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9759 SET_H_CBIT_MOVE (0);
9760 SET_H_VBIT_MOVE (0);
9764 CPU (h_xbit
) = opval
;
9765 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9769 SET_H_INSN_PREFIXED_P (opval
);
9770 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9780 CASE (sem
, INSN_AND_B_R
) : /* and.b $Rs,$Rd */
9782 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9783 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9784 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9785 int UNUSED written
= 0;
9786 IADDR UNUSED pc
= abuf
->addr
;
9787 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9791 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
9794 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
9796 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
9797 SET_H_GR (FLD (f_operand2
), opval
);
9798 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9803 BI opval
= LTQI (tmp_tmpd
, 0);
9804 CPU (h_nbit
) = opval
;
9805 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9808 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9809 CPU (h_zbit
) = opval
;
9810 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9812 SET_H_CBIT_MOVE (0);
9813 SET_H_VBIT_MOVE (0);
9817 CPU (h_xbit
) = opval
;
9818 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9822 SET_H_INSN_PREFIXED_P (opval
);
9823 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9833 CASE (sem
, INSN_AND_W_R
) : /* and.w $Rs,$Rd */
9835 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9836 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9837 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9838 int UNUSED written
= 0;
9839 IADDR UNUSED pc
= abuf
->addr
;
9840 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9844 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
9847 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
9849 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
9850 SET_H_GR (FLD (f_operand2
), opval
);
9851 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9856 BI opval
= LTHI (tmp_tmpd
, 0);
9857 CPU (h_nbit
) = opval
;
9858 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9861 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9862 CPU (h_zbit
) = opval
;
9863 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9865 SET_H_CBIT_MOVE (0);
9866 SET_H_VBIT_MOVE (0);
9870 CPU (h_xbit
) = opval
;
9871 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9875 SET_H_INSN_PREFIXED_P (opval
);
9876 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9886 CASE (sem
, INSN_AND_D_R
) : /* and.d $Rs,$Rd */
9888 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9889 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9890 #define FLD(f) abuf->fields.sfmt_add_b_r.f
9891 int UNUSED written
= 0;
9892 IADDR UNUSED pc
= abuf
->addr
;
9893 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9897 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
9899 SI opval
= tmp_tmpd
;
9900 SET_H_GR (FLD (f_operand2
), opval
);
9901 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9905 BI opval
= LTSI (tmp_tmpd
, 0);
9906 CPU (h_nbit
) = opval
;
9907 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9910 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9911 CPU (h_zbit
) = opval
;
9912 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9914 SET_H_CBIT_MOVE (0);
9915 SET_H_VBIT_MOVE (0);
9919 CPU (h_xbit
) = opval
;
9920 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9924 SET_H_INSN_PREFIXED_P (opval
);
9925 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9935 CASE (sem
, INSN_AND_M_B_M
) : /* and-m.b [${Rs}${inc}],${Rd} */
9937 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9938 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9939 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
9940 int UNUSED written
= 0;
9941 IADDR UNUSED pc
= abuf
->addr
;
9942 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9946 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
9949 tmp_postinc
= FLD (f_memmode
);
9950 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
9951 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
9952 ; if (NEBI (tmp_postinc
, 0)) {
9954 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9955 tmp_addr
= ADDSI (tmp_addr
, 1);
9958 SI opval
= tmp_addr
;
9959 SET_H_GR (FLD (f_operand1
), opval
);
9960 written
|= (1 << 11);
9961 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9968 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
9970 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
9971 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
9972 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9977 BI opval
= LTQI (tmp_tmpd
, 0);
9978 CPU (h_nbit
) = opval
;
9979 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9982 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9983 CPU (h_zbit
) = opval
;
9984 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9986 SET_H_CBIT_MOVE (0);
9987 SET_H_VBIT_MOVE (0);
9991 CPU (h_xbit
) = opval
;
9992 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9996 SET_H_INSN_PREFIXED_P (opval
);
9997 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10003 abuf
->written
= written
;
10008 CASE (sem
, INSN_AND_M_W_M
) : /* and-m.w [${Rs}${inc}],${Rd} */
10010 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10011 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10012 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10013 int UNUSED written
= 0;
10014 IADDR UNUSED pc
= abuf
->addr
;
10015 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10019 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10022 tmp_postinc
= FLD (f_memmode
);
10023 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10024 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10025 ; if (NEBI (tmp_postinc
, 0)) {
10027 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10028 tmp_addr
= ADDSI (tmp_addr
, 2);
10031 SI opval
= tmp_addr
;
10032 SET_H_GR (FLD (f_operand1
), opval
);
10033 written
|= (1 << 11);
10034 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10038 ; tmp_tmp_mem
; }));
10041 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10043 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10044 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10045 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10050 BI opval
= LTHI (tmp_tmpd
, 0);
10051 CPU (h_nbit
) = opval
;
10052 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10055 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10056 CPU (h_zbit
) = opval
;
10057 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10059 SET_H_CBIT_MOVE (0);
10060 SET_H_VBIT_MOVE (0);
10064 CPU (h_xbit
) = opval
;
10065 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10069 SET_H_INSN_PREFIXED_P (opval
);
10070 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10076 abuf
->written
= written
;
10081 CASE (sem
, INSN_AND_M_D_M
) : /* and-m.d [${Rs}${inc}],${Rd} */
10083 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10084 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10085 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10086 int UNUSED written
= 0;
10087 IADDR UNUSED pc
= abuf
->addr
;
10088 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10092 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10095 tmp_postinc
= FLD (f_memmode
);
10096 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10097 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10098 ; if (NEBI (tmp_postinc
, 0)) {
10100 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10101 tmp_addr
= ADDSI (tmp_addr
, 4);
10104 SI opval
= tmp_addr
;
10105 SET_H_GR (FLD (f_operand1
), opval
);
10106 written
|= (1 << 10);
10107 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10111 ; tmp_tmp_mem
; }));
10113 SI opval
= tmp_tmpd
;
10114 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10115 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10119 BI opval
= LTSI (tmp_tmpd
, 0);
10120 CPU (h_nbit
) = opval
;
10121 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10124 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10125 CPU (h_zbit
) = opval
;
10126 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10128 SET_H_CBIT_MOVE (0);
10129 SET_H_VBIT_MOVE (0);
10133 CPU (h_xbit
) = opval
;
10134 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10138 SET_H_INSN_PREFIXED_P (opval
);
10139 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10145 abuf
->written
= written
;
10150 CASE (sem
, INSN_ANDCBR
) : /* and.b ${sconst8}],${Rd} */
10152 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10153 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10154 #define FLD(f) abuf->fields.sfmt_addcbr.f
10155 int UNUSED written
= 0;
10156 IADDR UNUSED pc
= abuf
->addr
;
10157 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10161 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10164 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10166 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10167 SET_H_GR (FLD (f_operand2
), opval
);
10168 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10173 BI opval
= LTQI (tmp_tmpd
, 0);
10174 CPU (h_nbit
) = opval
;
10175 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10178 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10179 CPU (h_zbit
) = opval
;
10180 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10182 SET_H_CBIT_MOVE (0);
10183 SET_H_VBIT_MOVE (0);
10187 CPU (h_xbit
) = opval
;
10188 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10192 SET_H_INSN_PREFIXED_P (opval
);
10193 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10203 CASE (sem
, INSN_ANDCWR
) : /* and.w ${sconst16}],${Rd} */
10205 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10206 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10207 #define FLD(f) abuf->fields.sfmt_addcwr.f
10208 int UNUSED written
= 0;
10209 IADDR UNUSED pc
= abuf
->addr
;
10210 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10214 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10217 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10219 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10220 SET_H_GR (FLD (f_operand2
), opval
);
10221 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10226 BI opval
= LTHI (tmp_tmpd
, 0);
10227 CPU (h_nbit
) = opval
;
10228 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10231 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10232 CPU (h_zbit
) = opval
;
10233 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10235 SET_H_CBIT_MOVE (0);
10236 SET_H_VBIT_MOVE (0);
10240 CPU (h_xbit
) = opval
;
10241 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10245 SET_H_INSN_PREFIXED_P (opval
);
10246 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10256 CASE (sem
, INSN_ANDCDR
) : /* and.d ${const32}],${Rd} */
10258 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10259 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10260 #define FLD(f) abuf->fields.sfmt_addcdr.f
10261 int UNUSED written
= 0;
10262 IADDR UNUSED pc
= abuf
->addr
;
10263 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10267 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10269 SI opval
= tmp_tmpd
;
10270 SET_H_GR (FLD (f_operand2
), opval
);
10271 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10275 BI opval
= LTSI (tmp_tmpd
, 0);
10276 CPU (h_nbit
) = opval
;
10277 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10280 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10281 CPU (h_zbit
) = opval
;
10282 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10284 SET_H_CBIT_MOVE (0);
10285 SET_H_VBIT_MOVE (0);
10289 CPU (h_xbit
) = opval
;
10290 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10294 SET_H_INSN_PREFIXED_P (opval
);
10295 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10305 CASE (sem
, INSN_ANDQ
) : /* andq $i,$Rd */
10307 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10308 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10309 #define FLD(f) abuf->fields.sfmt_andq.f
10310 int UNUSED written
= 0;
10311 IADDR UNUSED pc
= abuf
->addr
;
10312 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10316 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10318 SI opval
= tmp_tmpd
;
10319 SET_H_GR (FLD (f_operand2
), opval
);
10320 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10324 BI opval
= LTSI (tmp_tmpd
, 0);
10325 CPU (h_nbit
) = opval
;
10326 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10329 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10330 CPU (h_zbit
) = opval
;
10331 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10333 SET_H_CBIT_MOVE (0);
10334 SET_H_VBIT_MOVE (0);
10338 CPU (h_xbit
) = opval
;
10339 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10343 SET_H_INSN_PREFIXED_P (opval
);
10344 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10354 CASE (sem
, INSN_ORR_B_R
) : /* orr.b $Rs,$Rd */
10356 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10357 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10358 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10359 int UNUSED written
= 0;
10360 IADDR UNUSED pc
= abuf
->addr
;
10361 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10365 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10368 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10370 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10371 SET_H_GR (FLD (f_operand2
), opval
);
10372 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10377 BI opval
= LTQI (tmp_tmpd
, 0);
10378 CPU (h_nbit
) = opval
;
10379 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10382 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10383 CPU (h_zbit
) = opval
;
10384 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10386 SET_H_CBIT_MOVE (0);
10387 SET_H_VBIT_MOVE (0);
10391 CPU (h_xbit
) = opval
;
10392 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10396 SET_H_INSN_PREFIXED_P (opval
);
10397 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10407 CASE (sem
, INSN_ORR_W_R
) : /* orr.w $Rs,$Rd */
10409 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10410 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10411 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10412 int UNUSED written
= 0;
10413 IADDR UNUSED pc
= abuf
->addr
;
10414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10418 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10421 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10423 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10424 SET_H_GR (FLD (f_operand2
), opval
);
10425 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10430 BI opval
= LTHI (tmp_tmpd
, 0);
10431 CPU (h_nbit
) = opval
;
10432 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10435 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10436 CPU (h_zbit
) = opval
;
10437 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10439 SET_H_CBIT_MOVE (0);
10440 SET_H_VBIT_MOVE (0);
10444 CPU (h_xbit
) = opval
;
10445 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10449 SET_H_INSN_PREFIXED_P (opval
);
10450 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10460 CASE (sem
, INSN_ORR_D_R
) : /* orr.d $Rs,$Rd */
10462 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10463 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10464 #define FLD(f) abuf->fields.sfmt_add_b_r.f
10465 int UNUSED written
= 0;
10466 IADDR UNUSED pc
= abuf
->addr
;
10467 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10471 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10473 SI opval
= tmp_tmpd
;
10474 SET_H_GR (FLD (f_operand2
), opval
);
10475 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10479 BI opval
= LTSI (tmp_tmpd
, 0);
10480 CPU (h_nbit
) = opval
;
10481 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10484 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10485 CPU (h_zbit
) = opval
;
10486 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10488 SET_H_CBIT_MOVE (0);
10489 SET_H_VBIT_MOVE (0);
10493 CPU (h_xbit
) = opval
;
10494 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10498 SET_H_INSN_PREFIXED_P (opval
);
10499 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10509 CASE (sem
, INSN_OR_M_B_M
) : /* or-m.b [${Rs}${inc}],${Rd} */
10511 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10512 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10513 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10514 int UNUSED written
= 0;
10515 IADDR UNUSED pc
= abuf
->addr
;
10516 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10520 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10523 tmp_postinc
= FLD (f_memmode
);
10524 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10525 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10526 ; if (NEBI (tmp_postinc
, 0)) {
10528 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10529 tmp_addr
= ADDSI (tmp_addr
, 1);
10532 SI opval
= tmp_addr
;
10533 SET_H_GR (FLD (f_operand1
), opval
);
10534 written
|= (1 << 11);
10535 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10539 ; tmp_tmp_mem
; }));
10542 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10544 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10545 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10546 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10551 BI opval
= LTQI (tmp_tmpd
, 0);
10552 CPU (h_nbit
) = opval
;
10553 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10556 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10557 CPU (h_zbit
) = opval
;
10558 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10560 SET_H_CBIT_MOVE (0);
10561 SET_H_VBIT_MOVE (0);
10565 CPU (h_xbit
) = opval
;
10566 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10570 SET_H_INSN_PREFIXED_P (opval
);
10571 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10577 abuf
->written
= written
;
10582 CASE (sem
, INSN_OR_M_W_M
) : /* or-m.w [${Rs}${inc}],${Rd} */
10584 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10585 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10586 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10587 int UNUSED written
= 0;
10588 IADDR UNUSED pc
= abuf
->addr
;
10589 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10593 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10596 tmp_postinc
= FLD (f_memmode
);
10597 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10598 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10599 ; if (NEBI (tmp_postinc
, 0)) {
10601 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10602 tmp_addr
= ADDSI (tmp_addr
, 2);
10605 SI opval
= tmp_addr
;
10606 SET_H_GR (FLD (f_operand1
), opval
);
10607 written
|= (1 << 11);
10608 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10612 ; tmp_tmp_mem
; }));
10615 tmp_oldregval
= GET_H_RAW_GR_PC (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10617 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10618 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10619 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10624 BI opval
= LTHI (tmp_tmpd
, 0);
10625 CPU (h_nbit
) = opval
;
10626 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10629 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10630 CPU (h_zbit
) = opval
;
10631 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10633 SET_H_CBIT_MOVE (0);
10634 SET_H_VBIT_MOVE (0);
10638 CPU (h_xbit
) = opval
;
10639 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10643 SET_H_INSN_PREFIXED_P (opval
);
10644 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10650 abuf
->written
= written
;
10655 CASE (sem
, INSN_OR_M_D_M
) : /* or-m.d [${Rs}${inc}],${Rd} */
10657 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10658 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10659 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10660 int UNUSED written
= 0;
10661 IADDR UNUSED pc
= abuf
->addr
;
10662 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10666 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10669 tmp_postinc
= FLD (f_memmode
);
10670 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
10671 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10672 ; if (NEBI (tmp_postinc
, 0)) {
10674 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10675 tmp_addr
= ADDSI (tmp_addr
, 4);
10678 SI opval
= tmp_addr
;
10679 SET_H_GR (FLD (f_operand1
), opval
);
10680 written
|= (1 << 10);
10681 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10685 ; tmp_tmp_mem
; }));
10687 SI opval
= tmp_tmpd
;
10688 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10689 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10693 BI opval
= LTSI (tmp_tmpd
, 0);
10694 CPU (h_nbit
) = opval
;
10695 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10698 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10699 CPU (h_zbit
) = opval
;
10700 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10702 SET_H_CBIT_MOVE (0);
10703 SET_H_VBIT_MOVE (0);
10707 CPU (h_xbit
) = opval
;
10708 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10712 SET_H_INSN_PREFIXED_P (opval
);
10713 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10719 abuf
->written
= written
;
10724 CASE (sem
, INSN_ORCBR
) : /* or.b ${sconst8}],${Rd} */
10726 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10727 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10728 #define FLD(f) abuf->fields.sfmt_addcbr.f
10729 int UNUSED written
= 0;
10730 IADDR UNUSED pc
= abuf
->addr
;
10731 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10735 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10738 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10740 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10741 SET_H_GR (FLD (f_operand2
), opval
);
10742 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10747 BI opval
= LTQI (tmp_tmpd
, 0);
10748 CPU (h_nbit
) = opval
;
10749 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10752 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10753 CPU (h_zbit
) = opval
;
10754 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10756 SET_H_CBIT_MOVE (0);
10757 SET_H_VBIT_MOVE (0);
10761 CPU (h_xbit
) = opval
;
10762 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10766 SET_H_INSN_PREFIXED_P (opval
);
10767 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10777 CASE (sem
, INSN_ORCWR
) : /* or.w ${sconst16}],${Rd} */
10779 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10780 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10781 #define FLD(f) abuf->fields.sfmt_addcwr.f
10782 int UNUSED written
= 0;
10783 IADDR UNUSED pc
= abuf
->addr
;
10784 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10788 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10791 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
10793 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10794 SET_H_GR (FLD (f_operand2
), opval
);
10795 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10800 BI opval
= LTHI (tmp_tmpd
, 0);
10801 CPU (h_nbit
) = opval
;
10802 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10805 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10806 CPU (h_zbit
) = opval
;
10807 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10809 SET_H_CBIT_MOVE (0);
10810 SET_H_VBIT_MOVE (0);
10814 CPU (h_xbit
) = opval
;
10815 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10819 SET_H_INSN_PREFIXED_P (opval
);
10820 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10830 CASE (sem
, INSN_ORCDR
) : /* or.d ${const32}],${Rd} */
10832 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10833 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10834 #define FLD(f) abuf->fields.sfmt_addcdr.f
10835 int UNUSED written
= 0;
10836 IADDR UNUSED pc
= abuf
->addr
;
10837 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10841 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10843 SI opval
= tmp_tmpd
;
10844 SET_H_GR (FLD (f_operand2
), opval
);
10845 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10849 BI opval
= LTSI (tmp_tmpd
, 0);
10850 CPU (h_nbit
) = opval
;
10851 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10854 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10855 CPU (h_zbit
) = opval
;
10856 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10858 SET_H_CBIT_MOVE (0);
10859 SET_H_VBIT_MOVE (0);
10863 CPU (h_xbit
) = opval
;
10864 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10868 SET_H_INSN_PREFIXED_P (opval
);
10869 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10879 CASE (sem
, INSN_ORQ
) : /* orq $i,$Rd */
10881 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10882 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10883 #define FLD(f) abuf->fields.sfmt_andq.f
10884 int UNUSED written
= 0;
10885 IADDR UNUSED pc
= abuf
->addr
;
10886 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10890 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10892 SI opval
= tmp_tmpd
;
10893 SET_H_GR (FLD (f_operand2
), opval
);
10894 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10898 BI opval
= LTSI (tmp_tmpd
, 0);
10899 CPU (h_nbit
) = opval
;
10900 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10903 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10904 CPU (h_zbit
) = opval
;
10905 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10907 SET_H_CBIT_MOVE (0);
10908 SET_H_VBIT_MOVE (0);
10912 CPU (h_xbit
) = opval
;
10913 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10917 SET_H_INSN_PREFIXED_P (opval
);
10918 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10928 CASE (sem
, INSN_XOR
) : /* xor $Rs,$Rd */
10930 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10931 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10932 #define FLD(f) abuf->fields.sfmt_muls_b.f
10933 int UNUSED written
= 0;
10934 IADDR UNUSED pc
= abuf
->addr
;
10935 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10939 tmp_tmpd
= XORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10941 SI opval
= tmp_tmpd
;
10942 SET_H_GR (FLD (f_operand2
), opval
);
10943 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10947 BI opval
= LTSI (tmp_tmpd
, 0);
10948 CPU (h_nbit
) = opval
;
10949 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10952 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10953 CPU (h_zbit
) = opval
;
10954 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10956 SET_H_CBIT_MOVE (0);
10957 SET_H_VBIT_MOVE (0);
10961 CPU (h_xbit
) = opval
;
10962 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10966 SET_H_INSN_PREFIXED_P (opval
);
10967 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10977 CASE (sem
, INSN_SWAP
) : /* swap${swapoption} ${Rs} */
10979 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10980 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10981 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
10982 int UNUSED written
= 0;
10983 IADDR UNUSED pc
= abuf
->addr
;
10984 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10989 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
10990 tmp_tmpd
= ({ SI tmp_tmpcode
;
10993 tmp_tmpcode
= FLD (f_operand2
);
10994 ; tmp_tmpval
= tmp_tmps
;
10995 ; if (EQSI (tmp_tmpcode
, 0)) {
10996 tmp_tmpres
= (cgen_rtx_error (current_cpu
, "SWAP without swap modifier isn't implemented"), 0);
10998 else if (EQSI (tmp_tmpcode
, 1)) {
10999 tmp_tmpres
= ({ SI tmp_tmpr
;
11000 tmp_tmpr
= tmp_tmpval
;
11001 ; 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)))))))); });
11003 else if (EQSI (tmp_tmpcode
, 2)) {
11004 tmp_tmpres
= ({ SI tmp_tmpb
;
11005 tmp_tmpb
= tmp_tmpval
;
11006 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11008 else if (EQSI (tmp_tmpcode
, 3)) {
11009 tmp_tmpres
= ({ SI tmp_tmpr
;
11010 tmp_tmpr
= ({ SI tmp_tmpb
;
11011 tmp_tmpb
= tmp_tmpval
;
11012 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11013 ; 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)))))))); });
11015 else if (EQSI (tmp_tmpcode
, 4)) {
11016 tmp_tmpres
= ({ SI tmp_tmpb
;
11017 tmp_tmpb
= tmp_tmpval
;
11018 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11020 else if (EQSI (tmp_tmpcode
, 5)) {
11021 tmp_tmpres
= ({ SI tmp_tmpr
;
11022 tmp_tmpr
= ({ SI tmp_tmpb
;
11023 tmp_tmpb
= tmp_tmpval
;
11024 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11025 ; 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)))))))); });
11027 else if (EQSI (tmp_tmpcode
, 6)) {
11028 tmp_tmpres
= ({ SI tmp_tmpb
;
11029 tmp_tmpb
= ({ SI tmp_tmpb
;
11030 tmp_tmpb
= tmp_tmpval
;
11031 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11032 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11034 else if (EQSI (tmp_tmpcode
, 7)) {
11035 tmp_tmpres
= ({ SI tmp_tmpr
;
11036 tmp_tmpr
= ({ SI tmp_tmpb
;
11037 tmp_tmpb
= ({ SI tmp_tmpb
;
11038 tmp_tmpb
= tmp_tmpval
;
11039 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11040 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11041 ; 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)))))))); });
11043 else if (EQSI (tmp_tmpcode
, 8)) {
11044 tmp_tmpres
= INVSI (tmp_tmpval
);
11046 else if (EQSI (tmp_tmpcode
, 9)) {
11047 tmp_tmpres
= ({ SI tmp_tmpr
;
11048 tmp_tmpr
= INVSI (tmp_tmpval
);
11049 ; 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)))))))); });
11051 else if (EQSI (tmp_tmpcode
, 10)) {
11052 tmp_tmpres
= ({ SI tmp_tmpb
;
11053 tmp_tmpb
= INVSI (tmp_tmpval
);
11054 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11056 else if (EQSI (tmp_tmpcode
, 11)) {
11057 tmp_tmpres
= ({ SI tmp_tmpr
;
11058 tmp_tmpr
= ({ SI tmp_tmpb
;
11059 tmp_tmpb
= INVSI (tmp_tmpval
);
11060 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11061 ; 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)))))))); });
11063 else if (EQSI (tmp_tmpcode
, 12)) {
11064 tmp_tmpres
= ({ SI tmp_tmpb
;
11065 tmp_tmpb
= INVSI (tmp_tmpval
);
11066 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11068 else if (EQSI (tmp_tmpcode
, 13)) {
11069 tmp_tmpres
= ({ SI tmp_tmpr
;
11070 tmp_tmpr
= ({ SI tmp_tmpb
;
11071 tmp_tmpb
= INVSI (tmp_tmpval
);
11072 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11073 ; 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)))))))); });
11075 else if (EQSI (tmp_tmpcode
, 14)) {
11076 tmp_tmpres
= ({ SI tmp_tmpb
;
11077 tmp_tmpb
= ({ SI tmp_tmpb
;
11078 tmp_tmpb
= INVSI (tmp_tmpval
);
11079 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11080 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11082 else if (EQSI (tmp_tmpcode
, 15)) {
11083 tmp_tmpres
= ({ SI tmp_tmpr
;
11084 tmp_tmpr
= ({ SI tmp_tmpb
;
11085 tmp_tmpb
= ({ SI tmp_tmpb
;
11086 tmp_tmpb
= INVSI (tmp_tmpval
);
11087 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11088 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11089 ; 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)))))))); });
11093 SI opval
= tmp_tmpd
;
11094 SET_H_GR (FLD (f_operand1
), opval
);
11095 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11099 BI opval
= LTSI (tmp_tmpd
, 0);
11100 CPU (h_nbit
) = opval
;
11101 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11104 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11105 CPU (h_zbit
) = opval
;
11106 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11108 SET_H_CBIT_MOVE (0);
11109 SET_H_VBIT_MOVE (0);
11113 CPU (h_xbit
) = opval
;
11114 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11118 SET_H_INSN_PREFIXED_P (opval
);
11119 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11129 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11131 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11132 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11133 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11134 int UNUSED written
= 0;
11135 IADDR UNUSED pc
= abuf
->addr
;
11136 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11142 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11143 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11144 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11147 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11149 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11150 SET_H_GR (FLD (f_operand2
), opval
);
11151 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11156 BI opval
= LTQI (tmp_tmpd
, 0);
11157 CPU (h_nbit
) = opval
;
11158 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11161 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11162 CPU (h_zbit
) = opval
;
11163 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11165 SET_H_CBIT_MOVE (0);
11166 SET_H_VBIT_MOVE (0);
11170 CPU (h_xbit
) = opval
;
11171 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11175 SET_H_INSN_PREFIXED_P (opval
);
11176 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11186 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11188 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11189 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11190 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11191 int UNUSED written
= 0;
11192 IADDR UNUSED pc
= abuf
->addr
;
11193 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11199 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11200 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11201 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11204 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11206 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11207 SET_H_GR (FLD (f_operand2
), opval
);
11208 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11213 BI opval
= LTHI (tmp_tmpd
, 0);
11214 CPU (h_nbit
) = opval
;
11215 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11218 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11219 CPU (h_zbit
) = opval
;
11220 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11222 SET_H_CBIT_MOVE (0);
11223 SET_H_VBIT_MOVE (0);
11227 CPU (h_xbit
) = opval
;
11228 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11232 SET_H_INSN_PREFIXED_P (opval
);
11233 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11243 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11245 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11247 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11248 int UNUSED written
= 0;
11249 IADDR UNUSED pc
= abuf
->addr
;
11250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11256 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11257 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11258 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11260 SI opval
= tmp_tmpd
;
11261 SET_H_GR (FLD (f_operand2
), opval
);
11262 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11266 BI opval
= LTSI (tmp_tmpd
, 0);
11267 CPU (h_nbit
) = opval
;
11268 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11271 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11272 CPU (h_zbit
) = opval
;
11273 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11275 SET_H_CBIT_MOVE (0);
11276 SET_H_VBIT_MOVE (0);
11280 CPU (h_xbit
) = opval
;
11281 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11285 SET_H_INSN_PREFIXED_P (opval
);
11286 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11296 CASE (sem
, INSN_ASRQ
) : /* asrq $c,${Rd} */
11298 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11299 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11300 #define FLD(f) abuf->fields.sfmt_asrq.f
11301 int UNUSED written
= 0;
11302 IADDR UNUSED pc
= abuf
->addr
;
11303 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11307 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11309 SI opval
= tmp_tmpd
;
11310 SET_H_GR (FLD (f_operand2
), opval
);
11311 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11315 BI opval
= LTSI (tmp_tmpd
, 0);
11316 CPU (h_nbit
) = opval
;
11317 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11320 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11321 CPU (h_zbit
) = opval
;
11322 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11324 SET_H_CBIT_MOVE (0);
11325 SET_H_VBIT_MOVE (0);
11329 CPU (h_xbit
) = opval
;
11330 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11334 SET_H_INSN_PREFIXED_P (opval
);
11335 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11345 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11347 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11348 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11349 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11350 int UNUSED written
= 0;
11351 IADDR UNUSED pc
= abuf
->addr
;
11352 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11357 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11358 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11361 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11363 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11364 SET_H_GR (FLD (f_operand2
), opval
);
11365 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11370 BI opval
= LTQI (tmp_tmpd
, 0);
11371 CPU (h_nbit
) = opval
;
11372 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11375 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11376 CPU (h_zbit
) = opval
;
11377 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11379 SET_H_CBIT_MOVE (0);
11380 SET_H_VBIT_MOVE (0);
11384 CPU (h_xbit
) = opval
;
11385 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11389 SET_H_INSN_PREFIXED_P (opval
);
11390 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11400 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11402 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11403 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11404 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11405 int UNUSED written
= 0;
11406 IADDR UNUSED pc
= abuf
->addr
;
11407 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11412 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11413 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11416 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11418 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11419 SET_H_GR (FLD (f_operand2
), opval
);
11420 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11425 BI opval
= LTHI (tmp_tmpd
, 0);
11426 CPU (h_nbit
) = opval
;
11427 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11430 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11431 CPU (h_zbit
) = opval
;
11432 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11434 SET_H_CBIT_MOVE (0);
11435 SET_H_VBIT_MOVE (0);
11439 CPU (h_xbit
) = opval
;
11440 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11444 SET_H_INSN_PREFIXED_P (opval
);
11445 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11455 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11457 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11458 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11459 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11460 int UNUSED written
= 0;
11461 IADDR UNUSED pc
= abuf
->addr
;
11462 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11467 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11468 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11470 SI opval
= tmp_tmpd
;
11471 SET_H_GR (FLD (f_operand2
), opval
);
11472 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11476 BI opval
= LTSI (tmp_tmpd
, 0);
11477 CPU (h_nbit
) = opval
;
11478 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11481 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11482 CPU (h_zbit
) = opval
;
11483 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11485 SET_H_CBIT_MOVE (0);
11486 SET_H_VBIT_MOVE (0);
11490 CPU (h_xbit
) = opval
;
11491 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11495 SET_H_INSN_PREFIXED_P (opval
);
11496 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11506 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
11508 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11509 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11510 #define FLD(f) abuf->fields.sfmt_asrq.f
11511 int UNUSED written
= 0;
11512 IADDR UNUSED pc
= abuf
->addr
;
11513 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11517 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11519 SI opval
= tmp_tmpd
;
11520 SET_H_GR (FLD (f_operand2
), opval
);
11521 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11525 BI opval
= LTSI (tmp_tmpd
, 0);
11526 CPU (h_nbit
) = opval
;
11527 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11530 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11531 CPU (h_zbit
) = opval
;
11532 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11534 SET_H_CBIT_MOVE (0);
11535 SET_H_VBIT_MOVE (0);
11539 CPU (h_xbit
) = opval
;
11540 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11544 SET_H_INSN_PREFIXED_P (opval
);
11545 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11555 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
11557 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11558 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11559 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11560 int UNUSED written
= 0;
11561 IADDR UNUSED pc
= abuf
->addr
;
11562 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11567 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11568 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11571 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11573 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11574 SET_H_GR (FLD (f_operand2
), opval
);
11575 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11580 BI opval
= LTQI (tmp_tmpd
, 0);
11581 CPU (h_nbit
) = opval
;
11582 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11585 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11586 CPU (h_zbit
) = opval
;
11587 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11589 SET_H_CBIT_MOVE (0);
11590 SET_H_VBIT_MOVE (0);
11594 CPU (h_xbit
) = opval
;
11595 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11599 SET_H_INSN_PREFIXED_P (opval
);
11600 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11610 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
11612 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11613 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11614 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11615 int UNUSED written
= 0;
11616 IADDR UNUSED pc
= abuf
->addr
;
11617 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11622 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11623 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11626 tmp_oldregval
= GET_H_RAW_GR_PC (FLD (f_operand2
));
11628 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11629 SET_H_GR (FLD (f_operand2
), opval
);
11630 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11635 BI opval
= LTHI (tmp_tmpd
, 0);
11636 CPU (h_nbit
) = opval
;
11637 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11640 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11641 CPU (h_zbit
) = opval
;
11642 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11644 SET_H_CBIT_MOVE (0);
11645 SET_H_VBIT_MOVE (0);
11649 CPU (h_xbit
) = opval
;
11650 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11654 SET_H_INSN_PREFIXED_P (opval
);
11655 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11665 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
11667 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11668 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11669 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11670 int UNUSED written
= 0;
11671 IADDR UNUSED pc
= abuf
->addr
;
11672 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11677 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11678 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11680 SI opval
= tmp_tmpd
;
11681 SET_H_GR (FLD (f_operand2
), opval
);
11682 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11686 BI opval
= LTSI (tmp_tmpd
, 0);
11687 CPU (h_nbit
) = opval
;
11688 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11691 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11692 CPU (h_zbit
) = opval
;
11693 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11695 SET_H_CBIT_MOVE (0);
11696 SET_H_VBIT_MOVE (0);
11700 CPU (h_xbit
) = opval
;
11701 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11705 SET_H_INSN_PREFIXED_P (opval
);
11706 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11716 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
11718 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11719 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11720 #define FLD(f) abuf->fields.sfmt_asrq.f
11721 int UNUSED written
= 0;
11722 IADDR UNUSED pc
= abuf
->addr
;
11723 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11727 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11729 SI opval
= tmp_tmpd
;
11730 SET_H_GR (FLD (f_operand2
), opval
);
11731 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11735 BI opval
= LTSI (tmp_tmpd
, 0);
11736 CPU (h_nbit
) = opval
;
11737 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11740 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11741 CPU (h_zbit
) = opval
;
11742 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11744 SET_H_CBIT_MOVE (0);
11745 SET_H_VBIT_MOVE (0);
11749 CPU (h_xbit
) = opval
;
11750 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11754 SET_H_INSN_PREFIXED_P (opval
);
11755 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11765 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
11767 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11768 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11769 #define FLD(f) abuf->fields.sfmt_add_b_r.f
11770 int UNUSED written
= 0;
11771 IADDR UNUSED pc
= abuf
->addr
;
11772 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11777 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31)));
11780 BI opval
= LTSI (tmp_tmpd
, 0);
11781 CPU (h_nbit
) = opval
;
11782 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11785 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11786 CPU (h_zbit
) = opval
;
11787 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11789 SET_H_CBIT_MOVE (0);
11790 SET_H_VBIT_MOVE (0);
11794 CPU (h_xbit
) = opval
;
11795 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11799 SET_H_INSN_PREFIXED_P (opval
);
11800 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11810 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
11812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11814 #define FLD(f) abuf->fields.sfmt_asrq.f
11815 int UNUSED written
= 0;
11816 IADDR UNUSED pc
= abuf
->addr
;
11817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11821 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
11824 BI opval
= LTSI (tmp_tmpd
, 0);
11825 CPU (h_nbit
) = opval
;
11826 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11829 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11830 CPU (h_zbit
) = opval
;
11831 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11833 SET_H_CBIT_MOVE (0);
11834 SET_H_VBIT_MOVE (0);
11838 CPU (h_xbit
) = opval
;
11839 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11843 SET_H_INSN_PREFIXED_P (opval
);
11844 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11854 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
11856 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11857 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11858 #define FLD(f) abuf->fields.sfmt_setf.f
11859 int UNUSED written
= 0;
11860 IADDR UNUSED pc
= abuf
->addr
;
11861 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11865 tmp_tmp
= FLD (f_dstsrc
);
11866 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
11869 CPU (h_cbit
) = opval
;
11870 written
|= (1 << 1);
11871 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
11874 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
11877 CPU (h_vbit
) = opval
;
11878 written
|= (1 << 7);
11879 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
11882 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
11885 CPU (h_zbit
) = opval
;
11886 written
|= (1 << 9);
11887 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11890 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
11893 CPU (h_nbit
) = opval
;
11894 written
|= (1 << 3);
11895 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11898 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
11901 CPU (h_xbit
) = opval
;
11902 written
|= (1 << 8);
11903 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11906 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
11909 SET_H_IBIT (opval
);
11910 written
|= (1 << 2);
11911 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
11914 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
11917 SET_H_UBIT (opval
);
11918 written
|= (1 << 6);
11919 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
11922 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
11925 CPU (h_pbit
) = opval
;
11926 written
|= (1 << 4);
11927 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
11932 SET_H_INSN_PREFIXED_P (opval
);
11933 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11935 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
11938 CPU (h_xbit
) = opval
;
11939 written
|= (1 << 8);
11940 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11945 abuf
->written
= written
;
11950 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
11952 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11953 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11954 #define FLD(f) abuf->fields.sfmt_setf.f
11955 int UNUSED written
= 0;
11956 IADDR UNUSED pc
= abuf
->addr
;
11957 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11961 tmp_tmp
= FLD (f_dstsrc
);
11962 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
11965 CPU (h_cbit
) = opval
;
11966 written
|= (1 << 1);
11967 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
11970 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
11973 CPU (h_vbit
) = opval
;
11974 written
|= (1 << 7);
11975 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
11978 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
11981 CPU (h_zbit
) = opval
;
11982 written
|= (1 << 9);
11983 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11986 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
11989 CPU (h_nbit
) = opval
;
11990 written
|= (1 << 3);
11991 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11994 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
11997 CPU (h_xbit
) = opval
;
11998 written
|= (1 << 8);
11999 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12002 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12005 SET_H_IBIT (opval
);
12006 written
|= (1 << 2);
12007 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12010 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12013 SET_H_UBIT (opval
);
12014 written
|= (1 << 6);
12015 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12018 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12021 CPU (h_pbit
) = opval
;
12022 written
|= (1 << 4);
12023 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12029 CPU (h_xbit
) = opval
;
12030 written
|= (1 << 8);
12031 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12035 SET_H_INSN_PREFIXED_P (opval
);
12036 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12041 abuf
->written
= written
;
12046 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12048 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12049 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12050 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12051 int UNUSED written
= 0;
12052 IADDR UNUSED pc
= abuf
->addr
;
12054 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12058 tmp_truthval
= ({ SI tmp_tmpcond
;
12060 tmp_tmpcond
= FLD (f_operand2
);
12061 ; if (EQSI (tmp_tmpcond
, 0)) {
12062 tmp_condres
= NOTBI (CPU (h_cbit
));
12064 else if (EQSI (tmp_tmpcond
, 1)) {
12065 tmp_condres
= CPU (h_cbit
);
12067 else if (EQSI (tmp_tmpcond
, 2)) {
12068 tmp_condres
= NOTBI (CPU (h_zbit
));
12070 else if (EQSI (tmp_tmpcond
, 3)) {
12071 tmp_condres
= CPU (h_zbit
);
12073 else if (EQSI (tmp_tmpcond
, 4)) {
12074 tmp_condres
= NOTBI (CPU (h_vbit
));
12076 else if (EQSI (tmp_tmpcond
, 5)) {
12077 tmp_condres
= CPU (h_vbit
);
12079 else if (EQSI (tmp_tmpcond
, 6)) {
12080 tmp_condres
= NOTBI (CPU (h_nbit
));
12082 else if (EQSI (tmp_tmpcond
, 7)) {
12083 tmp_condres
= CPU (h_nbit
);
12085 else if (EQSI (tmp_tmpcond
, 8)) {
12086 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12088 else if (EQSI (tmp_tmpcond
, 9)) {
12089 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12091 else if (EQSI (tmp_tmpcond
, 10)) {
12092 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12094 else if (EQSI (tmp_tmpcond
, 11)) {
12095 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12097 else if (EQSI (tmp_tmpcond
, 12)) {
12098 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12100 else if (EQSI (tmp_tmpcond
, 13)) {
12101 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12103 else if (EQSI (tmp_tmpcond
, 14)) {
12106 else if (EQSI (tmp_tmpcond
, 15)) {
12107 tmp_condres
= CPU (h_pbit
);
12110 crisv10f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12114 CPU (h_xbit
) = opval
;
12115 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12119 SET_H_INSN_PREFIXED_P (opval
);
12120 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12123 if (tmp_truthval
) {
12126 USI opval
= FLD (i_o_pcrel
);
12127 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12128 written
|= (1 << 8);
12129 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12135 abuf
->written
= written
;
12136 SEM_BRANCH_FINI (vpc
);
12141 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12143 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12144 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12145 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12146 int UNUSED written
= 0;
12147 IADDR UNUSED pc
= abuf
->addr
;
12149 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12155 CPU (h_xbit
) = opval
;
12156 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12160 SET_H_INSN_PREFIXED_P (opval
);
12161 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12166 USI opval
= FLD (i_o_pcrel
);
12167 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12168 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12173 SEM_BRANCH_FINI (vpc
);
12178 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12180 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12181 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12182 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12183 int UNUSED written
= 0;
12184 IADDR UNUSED pc
= abuf
->addr
;
12186 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12190 tmp_truthval
= ({ SI tmp_tmpcond
;
12192 tmp_tmpcond
= FLD (f_operand2
);
12193 ; if (EQSI (tmp_tmpcond
, 0)) {
12194 tmp_condres
= NOTBI (CPU (h_cbit
));
12196 else if (EQSI (tmp_tmpcond
, 1)) {
12197 tmp_condres
= CPU (h_cbit
);
12199 else if (EQSI (tmp_tmpcond
, 2)) {
12200 tmp_condres
= NOTBI (CPU (h_zbit
));
12202 else if (EQSI (tmp_tmpcond
, 3)) {
12203 tmp_condres
= CPU (h_zbit
);
12205 else if (EQSI (tmp_tmpcond
, 4)) {
12206 tmp_condres
= NOTBI (CPU (h_vbit
));
12208 else if (EQSI (tmp_tmpcond
, 5)) {
12209 tmp_condres
= CPU (h_vbit
);
12211 else if (EQSI (tmp_tmpcond
, 6)) {
12212 tmp_condres
= NOTBI (CPU (h_nbit
));
12214 else if (EQSI (tmp_tmpcond
, 7)) {
12215 tmp_condres
= CPU (h_nbit
);
12217 else if (EQSI (tmp_tmpcond
, 8)) {
12218 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12220 else if (EQSI (tmp_tmpcond
, 9)) {
12221 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12223 else if (EQSI (tmp_tmpcond
, 10)) {
12224 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12226 else if (EQSI (tmp_tmpcond
, 11)) {
12227 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12229 else if (EQSI (tmp_tmpcond
, 12)) {
12230 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12232 else if (EQSI (tmp_tmpcond
, 13)) {
12233 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12235 else if (EQSI (tmp_tmpcond
, 14)) {
12238 else if (EQSI (tmp_tmpcond
, 15)) {
12239 tmp_condres
= CPU (h_pbit
);
12242 crisv10f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12246 CPU (h_xbit
) = opval
;
12247 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12251 SET_H_INSN_PREFIXED_P (opval
);
12252 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12255 if (tmp_truthval
) {
12258 USI opval
= FLD (i_o_word_pcrel
);
12259 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12260 written
|= (1 << 8);
12261 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12267 abuf
->written
= written
;
12268 SEM_BRANCH_FINI (vpc
);
12273 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12275 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12276 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12277 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12278 int UNUSED written
= 0;
12279 IADDR UNUSED pc
= abuf
->addr
;
12281 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12287 CPU (h_xbit
) = opval
;
12288 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12292 SET_H_INSN_PREFIXED_P (opval
);
12293 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12298 USI opval
= FLD (i_o_word_pcrel
);
12299 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12300 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12305 SEM_BRANCH_FINI (vpc
);
12310 CASE (sem
, INSN_JUMP_R
) : /* jump/jsr/jir ${Rs} */
12312 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12313 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12314 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12315 int UNUSED written
= 0;
12316 IADDR UNUSED pc
= abuf
->addr
;
12318 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12322 SI opval
= ADDSI (pc
, 2);
12323 SET_H_SR (FLD (f_operand2
), opval
);
12324 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12327 USI opval
= GET_H_GR (FLD (f_operand1
));
12328 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12329 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12334 CPU (h_xbit
) = opval
;
12335 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12339 SET_H_INSN_PREFIXED_P (opval
);
12340 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12345 SEM_BRANCH_FINI (vpc
);
12350 CASE (sem
, INSN_JUMP_M
) : /* jump/jsr/jir [${Rs}${inc}] */
12352 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12354 #define FLD(f) abuf->fields.sfmt_move_m_sprv10.f
12355 int UNUSED written
= 0;
12356 IADDR UNUSED pc
= abuf
->addr
;
12358 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12362 SI opval
= ADDSI (pc
, 2);
12363 SET_H_SR (FLD (f_operand2
), opval
);
12364 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12367 USI opval
= ({ SI tmp_addr
;
12370 tmp_postinc
= FLD (f_memmode
);
12371 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12372 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
12373 ; if (NEBI (tmp_postinc
, 0)) {
12375 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12376 tmp_addr
= ADDSI (tmp_addr
, 4);
12379 SI opval
= tmp_addr
;
12380 SET_H_GR (FLD (f_operand1
), opval
);
12381 written
|= (1 << 7);
12382 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12387 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12388 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12393 CPU (h_xbit
) = opval
;
12394 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12398 SET_H_INSN_PREFIXED_P (opval
);
12399 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12404 abuf
->written
= written
;
12405 SEM_BRANCH_FINI (vpc
);
12410 CASE (sem
, INSN_JUMP_C
) : /* jump/jsr/jir ${const32} */
12412 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12413 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12414 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
12415 int UNUSED written
= 0;
12416 IADDR UNUSED pc
= abuf
->addr
;
12418 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12422 SI opval
= ADDSI (pc
, 6);
12423 SET_H_SR (FLD (f_operand2
), opval
);
12424 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12427 USI opval
= FLD (f_indir_pc__dword
);
12428 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12429 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12434 CPU (h_xbit
) = opval
;
12435 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12439 SET_H_INSN_PREFIXED_P (opval
);
12440 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12445 SEM_BRANCH_FINI (vpc
);
12450 CASE (sem
, INSN_BREAK
) : /* break $n */
12452 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12453 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12454 #define FLD(f) abuf->fields.sfmt_break.f
12455 int UNUSED written
= 0;
12456 IADDR UNUSED pc
= abuf
->addr
;
12458 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12464 CPU (h_xbit
) = opval
;
12465 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12469 SET_H_INSN_PREFIXED_P (opval
);
12470 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12474 USI opval
= crisv10f_break_handler (current_cpu
, FLD (f_u4
), pc
);
12475 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12476 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12480 SEM_BRANCH_FINI (vpc
);
12485 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
12487 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12488 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12489 #define FLD(f) abuf->fields.sfmt_muls_b.f
12490 int UNUSED written
= 0;
12491 IADDR UNUSED pc
= abuf
->addr
;
12492 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12498 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
12499 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12500 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12502 SI opval
= tmp_newval
;
12503 SET_H_GR (FLD (f_operand2
), opval
);
12504 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12508 BI opval
= LTSI (tmp_newval
, 0);
12509 CPU (h_nbit
) = opval
;
12510 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12513 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12514 CPU (h_zbit
) = opval
;
12515 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12517 SET_H_CBIT_MOVE (0);
12518 SET_H_VBIT_MOVE (0);
12522 CPU (h_xbit
) = opval
;
12523 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12527 SET_H_INSN_PREFIXED_P (opval
);
12528 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12538 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
12540 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12541 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12542 #define FLD(f) abuf->fields.sfmt_muls_b.f
12543 int UNUSED written
= 0;
12544 IADDR UNUSED pc
= abuf
->addr
;
12545 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12551 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
12552 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12553 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12555 SI opval
= tmp_newval
;
12556 SET_H_GR (FLD (f_operand2
), opval
);
12557 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12561 BI opval
= LTSI (tmp_newval
, 0);
12562 CPU (h_nbit
) = opval
;
12563 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12566 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12567 CPU (h_zbit
) = opval
;
12568 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12570 SET_H_CBIT_MOVE (0);
12571 SET_H_VBIT_MOVE (0);
12575 CPU (h_xbit
) = opval
;
12576 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12580 SET_H_INSN_PREFIXED_P (opval
);
12581 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12591 CASE (sem
, INSN_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
12593 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12594 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12595 #define FLD(f) abuf->fields.sfmt_muls_b.f
12596 int UNUSED written
= 0;
12597 IADDR UNUSED pc
= abuf
->addr
;
12598 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12604 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
12605 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12606 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12608 SI opval
= tmp_newval
;
12609 SET_H_GR (FLD (f_operand2
), opval
);
12610 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12614 BI opval
= LTSI (tmp_newval
, 0);
12615 CPU (h_nbit
) = opval
;
12616 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12619 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12620 CPU (h_zbit
) = opval
;
12621 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12623 SET_H_CBIT_MOVE (0);
12624 SET_H_VBIT_MOVE (0);
12628 CPU (h_xbit
) = opval
;
12629 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12633 SET_H_INSN_PREFIXED_P (opval
);
12634 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12644 CASE (sem
, INSN_BOUND_M_B_M
) : /* bound-m.b [${Rs}${inc}],${Rd} */
12646 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12647 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12648 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12649 int UNUSED written
= 0;
12650 IADDR UNUSED pc
= abuf
->addr
;
12651 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12657 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
12660 tmp_postinc
= FLD (f_memmode
);
12661 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12662 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
12663 ; if (NEBI (tmp_postinc
, 0)) {
12665 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12666 tmp_addr
= ADDSI (tmp_addr
, 1);
12669 SI opval
= tmp_addr
;
12670 SET_H_GR (FLD (f_operand1
), opval
);
12671 written
|= (1 << 9);
12672 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12676 ; tmp_tmp_mem
; }));
12677 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12678 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12679 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
12681 SI opval
= tmp_newval
;
12682 SET_H_GR (FLD (f_operand1
), opval
);
12683 written
|= (1 << 9);
12684 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12688 SI opval
= tmp_newval
;
12689 SET_H_GR (FLD (f_operand2
), opval
);
12690 written
|= (1 << 8);
12691 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12696 BI opval
= LTSI (tmp_newval
, 0);
12697 CPU (h_nbit
) = opval
;
12698 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12701 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12702 CPU (h_zbit
) = opval
;
12703 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12705 SET_H_CBIT_MOVE (0);
12706 SET_H_VBIT_MOVE (0);
12710 CPU (h_xbit
) = opval
;
12711 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12715 SET_H_INSN_PREFIXED_P (opval
);
12716 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12722 abuf
->written
= written
;
12727 CASE (sem
, INSN_BOUND_M_W_M
) : /* bound-m.w [${Rs}${inc}],${Rd} */
12729 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12730 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12731 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12732 int UNUSED written
= 0;
12733 IADDR UNUSED pc
= abuf
->addr
;
12734 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12740 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
12743 tmp_postinc
= FLD (f_memmode
);
12744 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12745 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
12746 ; if (NEBI (tmp_postinc
, 0)) {
12748 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12749 tmp_addr
= ADDSI (tmp_addr
, 2);
12752 SI opval
= tmp_addr
;
12753 SET_H_GR (FLD (f_operand1
), opval
);
12754 written
|= (1 << 9);
12755 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12759 ; tmp_tmp_mem
; }));
12760 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12761 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12762 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
12764 SI opval
= tmp_newval
;
12765 SET_H_GR (FLD (f_operand1
), opval
);
12766 written
|= (1 << 9);
12767 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12771 SI opval
= tmp_newval
;
12772 SET_H_GR (FLD (f_operand2
), opval
);
12773 written
|= (1 << 8);
12774 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12779 BI opval
= LTSI (tmp_newval
, 0);
12780 CPU (h_nbit
) = opval
;
12781 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12784 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12785 CPU (h_zbit
) = opval
;
12786 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12788 SET_H_CBIT_MOVE (0);
12789 SET_H_VBIT_MOVE (0);
12793 CPU (h_xbit
) = opval
;
12794 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12798 SET_H_INSN_PREFIXED_P (opval
);
12799 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12805 abuf
->written
= written
;
12810 CASE (sem
, INSN_BOUND_M_D_M
) : /* bound-m.d [${Rs}${inc}],${Rd} */
12812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12814 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
12815 int UNUSED written
= 0;
12816 IADDR UNUSED pc
= abuf
->addr
;
12817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12823 tmp_tmpops
= ({ SI tmp_addr
;
12826 tmp_postinc
= FLD (f_memmode
);
12827 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
12828 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
12829 ; if (NEBI (tmp_postinc
, 0)) {
12831 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
12832 tmp_addr
= ADDSI (tmp_addr
, 4);
12835 SI opval
= tmp_addr
;
12836 SET_H_GR (FLD (f_operand1
), opval
);
12837 written
|= (1 << 9);
12838 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12843 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12844 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12845 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
12847 SI opval
= tmp_newval
;
12848 SET_H_GR (FLD (f_operand1
), opval
);
12849 written
|= (1 << 9);
12850 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12854 SI opval
= tmp_newval
;
12855 SET_H_GR (FLD (f_operand2
), opval
);
12856 written
|= (1 << 8);
12857 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12862 BI opval
= LTSI (tmp_newval
, 0);
12863 CPU (h_nbit
) = opval
;
12864 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12867 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12868 CPU (h_zbit
) = opval
;
12869 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12871 SET_H_CBIT_MOVE (0);
12872 SET_H_VBIT_MOVE (0);
12876 CPU (h_xbit
) = opval
;
12877 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12881 SET_H_INSN_PREFIXED_P (opval
);
12882 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12888 abuf
->written
= written
;
12893 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
12895 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12896 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12897 #define FLD(f) abuf->fields.sfmt_bound_cb.f
12898 int UNUSED written
= 0;
12899 IADDR UNUSED pc
= abuf
->addr
;
12900 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12906 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
12907 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12908 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12910 SI opval
= tmp_newval
;
12911 SET_H_GR (FLD (f_operand2
), opval
);
12912 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12916 BI opval
= LTSI (tmp_newval
, 0);
12917 CPU (h_nbit
) = opval
;
12918 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12921 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12922 CPU (h_zbit
) = opval
;
12923 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12925 SET_H_CBIT_MOVE (0);
12926 SET_H_VBIT_MOVE (0);
12930 CPU (h_xbit
) = opval
;
12931 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12935 SET_H_INSN_PREFIXED_P (opval
);
12936 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12946 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
12948 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12949 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12950 #define FLD(f) abuf->fields.sfmt_bound_cw.f
12951 int UNUSED written
= 0;
12952 IADDR UNUSED pc
= abuf
->addr
;
12953 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12959 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
12960 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
12961 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
12963 SI opval
= tmp_newval
;
12964 SET_H_GR (FLD (f_operand2
), opval
);
12965 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12969 BI opval
= LTSI (tmp_newval
, 0);
12970 CPU (h_nbit
) = opval
;
12971 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12974 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12975 CPU (h_zbit
) = opval
;
12976 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12978 SET_H_CBIT_MOVE (0);
12979 SET_H_VBIT_MOVE (0);
12983 CPU (h_xbit
) = opval
;
12984 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12988 SET_H_INSN_PREFIXED_P (opval
);
12989 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12999 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13001 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13002 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13003 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13004 int UNUSED written
= 0;
13005 IADDR UNUSED pc
= abuf
->addr
;
13006 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13012 tmp_tmpops
= FLD (f_indir_pc__dword
);
13013 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13014 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13016 SI opval
= tmp_newval
;
13017 SET_H_GR (FLD (f_operand2
), opval
);
13018 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13022 BI opval
= LTSI (tmp_newval
, 0);
13023 CPU (h_nbit
) = opval
;
13024 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13027 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13028 CPU (h_zbit
) = opval
;
13029 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13031 SET_H_CBIT_MOVE (0);
13032 SET_H_VBIT_MOVE (0);
13036 CPU (h_xbit
) = opval
;
13037 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13041 SET_H_INSN_PREFIXED_P (opval
);
13042 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13052 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13054 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13055 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13056 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13057 int UNUSED written
= 0;
13058 IADDR UNUSED pc
= abuf
->addr
;
13059 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13063 tmp_truthval
= ({ SI tmp_tmpcond
;
13065 tmp_tmpcond
= FLD (f_operand2
);
13066 ; if (EQSI (tmp_tmpcond
, 0)) {
13067 tmp_condres
= NOTBI (CPU (h_cbit
));
13069 else if (EQSI (tmp_tmpcond
, 1)) {
13070 tmp_condres
= CPU (h_cbit
);
13072 else if (EQSI (tmp_tmpcond
, 2)) {
13073 tmp_condres
= NOTBI (CPU (h_zbit
));
13075 else if (EQSI (tmp_tmpcond
, 3)) {
13076 tmp_condres
= CPU (h_zbit
);
13078 else if (EQSI (tmp_tmpcond
, 4)) {
13079 tmp_condres
= NOTBI (CPU (h_vbit
));
13081 else if (EQSI (tmp_tmpcond
, 5)) {
13082 tmp_condres
= CPU (h_vbit
);
13084 else if (EQSI (tmp_tmpcond
, 6)) {
13085 tmp_condres
= NOTBI (CPU (h_nbit
));
13087 else if (EQSI (tmp_tmpcond
, 7)) {
13088 tmp_condres
= CPU (h_nbit
);
13090 else if (EQSI (tmp_tmpcond
, 8)) {
13091 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13093 else if (EQSI (tmp_tmpcond
, 9)) {
13094 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13096 else if (EQSI (tmp_tmpcond
, 10)) {
13097 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13099 else if (EQSI (tmp_tmpcond
, 11)) {
13100 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13102 else if (EQSI (tmp_tmpcond
, 12)) {
13103 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13105 else if (EQSI (tmp_tmpcond
, 13)) {
13106 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13108 else if (EQSI (tmp_tmpcond
, 14)) {
13111 else if (EQSI (tmp_tmpcond
, 15)) {
13112 tmp_condres
= CPU (h_pbit
);
13116 SI opval
= ZEXTBISI (tmp_truthval
);
13117 SET_H_GR (FLD (f_operand1
), opval
);
13118 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13123 CPU (h_xbit
) = opval
;
13124 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13128 SET_H_INSN_PREFIXED_P (opval
);
13129 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13138 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13140 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13141 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13142 #define FLD(f) abuf->fields.sfmt_muls_b.f
13143 int UNUSED written
= 0;
13144 IADDR UNUSED pc
= abuf
->addr
;
13145 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13150 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13153 if (GESI (tmp_tmp
, 0)) {
13155 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13156 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13159 if (GESI (tmp_tmp
, 0)) {
13161 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13162 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13165 if (GESI (tmp_tmp
, 0)) {
13167 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13168 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13171 if (GESI (tmp_tmp
, 0)) {
13173 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13174 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13177 if (GESI (tmp_tmp
, 0)) {
13179 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13180 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13183 if (GESI (tmp_tmp
, 0)) {
13185 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13186 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13189 if (GESI (tmp_tmp
, 0)) {
13191 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13192 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13195 if (GESI (tmp_tmp
, 0)) {
13197 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13198 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13201 if (GESI (tmp_tmp
, 0)) {
13203 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13204 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13207 if (GESI (tmp_tmp
, 0)) {
13209 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13210 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13213 if (GESI (tmp_tmp
, 0)) {
13215 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13216 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13219 if (GESI (tmp_tmp
, 0)) {
13221 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13222 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13225 if (GESI (tmp_tmp
, 0)) {
13227 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13228 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13231 if (GESI (tmp_tmp
, 0)) {
13233 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13234 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13237 if (GESI (tmp_tmp
, 0)) {
13239 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13240 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13243 if (GESI (tmp_tmp
, 0)) {
13245 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13246 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13249 if (GESI (tmp_tmp
, 0)) {
13251 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13252 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13255 if (GESI (tmp_tmp
, 0)) {
13257 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13258 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13261 if (GESI (tmp_tmp
, 0)) {
13263 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13264 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13267 if (GESI (tmp_tmp
, 0)) {
13269 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13270 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13273 if (GESI (tmp_tmp
, 0)) {
13275 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13276 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13279 if (GESI (tmp_tmp
, 0)) {
13281 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13282 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13285 if (GESI (tmp_tmp
, 0)) {
13287 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13288 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13291 if (GESI (tmp_tmp
, 0)) {
13293 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13294 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13297 if (GESI (tmp_tmp
, 0)) {
13299 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13300 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13303 if (GESI (tmp_tmp
, 0)) {
13305 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13306 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13309 if (GESI (tmp_tmp
, 0)) {
13311 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13312 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13315 if (GESI (tmp_tmp
, 0)) {
13317 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13318 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13321 if (GESI (tmp_tmp
, 0)) {
13323 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13324 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13327 if (GESI (tmp_tmp
, 0)) {
13329 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13330 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13333 if (GESI (tmp_tmp
, 0)) {
13335 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13336 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13339 if (GESI (tmp_tmp
, 0)) {
13341 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13342 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13347 SI opval
= tmp_tmpd
;
13348 SET_H_GR (FLD (f_operand2
), opval
);
13349 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13353 BI opval
= LTSI (tmp_tmpd
, 0);
13354 CPU (h_nbit
) = opval
;
13355 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13358 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13359 CPU (h_zbit
) = opval
;
13360 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13362 SET_H_CBIT_MOVE (0);
13363 SET_H_VBIT_MOVE (0);
13367 CPU (h_xbit
) = opval
;
13368 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13372 SET_H_INSN_PREFIXED_P (opval
);
13373 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13383 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13385 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13386 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13387 #define FLD(f) abuf->fields.sfmt_addoq.f
13388 int UNUSED written
= 0;
13389 IADDR UNUSED pc
= abuf
->addr
;
13390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13394 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13395 CPU (h_prefixreg_pre_v32
) = opval
;
13396 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13400 SET_H_INSN_PREFIXED_P (opval
);
13401 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13409 CASE (sem
, INSN_BDAPQPC
) : /* bdapq $o,PC */
13411 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13412 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13413 #define FLD(f) abuf->fields.sfmt_addoq.f
13414 int UNUSED written
= 0;
13415 IADDR UNUSED pc
= abuf
->addr
;
13417 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13421 SI opval
= ADDSI (ADDSI (pc
, 2), FLD (f_s8
));
13422 CPU (h_prefixreg_pre_v32
) = opval
;
13423 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13427 SET_H_INSN_PREFIXED_P (opval
);
13428 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13430 cris_flush_simulator_decode_cache (current_cpu
, pc
);
13433 SEM_BRANCH_FINI (vpc
);
13438 CASE (sem
, INSN_BDAP_32_PC
) : /* bdap ${sconst32},PC */
13440 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13441 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13442 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13443 int UNUSED written
= 0;
13444 IADDR UNUSED pc
= abuf
->addr
;
13445 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13451 tmp_offs
= FLD (f_indir_pc__dword
);
13452 tmp_oldpc
= ADDSI (pc
, 6);
13453 tmp_newpc
= ADDSI (tmp_oldpc
, tmp_offs
);
13455 SI opval
= tmp_newpc
;
13456 CPU (h_prefixreg_pre_v32
) = opval
;
13457 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13461 SET_H_INSN_PREFIXED_P (opval
);
13462 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13470 CASE (sem
, INSN_MOVE_M_PCPLUS_P0
) : /* move [PC+],P0 */
13472 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13473 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13474 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13475 int UNUSED written
= 0;
13476 IADDR UNUSED pc
= abuf
->addr
;
13478 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13480 if (GET_H_INSN_PREFIXED_P ()) {
13483 tmp_dummy
= ({ SI tmp_addr
;
13486 tmp_postinc
= FLD (f_memmode
);
13487 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (pc
) : (CPU (h_prefixreg_pre_v32
)));
13488 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13489 ; if (NEBI (tmp_postinc
, 0)) {
13491 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13492 tmp_addr
= ADDSI (tmp_addr
, 1);
13495 USI opval
= tmp_addr
;
13496 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13497 written
|= (1 << 5);
13498 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13506 CPU (h_xbit
) = opval
;
13507 written
|= (1 << 7);
13508 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13512 SET_H_INSN_PREFIXED_P (opval
);
13513 written
|= (1 << 6);
13514 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13519 cgen_rtx_error (current_cpu
, "move [PC+],P0 without prefix is not implemented");
13522 abuf
->written
= written
;
13523 SEM_BRANCH_FINI (vpc
);
13528 CASE (sem
, INSN_MOVE_M_SPPLUS_P8
) : /* move [SP+],P8 */
13530 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13531 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13532 #define FLD(f) abuf->fields.sfmt_move_m_spplus_p8.f
13533 int UNUSED written
= 0;
13534 IADDR UNUSED pc
= abuf
->addr
;
13535 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13537 if (GET_H_INSN_PREFIXED_P ()) {
13540 tmp_dummy
= ({ SI tmp_addr
;
13543 tmp_postinc
= FLD (f_memmode
);
13544 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (((UINT
) 14))) : (CPU (h_prefixreg_pre_v32
)));
13545 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13546 ; if (NEBI (tmp_postinc
, 0)) {
13548 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13549 tmp_addr
= ADDSI (tmp_addr
, 4);
13552 SI opval
= tmp_addr
;
13553 SET_H_GR (((UINT
) 14), opval
);
13554 written
|= (1 << 5);
13555 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13563 CPU (h_xbit
) = opval
;
13564 written
|= (1 << 7);
13565 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13569 SET_H_INSN_PREFIXED_P (opval
);
13570 written
|= (1 << 6);
13571 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13576 cgen_rtx_error (current_cpu
, "move [SP+],P8 without prefix is not implemented");
13579 abuf
->written
= written
;
13584 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13586 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13587 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13588 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13589 int UNUSED written
= 0;
13590 IADDR UNUSED pc
= abuf
->addr
;
13591 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13595 tmp_tmps
= ({ SI tmp_addr
;
13598 tmp_postinc
= FLD (f_memmode
);
13599 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13600 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13601 ; if (NEBI (tmp_postinc
, 0)) {
13603 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13604 tmp_addr
= ADDSI (tmp_addr
, 1);
13607 SI opval
= tmp_addr
;
13608 SET_H_GR (FLD (f_operand1
), opval
);
13609 written
|= (1 << 6);
13610 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13616 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13617 CPU (h_prefixreg_pre_v32
) = opval
;
13618 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13622 SET_H_INSN_PREFIXED_P (opval
);
13623 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13627 abuf
->written
= written
;
13632 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13634 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13635 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13636 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13637 int UNUSED written
= 0;
13638 IADDR UNUSED pc
= abuf
->addr
;
13639 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13643 tmp_tmps
= ({ SI tmp_addr
;
13646 tmp_postinc
= FLD (f_memmode
);
13647 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13648 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
13649 ; if (NEBI (tmp_postinc
, 0)) {
13651 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13652 tmp_addr
= ADDSI (tmp_addr
, 2);
13655 SI opval
= tmp_addr
;
13656 SET_H_GR (FLD (f_operand1
), opval
);
13657 written
|= (1 << 6);
13658 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13664 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
13665 CPU (h_prefixreg_pre_v32
) = opval
;
13666 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13670 SET_H_INSN_PREFIXED_P (opval
);
13671 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13675 abuf
->written
= written
;
13680 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13682 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13683 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13684 #define FLD(f) abuf->fields.sfmt_bound_m_b_m.f
13685 int UNUSED written
= 0;
13686 IADDR UNUSED pc
= abuf
->addr
;
13687 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13691 tmp_tmps
= ({ SI tmp_addr
;
13694 tmp_postinc
= FLD (f_memmode
);
13695 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13696 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13697 ; if (NEBI (tmp_postinc
, 0)) {
13699 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13700 tmp_addr
= ADDSI (tmp_addr
, 4);
13703 SI opval
= tmp_addr
;
13704 SET_H_GR (FLD (f_operand1
), opval
);
13705 written
|= (1 << 6);
13706 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13712 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
13713 CPU (h_prefixreg_pre_v32
) = opval
;
13714 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13718 SET_H_INSN_PREFIXED_P (opval
);
13719 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13723 abuf
->written
= written
;
13728 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
13730 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13731 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13732 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13733 int UNUSED written
= 0;
13734 IADDR UNUSED pc
= abuf
->addr
;
13735 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13739 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
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
);
13754 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
13756 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13757 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13758 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13759 int UNUSED written
= 0;
13760 IADDR UNUSED pc
= abuf
->addr
;
13761 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13765 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
13766 CPU (h_prefixreg_pre_v32
) = opval
;
13767 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13771 SET_H_INSN_PREFIXED_P (opval
);
13772 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13780 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
13782 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13783 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13784 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13785 int UNUSED written
= 0;
13786 IADDR UNUSED pc
= abuf
->addr
;
13787 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13791 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
13792 CPU (h_prefixreg_pre_v32
) = opval
;
13793 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13797 SET_H_INSN_PREFIXED_P (opval
);
13798 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13806 CASE (sem
, INSN_DIP_M
) : /* dip [${Rs}${inc}] */
13808 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13809 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13810 #define FLD(f) abuf->fields.sfmt_move_spr_mv10.f
13811 int UNUSED written
= 0;
13812 IADDR UNUSED pc
= abuf
->addr
;
13813 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13817 tmp_tmps
= ({ SI tmp_addr
;
13820 tmp_postinc
= FLD (f_memmode
);
13821 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (CPU (h_prefixreg_pre_v32
)));
13822 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13823 ; if (NEBI (tmp_postinc
, 0)) {
13825 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13826 tmp_addr
= ADDSI (tmp_addr
, 4);
13829 SI opval
= tmp_addr
;
13830 SET_H_GR (FLD (f_operand1
), opval
);
13831 written
|= (1 << 5);
13832 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13838 SI opval
= tmp_tmps
;
13839 CPU (h_prefixreg_pre_v32
) = opval
;
13840 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13844 SET_H_INSN_PREFIXED_P (opval
);
13845 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13849 abuf
->written
= written
;
13854 CASE (sem
, INSN_DIP_C
) : /* dip [PC+] */
13856 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13857 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13858 #define FLD(f) abuf->fields.sfmt_move_c_sprv10_p9.f
13859 int UNUSED written
= 0;
13860 IADDR UNUSED pc
= abuf
->addr
;
13861 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13865 SI opval
= FLD (f_indir_pc__dword
);
13866 CPU (h_prefixreg_pre_v32
) = opval
;
13867 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13871 SET_H_INSN_PREFIXED_P (opval
);
13872 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13880 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13882 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13883 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13884 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13885 int UNUSED written
= 0;
13886 IADDR UNUSED pc
= abuf
->addr
;
13887 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13891 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13892 CPU (h_prefixreg_pre_v32
) = opval
;
13893 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13897 SET_H_INSN_PREFIXED_P (opval
);
13898 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13906 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13908 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13909 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13910 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13911 int UNUSED written
= 0;
13912 IADDR UNUSED pc
= abuf
->addr
;
13913 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13917 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
13918 CPU (h_prefixreg_pre_v32
) = opval
;
13919 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13923 SET_H_INSN_PREFIXED_P (opval
);
13924 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13932 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
13934 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13936 #define FLD(f) abuf->fields.sfmt_add_b_r.f
13937 int UNUSED written
= 0;
13938 IADDR UNUSED pc
= abuf
->addr
;
13939 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13943 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
13944 CPU (h_prefixreg_pre_v32
) = opval
;
13945 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13949 SET_H_INSN_PREFIXED_P (opval
);
13950 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13958 CASE (sem
, INSN_BIAP_PC_B_R
) : /* biap-pc.b ${Rs-dfield}.m,PC */
13960 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13961 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13962 #define FLD(f) abuf->fields.sfmt_addoq.f
13963 int UNUSED written
= 0;
13964 IADDR UNUSED pc
= abuf
->addr
;
13965 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13969 SI opval
= ADDSI (ADDSI (pc
, 4), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13970 CPU (h_prefixreg_pre_v32
) = opval
;
13971 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13975 SET_H_INSN_PREFIXED_P (opval
);
13976 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13984 CASE (sem
, INSN_BIAP_PC_W_R
) : /* biap-pc.w ${Rs-dfield}.m,PC */
13986 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13987 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13988 #define FLD(f) abuf->fields.sfmt_addoq.f
13989 int UNUSED written
= 0;
13990 IADDR UNUSED pc
= abuf
->addr
;
13991 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13995 SI opval
= ADDSI (ADDSI (pc
, 4), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
13996 CPU (h_prefixreg_pre_v32
) = opval
;
13997 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14001 SET_H_INSN_PREFIXED_P (opval
);
14002 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14010 CASE (sem
, INSN_BIAP_PC_D_R
) : /* biap-pc.d ${Rs-dfield}.m,PC */
14012 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14013 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14014 #define FLD(f) abuf->fields.sfmt_addoq.f
14015 int UNUSED written
= 0;
14016 IADDR UNUSED pc
= abuf
->addr
;
14017 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14021 SI opval
= ADDSI (ADDSI (pc
, 4), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14022 CPU (h_prefixreg_pre_v32
) = opval
;
14023 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14027 SET_H_INSN_PREFIXED_P (opval
);
14028 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14038 ENDSWITCH (sem
) /* End of semantic switch. */
14040 /* At this point `vpc' contains the next insn to execute. */
14043 #undef DEFINE_SWITCH
14044 #endif /* DEFINE_SWITCH */