1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2005 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { CRISV32F_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
36 { CRISV32F_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
37 { CRISV32F_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
38 { CRISV32F_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
39 { CRISV32F_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
40 { CRISV32F_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
41 { CRISV32F_INSN_MOVE_B_R
, && case_sem_INSN_MOVE_B_R
},
42 { CRISV32F_INSN_MOVE_W_R
, && case_sem_INSN_MOVE_W_R
},
43 { CRISV32F_INSN_MOVE_D_R
, && case_sem_INSN_MOVE_D_R
},
44 { CRISV32F_INSN_MOVEQ
, && case_sem_INSN_MOVEQ
},
45 { CRISV32F_INSN_MOVS_B_R
, && case_sem_INSN_MOVS_B_R
},
46 { CRISV32F_INSN_MOVS_W_R
, && case_sem_INSN_MOVS_W_R
},
47 { CRISV32F_INSN_MOVU_B_R
, && case_sem_INSN_MOVU_B_R
},
48 { CRISV32F_INSN_MOVU_W_R
, && case_sem_INSN_MOVU_W_R
},
49 { CRISV32F_INSN_MOVECBR
, && case_sem_INSN_MOVECBR
},
50 { CRISV32F_INSN_MOVECWR
, && case_sem_INSN_MOVECWR
},
51 { CRISV32F_INSN_MOVECDR
, && case_sem_INSN_MOVECDR
},
52 { CRISV32F_INSN_MOVSCBR
, && case_sem_INSN_MOVSCBR
},
53 { CRISV32F_INSN_MOVSCWR
, && case_sem_INSN_MOVSCWR
},
54 { CRISV32F_INSN_MOVUCBR
, && case_sem_INSN_MOVUCBR
},
55 { CRISV32F_INSN_MOVUCWR
, && case_sem_INSN_MOVUCWR
},
56 { CRISV32F_INSN_ADDQ
, && case_sem_INSN_ADDQ
},
57 { CRISV32F_INSN_SUBQ
, && case_sem_INSN_SUBQ
},
58 { CRISV32F_INSN_CMP_R_B_R
, && case_sem_INSN_CMP_R_B_R
},
59 { CRISV32F_INSN_CMP_R_W_R
, && case_sem_INSN_CMP_R_W_R
},
60 { CRISV32F_INSN_CMP_R_D_R
, && case_sem_INSN_CMP_R_D_R
},
61 { CRISV32F_INSN_CMP_M_B_M
, && case_sem_INSN_CMP_M_B_M
},
62 { CRISV32F_INSN_CMP_M_W_M
, && case_sem_INSN_CMP_M_W_M
},
63 { CRISV32F_INSN_CMP_M_D_M
, && case_sem_INSN_CMP_M_D_M
},
64 { CRISV32F_INSN_CMPCBR
, && case_sem_INSN_CMPCBR
},
65 { CRISV32F_INSN_CMPCWR
, && case_sem_INSN_CMPCWR
},
66 { CRISV32F_INSN_CMPCDR
, && case_sem_INSN_CMPCDR
},
67 { CRISV32F_INSN_CMPQ
, && case_sem_INSN_CMPQ
},
68 { CRISV32F_INSN_CMPS_M_B_M
, && case_sem_INSN_CMPS_M_B_M
},
69 { CRISV32F_INSN_CMPS_M_W_M
, && case_sem_INSN_CMPS_M_W_M
},
70 { CRISV32F_INSN_CMPSCBR
, && case_sem_INSN_CMPSCBR
},
71 { CRISV32F_INSN_CMPSCWR
, && case_sem_INSN_CMPSCWR
},
72 { CRISV32F_INSN_CMPU_M_B_M
, && case_sem_INSN_CMPU_M_B_M
},
73 { CRISV32F_INSN_CMPU_M_W_M
, && case_sem_INSN_CMPU_M_W_M
},
74 { CRISV32F_INSN_CMPUCBR
, && case_sem_INSN_CMPUCBR
},
75 { CRISV32F_INSN_CMPUCWR
, && case_sem_INSN_CMPUCWR
},
76 { CRISV32F_INSN_MOVE_M_B_M
, && case_sem_INSN_MOVE_M_B_M
},
77 { CRISV32F_INSN_MOVE_M_W_M
, && case_sem_INSN_MOVE_M_W_M
},
78 { CRISV32F_INSN_MOVE_M_D_M
, && case_sem_INSN_MOVE_M_D_M
},
79 { CRISV32F_INSN_MOVS_M_B_M
, && case_sem_INSN_MOVS_M_B_M
},
80 { CRISV32F_INSN_MOVS_M_W_M
, && case_sem_INSN_MOVS_M_W_M
},
81 { CRISV32F_INSN_MOVU_M_B_M
, && case_sem_INSN_MOVU_M_B_M
},
82 { CRISV32F_INSN_MOVU_M_W_M
, && case_sem_INSN_MOVU_M_W_M
},
83 { CRISV32F_INSN_MOVE_R_SPRV32
, && case_sem_INSN_MOVE_R_SPRV32
},
84 { CRISV32F_INSN_MOVE_SPR_RV32
, && case_sem_INSN_MOVE_SPR_RV32
},
85 { CRISV32F_INSN_MOVE_M_SPRV32
, && case_sem_INSN_MOVE_M_SPRV32
},
86 { CRISV32F_INSN_MOVE_C_SPRV32_P0
, && case_sem_INSN_MOVE_C_SPRV32_P0
},
87 { CRISV32F_INSN_MOVE_C_SPRV32_P1
, && case_sem_INSN_MOVE_C_SPRV32_P1
},
88 { CRISV32F_INSN_MOVE_C_SPRV32_P2
, && case_sem_INSN_MOVE_C_SPRV32_P2
},
89 { CRISV32F_INSN_MOVE_C_SPRV32_P3
, && case_sem_INSN_MOVE_C_SPRV32_P3
},
90 { CRISV32F_INSN_MOVE_C_SPRV32_P4
, && case_sem_INSN_MOVE_C_SPRV32_P4
},
91 { CRISV32F_INSN_MOVE_C_SPRV32_P5
, && case_sem_INSN_MOVE_C_SPRV32_P5
},
92 { CRISV32F_INSN_MOVE_C_SPRV32_P6
, && case_sem_INSN_MOVE_C_SPRV32_P6
},
93 { CRISV32F_INSN_MOVE_C_SPRV32_P7
, && case_sem_INSN_MOVE_C_SPRV32_P7
},
94 { CRISV32F_INSN_MOVE_C_SPRV32_P8
, && case_sem_INSN_MOVE_C_SPRV32_P8
},
95 { CRISV32F_INSN_MOVE_C_SPRV32_P9
, && case_sem_INSN_MOVE_C_SPRV32_P9
},
96 { CRISV32F_INSN_MOVE_C_SPRV32_P10
, && case_sem_INSN_MOVE_C_SPRV32_P10
},
97 { CRISV32F_INSN_MOVE_C_SPRV32_P11
, && case_sem_INSN_MOVE_C_SPRV32_P11
},
98 { CRISV32F_INSN_MOVE_C_SPRV32_P12
, && case_sem_INSN_MOVE_C_SPRV32_P12
},
99 { CRISV32F_INSN_MOVE_C_SPRV32_P13
, && case_sem_INSN_MOVE_C_SPRV32_P13
},
100 { CRISV32F_INSN_MOVE_C_SPRV32_P14
, && case_sem_INSN_MOVE_C_SPRV32_P14
},
101 { CRISV32F_INSN_MOVE_C_SPRV32_P15
, && case_sem_INSN_MOVE_C_SPRV32_P15
},
102 { CRISV32F_INSN_MOVE_SPR_MV32
, && case_sem_INSN_MOVE_SPR_MV32
},
103 { CRISV32F_INSN_MOVE_SS_R
, && case_sem_INSN_MOVE_SS_R
},
104 { CRISV32F_INSN_MOVE_R_SS
, && case_sem_INSN_MOVE_R_SS
},
105 { CRISV32F_INSN_MOVEM_R_M_V32
, && case_sem_INSN_MOVEM_R_M_V32
},
106 { CRISV32F_INSN_MOVEM_M_R_V32
, && case_sem_INSN_MOVEM_M_R_V32
},
107 { CRISV32F_INSN_ADD_B_R
, && case_sem_INSN_ADD_B_R
},
108 { CRISV32F_INSN_ADD_W_R
, && case_sem_INSN_ADD_W_R
},
109 { CRISV32F_INSN_ADD_D_R
, && case_sem_INSN_ADD_D_R
},
110 { CRISV32F_INSN_ADD_M_B_M
, && case_sem_INSN_ADD_M_B_M
},
111 { CRISV32F_INSN_ADD_M_W_M
, && case_sem_INSN_ADD_M_W_M
},
112 { CRISV32F_INSN_ADD_M_D_M
, && case_sem_INSN_ADD_M_D_M
},
113 { CRISV32F_INSN_ADDCBR
, && case_sem_INSN_ADDCBR
},
114 { CRISV32F_INSN_ADDCWR
, && case_sem_INSN_ADDCWR
},
115 { CRISV32F_INSN_ADDCDR
, && case_sem_INSN_ADDCDR
},
116 { CRISV32F_INSN_ADDS_B_R
, && case_sem_INSN_ADDS_B_R
},
117 { CRISV32F_INSN_ADDS_W_R
, && case_sem_INSN_ADDS_W_R
},
118 { CRISV32F_INSN_ADDS_M_B_M
, && case_sem_INSN_ADDS_M_B_M
},
119 { CRISV32F_INSN_ADDS_M_W_M
, && case_sem_INSN_ADDS_M_W_M
},
120 { CRISV32F_INSN_ADDSCBR
, && case_sem_INSN_ADDSCBR
},
121 { CRISV32F_INSN_ADDSCWR
, && case_sem_INSN_ADDSCWR
},
122 { CRISV32F_INSN_ADDU_B_R
, && case_sem_INSN_ADDU_B_R
},
123 { CRISV32F_INSN_ADDU_W_R
, && case_sem_INSN_ADDU_W_R
},
124 { CRISV32F_INSN_ADDU_M_B_M
, && case_sem_INSN_ADDU_M_B_M
},
125 { CRISV32F_INSN_ADDU_M_W_M
, && case_sem_INSN_ADDU_M_W_M
},
126 { CRISV32F_INSN_ADDUCBR
, && case_sem_INSN_ADDUCBR
},
127 { CRISV32F_INSN_ADDUCWR
, && case_sem_INSN_ADDUCWR
},
128 { CRISV32F_INSN_SUB_B_R
, && case_sem_INSN_SUB_B_R
},
129 { CRISV32F_INSN_SUB_W_R
, && case_sem_INSN_SUB_W_R
},
130 { CRISV32F_INSN_SUB_D_R
, && case_sem_INSN_SUB_D_R
},
131 { CRISV32F_INSN_SUB_M_B_M
, && case_sem_INSN_SUB_M_B_M
},
132 { CRISV32F_INSN_SUB_M_W_M
, && case_sem_INSN_SUB_M_W_M
},
133 { CRISV32F_INSN_SUB_M_D_M
, && case_sem_INSN_SUB_M_D_M
},
134 { CRISV32F_INSN_SUBCBR
, && case_sem_INSN_SUBCBR
},
135 { CRISV32F_INSN_SUBCWR
, && case_sem_INSN_SUBCWR
},
136 { CRISV32F_INSN_SUBCDR
, && case_sem_INSN_SUBCDR
},
137 { CRISV32F_INSN_SUBS_B_R
, && case_sem_INSN_SUBS_B_R
},
138 { CRISV32F_INSN_SUBS_W_R
, && case_sem_INSN_SUBS_W_R
},
139 { CRISV32F_INSN_SUBS_M_B_M
, && case_sem_INSN_SUBS_M_B_M
},
140 { CRISV32F_INSN_SUBS_M_W_M
, && case_sem_INSN_SUBS_M_W_M
},
141 { CRISV32F_INSN_SUBSCBR
, && case_sem_INSN_SUBSCBR
},
142 { CRISV32F_INSN_SUBSCWR
, && case_sem_INSN_SUBSCWR
},
143 { CRISV32F_INSN_SUBU_B_R
, && case_sem_INSN_SUBU_B_R
},
144 { CRISV32F_INSN_SUBU_W_R
, && case_sem_INSN_SUBU_W_R
},
145 { CRISV32F_INSN_SUBU_M_B_M
, && case_sem_INSN_SUBU_M_B_M
},
146 { CRISV32F_INSN_SUBU_M_W_M
, && case_sem_INSN_SUBU_M_W_M
},
147 { CRISV32F_INSN_SUBUCBR
, && case_sem_INSN_SUBUCBR
},
148 { CRISV32F_INSN_SUBUCWR
, && case_sem_INSN_SUBUCWR
},
149 { CRISV32F_INSN_ADDC_R
, && case_sem_INSN_ADDC_R
},
150 { CRISV32F_INSN_ADDC_M
, && case_sem_INSN_ADDC_M
},
151 { CRISV32F_INSN_ADDC_C
, && case_sem_INSN_ADDC_C
},
152 { CRISV32F_INSN_LAPC_D
, && case_sem_INSN_LAPC_D
},
153 { CRISV32F_INSN_LAPCQ
, && case_sem_INSN_LAPCQ
},
154 { CRISV32F_INSN_ADDI_B_R
, && case_sem_INSN_ADDI_B_R
},
155 { CRISV32F_INSN_ADDI_W_R
, && case_sem_INSN_ADDI_W_R
},
156 { CRISV32F_INSN_ADDI_D_R
, && case_sem_INSN_ADDI_D_R
},
157 { CRISV32F_INSN_NEG_B_R
, && case_sem_INSN_NEG_B_R
},
158 { CRISV32F_INSN_NEG_W_R
, && case_sem_INSN_NEG_W_R
},
159 { CRISV32F_INSN_NEG_D_R
, && case_sem_INSN_NEG_D_R
},
160 { CRISV32F_INSN_TEST_M_B_M
, && case_sem_INSN_TEST_M_B_M
},
161 { CRISV32F_INSN_TEST_M_W_M
, && case_sem_INSN_TEST_M_W_M
},
162 { CRISV32F_INSN_TEST_M_D_M
, && case_sem_INSN_TEST_M_D_M
},
163 { CRISV32F_INSN_MOVE_R_M_B_M
, && case_sem_INSN_MOVE_R_M_B_M
},
164 { CRISV32F_INSN_MOVE_R_M_W_M
, && case_sem_INSN_MOVE_R_M_W_M
},
165 { CRISV32F_INSN_MOVE_R_M_D_M
, && case_sem_INSN_MOVE_R_M_D_M
},
166 { CRISV32F_INSN_MULS_B
, && case_sem_INSN_MULS_B
},
167 { CRISV32F_INSN_MULS_W
, && case_sem_INSN_MULS_W
},
168 { CRISV32F_INSN_MULS_D
, && case_sem_INSN_MULS_D
},
169 { CRISV32F_INSN_MULU_B
, && case_sem_INSN_MULU_B
},
170 { CRISV32F_INSN_MULU_W
, && case_sem_INSN_MULU_W
},
171 { CRISV32F_INSN_MULU_D
, && case_sem_INSN_MULU_D
},
172 { CRISV32F_INSN_MCP
, && case_sem_INSN_MCP
},
173 { CRISV32F_INSN_DSTEP
, && case_sem_INSN_DSTEP
},
174 { CRISV32F_INSN_ABS
, && case_sem_INSN_ABS
},
175 { CRISV32F_INSN_AND_B_R
, && case_sem_INSN_AND_B_R
},
176 { CRISV32F_INSN_AND_W_R
, && case_sem_INSN_AND_W_R
},
177 { CRISV32F_INSN_AND_D_R
, && case_sem_INSN_AND_D_R
},
178 { CRISV32F_INSN_AND_M_B_M
, && case_sem_INSN_AND_M_B_M
},
179 { CRISV32F_INSN_AND_M_W_M
, && case_sem_INSN_AND_M_W_M
},
180 { CRISV32F_INSN_AND_M_D_M
, && case_sem_INSN_AND_M_D_M
},
181 { CRISV32F_INSN_ANDCBR
, && case_sem_INSN_ANDCBR
},
182 { CRISV32F_INSN_ANDCWR
, && case_sem_INSN_ANDCWR
},
183 { CRISV32F_INSN_ANDCDR
, && case_sem_INSN_ANDCDR
},
184 { CRISV32F_INSN_ANDQ
, && case_sem_INSN_ANDQ
},
185 { CRISV32F_INSN_ORR_B_R
, && case_sem_INSN_ORR_B_R
},
186 { CRISV32F_INSN_ORR_W_R
, && case_sem_INSN_ORR_W_R
},
187 { CRISV32F_INSN_ORR_D_R
, && case_sem_INSN_ORR_D_R
},
188 { CRISV32F_INSN_OR_M_B_M
, && case_sem_INSN_OR_M_B_M
},
189 { CRISV32F_INSN_OR_M_W_M
, && case_sem_INSN_OR_M_W_M
},
190 { CRISV32F_INSN_OR_M_D_M
, && case_sem_INSN_OR_M_D_M
},
191 { CRISV32F_INSN_ORCBR
, && case_sem_INSN_ORCBR
},
192 { CRISV32F_INSN_ORCWR
, && case_sem_INSN_ORCWR
},
193 { CRISV32F_INSN_ORCDR
, && case_sem_INSN_ORCDR
},
194 { CRISV32F_INSN_ORQ
, && case_sem_INSN_ORQ
},
195 { CRISV32F_INSN_XOR
, && case_sem_INSN_XOR
},
196 { CRISV32F_INSN_SWAP
, && case_sem_INSN_SWAP
},
197 { CRISV32F_INSN_ASRR_B_R
, && case_sem_INSN_ASRR_B_R
},
198 { CRISV32F_INSN_ASRR_W_R
, && case_sem_INSN_ASRR_W_R
},
199 { CRISV32F_INSN_ASRR_D_R
, && case_sem_INSN_ASRR_D_R
},
200 { CRISV32F_INSN_ASRQ
, && case_sem_INSN_ASRQ
},
201 { CRISV32F_INSN_LSRR_B_R
, && case_sem_INSN_LSRR_B_R
},
202 { CRISV32F_INSN_LSRR_W_R
, && case_sem_INSN_LSRR_W_R
},
203 { CRISV32F_INSN_LSRR_D_R
, && case_sem_INSN_LSRR_D_R
},
204 { CRISV32F_INSN_LSRQ
, && case_sem_INSN_LSRQ
},
205 { CRISV32F_INSN_LSLR_B_R
, && case_sem_INSN_LSLR_B_R
},
206 { CRISV32F_INSN_LSLR_W_R
, && case_sem_INSN_LSLR_W_R
},
207 { CRISV32F_INSN_LSLR_D_R
, && case_sem_INSN_LSLR_D_R
},
208 { CRISV32F_INSN_LSLQ
, && case_sem_INSN_LSLQ
},
209 { CRISV32F_INSN_BTST
, && case_sem_INSN_BTST
},
210 { CRISV32F_INSN_BTSTQ
, && case_sem_INSN_BTSTQ
},
211 { CRISV32F_INSN_SETF
, && case_sem_INSN_SETF
},
212 { CRISV32F_INSN_CLEARF
, && case_sem_INSN_CLEARF
},
213 { CRISV32F_INSN_RFE
, && case_sem_INSN_RFE
},
214 { CRISV32F_INSN_SFE
, && case_sem_INSN_SFE
},
215 { CRISV32F_INSN_RFG
, && case_sem_INSN_RFG
},
216 { CRISV32F_INSN_RFN
, && case_sem_INSN_RFN
},
217 { CRISV32F_INSN_HALT
, && case_sem_INSN_HALT
},
218 { CRISV32F_INSN_BCC_B
, && case_sem_INSN_BCC_B
},
219 { CRISV32F_INSN_BA_B
, && case_sem_INSN_BA_B
},
220 { CRISV32F_INSN_BCC_W
, && case_sem_INSN_BCC_W
},
221 { CRISV32F_INSN_BA_W
, && case_sem_INSN_BA_W
},
222 { CRISV32F_INSN_JAS_R
, && case_sem_INSN_JAS_R
},
223 { CRISV32F_INSN_JAS_C
, && case_sem_INSN_JAS_C
},
224 { CRISV32F_INSN_JUMP_P
, && case_sem_INSN_JUMP_P
},
225 { CRISV32F_INSN_BAS_C
, && case_sem_INSN_BAS_C
},
226 { CRISV32F_INSN_JASC_R
, && case_sem_INSN_JASC_R
},
227 { CRISV32F_INSN_JASC_C
, && case_sem_INSN_JASC_C
},
228 { CRISV32F_INSN_BASC_C
, && case_sem_INSN_BASC_C
},
229 { CRISV32F_INSN_BREAK
, && case_sem_INSN_BREAK
},
230 { CRISV32F_INSN_BOUND_R_B_R
, && case_sem_INSN_BOUND_R_B_R
},
231 { CRISV32F_INSN_BOUND_R_W_R
, && case_sem_INSN_BOUND_R_W_R
},
232 { CRISV32F_INSN_BOUND_R_D_R
, && case_sem_INSN_BOUND_R_D_R
},
233 { CRISV32F_INSN_BOUND_CB
, && case_sem_INSN_BOUND_CB
},
234 { CRISV32F_INSN_BOUND_CW
, && case_sem_INSN_BOUND_CW
},
235 { CRISV32F_INSN_BOUND_CD
, && case_sem_INSN_BOUND_CD
},
236 { CRISV32F_INSN_SCC
, && case_sem_INSN_SCC
},
237 { CRISV32F_INSN_LZ
, && case_sem_INSN_LZ
},
238 { CRISV32F_INSN_ADDOQ
, && case_sem_INSN_ADDOQ
},
239 { CRISV32F_INSN_ADDO_M_B_M
, && case_sem_INSN_ADDO_M_B_M
},
240 { CRISV32F_INSN_ADDO_M_W_M
, && case_sem_INSN_ADDO_M_W_M
},
241 { CRISV32F_INSN_ADDO_M_D_M
, && case_sem_INSN_ADDO_M_D_M
},
242 { CRISV32F_INSN_ADDO_CB
, && case_sem_INSN_ADDO_CB
},
243 { CRISV32F_INSN_ADDO_CW
, && case_sem_INSN_ADDO_CW
},
244 { CRISV32F_INSN_ADDO_CD
, && case_sem_INSN_ADDO_CD
},
245 { CRISV32F_INSN_ADDI_ACR_B_R
, && case_sem_INSN_ADDI_ACR_B_R
},
246 { CRISV32F_INSN_ADDI_ACR_W_R
, && case_sem_INSN_ADDI_ACR_W_R
},
247 { CRISV32F_INSN_ADDI_ACR_D_R
, && case_sem_INSN_ADDI_ACR_D_R
},
248 { CRISV32F_INSN_FIDXI
, && case_sem_INSN_FIDXI
},
249 { CRISV32F_INSN_FTAGI
, && case_sem_INSN_FTAGI
},
250 { CRISV32F_INSN_FIDXD
, && case_sem_INSN_FIDXD
},
251 { CRISV32F_INSN_FTAGD
, && case_sem_INSN_FTAGD
},
256 for (i
= 0; labels
[i
].label
!= 0; ++i
)
259 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
261 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
266 #endif /* DEFINE_LABELS */
270 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
271 off frills like tracing and profiling. */
272 /* FIXME: A better way would be to have TRACE_RESULT check for something
273 that can cause it to be optimized out. Another way would be to emit
274 special handlers into the instruction "stream". */
278 #define TRACE_RESULT(cpu, abuf, name, type, val)
282 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
283 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
285 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
292 /* Branch to next handler without going around main loop. */
293 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
294 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
296 #else /* ! WITH_SCACHE_PBB */
298 #define NEXT(vpc) BREAK (sem)
301 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
303 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
306 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
309 #endif /* ! WITH_SCACHE_PBB */
313 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
315 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
316 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
317 #define FLD(f) abuf->fields.fmt_empty.f
318 int UNUSED written
= 0;
319 IADDR UNUSED pc
= abuf
->addr
;
320 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
323 /* Update the recorded pc in the cpu state struct.
324 Only necessary for WITH_SCACHE case, but to avoid the
325 conditional compilation .... */
327 /* Virtual insns have zero size. Overwrite vpc with address of next insn
328 using the default-insn-bitsize spec. When executing insns in parallel
329 we may want to queue the fault and continue execution. */
330 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
331 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
338 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
340 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
341 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
342 #define FLD(f) abuf->fields.fmt_empty.f
343 int UNUSED written
= 0;
344 IADDR UNUSED pc
= abuf
->addr
;
345 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
348 #if WITH_SCACHE_PBB_CRISV32F
349 crisv32f_pbb_after (current_cpu
, sem_arg
);
357 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
359 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
360 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
361 #define FLD(f) abuf->fields.fmt_empty.f
362 int UNUSED written
= 0;
363 IADDR UNUSED pc
= abuf
->addr
;
364 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
367 #if WITH_SCACHE_PBB_CRISV32F
368 crisv32f_pbb_before (current_cpu
, sem_arg
);
376 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
378 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
379 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
380 #define FLD(f) abuf->fields.fmt_empty.f
381 int UNUSED written
= 0;
382 IADDR UNUSED pc
= abuf
->addr
;
383 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
386 #if WITH_SCACHE_PBB_CRISV32F
388 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
389 pbb_br_type
, pbb_br_npc
);
392 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
393 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
394 CPU_PBB_BR_TYPE (current_cpu
),
395 CPU_PBB_BR_NPC (current_cpu
));
404 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
406 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
407 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
408 #define FLD(f) abuf->fields.fmt_empty.f
409 int UNUSED written
= 0;
410 IADDR UNUSED pc
= abuf
->addr
;
411 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
414 #if WITH_SCACHE_PBB_CRISV32F
415 vpc
= crisv32f_pbb_chain (current_cpu
, sem_arg
);
426 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
428 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
429 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
430 #define FLD(f) abuf->fields.fmt_empty.f
431 int UNUSED written
= 0;
432 IADDR UNUSED pc
= abuf
->addr
;
433 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
436 #if WITH_SCACHE_PBB_CRISV32F
437 #if defined DEFINE_SWITCH || defined FAST_P
438 /* In the switch case FAST_P is a constant, allowing several optimizations
439 in any called inline functions. */
440 vpc
= crisv32f_pbb_begin (current_cpu
, FAST_P
);
442 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
443 vpc
= crisv32f_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
445 vpc
= crisv32f_pbb_begin (current_cpu
, 0);
455 CASE (sem
, INSN_MOVE_B_R
) : /* move.b move.m ${Rs},${Rd} */
457 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
458 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
459 #define FLD(f) abuf->fields.sfmt_addc_m.f
460 int UNUSED written
= 0;
461 IADDR UNUSED pc
= abuf
->addr
;
462 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
466 tmp_newval
= GET_H_GR (FLD (f_operand1
));
469 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
471 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
472 SET_H_GR (FLD (f_operand2
), opval
);
473 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
478 BI opval
= LTQI (tmp_newval
, 0);
479 CPU (h_nbit
) = opval
;
480 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
483 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
484 CPU (h_zbit
) = opval
;
485 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
492 CPU (h_xbit
) = opval
;
493 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
497 SET_H_INSN_PREFIXED_P (opval
);
498 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
508 CASE (sem
, INSN_MOVE_W_R
) : /* move.w move.m ${Rs},${Rd} */
510 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
511 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
512 #define FLD(f) abuf->fields.sfmt_addc_m.f
513 int UNUSED written
= 0;
514 IADDR UNUSED pc
= abuf
->addr
;
515 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
519 tmp_newval
= GET_H_GR (FLD (f_operand1
));
522 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
524 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
525 SET_H_GR (FLD (f_operand2
), opval
);
526 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
531 BI opval
= LTHI (tmp_newval
, 0);
532 CPU (h_nbit
) = opval
;
533 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
536 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
537 CPU (h_zbit
) = opval
;
538 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
545 CPU (h_xbit
) = opval
;
546 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
550 SET_H_INSN_PREFIXED_P (opval
);
551 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
561 CASE (sem
, INSN_MOVE_D_R
) : /* move.d move.m ${Rs},${Rd} */
563 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
564 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
565 #define FLD(f) abuf->fields.sfmt_addc_m.f
566 int UNUSED written
= 0;
567 IADDR UNUSED pc
= abuf
->addr
;
568 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
572 tmp_newval
= GET_H_GR (FLD (f_operand1
));
574 SI opval
= tmp_newval
;
575 SET_H_GR (FLD (f_operand2
), opval
);
576 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
580 BI opval
= LTSI (tmp_newval
, 0);
581 CPU (h_nbit
) = opval
;
582 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
585 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
586 CPU (h_zbit
) = opval
;
587 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
594 CPU (h_xbit
) = opval
;
595 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
599 SET_H_INSN_PREFIXED_P (opval
);
600 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
610 CASE (sem
, INSN_MOVEQ
) : /* moveq $i,$Rd */
612 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
613 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
614 #define FLD(f) abuf->fields.sfmt_moveq.f
615 int UNUSED written
= 0;
616 IADDR UNUSED pc
= abuf
->addr
;
617 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
621 tmp_newval
= FLD (f_s6
);
623 SI opval
= tmp_newval
;
624 SET_H_GR (FLD (f_operand2
), opval
);
625 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
628 SET_H_NBIT_MOVE (LTSI (tmp_newval
, 0));
629 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1))));
635 CPU (h_xbit
) = opval
;
636 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
640 SET_H_INSN_PREFIXED_P (opval
);
641 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
651 CASE (sem
, INSN_MOVS_B_R
) : /* movs.b movs.m ${Rs},${Rd} */
653 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
654 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
655 #define FLD(f) abuf->fields.sfmt_muls_b.f
656 int UNUSED written
= 0;
657 IADDR UNUSED pc
= abuf
->addr
;
658 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
662 tmp_newval
= GET_H_GR (FLD (f_operand1
));
664 SI opval
= EXTQISI (tmp_newval
);
665 SET_H_GR (FLD (f_operand2
), opval
);
666 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
670 BI opval
= LTSI (tmp_newval
, 0);
671 CPU (h_nbit
) = opval
;
672 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
675 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
676 CPU (h_zbit
) = opval
;
677 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
684 CPU (h_xbit
) = opval
;
685 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
689 SET_H_INSN_PREFIXED_P (opval
);
690 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
700 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
702 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
703 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
704 #define FLD(f) abuf->fields.sfmt_muls_b.f
705 int UNUSED written
= 0;
706 IADDR UNUSED pc
= abuf
->addr
;
707 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
711 tmp_newval
= GET_H_GR (FLD (f_operand1
));
713 SI opval
= EXTHISI (tmp_newval
);
714 SET_H_GR (FLD (f_operand2
), opval
);
715 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
719 BI opval
= LTSI (tmp_newval
, 0);
720 CPU (h_nbit
) = opval
;
721 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
724 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
725 CPU (h_zbit
) = opval
;
726 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
733 CPU (h_xbit
) = opval
;
734 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
738 SET_H_INSN_PREFIXED_P (opval
);
739 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
749 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
751 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
752 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
753 #define FLD(f) abuf->fields.sfmt_muls_b.f
754 int UNUSED written
= 0;
755 IADDR UNUSED pc
= abuf
->addr
;
756 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
760 tmp_newval
= GET_H_GR (FLD (f_operand1
));
762 SI opval
= ZEXTQISI (tmp_newval
);
763 SET_H_GR (FLD (f_operand2
), opval
);
764 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
768 BI opval
= LTSI (tmp_newval
, 0);
769 CPU (h_nbit
) = opval
;
770 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
773 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
774 CPU (h_zbit
) = opval
;
775 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
782 CPU (h_xbit
) = opval
;
783 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
787 SET_H_INSN_PREFIXED_P (opval
);
788 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
798 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
800 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
801 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
802 #define FLD(f) abuf->fields.sfmt_muls_b.f
803 int UNUSED written
= 0;
804 IADDR UNUSED pc
= abuf
->addr
;
805 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
809 tmp_newval
= GET_H_GR (FLD (f_operand1
));
811 SI opval
= ZEXTHISI (tmp_newval
);
812 SET_H_GR (FLD (f_operand2
), opval
);
813 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
817 BI opval
= LTSI (tmp_newval
, 0);
818 CPU (h_nbit
) = opval
;
819 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
822 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
823 CPU (h_zbit
) = opval
;
824 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
831 CPU (h_xbit
) = opval
;
832 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
836 SET_H_INSN_PREFIXED_P (opval
);
837 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
847 CASE (sem
, INSN_MOVECBR
) : /* move.b ${sconst8},${Rd} */
849 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
850 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
851 #define FLD(f) abuf->fields.sfmt_addcbr.f
852 int UNUSED written
= 0;
853 IADDR UNUSED pc
= abuf
->addr
;
854 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
858 tmp_newval
= FLD (f_indir_pc__byte
);
861 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
863 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
864 SET_H_GR (FLD (f_operand2
), opval
);
865 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
870 BI opval
= LTQI (tmp_newval
, 0);
871 CPU (h_nbit
) = opval
;
872 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
875 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
876 CPU (h_zbit
) = opval
;
877 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
884 CPU (h_xbit
) = opval
;
885 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
889 SET_H_INSN_PREFIXED_P (opval
);
890 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
900 CASE (sem
, INSN_MOVECWR
) : /* move.w ${sconst16},${Rd} */
902 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
903 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
904 #define FLD(f) abuf->fields.sfmt_addcwr.f
905 int UNUSED written
= 0;
906 IADDR UNUSED pc
= abuf
->addr
;
907 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
911 tmp_newval
= FLD (f_indir_pc__word
);
914 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
916 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
917 SET_H_GR (FLD (f_operand2
), opval
);
918 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
923 BI opval
= LTHI (tmp_newval
, 0);
924 CPU (h_nbit
) = opval
;
925 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
928 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
929 CPU (h_zbit
) = opval
;
930 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
937 CPU (h_xbit
) = opval
;
938 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
942 SET_H_INSN_PREFIXED_P (opval
);
943 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
953 CASE (sem
, INSN_MOVECDR
) : /* move.d ${const32},${Rd} */
955 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
957 #define FLD(f) abuf->fields.sfmt_bound_cd.f
958 int UNUSED written
= 0;
959 IADDR UNUSED pc
= abuf
->addr
;
960 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
964 tmp_newval
= FLD (f_indir_pc__dword
);
966 SI opval
= tmp_newval
;
967 SET_H_GR (FLD (f_operand2
), opval
);
968 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
972 BI opval
= LTSI (tmp_newval
, 0);
973 CPU (h_nbit
) = opval
;
974 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
977 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
978 CPU (h_zbit
) = opval
;
979 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
986 CPU (h_xbit
) = opval
;
987 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
991 SET_H_INSN_PREFIXED_P (opval
);
992 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1002 CASE (sem
, INSN_MOVSCBR
) : /* movs.b ${sconst8},${Rd} */
1004 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1005 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1006 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1007 int UNUSED written
= 0;
1008 IADDR UNUSED pc
= abuf
->addr
;
1009 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1013 tmp_newval
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1015 SI opval
= tmp_newval
;
1016 SET_H_GR (FLD (f_operand2
), opval
);
1017 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1021 BI opval
= LTSI (tmp_newval
, 0);
1022 CPU (h_nbit
) = opval
;
1023 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1026 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1027 CPU (h_zbit
) = opval
;
1028 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1030 SET_H_CBIT_MOVE (0);
1031 SET_H_VBIT_MOVE (0);
1035 CPU (h_xbit
) = opval
;
1036 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1040 SET_H_INSN_PREFIXED_P (opval
);
1041 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1051 CASE (sem
, INSN_MOVSCWR
) : /* movs.w ${sconst16},${Rd} */
1053 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1054 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1055 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1056 int UNUSED written
= 0;
1057 IADDR UNUSED pc
= abuf
->addr
;
1058 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1062 tmp_newval
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1064 SI opval
= tmp_newval
;
1065 SET_H_GR (FLD (f_operand2
), opval
);
1066 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1070 BI opval
= LTSI (tmp_newval
, 0);
1071 CPU (h_nbit
) = opval
;
1072 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1075 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1076 CPU (h_zbit
) = opval
;
1077 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1079 SET_H_CBIT_MOVE (0);
1080 SET_H_VBIT_MOVE (0);
1084 CPU (h_xbit
) = opval
;
1085 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1089 SET_H_INSN_PREFIXED_P (opval
);
1090 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1100 CASE (sem
, INSN_MOVUCBR
) : /* movu.b ${uconst8},${Rd} */
1102 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1103 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1104 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1105 int UNUSED written
= 0;
1106 IADDR UNUSED pc
= abuf
->addr
;
1107 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1111 tmp_newval
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1113 SI opval
= tmp_newval
;
1114 SET_H_GR (FLD (f_operand2
), opval
);
1115 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1119 BI opval
= LTSI (tmp_newval
, 0);
1120 CPU (h_nbit
) = opval
;
1121 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1124 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1125 CPU (h_zbit
) = opval
;
1126 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1128 SET_H_CBIT_MOVE (0);
1129 SET_H_VBIT_MOVE (0);
1133 CPU (h_xbit
) = opval
;
1134 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1138 SET_H_INSN_PREFIXED_P (opval
);
1139 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1149 CASE (sem
, INSN_MOVUCWR
) : /* movu.w ${uconst16},${Rd} */
1151 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1152 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1153 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1154 int UNUSED written
= 0;
1155 IADDR UNUSED pc
= abuf
->addr
;
1156 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1160 tmp_newval
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1162 SI opval
= tmp_newval
;
1163 SET_H_GR (FLD (f_operand2
), opval
);
1164 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1168 BI opval
= LTSI (tmp_newval
, 0);
1169 CPU (h_nbit
) = opval
;
1170 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1173 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1174 CPU (h_zbit
) = opval
;
1175 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1177 SET_H_CBIT_MOVE (0);
1178 SET_H_VBIT_MOVE (0);
1182 CPU (h_xbit
) = opval
;
1183 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1187 SET_H_INSN_PREFIXED_P (opval
);
1188 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1198 CASE (sem
, INSN_ADDQ
) : /* addq $j,$Rd */
1200 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1201 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1202 #define FLD(f) abuf->fields.sfmt_addq.f
1203 int UNUSED written
= 0;
1204 IADDR UNUSED pc
= abuf
->addr
;
1205 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1212 tmp_tmpops
= FLD (f_u6
);
1213 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1214 tmp_carry
= CPU (h_cbit
);
1215 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1217 SI opval
= tmp_newval
;
1218 SET_H_GR (FLD (f_operand2
), opval
);
1219 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1223 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))));
1224 CPU (h_cbit
) = opval
;
1225 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1228 BI opval
= LTSI (tmp_newval
, 0);
1229 CPU (h_nbit
) = opval
;
1230 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1233 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1234 CPU (h_zbit
) = opval
;
1235 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1238 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)));
1239 CPU (h_vbit
) = opval
;
1240 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1245 CPU (h_xbit
) = opval
;
1246 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1250 SET_H_INSN_PREFIXED_P (opval
);
1251 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1261 CASE (sem
, INSN_SUBQ
) : /* subq $j,$Rd */
1263 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1264 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1265 #define FLD(f) abuf->fields.sfmt_addq.f
1266 int UNUSED written
= 0;
1267 IADDR UNUSED pc
= abuf
->addr
;
1268 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1275 tmp_tmpops
= FLD (f_u6
);
1276 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1277 tmp_carry
= CPU (h_cbit
);
1278 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1280 SI opval
= tmp_newval
;
1281 SET_H_GR (FLD (f_operand2
), opval
);
1282 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1286 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))));
1287 CPU (h_cbit
) = opval
;
1288 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1291 BI opval
= LTSI (tmp_newval
, 0);
1292 CPU (h_nbit
) = opval
;
1293 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1296 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1297 CPU (h_zbit
) = opval
;
1298 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1301 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)));
1302 CPU (h_vbit
) = opval
;
1303 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1308 CPU (h_xbit
) = opval
;
1309 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1313 SET_H_INSN_PREFIXED_P (opval
);
1314 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1324 CASE (sem
, INSN_CMP_R_B_R
) : /* cmp-r.b $Rs,$Rd */
1326 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1327 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1328 #define FLD(f) abuf->fields.sfmt_muls_b.f
1329 int UNUSED written
= 0;
1330 IADDR UNUSED pc
= abuf
->addr
;
1331 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1338 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1339 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1340 tmp_carry
= CPU (h_cbit
);
1341 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1345 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))));
1346 CPU (h_cbit
) = opval
;
1347 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1350 BI opval
= LTQI (tmp_newval
, 0);
1351 CPU (h_nbit
) = opval
;
1352 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1355 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1356 CPU (h_zbit
) = opval
;
1357 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1360 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)));
1361 CPU (h_vbit
) = opval
;
1362 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1367 CPU (h_xbit
) = opval
;
1368 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1372 SET_H_INSN_PREFIXED_P (opval
);
1373 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1383 CASE (sem
, INSN_CMP_R_W_R
) : /* cmp-r.w $Rs,$Rd */
1385 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1386 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1387 #define FLD(f) abuf->fields.sfmt_muls_b.f
1388 int UNUSED written
= 0;
1389 IADDR UNUSED pc
= abuf
->addr
;
1390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1397 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1398 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1399 tmp_carry
= CPU (h_cbit
);
1400 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1404 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))));
1405 CPU (h_cbit
) = opval
;
1406 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1409 BI opval
= LTHI (tmp_newval
, 0);
1410 CPU (h_nbit
) = opval
;
1411 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1414 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1415 CPU (h_zbit
) = opval
;
1416 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1419 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)));
1420 CPU (h_vbit
) = opval
;
1421 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1426 CPU (h_xbit
) = opval
;
1427 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1431 SET_H_INSN_PREFIXED_P (opval
);
1432 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1442 CASE (sem
, INSN_CMP_R_D_R
) : /* cmp-r.d $Rs,$Rd */
1444 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1445 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1446 #define FLD(f) abuf->fields.sfmt_muls_b.f
1447 int UNUSED written
= 0;
1448 IADDR UNUSED pc
= abuf
->addr
;
1449 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1456 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1457 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1458 tmp_carry
= CPU (h_cbit
);
1459 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1463 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))));
1464 CPU (h_cbit
) = opval
;
1465 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1468 BI opval
= LTSI (tmp_newval
, 0);
1469 CPU (h_nbit
) = opval
;
1470 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1473 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1474 CPU (h_zbit
) = opval
;
1475 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1478 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)));
1479 CPU (h_vbit
) = opval
;
1480 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1485 CPU (h_xbit
) = opval
;
1486 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1490 SET_H_INSN_PREFIXED_P (opval
);
1491 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1501 CASE (sem
, INSN_CMP_M_B_M
) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1503 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1504 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1505 #define FLD(f) abuf->fields.sfmt_addc_m.f
1506 int UNUSED written
= 0;
1507 IADDR UNUSED pc
= abuf
->addr
;
1508 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1515 tmp_tmpops
= ({ SI tmp_addr
;
1518 tmp_postinc
= FLD (f_memmode
);
1519 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1520 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1521 ; if (NEBI (tmp_postinc
, 0)) {
1523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1524 tmp_addr
= ADDSI (tmp_addr
, 1);
1527 SI opval
= tmp_addr
;
1528 SET_H_GR (FLD (f_operand1
), opval
);
1529 written
|= (1 << 9);
1530 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1535 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1536 tmp_carry
= CPU (h_cbit
);
1537 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1541 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))));
1542 CPU (h_cbit
) = opval
;
1543 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1546 BI opval
= LTQI (tmp_newval
, 0);
1547 CPU (h_nbit
) = opval
;
1548 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1551 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1552 CPU (h_zbit
) = opval
;
1553 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1556 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)));
1557 CPU (h_vbit
) = opval
;
1558 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1563 CPU (h_xbit
) = opval
;
1564 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1568 SET_H_INSN_PREFIXED_P (opval
);
1569 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1575 abuf
->written
= written
;
1580 CASE (sem
, INSN_CMP_M_W_M
) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1582 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1583 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1584 #define FLD(f) abuf->fields.sfmt_addc_m.f
1585 int UNUSED written
= 0;
1586 IADDR UNUSED pc
= abuf
->addr
;
1587 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1594 tmp_tmpops
= ({ SI tmp_addr
;
1597 tmp_postinc
= FLD (f_memmode
);
1598 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1599 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
1600 ; if (NEBI (tmp_postinc
, 0)) {
1602 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1603 tmp_addr
= ADDSI (tmp_addr
, 2);
1606 SI opval
= tmp_addr
;
1607 SET_H_GR (FLD (f_operand1
), opval
);
1608 written
|= (1 << 9);
1609 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1614 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1615 tmp_carry
= CPU (h_cbit
);
1616 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1620 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))));
1621 CPU (h_cbit
) = opval
;
1622 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1625 BI opval
= LTHI (tmp_newval
, 0);
1626 CPU (h_nbit
) = opval
;
1627 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1630 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1631 CPU (h_zbit
) = opval
;
1632 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1635 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)));
1636 CPU (h_vbit
) = opval
;
1637 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1642 CPU (h_xbit
) = opval
;
1643 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1647 SET_H_INSN_PREFIXED_P (opval
);
1648 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1654 abuf
->written
= written
;
1659 CASE (sem
, INSN_CMP_M_D_M
) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1661 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1662 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1663 #define FLD(f) abuf->fields.sfmt_addc_m.f
1664 int UNUSED written
= 0;
1665 IADDR UNUSED pc
= abuf
->addr
;
1666 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1673 tmp_tmpops
= ({ SI tmp_addr
;
1676 tmp_postinc
= FLD (f_memmode
);
1677 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1678 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
1679 ; if (NEBI (tmp_postinc
, 0)) {
1681 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1682 tmp_addr
= ADDSI (tmp_addr
, 4);
1685 SI opval
= tmp_addr
;
1686 SET_H_GR (FLD (f_operand1
), opval
);
1687 written
|= (1 << 9);
1688 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1693 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1694 tmp_carry
= CPU (h_cbit
);
1695 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1699 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))));
1700 CPU (h_cbit
) = opval
;
1701 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1704 BI opval
= LTSI (tmp_newval
, 0);
1705 CPU (h_nbit
) = opval
;
1706 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1709 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1710 CPU (h_zbit
) = opval
;
1711 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1714 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)));
1715 CPU (h_vbit
) = opval
;
1716 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1721 CPU (h_xbit
) = opval
;
1722 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1726 SET_H_INSN_PREFIXED_P (opval
);
1727 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1733 abuf
->written
= written
;
1738 CASE (sem
, INSN_CMPCBR
) : /* cmp.b $sconst8,$Rd */
1740 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1741 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1742 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1743 int UNUSED written
= 0;
1744 IADDR UNUSED pc
= abuf
->addr
;
1745 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1752 tmp_tmpops
= TRUNCSIQI (FLD (f_indir_pc__byte
));
1753 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1754 tmp_carry
= CPU (h_cbit
);
1755 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1759 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))));
1760 CPU (h_cbit
) = opval
;
1761 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1764 BI opval
= LTQI (tmp_newval
, 0);
1765 CPU (h_nbit
) = opval
;
1766 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1769 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1770 CPU (h_zbit
) = opval
;
1771 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1774 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)));
1775 CPU (h_vbit
) = opval
;
1776 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1781 CPU (h_xbit
) = opval
;
1782 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1786 SET_H_INSN_PREFIXED_P (opval
);
1787 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1797 CASE (sem
, INSN_CMPCWR
) : /* cmp.w $sconst16,$Rd */
1799 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1800 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1801 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1802 int UNUSED written
= 0;
1803 IADDR UNUSED pc
= abuf
->addr
;
1804 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1811 tmp_tmpops
= TRUNCSIHI (FLD (f_indir_pc__word
));
1812 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1813 tmp_carry
= CPU (h_cbit
);
1814 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1818 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))));
1819 CPU (h_cbit
) = opval
;
1820 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1823 BI opval
= LTHI (tmp_newval
, 0);
1824 CPU (h_nbit
) = opval
;
1825 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1828 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1829 CPU (h_zbit
) = opval
;
1830 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1833 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)));
1834 CPU (h_vbit
) = opval
;
1835 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1840 CPU (h_xbit
) = opval
;
1841 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1845 SET_H_INSN_PREFIXED_P (opval
);
1846 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1856 CASE (sem
, INSN_CMPCDR
) : /* cmp.d $const32,$Rd */
1858 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1859 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1860 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1861 int UNUSED written
= 0;
1862 IADDR UNUSED pc
= abuf
->addr
;
1863 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1870 tmp_tmpops
= FLD (f_indir_pc__dword
);
1871 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1872 tmp_carry
= CPU (h_cbit
);
1873 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1877 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))));
1878 CPU (h_cbit
) = opval
;
1879 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1882 BI opval
= LTSI (tmp_newval
, 0);
1883 CPU (h_nbit
) = opval
;
1884 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1887 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1888 CPU (h_zbit
) = opval
;
1889 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1892 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)));
1893 CPU (h_vbit
) = opval
;
1894 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1899 CPU (h_xbit
) = opval
;
1900 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1904 SET_H_INSN_PREFIXED_P (opval
);
1905 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1915 CASE (sem
, INSN_CMPQ
) : /* cmpq $i,$Rd */
1917 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1918 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1919 #define FLD(f) abuf->fields.sfmt_andq.f
1920 int UNUSED written
= 0;
1921 IADDR UNUSED pc
= abuf
->addr
;
1922 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1929 tmp_tmpops
= FLD (f_s6
);
1930 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1931 tmp_carry
= CPU (h_cbit
);
1932 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1936 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))));
1937 CPU (h_cbit
) = opval
;
1938 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1941 BI opval
= LTSI (tmp_newval
, 0);
1942 CPU (h_nbit
) = opval
;
1943 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1946 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1947 CPU (h_zbit
) = opval
;
1948 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1951 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)));
1952 CPU (h_vbit
) = opval
;
1953 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1958 CPU (h_xbit
) = opval
;
1959 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1963 SET_H_INSN_PREFIXED_P (opval
);
1964 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1974 CASE (sem
, INSN_CMPS_M_B_M
) : /* cmps-m.b [${Rs}${inc}],$Rd */
1976 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1978 #define FLD(f) abuf->fields.sfmt_addc_m.f
1979 int UNUSED written
= 0;
1980 IADDR UNUSED pc
= abuf
->addr
;
1981 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1988 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
1991 tmp_postinc
= FLD (f_memmode
);
1992 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1993 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1994 ; if (NEBI (tmp_postinc
, 0)) {
1996 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1997 tmp_addr
= ADDSI (tmp_addr
, 1);
2000 SI opval
= tmp_addr
;
2001 SET_H_GR (FLD (f_operand1
), opval
);
2002 written
|= (1 << 9);
2003 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2008 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2009 tmp_carry
= CPU (h_cbit
);
2010 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2014 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))));
2015 CPU (h_cbit
) = opval
;
2016 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2019 BI opval
= LTSI (tmp_newval
, 0);
2020 CPU (h_nbit
) = opval
;
2021 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2024 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2025 CPU (h_zbit
) = opval
;
2026 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2029 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)));
2030 CPU (h_vbit
) = opval
;
2031 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2036 CPU (h_xbit
) = opval
;
2037 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2041 SET_H_INSN_PREFIXED_P (opval
);
2042 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2048 abuf
->written
= written
;
2053 CASE (sem
, INSN_CMPS_M_W_M
) : /* cmps-m.w [${Rs}${inc}],$Rd */
2055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2057 #define FLD(f) abuf->fields.sfmt_addc_m.f
2058 int UNUSED written
= 0;
2059 IADDR UNUSED pc
= abuf
->addr
;
2060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2067 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
2070 tmp_postinc
= FLD (f_memmode
);
2071 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2072 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2073 ; if (NEBI (tmp_postinc
, 0)) {
2075 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2076 tmp_addr
= ADDSI (tmp_addr
, 2);
2079 SI opval
= tmp_addr
;
2080 SET_H_GR (FLD (f_operand1
), opval
);
2081 written
|= (1 << 9);
2082 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2087 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2088 tmp_carry
= CPU (h_cbit
);
2089 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2093 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))));
2094 CPU (h_cbit
) = opval
;
2095 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2098 BI opval
= LTSI (tmp_newval
, 0);
2099 CPU (h_nbit
) = opval
;
2100 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2103 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2104 CPU (h_zbit
) = opval
;
2105 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2108 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)));
2109 CPU (h_vbit
) = opval
;
2110 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2115 CPU (h_xbit
) = opval
;
2116 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2120 SET_H_INSN_PREFIXED_P (opval
);
2121 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2127 abuf
->written
= written
;
2132 CASE (sem
, INSN_CMPSCBR
) : /* [${Rs}${inc}],$Rd */
2134 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2135 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2136 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2137 int UNUSED written
= 0;
2138 IADDR UNUSED pc
= abuf
->addr
;
2139 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2146 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2147 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2148 tmp_carry
= CPU (h_cbit
);
2149 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2153 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))));
2154 CPU (h_cbit
) = opval
;
2155 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2158 BI opval
= LTSI (tmp_newval
, 0);
2159 CPU (h_nbit
) = opval
;
2160 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2163 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2164 CPU (h_zbit
) = opval
;
2165 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2168 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)));
2169 CPU (h_vbit
) = opval
;
2170 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2175 CPU (h_xbit
) = opval
;
2176 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2180 SET_H_INSN_PREFIXED_P (opval
);
2181 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2191 CASE (sem
, INSN_CMPSCWR
) : /* [${Rs}${inc}],$Rd */
2193 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2194 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2195 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2196 int UNUSED written
= 0;
2197 IADDR UNUSED pc
= abuf
->addr
;
2198 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2205 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2206 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2207 tmp_carry
= CPU (h_cbit
);
2208 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2212 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))));
2213 CPU (h_cbit
) = opval
;
2214 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2217 BI opval
= LTSI (tmp_newval
, 0);
2218 CPU (h_nbit
) = opval
;
2219 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2222 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2223 CPU (h_zbit
) = opval
;
2224 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2227 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)));
2228 CPU (h_vbit
) = opval
;
2229 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2234 CPU (h_xbit
) = opval
;
2235 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2239 SET_H_INSN_PREFIXED_P (opval
);
2240 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2250 CASE (sem
, INSN_CMPU_M_B_M
) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2252 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2253 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2254 #define FLD(f) abuf->fields.sfmt_addc_m.f
2255 int UNUSED written
= 0;
2256 IADDR UNUSED pc
= abuf
->addr
;
2257 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2264 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
2267 tmp_postinc
= FLD (f_memmode
);
2268 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2269 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2270 ; if (NEBI (tmp_postinc
, 0)) {
2272 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2273 tmp_addr
= ADDSI (tmp_addr
, 1);
2276 SI opval
= tmp_addr
;
2277 SET_H_GR (FLD (f_operand1
), opval
);
2278 written
|= (1 << 9);
2279 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2284 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2285 tmp_carry
= CPU (h_cbit
);
2286 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2290 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))));
2291 CPU (h_cbit
) = opval
;
2292 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2295 BI opval
= LTSI (tmp_newval
, 0);
2296 CPU (h_nbit
) = opval
;
2297 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2300 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2301 CPU (h_zbit
) = opval
;
2302 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2305 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)));
2306 CPU (h_vbit
) = opval
;
2307 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2312 CPU (h_xbit
) = opval
;
2313 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2317 SET_H_INSN_PREFIXED_P (opval
);
2318 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2324 abuf
->written
= written
;
2329 CASE (sem
, INSN_CMPU_M_W_M
) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2331 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2332 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2333 #define FLD(f) abuf->fields.sfmt_addc_m.f
2334 int UNUSED written
= 0;
2335 IADDR UNUSED pc
= abuf
->addr
;
2336 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2343 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
2346 tmp_postinc
= FLD (f_memmode
);
2347 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2348 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2349 ; if (NEBI (tmp_postinc
, 0)) {
2351 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2352 tmp_addr
= ADDSI (tmp_addr
, 2);
2355 SI opval
= tmp_addr
;
2356 SET_H_GR (FLD (f_operand1
), opval
);
2357 written
|= (1 << 9);
2358 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2363 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2364 tmp_carry
= CPU (h_cbit
);
2365 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2369 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))));
2370 CPU (h_cbit
) = opval
;
2371 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2374 BI opval
= LTSI (tmp_newval
, 0);
2375 CPU (h_nbit
) = opval
;
2376 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2379 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2380 CPU (h_zbit
) = opval
;
2381 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2384 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)));
2385 CPU (h_vbit
) = opval
;
2386 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2391 CPU (h_xbit
) = opval
;
2392 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2396 SET_H_INSN_PREFIXED_P (opval
);
2397 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2403 abuf
->written
= written
;
2408 CASE (sem
, INSN_CMPUCBR
) : /* [${Rs}${inc}],$Rd */
2410 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2411 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2412 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2413 int UNUSED written
= 0;
2414 IADDR UNUSED pc
= abuf
->addr
;
2415 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2422 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2423 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2424 tmp_carry
= CPU (h_cbit
);
2425 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2429 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))));
2430 CPU (h_cbit
) = opval
;
2431 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2434 BI opval
= LTSI (tmp_newval
, 0);
2435 CPU (h_nbit
) = opval
;
2436 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2439 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2440 CPU (h_zbit
) = opval
;
2441 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2444 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)));
2445 CPU (h_vbit
) = opval
;
2446 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2451 CPU (h_xbit
) = opval
;
2452 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2456 SET_H_INSN_PREFIXED_P (opval
);
2457 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2467 CASE (sem
, INSN_CMPUCWR
) : /* [${Rs}${inc}],$Rd */
2469 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2470 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2471 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2472 int UNUSED written
= 0;
2473 IADDR UNUSED pc
= abuf
->addr
;
2474 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2481 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2482 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2483 tmp_carry
= CPU (h_cbit
);
2484 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2488 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))));
2489 CPU (h_cbit
) = opval
;
2490 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2493 BI opval
= LTSI (tmp_newval
, 0);
2494 CPU (h_nbit
) = opval
;
2495 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2498 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2499 CPU (h_zbit
) = opval
;
2500 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2503 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)));
2504 CPU (h_vbit
) = opval
;
2505 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2510 CPU (h_xbit
) = opval
;
2511 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2515 SET_H_INSN_PREFIXED_P (opval
);
2516 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2526 CASE (sem
, INSN_MOVE_M_B_M
) : /* move-m.b [${Rs}${inc}],${Rd} */
2528 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2529 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2530 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2531 int UNUSED written
= 0;
2532 IADDR UNUSED pc
= abuf
->addr
;
2533 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2537 tmp_tmp
= ({ SI tmp_addr
;
2540 tmp_postinc
= FLD (f_memmode
);
2541 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2542 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2543 ; if (NEBI (tmp_postinc
, 0)) {
2545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2546 tmp_addr
= ADDSI (tmp_addr
, 1);
2549 SI opval
= tmp_addr
;
2550 SET_H_GR (FLD (f_operand1
), opval
);
2551 written
|= (1 << 10);
2552 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2559 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2561 SI opval
= ORSI (ANDSI (tmp_tmp
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
2562 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2563 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2568 BI opval
= LTQI (tmp_tmp
, 0);
2569 CPU (h_nbit
) = opval
;
2570 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2573 BI opval
= ANDIF (EQQI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2574 CPU (h_zbit
) = opval
;
2575 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2577 SET_H_CBIT_MOVE (0);
2578 SET_H_VBIT_MOVE (0);
2582 CPU (h_xbit
) = opval
;
2583 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2587 SET_H_INSN_PREFIXED_P (opval
);
2588 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2594 abuf
->written
= written
;
2599 CASE (sem
, INSN_MOVE_M_W_M
) : /* move-m.w [${Rs}${inc}],${Rd} */
2601 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2602 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2603 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2604 int UNUSED written
= 0;
2605 IADDR UNUSED pc
= abuf
->addr
;
2606 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2610 tmp_tmp
= ({ SI tmp_addr
;
2613 tmp_postinc
= FLD (f_memmode
);
2614 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2615 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2616 ; if (NEBI (tmp_postinc
, 0)) {
2618 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2619 tmp_addr
= ADDSI (tmp_addr
, 2);
2622 SI opval
= tmp_addr
;
2623 SET_H_GR (FLD (f_operand1
), opval
);
2624 written
|= (1 << 10);
2625 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2632 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2634 SI opval
= ORSI (ANDSI (tmp_tmp
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
2635 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2636 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2641 BI opval
= LTHI (tmp_tmp
, 0);
2642 CPU (h_nbit
) = opval
;
2643 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2646 BI opval
= ANDIF (EQHI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2647 CPU (h_zbit
) = opval
;
2648 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2650 SET_H_CBIT_MOVE (0);
2651 SET_H_VBIT_MOVE (0);
2655 CPU (h_xbit
) = opval
;
2656 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2660 SET_H_INSN_PREFIXED_P (opval
);
2661 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2667 abuf
->written
= written
;
2672 CASE (sem
, INSN_MOVE_M_D_M
) : /* move-m.d [${Rs}${inc}],${Rd} */
2674 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2675 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2676 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2677 int UNUSED written
= 0;
2678 IADDR UNUSED pc
= abuf
->addr
;
2679 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2683 tmp_tmp
= ({ SI tmp_addr
;
2686 tmp_postinc
= FLD (f_memmode
);
2687 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2688 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
2689 ; if (NEBI (tmp_postinc
, 0)) {
2691 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2692 tmp_addr
= ADDSI (tmp_addr
, 4);
2695 SI opval
= tmp_addr
;
2696 SET_H_GR (FLD (f_operand1
), opval
);
2697 written
|= (1 << 9);
2698 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2705 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2706 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2710 BI opval
= LTSI (tmp_tmp
, 0);
2711 CPU (h_nbit
) = opval
;
2712 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2715 BI opval
= ANDIF (EQSI (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_MOVS_M_B_M
) : /* movs-m.b [${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_movs_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
= EXTQISI (({ 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
))) : (GET_H_PREFIXREG_V32 ()));
2757 ; tmp_tmp_mem
= GETMEMQI (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
, 1);
2764 SI opval
= tmp_addr
;
2765 SET_H_GR (FLD (f_operand1
), opval
);
2766 written
|= (1 << 8);
2767 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2772 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2775 SET_H_GR (FLD (f_operand1
), opval
);
2776 written
|= (1 << 8);
2777 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2782 SET_H_GR (FLD (f_operand2
), opval
);
2783 written
|= (1 << 7);
2784 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2789 BI opval
= LTSI (tmp_tmp
, 0);
2790 CPU (h_nbit
) = opval
;
2791 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2794 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2795 CPU (h_zbit
) = opval
;
2796 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2798 SET_H_CBIT_MOVE (0);
2799 SET_H_VBIT_MOVE (0);
2803 CPU (h_xbit
) = opval
;
2804 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2808 SET_H_INSN_PREFIXED_P (opval
);
2809 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2815 abuf
->written
= written
;
2820 CASE (sem
, INSN_MOVS_M_W_M
) : /* movs-m.w [${Rs}${inc}],${Rd} */
2822 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2823 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2824 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2825 int UNUSED written
= 0;
2826 IADDR UNUSED pc
= abuf
->addr
;
2827 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2831 tmp_tmp
= EXTHISI (({ SI tmp_addr
;
2834 tmp_postinc
= FLD (f_memmode
);
2835 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2836 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2837 ; if (NEBI (tmp_postinc
, 0)) {
2839 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2840 tmp_addr
= ADDSI (tmp_addr
, 2);
2843 SI opval
= tmp_addr
;
2844 SET_H_GR (FLD (f_operand1
), opval
);
2845 written
|= (1 << 8);
2846 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2851 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2854 SET_H_GR (FLD (f_operand1
), opval
);
2855 written
|= (1 << 8);
2856 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2861 SET_H_GR (FLD (f_operand2
), opval
);
2862 written
|= (1 << 7);
2863 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2868 BI opval
= LTSI (tmp_tmp
, 0);
2869 CPU (h_nbit
) = opval
;
2870 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2873 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2874 CPU (h_zbit
) = opval
;
2875 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2877 SET_H_CBIT_MOVE (0);
2878 SET_H_VBIT_MOVE (0);
2882 CPU (h_xbit
) = opval
;
2883 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2887 SET_H_INSN_PREFIXED_P (opval
);
2888 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2894 abuf
->written
= written
;
2899 CASE (sem
, INSN_MOVU_M_B_M
) : /* movu-m.b [${Rs}${inc}],${Rd} */
2901 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2902 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2903 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2904 int UNUSED written
= 0;
2905 IADDR UNUSED pc
= abuf
->addr
;
2906 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2910 tmp_tmp
= ZEXTQISI (({ SI tmp_addr
;
2913 tmp_postinc
= FLD (f_memmode
);
2914 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2915 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2916 ; if (NEBI (tmp_postinc
, 0)) {
2918 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2919 tmp_addr
= ADDSI (tmp_addr
, 1);
2922 SI opval
= tmp_addr
;
2923 SET_H_GR (FLD (f_operand1
), opval
);
2924 written
|= (1 << 8);
2925 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2930 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2933 SET_H_GR (FLD (f_operand1
), opval
);
2934 written
|= (1 << 8);
2935 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2940 SET_H_GR (FLD (f_operand2
), opval
);
2941 written
|= (1 << 7);
2942 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2947 BI opval
= LTSI (tmp_tmp
, 0);
2948 CPU (h_nbit
) = opval
;
2949 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2952 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2953 CPU (h_zbit
) = opval
;
2954 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2956 SET_H_CBIT_MOVE (0);
2957 SET_H_VBIT_MOVE (0);
2961 CPU (h_xbit
) = opval
;
2962 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2966 SET_H_INSN_PREFIXED_P (opval
);
2967 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2973 abuf
->written
= written
;
2978 CASE (sem
, INSN_MOVU_M_W_M
) : /* movu-m.w [${Rs}${inc}],${Rd} */
2980 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2981 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2982 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2983 int UNUSED written
= 0;
2984 IADDR UNUSED pc
= abuf
->addr
;
2985 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2989 tmp_tmp
= ZEXTHISI (({ SI tmp_addr
;
2992 tmp_postinc
= FLD (f_memmode
);
2993 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2994 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2995 ; if (NEBI (tmp_postinc
, 0)) {
2997 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2998 tmp_addr
= ADDSI (tmp_addr
, 2);
3001 SI opval
= tmp_addr
;
3002 SET_H_GR (FLD (f_operand1
), opval
);
3003 written
|= (1 << 8);
3004 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3009 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3012 SET_H_GR (FLD (f_operand1
), opval
);
3013 written
|= (1 << 8);
3014 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3019 SET_H_GR (FLD (f_operand2
), opval
);
3020 written
|= (1 << 7);
3021 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3026 BI opval
= LTSI (tmp_tmp
, 0);
3027 CPU (h_nbit
) = opval
;
3028 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3031 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3032 CPU (h_zbit
) = opval
;
3033 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3035 SET_H_CBIT_MOVE (0);
3036 SET_H_VBIT_MOVE (0);
3040 CPU (h_xbit
) = opval
;
3041 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3045 SET_H_INSN_PREFIXED_P (opval
);
3046 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3052 abuf
->written
= written
;
3057 CASE (sem
, INSN_MOVE_R_SPRV32
) : /* move ${Rs},${Pd} */
3059 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3060 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3061 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3062 int UNUSED written
= 0;
3063 IADDR UNUSED pc
= abuf
->addr
;
3064 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3069 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
3070 tmp_rno
= FLD (f_operand2
);
3071 if (ORIF (ORIF (EQSI (tmp_rno
, 0), EQSI (tmp_rno
, 1)), ORIF (EQSI (tmp_rno
, 4), EQSI (tmp_rno
, 8)))) {
3072 cgen_rtx_error (current_cpu
, "move-r-spr: trying to set a read-only special register");
3077 SET_H_SR (FLD (f_operand2
), opval
);
3078 written
|= (1 << 2);
3079 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3085 CPU (h_xbit
) = opval
;
3086 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3090 SET_H_INSN_PREFIXED_P (opval
);
3091 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3096 abuf
->written
= written
;
3101 CASE (sem
, INSN_MOVE_SPR_RV32
) : /* move ${Ps},${Rd-sfield} */
3103 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3104 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3105 #define FLD(f) abuf->fields.sfmt_mcp.f
3106 int UNUSED written
= 0;
3107 IADDR UNUSED pc
= abuf
->addr
;
3108 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3114 tmp_prno
= FLD (f_operand2
);
3115 tmp_newval
= GET_H_SR (FLD (f_operand2
));
3116 if (EQSI (tmp_prno
, 0)) {
3119 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3121 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3122 SET_H_GR (FLD (f_operand1
), opval
);
3123 written
|= (1 << 4);
3124 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3128 else if (EQSI (tmp_prno
, 1)) {
3131 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3133 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3134 SET_H_GR (FLD (f_operand1
), opval
);
3135 written
|= (1 << 4);
3136 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3140 else if (EQSI (tmp_prno
, 2)) {
3143 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3145 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3146 SET_H_GR (FLD (f_operand1
), opval
);
3147 written
|= (1 << 4);
3148 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3152 else if (EQSI (tmp_prno
, 3)) {
3155 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3157 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3158 SET_H_GR (FLD (f_operand1
), opval
);
3159 written
|= (1 << 4);
3160 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3164 else if (EQSI (tmp_prno
, 4)) {
3167 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3169 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3170 SET_H_GR (FLD (f_operand1
), opval
);
3171 written
|= (1 << 4);
3172 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3176 else if (EQSI (tmp_prno
, 5)) {
3178 SI opval
= tmp_newval
;
3179 SET_H_GR (FLD (f_operand1
), opval
);
3180 written
|= (1 << 4);
3181 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3184 else if (EQSI (tmp_prno
, 6)) {
3186 SI opval
= tmp_newval
;
3187 SET_H_GR (FLD (f_operand1
), opval
);
3188 written
|= (1 << 4);
3189 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3192 else if (EQSI (tmp_prno
, 7)) {
3194 SI opval
= tmp_newval
;
3195 SET_H_GR (FLD (f_operand1
), opval
);
3196 written
|= (1 << 4);
3197 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3200 else if (EQSI (tmp_prno
, 8)) {
3202 SI opval
= tmp_newval
;
3203 SET_H_GR (FLD (f_operand1
), opval
);
3204 written
|= (1 << 4);
3205 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3208 else if (EQSI (tmp_prno
, 9)) {
3210 SI opval
= tmp_newval
;
3211 SET_H_GR (FLD (f_operand1
), opval
);
3212 written
|= (1 << 4);
3213 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3216 else if (EQSI (tmp_prno
, 10)) {
3218 SI opval
= tmp_newval
;
3219 SET_H_GR (FLD (f_operand1
), opval
);
3220 written
|= (1 << 4);
3221 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3224 else if (EQSI (tmp_prno
, 11)) {
3226 SI opval
= tmp_newval
;
3227 SET_H_GR (FLD (f_operand1
), opval
);
3228 written
|= (1 << 4);
3229 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3232 else if (EQSI (tmp_prno
, 12)) {
3234 SI opval
= tmp_newval
;
3235 SET_H_GR (FLD (f_operand1
), opval
);
3236 written
|= (1 << 4);
3237 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3240 else if (EQSI (tmp_prno
, 13)) {
3242 SI opval
= tmp_newval
;
3243 SET_H_GR (FLD (f_operand1
), opval
);
3244 written
|= (1 << 4);
3245 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3248 else if (EQSI (tmp_prno
, 14)) {
3250 SI opval
= tmp_newval
;
3251 SET_H_GR (FLD (f_operand1
), opval
);
3252 written
|= (1 << 4);
3253 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3256 else if (EQSI (tmp_prno
, 15)) {
3258 SI opval
= tmp_newval
;
3259 SET_H_GR (FLD (f_operand1
), opval
);
3260 written
|= (1 << 4);
3261 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3265 cgen_rtx_error (current_cpu
, "move-spr-r from unimplemented register");
3270 CPU (h_xbit
) = opval
;
3271 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3275 SET_H_INSN_PREFIXED_P (opval
);
3276 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3281 abuf
->written
= written
;
3286 CASE (sem
, INSN_MOVE_M_SPRV32
) : /* move [${Rs}${inc}],${Pd} */
3288 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3289 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3290 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3291 int UNUSED written
= 0;
3292 IADDR UNUSED pc
= abuf
->addr
;
3293 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3298 tmp_rno
= FLD (f_operand2
);
3299 if (EQSI (tmp_rno
, 0)) {
3300 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3303 tmp_postinc
= FLD (f_memmode
);
3304 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3305 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3306 ; if (NEBI (tmp_postinc
, 0)) {
3308 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3309 tmp_addr
= ADDSI (tmp_addr
, 1);
3312 SI opval
= tmp_addr
;
3313 SET_H_GR (FLD (f_operand1
), opval
);
3314 written
|= (1 << 9);
3315 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3321 else if (EQSI (tmp_rno
, 1)) {
3322 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3325 tmp_postinc
= FLD (f_memmode
);
3326 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3327 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3328 ; if (NEBI (tmp_postinc
, 0)) {
3330 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3331 tmp_addr
= ADDSI (tmp_addr
, 1);
3334 SI opval
= tmp_addr
;
3335 SET_H_GR (FLD (f_operand1
), opval
);
3336 written
|= (1 << 9);
3337 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3343 else if (EQSI (tmp_rno
, 2)) {
3344 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3347 tmp_postinc
= FLD (f_memmode
);
3348 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3349 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3350 ; if (NEBI (tmp_postinc
, 0)) {
3352 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3353 tmp_addr
= ADDSI (tmp_addr
, 1);
3356 SI opval
= tmp_addr
;
3357 SET_H_GR (FLD (f_operand1
), opval
);
3358 written
|= (1 << 9);
3359 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3365 else if (EQSI (tmp_rno
, 3)) {
3366 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3369 tmp_postinc
= FLD (f_memmode
);
3370 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3371 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3372 ; if (NEBI (tmp_postinc
, 0)) {
3374 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3375 tmp_addr
= ADDSI (tmp_addr
, 1);
3378 SI opval
= tmp_addr
;
3379 SET_H_GR (FLD (f_operand1
), opval
);
3380 written
|= (1 << 9);
3381 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3387 else if (EQSI (tmp_rno
, 4)) {
3388 tmp_newval
= EXTHISI (({ SI tmp_addr
;
3391 tmp_postinc
= FLD (f_memmode
);
3392 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3393 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
3394 ; if (NEBI (tmp_postinc
, 0)) {
3396 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3397 tmp_addr
= ADDSI (tmp_addr
, 2);
3400 SI opval
= tmp_addr
;
3401 SET_H_GR (FLD (f_operand1
), opval
);
3402 written
|= (1 << 9);
3403 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3409 else if (EQSI (tmp_rno
, 5)) {
3410 tmp_newval
= ({ SI tmp_addr
;
3413 tmp_postinc
= FLD (f_memmode
);
3414 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3415 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3416 ; if (NEBI (tmp_postinc
, 0)) {
3418 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3419 tmp_addr
= ADDSI (tmp_addr
, 4);
3422 SI opval
= tmp_addr
;
3423 SET_H_GR (FLD (f_operand1
), opval
);
3424 written
|= (1 << 9);
3425 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3431 else if (EQSI (tmp_rno
, 6)) {
3432 tmp_newval
= ({ SI tmp_addr
;
3435 tmp_postinc
= FLD (f_memmode
);
3436 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3437 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3438 ; if (NEBI (tmp_postinc
, 0)) {
3440 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3441 tmp_addr
= ADDSI (tmp_addr
, 4);
3444 SI opval
= tmp_addr
;
3445 SET_H_GR (FLD (f_operand1
), opval
);
3446 written
|= (1 << 9);
3447 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3453 else if (EQSI (tmp_rno
, 7)) {
3454 tmp_newval
= ({ SI tmp_addr
;
3457 tmp_postinc
= FLD (f_memmode
);
3458 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3459 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3460 ; if (NEBI (tmp_postinc
, 0)) {
3462 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3463 tmp_addr
= ADDSI (tmp_addr
, 4);
3466 SI opval
= tmp_addr
;
3467 SET_H_GR (FLD (f_operand1
), opval
);
3468 written
|= (1 << 9);
3469 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3475 else if (EQSI (tmp_rno
, 8)) {
3476 tmp_newval
= ({ SI tmp_addr
;
3479 tmp_postinc
= FLD (f_memmode
);
3480 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3481 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3482 ; if (NEBI (tmp_postinc
, 0)) {
3484 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3485 tmp_addr
= ADDSI (tmp_addr
, 4);
3488 SI opval
= tmp_addr
;
3489 SET_H_GR (FLD (f_operand1
), opval
);
3490 written
|= (1 << 9);
3491 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3497 else if (EQSI (tmp_rno
, 9)) {
3498 tmp_newval
= ({ SI tmp_addr
;
3501 tmp_postinc
= FLD (f_memmode
);
3502 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3503 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3504 ; if (NEBI (tmp_postinc
, 0)) {
3506 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3507 tmp_addr
= ADDSI (tmp_addr
, 4);
3510 SI opval
= tmp_addr
;
3511 SET_H_GR (FLD (f_operand1
), opval
);
3512 written
|= (1 << 9);
3513 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3519 else if (EQSI (tmp_rno
, 10)) {
3520 tmp_newval
= ({ SI tmp_addr
;
3523 tmp_postinc
= FLD (f_memmode
);
3524 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3525 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3526 ; if (NEBI (tmp_postinc
, 0)) {
3528 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3529 tmp_addr
= ADDSI (tmp_addr
, 4);
3532 SI opval
= tmp_addr
;
3533 SET_H_GR (FLD (f_operand1
), opval
);
3534 written
|= (1 << 9);
3535 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3541 else if (EQSI (tmp_rno
, 11)) {
3542 tmp_newval
= ({ SI tmp_addr
;
3545 tmp_postinc
= FLD (f_memmode
);
3546 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3547 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3548 ; if (NEBI (tmp_postinc
, 0)) {
3550 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3551 tmp_addr
= ADDSI (tmp_addr
, 4);
3554 SI opval
= tmp_addr
;
3555 SET_H_GR (FLD (f_operand1
), opval
);
3556 written
|= (1 << 9);
3557 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3563 else if (EQSI (tmp_rno
, 12)) {
3564 tmp_newval
= ({ SI tmp_addr
;
3567 tmp_postinc
= FLD (f_memmode
);
3568 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3569 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3570 ; if (NEBI (tmp_postinc
, 0)) {
3572 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3573 tmp_addr
= ADDSI (tmp_addr
, 4);
3576 SI opval
= tmp_addr
;
3577 SET_H_GR (FLD (f_operand1
), opval
);
3578 written
|= (1 << 9);
3579 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3585 else if (EQSI (tmp_rno
, 13)) {
3586 tmp_newval
= ({ SI tmp_addr
;
3589 tmp_postinc
= FLD (f_memmode
);
3590 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3591 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3592 ; if (NEBI (tmp_postinc
, 0)) {
3594 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3595 tmp_addr
= ADDSI (tmp_addr
, 4);
3598 SI opval
= tmp_addr
;
3599 SET_H_GR (FLD (f_operand1
), opval
);
3600 written
|= (1 << 9);
3601 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3607 else if (EQSI (tmp_rno
, 14)) {
3608 tmp_newval
= ({ SI tmp_addr
;
3611 tmp_postinc
= FLD (f_memmode
);
3612 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3613 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3614 ; if (NEBI (tmp_postinc
, 0)) {
3616 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3617 tmp_addr
= ADDSI (tmp_addr
, 4);
3620 SI opval
= tmp_addr
;
3621 SET_H_GR (FLD (f_operand1
), opval
);
3622 written
|= (1 << 9);
3623 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3629 else if (EQSI (tmp_rno
, 15)) {
3630 tmp_newval
= ({ SI tmp_addr
;
3633 tmp_postinc
= FLD (f_memmode
);
3634 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3635 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3636 ; if (NEBI (tmp_postinc
, 0)) {
3638 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3639 tmp_addr
= ADDSI (tmp_addr
, 4);
3642 SI opval
= tmp_addr
;
3643 SET_H_GR (FLD (f_operand1
), opval
);
3644 written
|= (1 << 9);
3645 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3652 cgen_rtx_error (current_cpu
, "Trying to set unimplemented special register");
3655 SI opval
= tmp_newval
;
3656 SET_H_SR (FLD (f_operand2
), opval
);
3657 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3662 CPU (h_xbit
) = opval
;
3663 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3667 SET_H_INSN_PREFIXED_P (opval
);
3668 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3673 abuf
->written
= written
;
3678 CASE (sem
, INSN_MOVE_C_SPRV32_P0
) : /* move ${const32},${Pd} */
3680 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3681 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3682 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3683 int UNUSED written
= 0;
3684 IADDR UNUSED pc
= abuf
->addr
;
3685 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3689 SI opval
= FLD (f_indir_pc__dword
);
3690 SET_H_SR (FLD (f_operand2
), opval
);
3691 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3696 CPU (h_xbit
) = opval
;
3697 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3701 SET_H_INSN_PREFIXED_P (opval
);
3702 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3711 CASE (sem
, INSN_MOVE_C_SPRV32_P1
) : /* move ${const32},${Pd} */
3713 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3714 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3715 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3716 int UNUSED written
= 0;
3717 IADDR UNUSED pc
= abuf
->addr
;
3718 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3722 SI opval
= FLD (f_indir_pc__dword
);
3723 SET_H_SR (FLD (f_operand2
), opval
);
3724 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3729 CPU (h_xbit
) = opval
;
3730 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3734 SET_H_INSN_PREFIXED_P (opval
);
3735 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3744 CASE (sem
, INSN_MOVE_C_SPRV32_P2
) : /* move ${const32},${Pd} */
3746 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3747 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3748 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3749 int UNUSED written
= 0;
3750 IADDR UNUSED pc
= abuf
->addr
;
3751 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3755 SI opval
= FLD (f_indir_pc__dword
);
3756 SET_H_SR (FLD (f_operand2
), opval
);
3757 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3762 CPU (h_xbit
) = opval
;
3763 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3767 SET_H_INSN_PREFIXED_P (opval
);
3768 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3777 CASE (sem
, INSN_MOVE_C_SPRV32_P3
) : /* move ${const32},${Pd} */
3779 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3780 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3781 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3782 int UNUSED written
= 0;
3783 IADDR UNUSED pc
= abuf
->addr
;
3784 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3788 SI opval
= FLD (f_indir_pc__dword
);
3789 SET_H_SR (FLD (f_operand2
), opval
);
3790 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3795 CPU (h_xbit
) = opval
;
3796 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3800 SET_H_INSN_PREFIXED_P (opval
);
3801 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3810 CASE (sem
, INSN_MOVE_C_SPRV32_P4
) : /* move ${const32},${Pd} */
3812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3814 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3815 int UNUSED written
= 0;
3816 IADDR UNUSED pc
= abuf
->addr
;
3817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3821 SI opval
= FLD (f_indir_pc__dword
);
3822 SET_H_SR (FLD (f_operand2
), opval
);
3823 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3828 CPU (h_xbit
) = opval
;
3829 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3833 SET_H_INSN_PREFIXED_P (opval
);
3834 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3843 CASE (sem
, INSN_MOVE_C_SPRV32_P5
) : /* move ${const32},${Pd} */
3845 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3846 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3847 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3848 int UNUSED written
= 0;
3849 IADDR UNUSED pc
= abuf
->addr
;
3850 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3854 SI opval
= FLD (f_indir_pc__dword
);
3855 SET_H_SR (FLD (f_operand2
), opval
);
3856 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3861 CPU (h_xbit
) = opval
;
3862 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3866 SET_H_INSN_PREFIXED_P (opval
);
3867 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3876 CASE (sem
, INSN_MOVE_C_SPRV32_P6
) : /* move ${const32},${Pd} */
3878 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3879 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3880 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3881 int UNUSED written
= 0;
3882 IADDR UNUSED pc
= abuf
->addr
;
3883 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3887 SI opval
= FLD (f_indir_pc__dword
);
3888 SET_H_SR (FLD (f_operand2
), opval
);
3889 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3894 CPU (h_xbit
) = opval
;
3895 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3899 SET_H_INSN_PREFIXED_P (opval
);
3900 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3909 CASE (sem
, INSN_MOVE_C_SPRV32_P7
) : /* move ${const32},${Pd} */
3911 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3912 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3913 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3914 int UNUSED written
= 0;
3915 IADDR UNUSED pc
= abuf
->addr
;
3916 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3920 SI opval
= FLD (f_indir_pc__dword
);
3921 SET_H_SR (FLD (f_operand2
), opval
);
3922 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3927 CPU (h_xbit
) = opval
;
3928 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3932 SET_H_INSN_PREFIXED_P (opval
);
3933 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3942 CASE (sem
, INSN_MOVE_C_SPRV32_P8
) : /* move ${const32},${Pd} */
3944 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3945 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3946 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3947 int UNUSED written
= 0;
3948 IADDR UNUSED pc
= abuf
->addr
;
3949 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3953 SI opval
= FLD (f_indir_pc__dword
);
3954 SET_H_SR (FLD (f_operand2
), opval
);
3955 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3960 CPU (h_xbit
) = opval
;
3961 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3965 SET_H_INSN_PREFIXED_P (opval
);
3966 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3975 CASE (sem
, INSN_MOVE_C_SPRV32_P9
) : /* move ${const32},${Pd} */
3977 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3978 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3979 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
3980 int UNUSED written
= 0;
3981 IADDR UNUSED pc
= abuf
->addr
;
3982 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3986 SI opval
= FLD (f_indir_pc__dword
);
3987 SET_H_SR (FLD (f_operand2
), opval
);
3988 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3993 CPU (h_xbit
) = opval
;
3994 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3998 SET_H_INSN_PREFIXED_P (opval
);
3999 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4008 CASE (sem
, INSN_MOVE_C_SPRV32_P10
) : /* move ${const32},${Pd} */
4010 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4011 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4012 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
4013 int UNUSED written
= 0;
4014 IADDR UNUSED pc
= abuf
->addr
;
4015 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4019 SI opval
= FLD (f_indir_pc__dword
);
4020 SET_H_SR (FLD (f_operand2
), opval
);
4021 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4026 CPU (h_xbit
) = opval
;
4027 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4031 SET_H_INSN_PREFIXED_P (opval
);
4032 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4041 CASE (sem
, INSN_MOVE_C_SPRV32_P11
) : /* move ${const32},${Pd} */
4043 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4044 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4045 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
4046 int UNUSED written
= 0;
4047 IADDR UNUSED pc
= abuf
->addr
;
4048 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4052 SI opval
= FLD (f_indir_pc__dword
);
4053 SET_H_SR (FLD (f_operand2
), opval
);
4054 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4059 CPU (h_xbit
) = opval
;
4060 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4064 SET_H_INSN_PREFIXED_P (opval
);
4065 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4074 CASE (sem
, INSN_MOVE_C_SPRV32_P12
) : /* move ${const32},${Pd} */
4076 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4077 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4078 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
4079 int UNUSED written
= 0;
4080 IADDR UNUSED pc
= abuf
->addr
;
4081 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4085 SI opval
= FLD (f_indir_pc__dword
);
4086 SET_H_SR (FLD (f_operand2
), opval
);
4087 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4092 CPU (h_xbit
) = opval
;
4093 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4097 SET_H_INSN_PREFIXED_P (opval
);
4098 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4107 CASE (sem
, INSN_MOVE_C_SPRV32_P13
) : /* move ${const32},${Pd} */
4109 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4110 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4111 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
4112 int UNUSED written
= 0;
4113 IADDR UNUSED pc
= abuf
->addr
;
4114 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4118 SI opval
= FLD (f_indir_pc__dword
);
4119 SET_H_SR (FLD (f_operand2
), opval
);
4120 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4125 CPU (h_xbit
) = opval
;
4126 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4130 SET_H_INSN_PREFIXED_P (opval
);
4131 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4140 CASE (sem
, INSN_MOVE_C_SPRV32_P14
) : /* move ${const32},${Pd} */
4142 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4143 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4144 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
4145 int UNUSED written
= 0;
4146 IADDR UNUSED pc
= abuf
->addr
;
4147 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4151 SI opval
= FLD (f_indir_pc__dword
);
4152 SET_H_SR (FLD (f_operand2
), opval
);
4153 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4158 CPU (h_xbit
) = opval
;
4159 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4163 SET_H_INSN_PREFIXED_P (opval
);
4164 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4173 CASE (sem
, INSN_MOVE_C_SPRV32_P15
) : /* move ${const32},${Pd} */
4175 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4176 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4177 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
4178 int UNUSED written
= 0;
4179 IADDR UNUSED pc
= abuf
->addr
;
4180 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
4184 SI opval
= FLD (f_indir_pc__dword
);
4185 SET_H_SR (FLD (f_operand2
), opval
);
4186 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4191 CPU (h_xbit
) = opval
;
4192 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4196 SET_H_INSN_PREFIXED_P (opval
);
4197 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4206 CASE (sem
, INSN_MOVE_SPR_MV32
) : /* move ${Ps},[${Rd-sfield}${inc}] */
4208 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4209 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4210 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4211 int UNUSED written
= 0;
4212 IADDR UNUSED pc
= abuf
->addr
;
4213 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4217 tmp_rno
= FLD (f_operand2
);
4218 if (EQSI (tmp_rno
, 0)) {
4222 tmp_postinc
= FLD (f_memmode
);
4223 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4224 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4225 if (EQBI (CPU (h_pbit
), 0)) {
4228 QI opval
= GET_H_SR (FLD (f_operand2
));
4229 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4230 written
|= (1 << 12);
4231 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4234 BI opval
= CPU (h_pbit
);
4235 CPU (h_cbit
) = opval
;
4236 written
|= (1 << 10);
4237 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4243 CPU (h_cbit
) = opval
;
4244 written
|= (1 << 10);
4245 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4250 QI opval
= GET_H_SR (FLD (f_operand2
));
4251 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4252 written
|= (1 << 12);
4253 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4256 if (NEBI (tmp_postinc
, 0)) {
4258 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4259 tmp_addr
= ADDSI (tmp_addr
, 1);
4262 SI opval
= tmp_addr
;
4263 SET_H_GR (FLD (f_operand1
), opval
);
4264 written
|= (1 << 9);
4265 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4271 else if (EQSI (tmp_rno
, 1)) {
4275 tmp_postinc
= FLD (f_memmode
);
4276 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4277 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4278 if (EQBI (CPU (h_pbit
), 0)) {
4281 QI opval
= GET_H_SR (FLD (f_operand2
));
4282 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4283 written
|= (1 << 12);
4284 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4287 BI opval
= CPU (h_pbit
);
4288 CPU (h_cbit
) = opval
;
4289 written
|= (1 << 10);
4290 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4296 CPU (h_cbit
) = opval
;
4297 written
|= (1 << 10);
4298 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4303 QI opval
= GET_H_SR (FLD (f_operand2
));
4304 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4305 written
|= (1 << 12);
4306 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4309 if (NEBI (tmp_postinc
, 0)) {
4311 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4312 tmp_addr
= ADDSI (tmp_addr
, 1);
4315 SI opval
= tmp_addr
;
4316 SET_H_GR (FLD (f_operand1
), opval
);
4317 written
|= (1 << 9);
4318 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4324 else if (EQSI (tmp_rno
, 2)) {
4328 tmp_postinc
= FLD (f_memmode
);
4329 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4330 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4331 if (EQBI (CPU (h_pbit
), 0)) {
4334 QI opval
= GET_H_SR (FLD (f_operand2
));
4335 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4336 written
|= (1 << 12);
4337 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4340 BI opval
= CPU (h_pbit
);
4341 CPU (h_cbit
) = opval
;
4342 written
|= (1 << 10);
4343 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4349 CPU (h_cbit
) = opval
;
4350 written
|= (1 << 10);
4351 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4356 QI opval
= GET_H_SR (FLD (f_operand2
));
4357 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4358 written
|= (1 << 12);
4359 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4362 if (NEBI (tmp_postinc
, 0)) {
4364 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4365 tmp_addr
= ADDSI (tmp_addr
, 1);
4368 SI opval
= tmp_addr
;
4369 SET_H_GR (FLD (f_operand1
), opval
);
4370 written
|= (1 << 9);
4371 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4377 else if (EQSI (tmp_rno
, 3)) {
4381 tmp_postinc
= FLD (f_memmode
);
4382 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4383 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4384 if (EQBI (CPU (h_pbit
), 0)) {
4387 QI opval
= GET_H_SR (FLD (f_operand2
));
4388 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4389 written
|= (1 << 12);
4390 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4393 BI opval
= CPU (h_pbit
);
4394 CPU (h_cbit
) = opval
;
4395 written
|= (1 << 10);
4396 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4402 CPU (h_cbit
) = opval
;
4403 written
|= (1 << 10);
4404 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4409 QI opval
= GET_H_SR (FLD (f_operand2
));
4410 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4411 written
|= (1 << 12);
4412 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4415 if (NEBI (tmp_postinc
, 0)) {
4417 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4418 tmp_addr
= ADDSI (tmp_addr
, 1);
4421 SI opval
= tmp_addr
;
4422 SET_H_GR (FLD (f_operand1
), opval
);
4423 written
|= (1 << 9);
4424 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4430 else if (EQSI (tmp_rno
, 4)) {
4434 tmp_postinc
= FLD (f_memmode
);
4435 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4436 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4437 if (EQBI (CPU (h_pbit
), 0)) {
4440 HI opval
= GET_H_SR (FLD (f_operand2
));
4441 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4442 written
|= (1 << 11);
4443 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4446 BI opval
= CPU (h_pbit
);
4447 CPU (h_cbit
) = opval
;
4448 written
|= (1 << 10);
4449 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4455 CPU (h_cbit
) = opval
;
4456 written
|= (1 << 10);
4457 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4462 HI opval
= GET_H_SR (FLD (f_operand2
));
4463 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4464 written
|= (1 << 11);
4465 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4468 if (NEBI (tmp_postinc
, 0)) {
4470 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4471 tmp_addr
= ADDSI (tmp_addr
, 2);
4474 SI opval
= tmp_addr
;
4475 SET_H_GR (FLD (f_operand1
), opval
);
4476 written
|= (1 << 9);
4477 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4483 else if (EQSI (tmp_rno
, 5)) {
4487 tmp_postinc
= FLD (f_memmode
);
4488 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4489 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4490 if (EQBI (CPU (h_pbit
), 0)) {
4493 SI opval
= GET_H_SR (FLD (f_operand2
));
4494 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4495 written
|= (1 << 13);
4496 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4499 BI opval
= CPU (h_pbit
);
4500 CPU (h_cbit
) = opval
;
4501 written
|= (1 << 10);
4502 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4508 CPU (h_cbit
) = opval
;
4509 written
|= (1 << 10);
4510 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4515 SI opval
= GET_H_SR (FLD (f_operand2
));
4516 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4517 written
|= (1 << 13);
4518 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4521 if (NEBI (tmp_postinc
, 0)) {
4523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4524 tmp_addr
= ADDSI (tmp_addr
, 4);
4527 SI opval
= tmp_addr
;
4528 SET_H_GR (FLD (f_operand1
), opval
);
4529 written
|= (1 << 9);
4530 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4536 else if (EQSI (tmp_rno
, 6)) {
4540 tmp_postinc
= FLD (f_memmode
);
4541 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4542 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4543 if (EQBI (CPU (h_pbit
), 0)) {
4546 SI opval
= GET_H_SR (FLD (f_operand2
));
4547 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4548 written
|= (1 << 13);
4549 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4552 BI opval
= CPU (h_pbit
);
4553 CPU (h_cbit
) = opval
;
4554 written
|= (1 << 10);
4555 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4561 CPU (h_cbit
) = opval
;
4562 written
|= (1 << 10);
4563 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4568 SI opval
= GET_H_SR (FLD (f_operand2
));
4569 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4570 written
|= (1 << 13);
4571 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4574 if (NEBI (tmp_postinc
, 0)) {
4576 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4577 tmp_addr
= ADDSI (tmp_addr
, 4);
4580 SI opval
= tmp_addr
;
4581 SET_H_GR (FLD (f_operand1
), opval
);
4582 written
|= (1 << 9);
4583 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4589 else if (EQSI (tmp_rno
, 7)) {
4593 tmp_postinc
= FLD (f_memmode
);
4594 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4595 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4596 if (EQBI (CPU (h_pbit
), 0)) {
4599 SI opval
= GET_H_SR (FLD (f_operand2
));
4600 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4601 written
|= (1 << 13);
4602 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4605 BI opval
= CPU (h_pbit
);
4606 CPU (h_cbit
) = opval
;
4607 written
|= (1 << 10);
4608 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4614 CPU (h_cbit
) = opval
;
4615 written
|= (1 << 10);
4616 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4621 SI opval
= GET_H_SR (FLD (f_operand2
));
4622 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4623 written
|= (1 << 13);
4624 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4627 if (NEBI (tmp_postinc
, 0)) {
4629 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4630 tmp_addr
= ADDSI (tmp_addr
, 4);
4633 SI opval
= tmp_addr
;
4634 SET_H_GR (FLD (f_operand1
), opval
);
4635 written
|= (1 << 9);
4636 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4642 else if (EQSI (tmp_rno
, 8)) {
4646 tmp_postinc
= FLD (f_memmode
);
4647 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4648 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4649 if (EQBI (CPU (h_pbit
), 0)) {
4652 SI opval
= GET_H_SR (FLD (f_operand2
));
4653 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4654 written
|= (1 << 13);
4655 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4658 BI opval
= CPU (h_pbit
);
4659 CPU (h_cbit
) = opval
;
4660 written
|= (1 << 10);
4661 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4667 CPU (h_cbit
) = opval
;
4668 written
|= (1 << 10);
4669 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4674 SI opval
= GET_H_SR (FLD (f_operand2
));
4675 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4676 written
|= (1 << 13);
4677 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4680 if (NEBI (tmp_postinc
, 0)) {
4682 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4683 tmp_addr
= ADDSI (tmp_addr
, 4);
4686 SI opval
= tmp_addr
;
4687 SET_H_GR (FLD (f_operand1
), opval
);
4688 written
|= (1 << 9);
4689 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4695 else if (EQSI (tmp_rno
, 9)) {
4699 tmp_postinc
= FLD (f_memmode
);
4700 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4701 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4702 if (EQBI (CPU (h_pbit
), 0)) {
4705 SI opval
= GET_H_SR (FLD (f_operand2
));
4706 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4707 written
|= (1 << 13);
4708 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4711 BI opval
= CPU (h_pbit
);
4712 CPU (h_cbit
) = opval
;
4713 written
|= (1 << 10);
4714 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4720 CPU (h_cbit
) = opval
;
4721 written
|= (1 << 10);
4722 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4727 SI opval
= GET_H_SR (FLD (f_operand2
));
4728 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4729 written
|= (1 << 13);
4730 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4733 if (NEBI (tmp_postinc
, 0)) {
4735 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4736 tmp_addr
= ADDSI (tmp_addr
, 4);
4739 SI opval
= tmp_addr
;
4740 SET_H_GR (FLD (f_operand1
), opval
);
4741 written
|= (1 << 9);
4742 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4748 else if (EQSI (tmp_rno
, 10)) {
4752 tmp_postinc
= FLD (f_memmode
);
4753 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4754 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4755 if (EQBI (CPU (h_pbit
), 0)) {
4758 SI opval
= GET_H_SR (FLD (f_operand2
));
4759 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4760 written
|= (1 << 13);
4761 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4764 BI opval
= CPU (h_pbit
);
4765 CPU (h_cbit
) = opval
;
4766 written
|= (1 << 10);
4767 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4773 CPU (h_cbit
) = opval
;
4774 written
|= (1 << 10);
4775 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4780 SI opval
= GET_H_SR (FLD (f_operand2
));
4781 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4782 written
|= (1 << 13);
4783 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4786 if (NEBI (tmp_postinc
, 0)) {
4788 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4789 tmp_addr
= ADDSI (tmp_addr
, 4);
4792 SI opval
= tmp_addr
;
4793 SET_H_GR (FLD (f_operand1
), opval
);
4794 written
|= (1 << 9);
4795 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4801 else if (EQSI (tmp_rno
, 11)) {
4805 tmp_postinc
= FLD (f_memmode
);
4806 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4807 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4808 if (EQBI (CPU (h_pbit
), 0)) {
4811 SI opval
= GET_H_SR (FLD (f_operand2
));
4812 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4813 written
|= (1 << 13);
4814 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4817 BI opval
= CPU (h_pbit
);
4818 CPU (h_cbit
) = opval
;
4819 written
|= (1 << 10);
4820 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4826 CPU (h_cbit
) = opval
;
4827 written
|= (1 << 10);
4828 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4833 SI opval
= GET_H_SR (FLD (f_operand2
));
4834 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4835 written
|= (1 << 13);
4836 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4839 if (NEBI (tmp_postinc
, 0)) {
4841 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4842 tmp_addr
= ADDSI (tmp_addr
, 4);
4845 SI opval
= tmp_addr
;
4846 SET_H_GR (FLD (f_operand1
), opval
);
4847 written
|= (1 << 9);
4848 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4854 else if (EQSI (tmp_rno
, 12)) {
4858 tmp_postinc
= FLD (f_memmode
);
4859 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4860 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4861 if (EQBI (CPU (h_pbit
), 0)) {
4864 SI opval
= GET_H_SR (FLD (f_operand2
));
4865 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4866 written
|= (1 << 13);
4867 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4870 BI opval
= CPU (h_pbit
);
4871 CPU (h_cbit
) = opval
;
4872 written
|= (1 << 10);
4873 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4879 CPU (h_cbit
) = opval
;
4880 written
|= (1 << 10);
4881 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4886 SI opval
= GET_H_SR (FLD (f_operand2
));
4887 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4888 written
|= (1 << 13);
4889 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4892 if (NEBI (tmp_postinc
, 0)) {
4894 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4895 tmp_addr
= ADDSI (tmp_addr
, 4);
4898 SI opval
= tmp_addr
;
4899 SET_H_GR (FLD (f_operand1
), opval
);
4900 written
|= (1 << 9);
4901 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4907 else if (EQSI (tmp_rno
, 13)) {
4911 tmp_postinc
= FLD (f_memmode
);
4912 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4913 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4914 if (EQBI (CPU (h_pbit
), 0)) {
4917 SI opval
= GET_H_SR (FLD (f_operand2
));
4918 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4919 written
|= (1 << 13);
4920 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4923 BI opval
= CPU (h_pbit
);
4924 CPU (h_cbit
) = opval
;
4925 written
|= (1 << 10);
4926 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4932 CPU (h_cbit
) = opval
;
4933 written
|= (1 << 10);
4934 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4939 SI opval
= GET_H_SR (FLD (f_operand2
));
4940 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4941 written
|= (1 << 13);
4942 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4945 if (NEBI (tmp_postinc
, 0)) {
4947 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4948 tmp_addr
= ADDSI (tmp_addr
, 4);
4951 SI opval
= tmp_addr
;
4952 SET_H_GR (FLD (f_operand1
), opval
);
4953 written
|= (1 << 9);
4954 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4960 else if (EQSI (tmp_rno
, 14)) {
4964 tmp_postinc
= FLD (f_memmode
);
4965 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4966 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4967 if (EQBI (CPU (h_pbit
), 0)) {
4970 SI opval
= GET_H_SR (FLD (f_operand2
));
4971 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4972 written
|= (1 << 13);
4973 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4976 BI opval
= CPU (h_pbit
);
4977 CPU (h_cbit
) = opval
;
4978 written
|= (1 << 10);
4979 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4985 CPU (h_cbit
) = opval
;
4986 written
|= (1 << 10);
4987 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4992 SI opval
= GET_H_SR (FLD (f_operand2
));
4993 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4994 written
|= (1 << 13);
4995 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4998 if (NEBI (tmp_postinc
, 0)) {
5000 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5001 tmp_addr
= ADDSI (tmp_addr
, 4);
5004 SI opval
= tmp_addr
;
5005 SET_H_GR (FLD (f_operand1
), opval
);
5006 written
|= (1 << 9);
5007 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5013 else if (EQSI (tmp_rno
, 15)) {
5017 tmp_postinc
= FLD (f_memmode
);
5018 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5019 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
5020 if (EQBI (CPU (h_pbit
), 0)) {
5023 SI opval
= GET_H_SR (FLD (f_operand2
));
5024 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5025 written
|= (1 << 13);
5026 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5029 BI opval
= CPU (h_pbit
);
5030 CPU (h_cbit
) = opval
;
5031 written
|= (1 << 10);
5032 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5038 CPU (h_cbit
) = opval
;
5039 written
|= (1 << 10);
5040 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5045 SI opval
= GET_H_SR (FLD (f_operand2
));
5046 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5047 written
|= (1 << 13);
5048 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5051 if (NEBI (tmp_postinc
, 0)) {
5053 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5054 tmp_addr
= ADDSI (tmp_addr
, 4);
5057 SI opval
= tmp_addr
;
5058 SET_H_GR (FLD (f_operand1
), opval
);
5059 written
|= (1 << 9);
5060 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5067 cgen_rtx_error (current_cpu
, "write from unimplemented special register");
5072 CPU (h_xbit
) = opval
;
5073 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5077 SET_H_INSN_PREFIXED_P (opval
);
5078 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5083 abuf
->written
= written
;
5088 CASE (sem
, INSN_MOVE_SS_R
) : /* move ${Ss},${Rd-sfield} */
5090 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5091 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5092 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
5093 int UNUSED written
= 0;
5094 IADDR UNUSED pc
= abuf
->addr
;
5095 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5099 SI opval
= GET_H_SUPR (FLD (f_operand2
));
5100 SET_H_GR (FLD (f_operand1
), opval
);
5101 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5106 CPU (h_xbit
) = opval
;
5107 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5111 SET_H_INSN_PREFIXED_P (opval
);
5112 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5121 CASE (sem
, INSN_MOVE_R_SS
) : /* move ${Rs},${Sd} */
5123 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5125 #define FLD(f) abuf->fields.sfmt_mcp.f
5126 int UNUSED written
= 0;
5127 IADDR UNUSED pc
= abuf
->addr
;
5128 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5132 SI opval
= GET_H_GR (FLD (f_operand1
));
5133 SET_H_SUPR (FLD (f_operand2
), opval
);
5134 TRACE_RESULT (current_cpu
, abuf
, "supr", 'x', opval
);
5139 CPU (h_xbit
) = opval
;
5140 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5144 SET_H_INSN_PREFIXED_P (opval
);
5145 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5154 CASE (sem
, INSN_MOVEM_R_M_V32
) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
5156 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5157 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5158 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
5159 int UNUSED written
= 0;
5160 IADDR UNUSED pc
= abuf
->addr
;
5161 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5166 tmp_postinc
= FLD (f_memmode
);
5169 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
5171 tmp_addr
= GET_H_GR (FLD (f_operand1
));
5173 if (GESI (FLD (f_operand2
), 0)) {
5176 tmp_tmp
= GET_H_GR (((UINT
) 0));
5179 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5180 written
|= (1 << 21);
5181 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5183 tmp_addr
= ADDSI (tmp_addr
, 4);
5186 if (GESI (FLD (f_operand2
), 1)) {
5189 tmp_tmp
= GET_H_GR (((UINT
) 1));
5192 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5193 written
|= (1 << 21);
5194 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5196 tmp_addr
= ADDSI (tmp_addr
, 4);
5199 if (GESI (FLD (f_operand2
), 2)) {
5202 tmp_tmp
= GET_H_GR (((UINT
) 2));
5205 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5206 written
|= (1 << 21);
5207 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5209 tmp_addr
= ADDSI (tmp_addr
, 4);
5212 if (GESI (FLD (f_operand2
), 3)) {
5215 tmp_tmp
= GET_H_GR (((UINT
) 3));
5218 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5219 written
|= (1 << 21);
5220 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5222 tmp_addr
= ADDSI (tmp_addr
, 4);
5225 if (GESI (FLD (f_operand2
), 4)) {
5228 tmp_tmp
= GET_H_GR (((UINT
) 4));
5231 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5232 written
|= (1 << 21);
5233 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5235 tmp_addr
= ADDSI (tmp_addr
, 4);
5238 if (GESI (FLD (f_operand2
), 5)) {
5241 tmp_tmp
= GET_H_GR (((UINT
) 5));
5244 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5245 written
|= (1 << 21);
5246 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5248 tmp_addr
= ADDSI (tmp_addr
, 4);
5251 if (GESI (FLD (f_operand2
), 6)) {
5254 tmp_tmp
= GET_H_GR (((UINT
) 6));
5257 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5258 written
|= (1 << 21);
5259 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5261 tmp_addr
= ADDSI (tmp_addr
, 4);
5264 if (GESI (FLD (f_operand2
), 7)) {
5267 tmp_tmp
= GET_H_GR (((UINT
) 7));
5270 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5271 written
|= (1 << 21);
5272 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5274 tmp_addr
= ADDSI (tmp_addr
, 4);
5277 if (GESI (FLD (f_operand2
), 8)) {
5280 tmp_tmp
= GET_H_GR (((UINT
) 8));
5283 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5284 written
|= (1 << 21);
5285 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5287 tmp_addr
= ADDSI (tmp_addr
, 4);
5290 if (GESI (FLD (f_operand2
), 9)) {
5293 tmp_tmp
= GET_H_GR (((UINT
) 9));
5296 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5297 written
|= (1 << 21);
5298 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5300 tmp_addr
= ADDSI (tmp_addr
, 4);
5303 if (GESI (FLD (f_operand2
), 10)) {
5306 tmp_tmp
= GET_H_GR (((UINT
) 10));
5309 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5310 written
|= (1 << 21);
5311 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5313 tmp_addr
= ADDSI (tmp_addr
, 4);
5316 if (GESI (FLD (f_operand2
), 11)) {
5319 tmp_tmp
= GET_H_GR (((UINT
) 11));
5322 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5323 written
|= (1 << 21);
5324 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5326 tmp_addr
= ADDSI (tmp_addr
, 4);
5329 if (GESI (FLD (f_operand2
), 12)) {
5332 tmp_tmp
= GET_H_GR (((UINT
) 12));
5335 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5336 written
|= (1 << 21);
5337 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5339 tmp_addr
= ADDSI (tmp_addr
, 4);
5342 if (GESI (FLD (f_operand2
), 13)) {
5345 tmp_tmp
= GET_H_GR (((UINT
) 13));
5348 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5349 written
|= (1 << 21);
5350 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5352 tmp_addr
= ADDSI (tmp_addr
, 4);
5355 if (GESI (FLD (f_operand2
), 14)) {
5358 tmp_tmp
= GET_H_GR (((UINT
) 14));
5361 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5362 written
|= (1 << 21);
5363 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5365 tmp_addr
= ADDSI (tmp_addr
, 4);
5368 if (GESI (FLD (f_operand2
), 15)) {
5371 tmp_tmp
= GET_H_GR (((UINT
) 15));
5374 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5375 written
|= (1 << 21);
5376 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5378 tmp_addr
= ADDSI (tmp_addr
, 4);
5382 if (NEBI (tmp_postinc
, 0)) {
5384 SI opval
= tmp_addr
;
5385 SET_H_GR (FLD (f_operand1
), opval
);
5386 written
|= (1 << 20);
5387 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5393 CPU (h_xbit
) = opval
;
5394 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5398 SET_H_INSN_PREFIXED_P (opval
);
5399 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5404 abuf
->written
= written
;
5409 CASE (sem
, INSN_MOVEM_M_R_V32
) : /* movem [${Rs}${inc}],${Rd} */
5411 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5412 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5413 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5414 int UNUSED written
= 0;
5415 IADDR UNUSED pc
= abuf
->addr
;
5416 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5421 tmp_postinc
= FLD (f_memmode
);
5422 tmp_addr
= GET_H_GR (FLD (f_operand1
));
5425 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
5428 if (GESI (FLD (f_operand2
), 0)) {
5431 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5434 SET_H_GR (((UINT
) 0), opval
);
5435 written
|= (1 << 6);
5436 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5438 tmp_addr
= ADDSI (tmp_addr
, 4);
5441 if (GESI (FLD (f_operand2
), 1)) {
5444 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5447 SET_H_GR (((UINT
) 1), opval
);
5448 written
|= (1 << 7);
5449 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5451 tmp_addr
= ADDSI (tmp_addr
, 4);
5454 if (GESI (FLD (f_operand2
), 2)) {
5457 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5460 SET_H_GR (((UINT
) 2), opval
);
5461 written
|= (1 << 14);
5462 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5464 tmp_addr
= ADDSI (tmp_addr
, 4);
5467 if (GESI (FLD (f_operand2
), 3)) {
5470 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5473 SET_H_GR (((UINT
) 3), opval
);
5474 written
|= (1 << 15);
5475 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5477 tmp_addr
= ADDSI (tmp_addr
, 4);
5480 if (GESI (FLD (f_operand2
), 4)) {
5483 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5486 SET_H_GR (((UINT
) 4), opval
);
5487 written
|= (1 << 16);
5488 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5490 tmp_addr
= ADDSI (tmp_addr
, 4);
5493 if (GESI (FLD (f_operand2
), 5)) {
5496 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5499 SET_H_GR (((UINT
) 5), opval
);
5500 written
|= (1 << 17);
5501 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5503 tmp_addr
= ADDSI (tmp_addr
, 4);
5506 if (GESI (FLD (f_operand2
), 6)) {
5509 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5512 SET_H_GR (((UINT
) 6), opval
);
5513 written
|= (1 << 18);
5514 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5516 tmp_addr
= ADDSI (tmp_addr
, 4);
5519 if (GESI (FLD (f_operand2
), 7)) {
5522 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5525 SET_H_GR (((UINT
) 7), opval
);
5526 written
|= (1 << 19);
5527 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5529 tmp_addr
= ADDSI (tmp_addr
, 4);
5532 if (GESI (FLD (f_operand2
), 8)) {
5535 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5538 SET_H_GR (((UINT
) 8), opval
);
5539 written
|= (1 << 20);
5540 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5542 tmp_addr
= ADDSI (tmp_addr
, 4);
5545 if (GESI (FLD (f_operand2
), 9)) {
5548 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5551 SET_H_GR (((UINT
) 9), opval
);
5552 written
|= (1 << 21);
5553 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5555 tmp_addr
= ADDSI (tmp_addr
, 4);
5558 if (GESI (FLD (f_operand2
), 10)) {
5561 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5564 SET_H_GR (((UINT
) 10), opval
);
5565 written
|= (1 << 8);
5566 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5568 tmp_addr
= ADDSI (tmp_addr
, 4);
5571 if (GESI (FLD (f_operand2
), 11)) {
5574 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5577 SET_H_GR (((UINT
) 11), opval
);
5578 written
|= (1 << 9);
5579 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5581 tmp_addr
= ADDSI (tmp_addr
, 4);
5584 if (GESI (FLD (f_operand2
), 12)) {
5587 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5590 SET_H_GR (((UINT
) 12), opval
);
5591 written
|= (1 << 10);
5592 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5594 tmp_addr
= ADDSI (tmp_addr
, 4);
5597 if (GESI (FLD (f_operand2
), 13)) {
5600 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5603 SET_H_GR (((UINT
) 13), opval
);
5604 written
|= (1 << 11);
5605 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5607 tmp_addr
= ADDSI (tmp_addr
, 4);
5610 if (GESI (FLD (f_operand2
), 14)) {
5613 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5616 SET_H_GR (((UINT
) 14), opval
);
5617 written
|= (1 << 12);
5618 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5620 tmp_addr
= ADDSI (tmp_addr
, 4);
5623 if (GESI (FLD (f_operand2
), 15)) {
5626 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5629 SET_H_GR (((UINT
) 15), opval
);
5630 written
|= (1 << 13);
5631 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5633 tmp_addr
= ADDSI (tmp_addr
, 4);
5637 if (NEBI (tmp_postinc
, 0)) {
5639 SI opval
= tmp_addr
;
5640 SET_H_GR (FLD (f_operand1
), opval
);
5641 written
|= (1 << 5);
5642 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5648 CPU (h_xbit
) = opval
;
5649 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5653 SET_H_INSN_PREFIXED_P (opval
);
5654 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5659 abuf
->written
= written
;
5664 CASE (sem
, INSN_ADD_B_R
) : /* add.b $Rs,$Rd */
5666 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5667 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5668 #define FLD(f) abuf->fields.sfmt_addc_m.f
5669 int UNUSED written
= 0;
5670 IADDR UNUSED pc
= abuf
->addr
;
5671 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5678 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5679 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5680 tmp_carry
= CPU (h_cbit
);
5681 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5684 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5686 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5687 SET_H_GR (FLD (f_operand2
), opval
);
5688 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5693 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTQI (tmp_tmpopd
, 0), GEQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_newval
, 0))));
5694 CPU (h_cbit
) = opval
;
5695 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5698 BI opval
= LTQI (tmp_newval
, 0);
5699 CPU (h_nbit
) = opval
;
5700 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5703 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5704 CPU (h_zbit
) = opval
;
5705 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5708 BI opval
= ORIF (ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
5709 CPU (h_vbit
) = opval
;
5710 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5715 CPU (h_xbit
) = opval
;
5716 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5720 SET_H_INSN_PREFIXED_P (opval
);
5721 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5731 CASE (sem
, INSN_ADD_W_R
) : /* add.w $Rs,$Rd */
5733 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5734 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5735 #define FLD(f) abuf->fields.sfmt_addc_m.f
5736 int UNUSED written
= 0;
5737 IADDR UNUSED pc
= abuf
->addr
;
5738 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5745 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5746 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5747 tmp_carry
= CPU (h_cbit
);
5748 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5751 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5753 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5754 SET_H_GR (FLD (f_operand2
), opval
);
5755 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5760 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))));
5761 CPU (h_cbit
) = opval
;
5762 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5765 BI opval
= LTHI (tmp_newval
, 0);
5766 CPU (h_nbit
) = opval
;
5767 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5770 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5771 CPU (h_zbit
) = opval
;
5772 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5775 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)));
5776 CPU (h_vbit
) = opval
;
5777 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5782 CPU (h_xbit
) = opval
;
5783 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5787 SET_H_INSN_PREFIXED_P (opval
);
5788 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5798 CASE (sem
, INSN_ADD_D_R
) : /* add.d $Rs,$Rd */
5800 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5801 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5802 #define FLD(f) abuf->fields.sfmt_addc_m.f
5803 int UNUSED written
= 0;
5804 IADDR UNUSED pc
= abuf
->addr
;
5805 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5812 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5813 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5814 tmp_carry
= CPU (h_cbit
);
5815 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5817 SI opval
= tmp_newval
;
5818 SET_H_GR (FLD (f_operand2
), opval
);
5819 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5823 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))));
5824 CPU (h_cbit
) = opval
;
5825 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5828 BI opval
= LTSI (tmp_newval
, 0);
5829 CPU (h_nbit
) = opval
;
5830 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5833 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5834 CPU (h_zbit
) = opval
;
5835 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5838 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)));
5839 CPU (h_vbit
) = opval
;
5840 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5845 CPU (h_xbit
) = opval
;
5846 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5850 SET_H_INSN_PREFIXED_P (opval
);
5851 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5861 CASE (sem
, INSN_ADD_M_B_M
) : /* add-m.b [${Rs}${inc}],${Rd} */
5863 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5864 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5865 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5866 int UNUSED written
= 0;
5867 IADDR UNUSED pc
= abuf
->addr
;
5868 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5875 tmp_tmpops
= ({ SI tmp_addr
;
5878 tmp_postinc
= FLD (f_memmode
);
5879 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5880 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
5881 ; if (NEBI (tmp_postinc
, 0)) {
5883 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5884 tmp_addr
= ADDSI (tmp_addr
, 1);
5887 SI opval
= tmp_addr
;
5888 SET_H_GR (FLD (f_operand1
), opval
);
5889 written
|= (1 << 12);
5890 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5895 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5896 tmp_carry
= CPU (h_cbit
);
5897 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5900 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5902 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5903 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5904 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5909 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))));
5910 CPU (h_cbit
) = opval
;
5911 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5914 BI opval
= LTQI (tmp_newval
, 0);
5915 CPU (h_nbit
) = opval
;
5916 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5919 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5920 CPU (h_zbit
) = opval
;
5921 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5924 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)));
5925 CPU (h_vbit
) = opval
;
5926 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5931 CPU (h_xbit
) = opval
;
5932 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5936 SET_H_INSN_PREFIXED_P (opval
);
5937 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5943 abuf
->written
= written
;
5948 CASE (sem
, INSN_ADD_M_W_M
) : /* add-m.w [${Rs}${inc}],${Rd} */
5950 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5951 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5952 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5953 int UNUSED written
= 0;
5954 IADDR UNUSED pc
= abuf
->addr
;
5955 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5962 tmp_tmpops
= ({ SI tmp_addr
;
5965 tmp_postinc
= FLD (f_memmode
);
5966 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5967 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
5968 ; if (NEBI (tmp_postinc
, 0)) {
5970 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5971 tmp_addr
= ADDSI (tmp_addr
, 2);
5974 SI opval
= tmp_addr
;
5975 SET_H_GR (FLD (f_operand1
), opval
);
5976 written
|= (1 << 12);
5977 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5982 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5983 tmp_carry
= CPU (h_cbit
);
5984 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5987 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5989 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5990 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5991 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5996 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))));
5997 CPU (h_cbit
) = opval
;
5998 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6001 BI opval
= LTHI (tmp_newval
, 0);
6002 CPU (h_nbit
) = opval
;
6003 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6006 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6007 CPU (h_zbit
) = opval
;
6008 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6011 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)));
6012 CPU (h_vbit
) = opval
;
6013 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6018 CPU (h_xbit
) = opval
;
6019 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6023 SET_H_INSN_PREFIXED_P (opval
);
6024 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6030 abuf
->written
= written
;
6035 CASE (sem
, INSN_ADD_M_D_M
) : /* add-m.d [${Rs}${inc}],${Rd} */
6037 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6038 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6039 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6040 int UNUSED written
= 0;
6041 IADDR UNUSED pc
= abuf
->addr
;
6042 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6049 tmp_tmpops
= ({ SI tmp_addr
;
6052 tmp_postinc
= FLD (f_memmode
);
6053 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6054 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
6055 ; if (NEBI (tmp_postinc
, 0)) {
6057 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6058 tmp_addr
= ADDSI (tmp_addr
, 4);
6061 SI opval
= tmp_addr
;
6062 SET_H_GR (FLD (f_operand1
), opval
);
6063 written
|= (1 << 11);
6064 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6069 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6070 tmp_carry
= CPU (h_cbit
);
6071 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6073 SI opval
= tmp_newval
;
6074 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6075 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6079 BI opval
= ORIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), ORIF (ANDIF (LTSI (tmp_tmpopd
, 0), GESI (tmp_newval
, 0)), ANDIF (LTSI (tmp_tmpops
, 0), GESI (tmp_newval
, 0))));
6080 CPU (h_cbit
) = opval
;
6081 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6084 BI opval
= LTSI (tmp_newval
, 0);
6085 CPU (h_nbit
) = opval
;
6086 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6089 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6090 CPU (h_zbit
) = opval
;
6091 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6094 BI opval
= ORIF (ANDIF (ANDIF (LTSI (tmp_tmpops
, 0), LTSI (tmp_tmpopd
, 0)), GESI (tmp_newval
, 0)), ANDIF (ANDIF (GESI (tmp_tmpops
, 0), GESI (tmp_tmpopd
, 0)), LTSI (tmp_newval
, 0)));
6095 CPU (h_vbit
) = opval
;
6096 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6101 CPU (h_xbit
) = opval
;
6102 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6106 SET_H_INSN_PREFIXED_P (opval
);
6107 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6113 abuf
->written
= written
;
6118 CASE (sem
, INSN_ADDCBR
) : /* add.b ${sconst8}],${Rd} */
6120 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6122 #define FLD(f) abuf->fields.sfmt_addcbr.f
6123 int UNUSED written
= 0;
6124 IADDR UNUSED pc
= abuf
->addr
;
6125 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6132 tmp_tmpops
= FLD (f_indir_pc__byte
);
6133 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6134 tmp_carry
= CPU (h_cbit
);
6135 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6138 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
6140 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
6141 SET_H_GR (FLD (f_operand2
), opval
);
6142 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6147 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))));
6148 CPU (h_cbit
) = opval
;
6149 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6152 BI opval
= LTQI (tmp_newval
, 0);
6153 CPU (h_nbit
) = opval
;
6154 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6157 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6158 CPU (h_zbit
) = opval
;
6159 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6162 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)));
6163 CPU (h_vbit
) = opval
;
6164 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6169 CPU (h_xbit
) = opval
;
6170 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6174 SET_H_INSN_PREFIXED_P (opval
);
6175 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6185 CASE (sem
, INSN_ADDCWR
) : /* add.w ${sconst16}],${Rd} */
6187 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6188 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6189 #define FLD(f) abuf->fields.sfmt_addcwr.f
6190 int UNUSED written
= 0;
6191 IADDR UNUSED pc
= abuf
->addr
;
6192 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6199 tmp_tmpops
= FLD (f_indir_pc__word
);
6200 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6201 tmp_carry
= CPU (h_cbit
);
6202 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6205 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
6207 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
6208 SET_H_GR (FLD (f_operand2
), opval
);
6209 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6214 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))));
6215 CPU (h_cbit
) = opval
;
6216 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6219 BI opval
= LTHI (tmp_newval
, 0);
6220 CPU (h_nbit
) = opval
;
6221 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6224 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6225 CPU (h_zbit
) = opval
;
6226 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6229 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)));
6230 CPU (h_vbit
) = opval
;
6231 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6236 CPU (h_xbit
) = opval
;
6237 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6241 SET_H_INSN_PREFIXED_P (opval
);
6242 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6252 CASE (sem
, INSN_ADDCDR
) : /* add.d ${const32}],${Rd} */
6254 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6255 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6256 #define FLD(f) abuf->fields.sfmt_addcdr.f
6257 int UNUSED written
= 0;
6258 IADDR UNUSED pc
= abuf
->addr
;
6259 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6266 tmp_tmpops
= FLD (f_indir_pc__dword
);
6267 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6268 tmp_carry
= CPU (h_cbit
);
6269 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6271 SI opval
= tmp_newval
;
6272 SET_H_GR (FLD (f_operand2
), opval
);
6273 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6277 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))));
6278 CPU (h_cbit
) = opval
;
6279 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6282 BI opval
= LTSI (tmp_newval
, 0);
6283 CPU (h_nbit
) = opval
;
6284 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6287 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6288 CPU (h_zbit
) = opval
;
6289 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6292 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)));
6293 CPU (h_vbit
) = opval
;
6294 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6299 CPU (h_xbit
) = opval
;
6300 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6304 SET_H_INSN_PREFIXED_P (opval
);
6305 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6315 CASE (sem
, INSN_ADDS_B_R
) : /* adds.b $Rs,$Rd */
6317 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6318 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6319 #define FLD(f) abuf->fields.sfmt_addc_m.f
6320 int UNUSED written
= 0;
6321 IADDR UNUSED pc
= abuf
->addr
;
6322 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6329 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6330 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6331 tmp_carry
= CPU (h_cbit
);
6332 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6334 SI opval
= tmp_newval
;
6335 SET_H_GR (FLD (f_operand2
), opval
);
6336 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6340 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))));
6341 CPU (h_cbit
) = opval
;
6342 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6345 BI opval
= LTSI (tmp_newval
, 0);
6346 CPU (h_nbit
) = opval
;
6347 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6350 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6351 CPU (h_zbit
) = opval
;
6352 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6355 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)));
6356 CPU (h_vbit
) = opval
;
6357 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6362 CPU (h_xbit
) = opval
;
6363 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6367 SET_H_INSN_PREFIXED_P (opval
);
6368 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6378 CASE (sem
, INSN_ADDS_W_R
) : /* adds.w $Rs,$Rd */
6380 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6381 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6382 #define FLD(f) abuf->fields.sfmt_addc_m.f
6383 int UNUSED written
= 0;
6384 IADDR UNUSED pc
= abuf
->addr
;
6385 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6392 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6393 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6394 tmp_carry
= CPU (h_cbit
);
6395 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6397 SI opval
= tmp_newval
;
6398 SET_H_GR (FLD (f_operand2
), opval
);
6399 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6403 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))));
6404 CPU (h_cbit
) = opval
;
6405 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6408 BI opval
= LTSI (tmp_newval
, 0);
6409 CPU (h_nbit
) = opval
;
6410 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6413 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6414 CPU (h_zbit
) = opval
;
6415 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6418 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)));
6419 CPU (h_vbit
) = opval
;
6420 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6425 CPU (h_xbit
) = opval
;
6426 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6430 SET_H_INSN_PREFIXED_P (opval
);
6431 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6441 CASE (sem
, INSN_ADDS_M_B_M
) : /* adds-m.b [${Rs}${inc}],$Rd */
6443 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6444 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6445 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6446 int UNUSED written
= 0;
6447 IADDR UNUSED pc
= abuf
->addr
;
6448 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6455 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
6458 tmp_postinc
= FLD (f_memmode
);
6459 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6460 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6461 ; if (NEBI (tmp_postinc
, 0)) {
6463 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6464 tmp_addr
= ADDSI (tmp_addr
, 1);
6467 SI opval
= tmp_addr
;
6468 SET_H_GR (FLD (f_operand1
), opval
);
6469 written
|= (1 << 11);
6470 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6475 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6476 tmp_carry
= CPU (h_cbit
);
6477 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6479 SI opval
= tmp_newval
;
6480 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6481 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6485 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))));
6486 CPU (h_cbit
) = opval
;
6487 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6490 BI opval
= LTSI (tmp_newval
, 0);
6491 CPU (h_nbit
) = opval
;
6492 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6495 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6496 CPU (h_zbit
) = opval
;
6497 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6500 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)));
6501 CPU (h_vbit
) = opval
;
6502 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6507 CPU (h_xbit
) = opval
;
6508 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6512 SET_H_INSN_PREFIXED_P (opval
);
6513 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6519 abuf
->written
= written
;
6524 CASE (sem
, INSN_ADDS_M_W_M
) : /* adds-m.w [${Rs}${inc}],$Rd */
6526 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6527 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6528 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6529 int UNUSED written
= 0;
6530 IADDR UNUSED pc
= abuf
->addr
;
6531 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6538 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
6541 tmp_postinc
= FLD (f_memmode
);
6542 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6543 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6544 ; if (NEBI (tmp_postinc
, 0)) {
6546 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6547 tmp_addr
= ADDSI (tmp_addr
, 2);
6550 SI opval
= tmp_addr
;
6551 SET_H_GR (FLD (f_operand1
), opval
);
6552 written
|= (1 << 11);
6553 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6558 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6559 tmp_carry
= CPU (h_cbit
);
6560 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6562 SI opval
= tmp_newval
;
6563 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6564 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6568 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))));
6569 CPU (h_cbit
) = opval
;
6570 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6573 BI opval
= LTSI (tmp_newval
, 0);
6574 CPU (h_nbit
) = opval
;
6575 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6578 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6579 CPU (h_zbit
) = opval
;
6580 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6583 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)));
6584 CPU (h_vbit
) = opval
;
6585 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6590 CPU (h_xbit
) = opval
;
6591 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6595 SET_H_INSN_PREFIXED_P (opval
);
6596 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6602 abuf
->written
= written
;
6607 CASE (sem
, INSN_ADDSCBR
) : /* [${Rs}${inc}],$Rd */
6609 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6610 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6611 #define FLD(f) abuf->fields.sfmt_addcbr.f
6612 int UNUSED written
= 0;
6613 IADDR UNUSED pc
= abuf
->addr
;
6614 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6621 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6622 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6623 tmp_carry
= CPU (h_cbit
);
6624 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6626 SI opval
= tmp_newval
;
6627 SET_H_GR (FLD (f_operand2
), opval
);
6628 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6632 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))));
6633 CPU (h_cbit
) = opval
;
6634 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6637 BI opval
= LTSI (tmp_newval
, 0);
6638 CPU (h_nbit
) = opval
;
6639 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6642 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6643 CPU (h_zbit
) = opval
;
6644 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6647 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)));
6648 CPU (h_vbit
) = opval
;
6649 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6654 CPU (h_xbit
) = opval
;
6655 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6659 SET_H_INSN_PREFIXED_P (opval
);
6660 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6670 CASE (sem
, INSN_ADDSCWR
) : /* [${Rs}${inc}],$Rd */
6672 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6674 #define FLD(f) abuf->fields.sfmt_addcwr.f
6675 int UNUSED written
= 0;
6676 IADDR UNUSED pc
= abuf
->addr
;
6677 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6684 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6685 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6686 tmp_carry
= CPU (h_cbit
);
6687 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6689 SI opval
= tmp_newval
;
6690 SET_H_GR (FLD (f_operand2
), opval
);
6691 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6695 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))));
6696 CPU (h_cbit
) = opval
;
6697 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6700 BI opval
= LTSI (tmp_newval
, 0);
6701 CPU (h_nbit
) = opval
;
6702 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6705 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6706 CPU (h_zbit
) = opval
;
6707 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6710 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)));
6711 CPU (h_vbit
) = opval
;
6712 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6717 CPU (h_xbit
) = opval
;
6718 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6722 SET_H_INSN_PREFIXED_P (opval
);
6723 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6733 CASE (sem
, INSN_ADDU_B_R
) : /* addu.b $Rs,$Rd */
6735 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6736 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6737 #define FLD(f) abuf->fields.sfmt_addc_m.f
6738 int UNUSED written
= 0;
6739 IADDR UNUSED pc
= abuf
->addr
;
6740 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6747 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6748 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6749 tmp_carry
= CPU (h_cbit
);
6750 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6752 SI opval
= tmp_newval
;
6753 SET_H_GR (FLD (f_operand2
), opval
);
6754 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6758 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))));
6759 CPU (h_cbit
) = opval
;
6760 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6763 BI opval
= LTSI (tmp_newval
, 0);
6764 CPU (h_nbit
) = opval
;
6765 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6768 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6769 CPU (h_zbit
) = opval
;
6770 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6773 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)));
6774 CPU (h_vbit
) = opval
;
6775 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6780 CPU (h_xbit
) = opval
;
6781 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6785 SET_H_INSN_PREFIXED_P (opval
);
6786 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6796 CASE (sem
, INSN_ADDU_W_R
) : /* addu.w $Rs,$Rd */
6798 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6799 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6800 #define FLD(f) abuf->fields.sfmt_addc_m.f
6801 int UNUSED written
= 0;
6802 IADDR UNUSED pc
= abuf
->addr
;
6803 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6810 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6811 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6812 tmp_carry
= CPU (h_cbit
);
6813 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6815 SI opval
= tmp_newval
;
6816 SET_H_GR (FLD (f_operand2
), opval
);
6817 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6821 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))));
6822 CPU (h_cbit
) = opval
;
6823 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6826 BI opval
= LTSI (tmp_newval
, 0);
6827 CPU (h_nbit
) = opval
;
6828 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6831 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6832 CPU (h_zbit
) = opval
;
6833 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6836 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)));
6837 CPU (h_vbit
) = opval
;
6838 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6843 CPU (h_xbit
) = opval
;
6844 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6848 SET_H_INSN_PREFIXED_P (opval
);
6849 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6859 CASE (sem
, INSN_ADDU_M_B_M
) : /* addu-m.b [${Rs}${inc}],$Rd */
6861 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6862 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6863 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6864 int UNUSED written
= 0;
6865 IADDR UNUSED pc
= abuf
->addr
;
6866 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6873 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
6876 tmp_postinc
= FLD (f_memmode
);
6877 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6878 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6879 ; if (NEBI (tmp_postinc
, 0)) {
6881 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6882 tmp_addr
= ADDSI (tmp_addr
, 1);
6885 SI opval
= tmp_addr
;
6886 SET_H_GR (FLD (f_operand1
), opval
);
6887 written
|= (1 << 11);
6888 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6893 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6894 tmp_carry
= CPU (h_cbit
);
6895 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6897 SI opval
= tmp_newval
;
6898 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6899 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6903 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))));
6904 CPU (h_cbit
) = opval
;
6905 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6908 BI opval
= LTSI (tmp_newval
, 0);
6909 CPU (h_nbit
) = opval
;
6910 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6913 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6914 CPU (h_zbit
) = opval
;
6915 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6918 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)));
6919 CPU (h_vbit
) = opval
;
6920 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6925 CPU (h_xbit
) = opval
;
6926 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6930 SET_H_INSN_PREFIXED_P (opval
);
6931 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6937 abuf
->written
= written
;
6942 CASE (sem
, INSN_ADDU_M_W_M
) : /* addu-m.w [${Rs}${inc}],$Rd */
6944 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6945 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6946 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6947 int UNUSED written
= 0;
6948 IADDR UNUSED pc
= abuf
->addr
;
6949 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6956 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
6959 tmp_postinc
= FLD (f_memmode
);
6960 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6961 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6962 ; if (NEBI (tmp_postinc
, 0)) {
6964 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6965 tmp_addr
= ADDSI (tmp_addr
, 2);
6968 SI opval
= tmp_addr
;
6969 SET_H_GR (FLD (f_operand1
), opval
);
6970 written
|= (1 << 11);
6971 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6976 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6977 tmp_carry
= CPU (h_cbit
);
6978 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6980 SI opval
= tmp_newval
;
6981 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6982 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6986 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))));
6987 CPU (h_cbit
) = opval
;
6988 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6991 BI opval
= LTSI (tmp_newval
, 0);
6992 CPU (h_nbit
) = opval
;
6993 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6996 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6997 CPU (h_zbit
) = opval
;
6998 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7001 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)));
7002 CPU (h_vbit
) = opval
;
7003 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7008 CPU (h_xbit
) = opval
;
7009 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7013 SET_H_INSN_PREFIXED_P (opval
);
7014 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7020 abuf
->written
= written
;
7025 CASE (sem
, INSN_ADDUCBR
) : /* [${Rs}${inc}],$Rd */
7027 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7028 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7029 #define FLD(f) abuf->fields.sfmt_addcbr.f
7030 int UNUSED written
= 0;
7031 IADDR UNUSED pc
= abuf
->addr
;
7032 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7039 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
7040 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7041 tmp_carry
= CPU (h_cbit
);
7042 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7044 SI opval
= tmp_newval
;
7045 SET_H_GR (FLD (f_operand2
), opval
);
7046 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7050 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))));
7051 CPU (h_cbit
) = opval
;
7052 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7055 BI opval
= LTSI (tmp_newval
, 0);
7056 CPU (h_nbit
) = opval
;
7057 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7060 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7061 CPU (h_zbit
) = opval
;
7062 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7065 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)));
7066 CPU (h_vbit
) = opval
;
7067 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7072 CPU (h_xbit
) = opval
;
7073 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7077 SET_H_INSN_PREFIXED_P (opval
);
7078 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7088 CASE (sem
, INSN_ADDUCWR
) : /* [${Rs}${inc}],$Rd */
7090 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7091 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7092 #define FLD(f) abuf->fields.sfmt_addcwr.f
7093 int UNUSED written
= 0;
7094 IADDR UNUSED pc
= abuf
->addr
;
7095 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7102 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
7103 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7104 tmp_carry
= CPU (h_cbit
);
7105 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7107 SI opval
= tmp_newval
;
7108 SET_H_GR (FLD (f_operand2
), opval
);
7109 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7113 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))));
7114 CPU (h_cbit
) = opval
;
7115 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7118 BI opval
= LTSI (tmp_newval
, 0);
7119 CPU (h_nbit
) = opval
;
7120 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7123 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7124 CPU (h_zbit
) = opval
;
7125 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7128 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)));
7129 CPU (h_vbit
) = opval
;
7130 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7135 CPU (h_xbit
) = opval
;
7136 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7140 SET_H_INSN_PREFIXED_P (opval
);
7141 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7151 CASE (sem
, INSN_SUB_B_R
) : /* sub.b $Rs,$Rd */
7153 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7154 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7155 #define FLD(f) abuf->fields.sfmt_addc_m.f
7156 int UNUSED written
= 0;
7157 IADDR UNUSED pc
= abuf
->addr
;
7158 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7165 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7166 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7167 tmp_carry
= CPU (h_cbit
);
7168 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7171 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7173 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7174 SET_H_GR (FLD (f_operand2
), opval
);
7175 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7180 BI opval
= ORIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), ORIF (ANDIF (GEQI (tmp_tmpopd
, 0), LTQI (tmp_newval
, 0)), ANDIF (LTQI (tmp_tmpops
, 0), LTQI (tmp_newval
, 0))));
7181 CPU (h_cbit
) = opval
;
7182 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7185 BI opval
= LTQI (tmp_newval
, 0);
7186 CPU (h_nbit
) = opval
;
7187 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7190 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7191 CPU (h_zbit
) = opval
;
7192 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7195 BI opval
= ORIF (ANDIF (ANDIF (GEQI (tmp_tmpops
, 0), LTQI (tmp_tmpopd
, 0)), GEQI (tmp_newval
, 0)), ANDIF (ANDIF (LTQI (tmp_tmpops
, 0), GEQI (tmp_tmpopd
, 0)), LTQI (tmp_newval
, 0)));
7196 CPU (h_vbit
) = opval
;
7197 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7202 CPU (h_xbit
) = opval
;
7203 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7207 SET_H_INSN_PREFIXED_P (opval
);
7208 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7218 CASE (sem
, INSN_SUB_W_R
) : /* sub.w $Rs,$Rd */
7220 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7221 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7222 #define FLD(f) abuf->fields.sfmt_addc_m.f
7223 int UNUSED written
= 0;
7224 IADDR UNUSED pc
= abuf
->addr
;
7225 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7232 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7233 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7234 tmp_carry
= CPU (h_cbit
);
7235 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7238 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7240 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7241 SET_H_GR (FLD (f_operand2
), opval
);
7242 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7247 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))));
7248 CPU (h_cbit
) = opval
;
7249 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7252 BI opval
= LTHI (tmp_newval
, 0);
7253 CPU (h_nbit
) = opval
;
7254 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7257 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7258 CPU (h_zbit
) = opval
;
7259 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7262 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)));
7263 CPU (h_vbit
) = opval
;
7264 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7269 CPU (h_xbit
) = opval
;
7270 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7274 SET_H_INSN_PREFIXED_P (opval
);
7275 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7285 CASE (sem
, INSN_SUB_D_R
) : /* sub.d $Rs,$Rd */
7287 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7288 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7289 #define FLD(f) abuf->fields.sfmt_addc_m.f
7290 int UNUSED written
= 0;
7291 IADDR UNUSED pc
= abuf
->addr
;
7292 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7299 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7300 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7301 tmp_carry
= CPU (h_cbit
);
7302 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7304 SI opval
= tmp_newval
;
7305 SET_H_GR (FLD (f_operand2
), opval
);
7306 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7310 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))));
7311 CPU (h_cbit
) = opval
;
7312 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7315 BI opval
= LTSI (tmp_newval
, 0);
7316 CPU (h_nbit
) = opval
;
7317 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7320 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7321 CPU (h_zbit
) = opval
;
7322 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7325 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)));
7326 CPU (h_vbit
) = opval
;
7327 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7332 CPU (h_xbit
) = opval
;
7333 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7337 SET_H_INSN_PREFIXED_P (opval
);
7338 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7348 CASE (sem
, INSN_SUB_M_B_M
) : /* sub-m.b [${Rs}${inc}],${Rd} */
7350 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7351 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7352 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7353 int UNUSED written
= 0;
7354 IADDR UNUSED pc
= abuf
->addr
;
7355 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7362 tmp_tmpops
= ({ SI tmp_addr
;
7365 tmp_postinc
= FLD (f_memmode
);
7366 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7367 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7368 ; if (NEBI (tmp_postinc
, 0)) {
7370 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7371 tmp_addr
= ADDSI (tmp_addr
, 1);
7374 SI opval
= tmp_addr
;
7375 SET_H_GR (FLD (f_operand1
), opval
);
7376 written
|= (1 << 12);
7377 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7382 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7383 tmp_carry
= CPU (h_cbit
);
7384 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7387 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7389 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7390 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7391 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7396 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))));
7397 CPU (h_cbit
) = opval
;
7398 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7401 BI opval
= LTQI (tmp_newval
, 0);
7402 CPU (h_nbit
) = opval
;
7403 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7406 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7407 CPU (h_zbit
) = opval
;
7408 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7411 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)));
7412 CPU (h_vbit
) = opval
;
7413 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7418 CPU (h_xbit
) = opval
;
7419 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7423 SET_H_INSN_PREFIXED_P (opval
);
7424 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7430 abuf
->written
= written
;
7435 CASE (sem
, INSN_SUB_M_W_M
) : /* sub-m.w [${Rs}${inc}],${Rd} */
7437 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7438 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7439 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7440 int UNUSED written
= 0;
7441 IADDR UNUSED pc
= abuf
->addr
;
7442 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7449 tmp_tmpops
= ({ SI tmp_addr
;
7452 tmp_postinc
= FLD (f_memmode
);
7453 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7454 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7455 ; if (NEBI (tmp_postinc
, 0)) {
7457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7458 tmp_addr
= ADDSI (tmp_addr
, 2);
7461 SI opval
= tmp_addr
;
7462 SET_H_GR (FLD (f_operand1
), opval
);
7463 written
|= (1 << 12);
7464 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7469 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7470 tmp_carry
= CPU (h_cbit
);
7471 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7474 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7476 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7477 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7478 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7483 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))));
7484 CPU (h_cbit
) = opval
;
7485 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7488 BI opval
= LTHI (tmp_newval
, 0);
7489 CPU (h_nbit
) = opval
;
7490 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7493 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7494 CPU (h_zbit
) = opval
;
7495 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7498 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)));
7499 CPU (h_vbit
) = opval
;
7500 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7505 CPU (h_xbit
) = opval
;
7506 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7510 SET_H_INSN_PREFIXED_P (opval
);
7511 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7517 abuf
->written
= written
;
7522 CASE (sem
, INSN_SUB_M_D_M
) : /* sub-m.d [${Rs}${inc}],${Rd} */
7524 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7525 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7526 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7527 int UNUSED written
= 0;
7528 IADDR UNUSED pc
= abuf
->addr
;
7529 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7536 tmp_tmpops
= ({ SI tmp_addr
;
7539 tmp_postinc
= FLD (f_memmode
);
7540 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7541 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
7542 ; if (NEBI (tmp_postinc
, 0)) {
7544 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7545 tmp_addr
= ADDSI (tmp_addr
, 4);
7548 SI opval
= tmp_addr
;
7549 SET_H_GR (FLD (f_operand1
), opval
);
7550 written
|= (1 << 11);
7551 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
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 (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (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
);
7600 abuf
->written
= written
;
7605 CASE (sem
, INSN_SUBCBR
) : /* sub.b ${sconst8}],${Rd} */
7607 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7608 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7609 #define FLD(f) abuf->fields.sfmt_addcbr.f
7610 int UNUSED written
= 0;
7611 IADDR UNUSED pc
= abuf
->addr
;
7612 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7619 tmp_tmpops
= FLD (f_indir_pc__byte
);
7620 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7621 tmp_carry
= CPU (h_cbit
);
7622 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7625 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7627 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7628 SET_H_GR (FLD (f_operand2
), opval
);
7629 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7634 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))));
7635 CPU (h_cbit
) = opval
;
7636 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7639 BI opval
= LTQI (tmp_newval
, 0);
7640 CPU (h_nbit
) = opval
;
7641 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7644 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7645 CPU (h_zbit
) = opval
;
7646 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7649 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)));
7650 CPU (h_vbit
) = opval
;
7651 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7656 CPU (h_xbit
) = opval
;
7657 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7661 SET_H_INSN_PREFIXED_P (opval
);
7662 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7672 CASE (sem
, INSN_SUBCWR
) : /* sub.w ${sconst16}],${Rd} */
7674 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7675 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7676 #define FLD(f) abuf->fields.sfmt_addcwr.f
7677 int UNUSED written
= 0;
7678 IADDR UNUSED pc
= abuf
->addr
;
7679 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7686 tmp_tmpops
= FLD (f_indir_pc__word
);
7687 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7688 tmp_carry
= CPU (h_cbit
);
7689 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7692 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7694 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7695 SET_H_GR (FLD (f_operand2
), opval
);
7696 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7701 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))));
7702 CPU (h_cbit
) = opval
;
7703 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7706 BI opval
= LTHI (tmp_newval
, 0);
7707 CPU (h_nbit
) = opval
;
7708 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7711 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7712 CPU (h_zbit
) = opval
;
7713 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7716 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)));
7717 CPU (h_vbit
) = opval
;
7718 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7723 CPU (h_xbit
) = opval
;
7724 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7728 SET_H_INSN_PREFIXED_P (opval
);
7729 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7739 CASE (sem
, INSN_SUBCDR
) : /* sub.d ${const32}],${Rd} */
7741 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7742 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7743 #define FLD(f) abuf->fields.sfmt_addcdr.f
7744 int UNUSED written
= 0;
7745 IADDR UNUSED pc
= abuf
->addr
;
7746 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
7753 tmp_tmpops
= FLD (f_indir_pc__dword
);
7754 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7755 tmp_carry
= CPU (h_cbit
);
7756 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7758 SI opval
= tmp_newval
;
7759 SET_H_GR (FLD (f_operand2
), opval
);
7760 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7764 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))));
7765 CPU (h_cbit
) = opval
;
7766 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7769 BI opval
= LTSI (tmp_newval
, 0);
7770 CPU (h_nbit
) = opval
;
7771 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7774 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7775 CPU (h_zbit
) = opval
;
7776 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7779 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)));
7780 CPU (h_vbit
) = opval
;
7781 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7786 CPU (h_xbit
) = opval
;
7787 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7791 SET_H_INSN_PREFIXED_P (opval
);
7792 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7802 CASE (sem
, INSN_SUBS_B_R
) : /* subs.b $Rs,$Rd */
7804 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7805 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7806 #define FLD(f) abuf->fields.sfmt_addc_m.f
7807 int UNUSED written
= 0;
7808 IADDR UNUSED pc
= abuf
->addr
;
7809 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7816 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
7817 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7818 tmp_carry
= CPU (h_cbit
);
7819 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7821 SI opval
= tmp_newval
;
7822 SET_H_GR (FLD (f_operand2
), opval
);
7823 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7827 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))));
7828 CPU (h_cbit
) = opval
;
7829 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7832 BI opval
= LTSI (tmp_newval
, 0);
7833 CPU (h_nbit
) = opval
;
7834 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7837 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7838 CPU (h_zbit
) = opval
;
7839 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7842 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)));
7843 CPU (h_vbit
) = opval
;
7844 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7849 CPU (h_xbit
) = opval
;
7850 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7854 SET_H_INSN_PREFIXED_P (opval
);
7855 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7865 CASE (sem
, INSN_SUBS_W_R
) : /* subs.w $Rs,$Rd */
7867 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7868 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7869 #define FLD(f) abuf->fields.sfmt_addc_m.f
7870 int UNUSED written
= 0;
7871 IADDR UNUSED pc
= abuf
->addr
;
7872 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7879 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
7880 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7881 tmp_carry
= CPU (h_cbit
);
7882 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7884 SI opval
= tmp_newval
;
7885 SET_H_GR (FLD (f_operand2
), opval
);
7886 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7890 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))));
7891 CPU (h_cbit
) = opval
;
7892 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7895 BI opval
= LTSI (tmp_newval
, 0);
7896 CPU (h_nbit
) = opval
;
7897 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7900 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7901 CPU (h_zbit
) = opval
;
7902 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7905 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)));
7906 CPU (h_vbit
) = opval
;
7907 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7912 CPU (h_xbit
) = opval
;
7913 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7917 SET_H_INSN_PREFIXED_P (opval
);
7918 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7928 CASE (sem
, INSN_SUBS_M_B_M
) : /* subs-m.b [${Rs}${inc}],$Rd */
7930 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7931 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7932 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7933 int UNUSED written
= 0;
7934 IADDR UNUSED pc
= abuf
->addr
;
7935 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7942 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
7945 tmp_postinc
= FLD (f_memmode
);
7946 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7947 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7948 ; if (NEBI (tmp_postinc
, 0)) {
7950 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7951 tmp_addr
= ADDSI (tmp_addr
, 1);
7954 SI opval
= tmp_addr
;
7955 SET_H_GR (FLD (f_operand1
), opval
);
7956 written
|= (1 << 11);
7957 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7962 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7963 tmp_carry
= CPU (h_cbit
);
7964 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7966 SI opval
= tmp_newval
;
7967 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7968 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7972 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))));
7973 CPU (h_cbit
) = opval
;
7974 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7977 BI opval
= LTSI (tmp_newval
, 0);
7978 CPU (h_nbit
) = opval
;
7979 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7982 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7983 CPU (h_zbit
) = opval
;
7984 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7987 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)));
7988 CPU (h_vbit
) = opval
;
7989 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7994 CPU (h_xbit
) = opval
;
7995 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7999 SET_H_INSN_PREFIXED_P (opval
);
8000 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8006 abuf
->written
= written
;
8011 CASE (sem
, INSN_SUBS_M_W_M
) : /* subs-m.w [${Rs}${inc}],$Rd */
8013 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8014 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8015 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8016 int UNUSED written
= 0;
8017 IADDR UNUSED pc
= abuf
->addr
;
8018 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8025 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
8028 tmp_postinc
= FLD (f_memmode
);
8029 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8030 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8031 ; if (NEBI (tmp_postinc
, 0)) {
8033 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8034 tmp_addr
= ADDSI (tmp_addr
, 2);
8037 SI opval
= tmp_addr
;
8038 SET_H_GR (FLD (f_operand1
), opval
);
8039 written
|= (1 << 11);
8040 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8045 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8046 tmp_carry
= CPU (h_cbit
);
8047 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8049 SI opval
= tmp_newval
;
8050 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8051 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8055 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))));
8056 CPU (h_cbit
) = opval
;
8057 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8060 BI opval
= LTSI (tmp_newval
, 0);
8061 CPU (h_nbit
) = opval
;
8062 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8065 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8066 CPU (h_zbit
) = opval
;
8067 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8070 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)));
8071 CPU (h_vbit
) = opval
;
8072 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8077 CPU (h_xbit
) = opval
;
8078 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8082 SET_H_INSN_PREFIXED_P (opval
);
8083 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8089 abuf
->written
= written
;
8094 CASE (sem
, INSN_SUBSCBR
) : /* [${Rs}${inc}],$Rd */
8096 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8097 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8098 #define FLD(f) abuf->fields.sfmt_addcbr.f
8099 int UNUSED written
= 0;
8100 IADDR UNUSED pc
= abuf
->addr
;
8101 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8108 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8109 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8110 tmp_carry
= CPU (h_cbit
);
8111 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8113 SI opval
= tmp_newval
;
8114 SET_H_GR (FLD (f_operand2
), opval
);
8115 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8119 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))));
8120 CPU (h_cbit
) = opval
;
8121 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8124 BI opval
= LTSI (tmp_newval
, 0);
8125 CPU (h_nbit
) = opval
;
8126 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8129 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8130 CPU (h_zbit
) = opval
;
8131 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8134 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)));
8135 CPU (h_vbit
) = opval
;
8136 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8141 CPU (h_xbit
) = opval
;
8142 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8146 SET_H_INSN_PREFIXED_P (opval
);
8147 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8157 CASE (sem
, INSN_SUBSCWR
) : /* [${Rs}${inc}],$Rd */
8159 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8160 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8161 #define FLD(f) abuf->fields.sfmt_addcwr.f
8162 int UNUSED written
= 0;
8163 IADDR UNUSED pc
= abuf
->addr
;
8164 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8171 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8172 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8173 tmp_carry
= CPU (h_cbit
);
8174 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8176 SI opval
= tmp_newval
;
8177 SET_H_GR (FLD (f_operand2
), opval
);
8178 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8182 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))));
8183 CPU (h_cbit
) = opval
;
8184 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8187 BI opval
= LTSI (tmp_newval
, 0);
8188 CPU (h_nbit
) = opval
;
8189 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8192 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8193 CPU (h_zbit
) = opval
;
8194 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8197 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)));
8198 CPU (h_vbit
) = opval
;
8199 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8204 CPU (h_xbit
) = opval
;
8205 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8209 SET_H_INSN_PREFIXED_P (opval
);
8210 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8220 CASE (sem
, INSN_SUBU_B_R
) : /* subu.b $Rs,$Rd */
8222 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8223 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8224 #define FLD(f) abuf->fields.sfmt_addc_m.f
8225 int UNUSED written
= 0;
8226 IADDR UNUSED pc
= abuf
->addr
;
8227 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8234 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
8235 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8236 tmp_carry
= CPU (h_cbit
);
8237 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8239 SI opval
= tmp_newval
;
8240 SET_H_GR (FLD (f_operand2
), opval
);
8241 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8245 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))));
8246 CPU (h_cbit
) = opval
;
8247 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8250 BI opval
= LTSI (tmp_newval
, 0);
8251 CPU (h_nbit
) = opval
;
8252 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8255 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8256 CPU (h_zbit
) = opval
;
8257 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8260 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)));
8261 CPU (h_vbit
) = opval
;
8262 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8267 CPU (h_xbit
) = opval
;
8268 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8272 SET_H_INSN_PREFIXED_P (opval
);
8273 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8283 CASE (sem
, INSN_SUBU_W_R
) : /* subu.w $Rs,$Rd */
8285 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8286 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8287 #define FLD(f) abuf->fields.sfmt_addc_m.f
8288 int UNUSED written
= 0;
8289 IADDR UNUSED pc
= abuf
->addr
;
8290 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8297 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
8298 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8299 tmp_carry
= CPU (h_cbit
);
8300 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8302 SI opval
= tmp_newval
;
8303 SET_H_GR (FLD (f_operand2
), opval
);
8304 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8308 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))));
8309 CPU (h_cbit
) = opval
;
8310 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8313 BI opval
= LTSI (tmp_newval
, 0);
8314 CPU (h_nbit
) = opval
;
8315 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8318 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8319 CPU (h_zbit
) = opval
;
8320 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8323 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)));
8324 CPU (h_vbit
) = opval
;
8325 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8330 CPU (h_xbit
) = opval
;
8331 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8335 SET_H_INSN_PREFIXED_P (opval
);
8336 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8346 CASE (sem
, INSN_SUBU_M_B_M
) : /* subu-m.b [${Rs}${inc}],$Rd */
8348 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8349 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8350 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8351 int UNUSED written
= 0;
8352 IADDR UNUSED pc
= abuf
->addr
;
8353 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8360 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
8363 tmp_postinc
= FLD (f_memmode
);
8364 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8365 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8366 ; if (NEBI (tmp_postinc
, 0)) {
8368 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8369 tmp_addr
= ADDSI (tmp_addr
, 1);
8372 SI opval
= tmp_addr
;
8373 SET_H_GR (FLD (f_operand1
), opval
);
8374 written
|= (1 << 11);
8375 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8380 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8381 tmp_carry
= CPU (h_cbit
);
8382 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8384 SI opval
= tmp_newval
;
8385 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8386 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8390 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))));
8391 CPU (h_cbit
) = opval
;
8392 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8395 BI opval
= LTSI (tmp_newval
, 0);
8396 CPU (h_nbit
) = opval
;
8397 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8400 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8401 CPU (h_zbit
) = opval
;
8402 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8405 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)));
8406 CPU (h_vbit
) = opval
;
8407 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8412 CPU (h_xbit
) = opval
;
8413 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8417 SET_H_INSN_PREFIXED_P (opval
);
8418 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8424 abuf
->written
= written
;
8429 CASE (sem
, INSN_SUBU_M_W_M
) : /* subu-m.w [${Rs}${inc}],$Rd */
8431 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8432 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8433 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8434 int UNUSED written
= 0;
8435 IADDR UNUSED pc
= abuf
->addr
;
8436 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8443 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
8446 tmp_postinc
= FLD (f_memmode
);
8447 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8448 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8449 ; if (NEBI (tmp_postinc
, 0)) {
8451 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8452 tmp_addr
= ADDSI (tmp_addr
, 2);
8455 SI opval
= tmp_addr
;
8456 SET_H_GR (FLD (f_operand1
), opval
);
8457 written
|= (1 << 11);
8458 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8463 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8464 tmp_carry
= CPU (h_cbit
);
8465 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8467 SI opval
= tmp_newval
;
8468 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8469 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8473 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))));
8474 CPU (h_cbit
) = opval
;
8475 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8478 BI opval
= LTSI (tmp_newval
, 0);
8479 CPU (h_nbit
) = opval
;
8480 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8483 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8484 CPU (h_zbit
) = opval
;
8485 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8488 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)));
8489 CPU (h_vbit
) = opval
;
8490 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8495 CPU (h_xbit
) = opval
;
8496 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8500 SET_H_INSN_PREFIXED_P (opval
);
8501 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8507 abuf
->written
= written
;
8512 CASE (sem
, INSN_SUBUCBR
) : /* [${Rs}${inc}],$Rd */
8514 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8515 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8516 #define FLD(f) abuf->fields.sfmt_addcbr.f
8517 int UNUSED written
= 0;
8518 IADDR UNUSED pc
= abuf
->addr
;
8519 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8526 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8527 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8528 tmp_carry
= CPU (h_cbit
);
8529 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8531 SI opval
= tmp_newval
;
8532 SET_H_GR (FLD (f_operand2
), opval
);
8533 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8537 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))));
8538 CPU (h_cbit
) = opval
;
8539 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8542 BI opval
= LTSI (tmp_newval
, 0);
8543 CPU (h_nbit
) = opval
;
8544 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8547 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8548 CPU (h_zbit
) = opval
;
8549 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8552 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)));
8553 CPU (h_vbit
) = opval
;
8554 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8559 CPU (h_xbit
) = opval
;
8560 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8564 SET_H_INSN_PREFIXED_P (opval
);
8565 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8575 CASE (sem
, INSN_SUBUCWR
) : /* [${Rs}${inc}],$Rd */
8577 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8578 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8579 #define FLD(f) abuf->fields.sfmt_addcwr.f
8580 int UNUSED written
= 0;
8581 IADDR UNUSED pc
= abuf
->addr
;
8582 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8589 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8590 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8591 tmp_carry
= CPU (h_cbit
);
8592 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8594 SI opval
= tmp_newval
;
8595 SET_H_GR (FLD (f_operand2
), opval
);
8596 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8600 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))));
8601 CPU (h_cbit
) = opval
;
8602 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8605 BI opval
= LTSI (tmp_newval
, 0);
8606 CPU (h_nbit
) = opval
;
8607 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8610 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8611 CPU (h_zbit
) = opval
;
8612 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8615 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)));
8616 CPU (h_vbit
) = opval
;
8617 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8622 CPU (h_xbit
) = opval
;
8623 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8627 SET_H_INSN_PREFIXED_P (opval
);
8628 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8638 CASE (sem
, INSN_ADDC_R
) : /* addc $Rs,$Rd */
8640 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8641 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8642 #define FLD(f) abuf->fields.sfmt_addc_m.f
8643 int UNUSED written
= 0;
8644 IADDR UNUSED pc
= abuf
->addr
;
8645 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8654 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8655 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8656 tmp_carry
= CPU (h_cbit
);
8657 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8659 SI opval
= tmp_newval
;
8660 SET_H_GR (FLD (f_operand2
), opval
);
8661 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8665 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))));
8666 CPU (h_cbit
) = opval
;
8667 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8670 BI opval
= LTSI (tmp_newval
, 0);
8671 CPU (h_nbit
) = opval
;
8672 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8675 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8676 CPU (h_zbit
) = opval
;
8677 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8680 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)));
8681 CPU (h_vbit
) = opval
;
8682 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8687 CPU (h_xbit
) = opval
;
8688 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8692 SET_H_INSN_PREFIXED_P (opval
);
8693 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8704 CASE (sem
, INSN_ADDC_M
) : /* addc [${Rs}${inc}],${Rd} */
8706 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8708 #define FLD(f) abuf->fields.sfmt_addc_m.f
8709 int UNUSED written
= 0;
8710 IADDR UNUSED pc
= abuf
->addr
;
8711 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8720 tmp_tmpops
= ({ SI tmp_addr
;
8723 tmp_postinc
= FLD (f_memmode
);
8724 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8725 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
8726 ; if (NEBI (tmp_postinc
, 0)) {
8728 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8729 tmp_addr
= ADDSI (tmp_addr
, 4);
8732 SI opval
= tmp_addr
;
8733 SET_H_GR (FLD (f_operand1
), opval
);
8734 written
|= (1 << 10);
8735 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8740 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8741 tmp_carry
= CPU (h_cbit
);
8742 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8744 SI opval
= tmp_newval
;
8745 SET_H_GR (FLD (f_operand2
), opval
);
8746 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8750 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))));
8751 CPU (h_cbit
) = opval
;
8752 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8755 BI opval
= LTSI (tmp_newval
, 0);
8756 CPU (h_nbit
) = opval
;
8757 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8760 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8761 CPU (h_zbit
) = opval
;
8762 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8765 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)));
8766 CPU (h_vbit
) = opval
;
8767 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8772 CPU (h_xbit
) = opval
;
8773 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8777 SET_H_INSN_PREFIXED_P (opval
);
8778 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8785 abuf
->written
= written
;
8790 CASE (sem
, INSN_ADDC_C
) : /* addc ${const32},${Rd} */
8792 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8793 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8794 #define FLD(f) abuf->fields.sfmt_addcdr.f
8795 int UNUSED written
= 0;
8796 IADDR UNUSED pc
= abuf
->addr
;
8797 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8806 tmp_tmpops
= FLD (f_indir_pc__dword
);
8807 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8808 tmp_carry
= CPU (h_cbit
);
8809 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8811 SI opval
= tmp_newval
;
8812 SET_H_GR (FLD (f_operand2
), opval
);
8813 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8817 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))));
8818 CPU (h_cbit
) = opval
;
8819 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8822 BI opval
= LTSI (tmp_newval
, 0);
8823 CPU (h_nbit
) = opval
;
8824 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8827 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8828 CPU (h_zbit
) = opval
;
8829 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8832 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)));
8833 CPU (h_vbit
) = opval
;
8834 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8839 CPU (h_xbit
) = opval
;
8840 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8844 SET_H_INSN_PREFIXED_P (opval
);
8845 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8856 CASE (sem
, INSN_LAPC_D
) : /* lapc.d ${const32-pcrel},${Rd} */
8858 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8859 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8860 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8861 int UNUSED written
= 0;
8862 IADDR UNUSED pc
= abuf
->addr
;
8863 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8867 SI opval
= FLD (i_const32_pcrel
);
8868 SET_H_GR (FLD (f_operand2
), opval
);
8869 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8874 CPU (h_xbit
) = opval
;
8875 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8879 SET_H_INSN_PREFIXED_P (opval
);
8880 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8889 CASE (sem
, INSN_LAPCQ
) : /* lapcq ${qo},${Rd} */
8891 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8892 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8893 #define FLD(f) abuf->fields.sfmt_lapcq.f
8894 int UNUSED written
= 0;
8895 IADDR UNUSED pc
= abuf
->addr
;
8896 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8900 SI opval
= FLD (i_qo
);
8901 SET_H_GR (FLD (f_operand2
), opval
);
8902 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8907 CPU (h_xbit
) = opval
;
8908 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8912 SET_H_INSN_PREFIXED_P (opval
);
8913 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8922 CASE (sem
, INSN_ADDI_B_R
) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8924 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8925 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8926 #define FLD(f) abuf->fields.sfmt_addc_m.f
8927 int UNUSED written
= 0;
8928 IADDR UNUSED pc
= abuf
->addr
;
8929 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8933 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
8934 SET_H_GR (FLD (f_operand1
), opval
);
8935 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8940 CPU (h_xbit
) = opval
;
8941 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8945 SET_H_INSN_PREFIXED_P (opval
);
8946 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8955 CASE (sem
, INSN_ADDI_W_R
) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8957 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8958 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8959 #define FLD(f) abuf->fields.sfmt_addc_m.f
8960 int UNUSED written
= 0;
8961 IADDR UNUSED pc
= abuf
->addr
;
8962 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8966 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
8967 SET_H_GR (FLD (f_operand1
), opval
);
8968 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8973 CPU (h_xbit
) = opval
;
8974 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8978 SET_H_INSN_PREFIXED_P (opval
);
8979 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8988 CASE (sem
, INSN_ADDI_D_R
) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8990 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8991 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8992 #define FLD(f) abuf->fields.sfmt_addc_m.f
8993 int UNUSED written
= 0;
8994 IADDR UNUSED pc
= abuf
->addr
;
8995 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8999 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
9000 SET_H_GR (FLD (f_operand1
), opval
);
9001 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9006 CPU (h_xbit
) = opval
;
9007 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9011 SET_H_INSN_PREFIXED_P (opval
);
9012 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9021 CASE (sem
, INSN_NEG_B_R
) : /* neg.b $Rs,$Rd */
9023 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9024 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9025 #define FLD(f) abuf->fields.sfmt_addc_m.f
9026 int UNUSED written
= 0;
9027 IADDR UNUSED pc
= abuf
->addr
;
9028 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9035 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
9037 tmp_carry
= CPU (h_cbit
);
9038 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9041 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
9043 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
9044 SET_H_GR (FLD (f_operand2
), opval
);
9045 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9050 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))));
9051 CPU (h_cbit
) = opval
;
9052 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9055 BI opval
= LTQI (tmp_newval
, 0);
9056 CPU (h_nbit
) = opval
;
9057 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9060 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9061 CPU (h_zbit
) = opval
;
9062 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9065 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)));
9066 CPU (h_vbit
) = opval
;
9067 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9072 CPU (h_xbit
) = opval
;
9073 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9077 SET_H_INSN_PREFIXED_P (opval
);
9078 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9088 CASE (sem
, INSN_NEG_W_R
) : /* neg.w $Rs,$Rd */
9090 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9091 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9092 #define FLD(f) abuf->fields.sfmt_addc_m.f
9093 int UNUSED written
= 0;
9094 IADDR UNUSED pc
= abuf
->addr
;
9095 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9102 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
9104 tmp_carry
= CPU (h_cbit
);
9105 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9108 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
9110 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
9111 SET_H_GR (FLD (f_operand2
), opval
);
9112 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9117 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))));
9118 CPU (h_cbit
) = opval
;
9119 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9122 BI opval
= LTHI (tmp_newval
, 0);
9123 CPU (h_nbit
) = opval
;
9124 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9127 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9128 CPU (h_zbit
) = opval
;
9129 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9132 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)));
9133 CPU (h_vbit
) = opval
;
9134 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9139 CPU (h_xbit
) = opval
;
9140 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9144 SET_H_INSN_PREFIXED_P (opval
);
9145 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9155 CASE (sem
, INSN_NEG_D_R
) : /* neg.d $Rs,$Rd */
9157 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9158 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9159 #define FLD(f) abuf->fields.sfmt_addc_m.f
9160 int UNUSED written
= 0;
9161 IADDR UNUSED pc
= abuf
->addr
;
9162 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9169 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
9171 tmp_carry
= CPU (h_cbit
);
9172 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9174 SI opval
= tmp_newval
;
9175 SET_H_GR (FLD (f_operand2
), opval
);
9176 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9180 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))));
9181 CPU (h_cbit
) = opval
;
9182 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9185 BI opval
= LTSI (tmp_newval
, 0);
9186 CPU (h_nbit
) = opval
;
9187 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9190 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9191 CPU (h_zbit
) = opval
;
9192 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9195 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)));
9196 CPU (h_vbit
) = opval
;
9197 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9202 CPU (h_xbit
) = opval
;
9203 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9207 SET_H_INSN_PREFIXED_P (opval
);
9208 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9218 CASE (sem
, INSN_TEST_M_B_M
) : /* test-m.b [${Rs}${inc}] */
9220 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9221 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9222 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9223 int UNUSED written
= 0;
9224 IADDR UNUSED pc
= abuf
->addr
;
9225 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9229 tmp_tmpd
= ({ SI tmp_addr
;
9232 tmp_postinc
= FLD (f_memmode
);
9233 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9234 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
9235 ; if (NEBI (tmp_postinc
, 0)) {
9237 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9238 tmp_addr
= ADDSI (tmp_addr
, 1);
9241 SI opval
= tmp_addr
;
9242 SET_H_GR (FLD (f_operand1
), opval
);
9243 written
|= (1 << 8);
9244 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9255 tmp_tmpopd
= tmp_tmpd
;
9256 tmp_carry
= CPU (h_cbit
);
9257 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9261 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))));
9262 CPU (h_cbit
) = opval
;
9263 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9266 BI opval
= LTQI (tmp_newval
, 0);
9267 CPU (h_nbit
) = opval
;
9268 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9271 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9272 CPU (h_zbit
) = opval
;
9273 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9276 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)));
9277 CPU (h_vbit
) = opval
;
9278 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9283 CPU (h_xbit
) = opval
;
9284 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9288 SET_H_INSN_PREFIXED_P (opval
);
9289 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9296 abuf
->written
= written
;
9301 CASE (sem
, INSN_TEST_M_W_M
) : /* test-m.w [${Rs}${inc}] */
9303 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9304 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9305 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9306 int UNUSED written
= 0;
9307 IADDR UNUSED pc
= abuf
->addr
;
9308 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9312 tmp_tmpd
= ({ SI tmp_addr
;
9315 tmp_postinc
= FLD (f_memmode
);
9316 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9317 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
9318 ; if (NEBI (tmp_postinc
, 0)) {
9320 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9321 tmp_addr
= ADDSI (tmp_addr
, 2);
9324 SI opval
= tmp_addr
;
9325 SET_H_GR (FLD (f_operand1
), opval
);
9326 written
|= (1 << 8);
9327 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9338 tmp_tmpopd
= tmp_tmpd
;
9339 tmp_carry
= CPU (h_cbit
);
9340 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9344 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))));
9345 CPU (h_cbit
) = opval
;
9346 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9349 BI opval
= LTHI (tmp_newval
, 0);
9350 CPU (h_nbit
) = opval
;
9351 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9354 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9355 CPU (h_zbit
) = opval
;
9356 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9359 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)));
9360 CPU (h_vbit
) = opval
;
9361 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9366 CPU (h_xbit
) = opval
;
9367 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9371 SET_H_INSN_PREFIXED_P (opval
);
9372 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9379 abuf
->written
= written
;
9384 CASE (sem
, INSN_TEST_M_D_M
) : /* test-m.d [${Rs}${inc}] */
9386 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9387 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9388 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9389 int UNUSED written
= 0;
9390 IADDR UNUSED pc
= abuf
->addr
;
9391 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9395 tmp_tmpd
= ({ SI tmp_addr
;
9398 tmp_postinc
= FLD (f_memmode
);
9399 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9400 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
9401 ; if (NEBI (tmp_postinc
, 0)) {
9403 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9404 tmp_addr
= ADDSI (tmp_addr
, 4);
9407 SI opval
= tmp_addr
;
9408 SET_H_GR (FLD (f_operand1
), opval
);
9409 written
|= (1 << 8);
9410 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9421 tmp_tmpopd
= tmp_tmpd
;
9422 tmp_carry
= CPU (h_cbit
);
9423 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9427 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))));
9428 CPU (h_cbit
) = opval
;
9429 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9432 BI opval
= LTSI (tmp_newval
, 0);
9433 CPU (h_nbit
) = opval
;
9434 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9437 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9438 CPU (h_zbit
) = opval
;
9439 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9442 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)));
9443 CPU (h_vbit
) = opval
;
9444 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9449 CPU (h_xbit
) = opval
;
9450 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9454 SET_H_INSN_PREFIXED_P (opval
);
9455 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9462 abuf
->written
= written
;
9467 CASE (sem
, INSN_MOVE_R_M_B_M
) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9469 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9470 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9471 #define FLD(f) abuf->fields.sfmt_addc_m.f
9472 int UNUSED written
= 0;
9473 IADDR UNUSED pc
= abuf
->addr
;
9474 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9478 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9482 tmp_postinc
= FLD (f_memmode
);
9483 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9484 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9485 if (EQBI (CPU (h_pbit
), 0)) {
9488 QI opval
= tmp_tmpd
;
9489 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9490 written
|= (1 << 10);
9491 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9494 BI opval
= CPU (h_pbit
);
9495 CPU (h_cbit
) = opval
;
9496 written
|= (1 << 9);
9497 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9503 CPU (h_cbit
) = opval
;
9504 written
|= (1 << 9);
9505 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9510 QI opval
= tmp_tmpd
;
9511 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9512 written
|= (1 << 10);
9513 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9516 if (NEBI (tmp_postinc
, 0)) {
9518 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9519 tmp_addr
= ADDSI (tmp_addr
, 1);
9522 SI opval
= tmp_addr
;
9523 SET_H_GR (FLD (f_operand1
), opval
);
9524 written
|= (1 << 8);
9525 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9533 CPU (h_xbit
) = opval
;
9534 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9538 SET_H_INSN_PREFIXED_P (opval
);
9539 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9544 abuf
->written
= written
;
9549 CASE (sem
, INSN_MOVE_R_M_W_M
) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9551 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9552 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9553 #define FLD(f) abuf->fields.sfmt_addc_m.f
9554 int UNUSED written
= 0;
9555 IADDR UNUSED pc
= abuf
->addr
;
9556 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9560 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9564 tmp_postinc
= FLD (f_memmode
);
9565 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9566 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9567 if (EQBI (CPU (h_pbit
), 0)) {
9570 HI opval
= tmp_tmpd
;
9571 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9572 written
|= (1 << 10);
9573 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9576 BI opval
= CPU (h_pbit
);
9577 CPU (h_cbit
) = opval
;
9578 written
|= (1 << 9);
9579 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9585 CPU (h_cbit
) = opval
;
9586 written
|= (1 << 9);
9587 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9592 HI opval
= tmp_tmpd
;
9593 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9594 written
|= (1 << 10);
9595 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9598 if (NEBI (tmp_postinc
, 0)) {
9600 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9601 tmp_addr
= ADDSI (tmp_addr
, 2);
9604 SI opval
= tmp_addr
;
9605 SET_H_GR (FLD (f_operand1
), opval
);
9606 written
|= (1 << 8);
9607 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9615 CPU (h_xbit
) = opval
;
9616 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9620 SET_H_INSN_PREFIXED_P (opval
);
9621 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9626 abuf
->written
= written
;
9631 CASE (sem
, INSN_MOVE_R_M_D_M
) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9633 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9634 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9635 #define FLD(f) abuf->fields.sfmt_addc_m.f
9636 int UNUSED written
= 0;
9637 IADDR UNUSED pc
= abuf
->addr
;
9638 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9642 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9646 tmp_postinc
= FLD (f_memmode
);
9647 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9648 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9649 if (EQBI (CPU (h_pbit
), 0)) {
9652 SI opval
= tmp_tmpd
;
9653 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9654 written
|= (1 << 10);
9655 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9658 BI opval
= CPU (h_pbit
);
9659 CPU (h_cbit
) = opval
;
9660 written
|= (1 << 9);
9661 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9667 CPU (h_cbit
) = opval
;
9668 written
|= (1 << 9);
9669 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9674 SI opval
= tmp_tmpd
;
9675 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9676 written
|= (1 << 10);
9677 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9680 if (NEBI (tmp_postinc
, 0)) {
9682 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9683 tmp_addr
= ADDSI (tmp_addr
, 4);
9686 SI opval
= tmp_addr
;
9687 SET_H_GR (FLD (f_operand1
), opval
);
9688 written
|= (1 << 8);
9689 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9697 CPU (h_xbit
) = opval
;
9698 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9702 SET_H_INSN_PREFIXED_P (opval
);
9703 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9708 abuf
->written
= written
;
9713 CASE (sem
, INSN_MULS_B
) : /* muls.b $Rs,$Rd */
9715 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9716 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9717 #define FLD(f) abuf->fields.sfmt_muls_b.f
9718 int UNUSED written
= 0;
9719 IADDR UNUSED pc
= abuf
->addr
;
9720 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9726 tmp_src1
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9727 tmp_src2
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9728 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9730 SI opval
= TRUNCDISI (tmp_tmpr
);
9731 SET_H_GR (FLD (f_operand2
), opval
);
9732 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9735 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9736 SET_H_SR (((UINT
) 7), opval
);
9737 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9741 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9742 CPU (h_cbit
) = opval
;
9743 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9746 BI opval
= LTDI (tmp_tmpr
, 0);
9747 CPU (h_nbit
) = opval
;
9748 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9751 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9752 CPU (h_zbit
) = opval
;
9753 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9756 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9757 CPU (h_vbit
) = opval
;
9758 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9763 CPU (h_xbit
) = opval
;
9764 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9768 SET_H_INSN_PREFIXED_P (opval
);
9769 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9779 CASE (sem
, INSN_MULS_W
) : /* muls.w $Rs,$Rd */
9781 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9782 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9783 #define FLD(f) abuf->fields.sfmt_muls_b.f
9784 int UNUSED written
= 0;
9785 IADDR UNUSED pc
= abuf
->addr
;
9786 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9792 tmp_src1
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9793 tmp_src2
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9794 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9796 SI opval
= TRUNCDISI (tmp_tmpr
);
9797 SET_H_GR (FLD (f_operand2
), opval
);
9798 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9801 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9802 SET_H_SR (((UINT
) 7), opval
);
9803 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9807 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9808 CPU (h_cbit
) = opval
;
9809 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9812 BI opval
= LTDI (tmp_tmpr
, 0);
9813 CPU (h_nbit
) = opval
;
9814 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9817 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9818 CPU (h_zbit
) = opval
;
9819 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9822 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9823 CPU (h_vbit
) = opval
;
9824 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9829 CPU (h_xbit
) = opval
;
9830 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9834 SET_H_INSN_PREFIXED_P (opval
);
9835 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9845 CASE (sem
, INSN_MULS_D
) : /* muls.d $Rs,$Rd */
9847 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9848 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9849 #define FLD(f) abuf->fields.sfmt_muls_b.f
9850 int UNUSED written
= 0;
9851 IADDR UNUSED pc
= abuf
->addr
;
9852 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9858 tmp_src1
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9859 tmp_src2
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9860 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9862 SI opval
= TRUNCDISI (tmp_tmpr
);
9863 SET_H_GR (FLD (f_operand2
), opval
);
9864 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9867 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9868 SET_H_SR (((UINT
) 7), opval
);
9869 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9873 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9874 CPU (h_cbit
) = opval
;
9875 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9878 BI opval
= LTDI (tmp_tmpr
, 0);
9879 CPU (h_nbit
) = opval
;
9880 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9883 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9884 CPU (h_zbit
) = opval
;
9885 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9888 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9889 CPU (h_vbit
) = opval
;
9890 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9895 CPU (h_xbit
) = opval
;
9896 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9900 SET_H_INSN_PREFIXED_P (opval
);
9901 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9911 CASE (sem
, INSN_MULU_B
) : /* mulu.b $Rs,$Rd */
9913 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9914 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9915 #define FLD(f) abuf->fields.sfmt_muls_b.f
9916 int UNUSED written
= 0;
9917 IADDR UNUSED pc
= abuf
->addr
;
9918 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9924 tmp_src1
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9925 tmp_src2
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9926 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9928 SI opval
= TRUNCDISI (tmp_tmpr
);
9929 SET_H_GR (FLD (f_operand2
), opval
);
9930 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9933 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9934 SET_H_SR (((UINT
) 7), opval
);
9935 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9939 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9940 CPU (h_cbit
) = opval
;
9941 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9944 BI opval
= LTDI (tmp_tmpr
, 0);
9945 CPU (h_nbit
) = opval
;
9946 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9949 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9950 CPU (h_zbit
) = opval
;
9951 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9954 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9955 CPU (h_vbit
) = opval
;
9956 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9961 CPU (h_xbit
) = opval
;
9962 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9966 SET_H_INSN_PREFIXED_P (opval
);
9967 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9977 CASE (sem
, INSN_MULU_W
) : /* mulu.w $Rs,$Rd */
9979 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9980 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9981 #define FLD(f) abuf->fields.sfmt_muls_b.f
9982 int UNUSED written
= 0;
9983 IADDR UNUSED pc
= abuf
->addr
;
9984 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9990 tmp_src1
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9991 tmp_src2
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9992 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9994 SI opval
= TRUNCDISI (tmp_tmpr
);
9995 SET_H_GR (FLD (f_operand2
), opval
);
9996 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9999 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
10000 SET_H_SR (((UINT
) 7), opval
);
10001 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
10005 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
10006 CPU (h_cbit
) = opval
;
10007 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
10010 BI opval
= LTDI (tmp_tmpr
, 0);
10011 CPU (h_nbit
) = opval
;
10012 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10015 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
10016 CPU (h_zbit
) = opval
;
10017 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10020 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
10021 CPU (h_vbit
) = opval
;
10022 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
10027 CPU (h_xbit
) = opval
;
10028 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10032 SET_H_INSN_PREFIXED_P (opval
);
10033 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10043 CASE (sem
, INSN_MULU_D
) : /* mulu.d $Rs,$Rd */
10045 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10046 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10047 #define FLD(f) abuf->fields.sfmt_muls_b.f
10048 int UNUSED written
= 0;
10049 IADDR UNUSED pc
= abuf
->addr
;
10050 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10056 tmp_src1
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
10057 tmp_src2
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
10058 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
10060 SI opval
= TRUNCDISI (tmp_tmpr
);
10061 SET_H_GR (FLD (f_operand2
), opval
);
10062 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10065 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
10066 SET_H_SR (((UINT
) 7), opval
);
10067 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
10071 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
10072 CPU (h_cbit
) = opval
;
10073 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
10076 BI opval
= LTDI (tmp_tmpr
, 0);
10077 CPU (h_nbit
) = opval
;
10078 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10081 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
10082 CPU (h_zbit
) = opval
;
10083 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10086 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
10087 CPU (h_vbit
) = opval
;
10088 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
10093 CPU (h_xbit
) = opval
;
10094 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10098 SET_H_INSN_PREFIXED_P (opval
);
10099 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10109 CASE (sem
, INSN_MCP
) : /* mcp $Ps,$Rd */
10111 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10112 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10113 #define FLD(f) abuf->fields.sfmt_mcp.f
10114 int UNUSED written
= 0;
10115 IADDR UNUSED pc
= abuf
->addr
;
10116 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10126 tmp_tmpops
= GET_H_SR (FLD (f_operand2
));
10127 tmp_tmpopd
= GET_H_GR (FLD (f_operand1
));
10128 tmp_carry
= CPU (h_rbit
);
10129 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
10131 SI opval
= tmp_newval
;
10132 SET_H_GR (FLD (f_operand1
), opval
);
10133 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10137 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))));
10138 CPU (h_rbit
) = opval
;
10139 TRACE_RESULT (current_cpu
, abuf
, "rbit", 'x', opval
);
10142 BI opval
= LTSI (tmp_newval
, 0);
10143 CPU (h_nbit
) = opval
;
10144 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10147 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
10148 CPU (h_zbit
) = opval
;
10149 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10152 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)));
10153 CPU (h_vbit
) = opval
;
10154 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
10159 CPU (h_xbit
) = opval
;
10160 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10164 SET_H_INSN_PREFIXED_P (opval
);
10165 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10176 CASE (sem
, INSN_DSTEP
) : /* dstep $Rs,$Rd */
10178 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10179 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10180 #define FLD(f) abuf->fields.sfmt_muls_b.f
10181 int UNUSED written
= 0;
10182 IADDR UNUSED pc
= abuf
->addr
;
10183 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10189 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
10190 tmp_tmp
= SLLSI (GET_H_GR (FLD (f_operand2
)), 1);
10191 tmp_tmpd
= ((GEUSI (tmp_tmp
, tmp_tmps
)) ? (SUBSI (tmp_tmp
, tmp_tmps
)) : (tmp_tmp
));
10193 SI opval
= tmp_tmpd
;
10194 SET_H_GR (FLD (f_operand2
), opval
);
10195 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10199 BI opval
= LTSI (tmp_tmpd
, 0);
10200 CPU (h_nbit
) = opval
;
10201 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10204 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10205 CPU (h_zbit
) = opval
;
10206 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10208 SET_H_CBIT_MOVE (0);
10209 SET_H_VBIT_MOVE (0);
10213 CPU (h_xbit
) = opval
;
10214 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10218 SET_H_INSN_PREFIXED_P (opval
);
10219 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10229 CASE (sem
, INSN_ABS
) : /* abs $Rs,$Rd */
10231 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10232 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10233 #define FLD(f) abuf->fields.sfmt_muls_b.f
10234 int UNUSED written
= 0;
10235 IADDR UNUSED pc
= abuf
->addr
;
10236 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10240 tmp_tmpd
= ABSSI (GET_H_GR (FLD (f_operand1
)));
10242 SI opval
= tmp_tmpd
;
10243 SET_H_GR (FLD (f_operand2
), opval
);
10244 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10248 BI opval
= LTSI (tmp_tmpd
, 0);
10249 CPU (h_nbit
) = opval
;
10250 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10253 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10254 CPU (h_zbit
) = opval
;
10255 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10257 SET_H_CBIT_MOVE (0);
10258 SET_H_VBIT_MOVE (0);
10262 CPU (h_xbit
) = opval
;
10263 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10267 SET_H_INSN_PREFIXED_P (opval
);
10268 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10278 CASE (sem
, INSN_AND_B_R
) : /* and.b $Rs,$Rd */
10280 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10281 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10282 #define FLD(f) abuf->fields.sfmt_addc_m.f
10283 int UNUSED written
= 0;
10284 IADDR UNUSED pc
= abuf
->addr
;
10285 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10289 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10292 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10294 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10295 SET_H_GR (FLD (f_operand2
), opval
);
10296 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10301 BI opval
= LTQI (tmp_tmpd
, 0);
10302 CPU (h_nbit
) = opval
;
10303 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10306 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10307 CPU (h_zbit
) = opval
;
10308 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10310 SET_H_CBIT_MOVE (0);
10311 SET_H_VBIT_MOVE (0);
10315 CPU (h_xbit
) = opval
;
10316 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10320 SET_H_INSN_PREFIXED_P (opval
);
10321 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10331 CASE (sem
, INSN_AND_W_R
) : /* and.w $Rs,$Rd */
10333 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10334 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10335 #define FLD(f) abuf->fields.sfmt_addc_m.f
10336 int UNUSED written
= 0;
10337 IADDR UNUSED pc
= abuf
->addr
;
10338 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10342 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10345 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10347 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10348 SET_H_GR (FLD (f_operand2
), opval
);
10349 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10354 BI opval
= LTHI (tmp_tmpd
, 0);
10355 CPU (h_nbit
) = opval
;
10356 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10359 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10360 CPU (h_zbit
) = opval
;
10361 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10363 SET_H_CBIT_MOVE (0);
10364 SET_H_VBIT_MOVE (0);
10368 CPU (h_xbit
) = opval
;
10369 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10373 SET_H_INSN_PREFIXED_P (opval
);
10374 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10384 CASE (sem
, INSN_AND_D_R
) : /* and.d $Rs,$Rd */
10386 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10387 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10388 #define FLD(f) abuf->fields.sfmt_addc_m.f
10389 int UNUSED written
= 0;
10390 IADDR UNUSED pc
= abuf
->addr
;
10391 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10395 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10397 SI opval
= tmp_tmpd
;
10398 SET_H_GR (FLD (f_operand2
), opval
);
10399 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10403 BI opval
= LTSI (tmp_tmpd
, 0);
10404 CPU (h_nbit
) = opval
;
10405 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10408 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10409 CPU (h_zbit
) = opval
;
10410 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10412 SET_H_CBIT_MOVE (0);
10413 SET_H_VBIT_MOVE (0);
10417 CPU (h_xbit
) = opval
;
10418 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10422 SET_H_INSN_PREFIXED_P (opval
);
10423 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10433 CASE (sem
, INSN_AND_M_B_M
) : /* and-m.b [${Rs}${inc}],${Rd} */
10435 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10436 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10437 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10438 int UNUSED written
= 0;
10439 IADDR UNUSED pc
= abuf
->addr
;
10440 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10444 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10447 tmp_postinc
= FLD (f_memmode
);
10448 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10449 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10450 ; if (NEBI (tmp_postinc
, 0)) {
10452 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10453 tmp_addr
= ADDSI (tmp_addr
, 1);
10456 SI opval
= tmp_addr
;
10457 SET_H_GR (FLD (f_operand1
), opval
);
10458 written
|= (1 << 11);
10459 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10463 ; tmp_tmp_mem
; }));
10466 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10468 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10469 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10470 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10475 BI opval
= LTQI (tmp_tmpd
, 0);
10476 CPU (h_nbit
) = opval
;
10477 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10480 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10481 CPU (h_zbit
) = opval
;
10482 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10484 SET_H_CBIT_MOVE (0);
10485 SET_H_VBIT_MOVE (0);
10489 CPU (h_xbit
) = opval
;
10490 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10494 SET_H_INSN_PREFIXED_P (opval
);
10495 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10501 abuf
->written
= written
;
10506 CASE (sem
, INSN_AND_M_W_M
) : /* and-m.w [${Rs}${inc}],${Rd} */
10508 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10509 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10510 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10511 int UNUSED written
= 0;
10512 IADDR UNUSED pc
= abuf
->addr
;
10513 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10517 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10520 tmp_postinc
= FLD (f_memmode
);
10521 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10522 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10523 ; if (NEBI (tmp_postinc
, 0)) {
10525 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10526 tmp_addr
= ADDSI (tmp_addr
, 2);
10529 SI opval
= tmp_addr
;
10530 SET_H_GR (FLD (f_operand1
), opval
);
10531 written
|= (1 << 11);
10532 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10536 ; tmp_tmp_mem
; }));
10539 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10541 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10542 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10543 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10548 BI opval
= LTHI (tmp_tmpd
, 0);
10549 CPU (h_nbit
) = opval
;
10550 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10553 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10554 CPU (h_zbit
) = opval
;
10555 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10557 SET_H_CBIT_MOVE (0);
10558 SET_H_VBIT_MOVE (0);
10562 CPU (h_xbit
) = opval
;
10563 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10567 SET_H_INSN_PREFIXED_P (opval
);
10568 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10574 abuf
->written
= written
;
10579 CASE (sem
, INSN_AND_M_D_M
) : /* and-m.d [${Rs}${inc}],${Rd} */
10581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10582 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10583 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10584 int UNUSED written
= 0;
10585 IADDR UNUSED pc
= abuf
->addr
;
10586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10590 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10593 tmp_postinc
= FLD (f_memmode
);
10594 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10595 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10596 ; if (NEBI (tmp_postinc
, 0)) {
10598 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10599 tmp_addr
= ADDSI (tmp_addr
, 4);
10602 SI opval
= tmp_addr
;
10603 SET_H_GR (FLD (f_operand1
), opval
);
10604 written
|= (1 << 10);
10605 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10609 ; tmp_tmp_mem
; }));
10611 SI opval
= tmp_tmpd
;
10612 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10613 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10617 BI opval
= LTSI (tmp_tmpd
, 0);
10618 CPU (h_nbit
) = opval
;
10619 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10622 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10623 CPU (h_zbit
) = opval
;
10624 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10626 SET_H_CBIT_MOVE (0);
10627 SET_H_VBIT_MOVE (0);
10631 CPU (h_xbit
) = opval
;
10632 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10636 SET_H_INSN_PREFIXED_P (opval
);
10637 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10643 abuf
->written
= written
;
10648 CASE (sem
, INSN_ANDCBR
) : /* and.b ${sconst8}],${Rd} */
10650 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10651 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10652 #define FLD(f) abuf->fields.sfmt_addcbr.f
10653 int UNUSED written
= 0;
10654 IADDR UNUSED pc
= abuf
->addr
;
10655 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10659 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10662 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10664 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10665 SET_H_GR (FLD (f_operand2
), opval
);
10666 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10671 BI opval
= LTQI (tmp_tmpd
, 0);
10672 CPU (h_nbit
) = opval
;
10673 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10676 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10677 CPU (h_zbit
) = opval
;
10678 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10680 SET_H_CBIT_MOVE (0);
10681 SET_H_VBIT_MOVE (0);
10685 CPU (h_xbit
) = opval
;
10686 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10690 SET_H_INSN_PREFIXED_P (opval
);
10691 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10701 CASE (sem
, INSN_ANDCWR
) : /* and.w ${sconst16}],${Rd} */
10703 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10704 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10705 #define FLD(f) abuf->fields.sfmt_addcwr.f
10706 int UNUSED written
= 0;
10707 IADDR UNUSED pc
= abuf
->addr
;
10708 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10712 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10715 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10717 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10718 SET_H_GR (FLD (f_operand2
), opval
);
10719 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10724 BI opval
= LTHI (tmp_tmpd
, 0);
10725 CPU (h_nbit
) = opval
;
10726 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10729 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10730 CPU (h_zbit
) = opval
;
10731 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10733 SET_H_CBIT_MOVE (0);
10734 SET_H_VBIT_MOVE (0);
10738 CPU (h_xbit
) = opval
;
10739 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10743 SET_H_INSN_PREFIXED_P (opval
);
10744 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10754 CASE (sem
, INSN_ANDCDR
) : /* and.d ${const32}],${Rd} */
10756 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10757 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10758 #define FLD(f) abuf->fields.sfmt_addcdr.f
10759 int UNUSED written
= 0;
10760 IADDR UNUSED pc
= abuf
->addr
;
10761 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10765 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10767 SI opval
= tmp_tmpd
;
10768 SET_H_GR (FLD (f_operand2
), opval
);
10769 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10773 BI opval
= LTSI (tmp_tmpd
, 0);
10774 CPU (h_nbit
) = opval
;
10775 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10778 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10779 CPU (h_zbit
) = opval
;
10780 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10782 SET_H_CBIT_MOVE (0);
10783 SET_H_VBIT_MOVE (0);
10787 CPU (h_xbit
) = opval
;
10788 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10792 SET_H_INSN_PREFIXED_P (opval
);
10793 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10803 CASE (sem
, INSN_ANDQ
) : /* andq $i,$Rd */
10805 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10806 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10807 #define FLD(f) abuf->fields.sfmt_andq.f
10808 int UNUSED written
= 0;
10809 IADDR UNUSED pc
= abuf
->addr
;
10810 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10814 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10816 SI opval
= tmp_tmpd
;
10817 SET_H_GR (FLD (f_operand2
), opval
);
10818 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10822 BI opval
= LTSI (tmp_tmpd
, 0);
10823 CPU (h_nbit
) = opval
;
10824 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10827 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10828 CPU (h_zbit
) = opval
;
10829 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10831 SET_H_CBIT_MOVE (0);
10832 SET_H_VBIT_MOVE (0);
10836 CPU (h_xbit
) = opval
;
10837 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10841 SET_H_INSN_PREFIXED_P (opval
);
10842 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10852 CASE (sem
, INSN_ORR_B_R
) : /* orr.b $Rs,$Rd */
10854 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10855 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10856 #define FLD(f) abuf->fields.sfmt_addc_m.f
10857 int UNUSED written
= 0;
10858 IADDR UNUSED pc
= abuf
->addr
;
10859 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10863 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10866 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10868 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10869 SET_H_GR (FLD (f_operand2
), opval
);
10870 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10875 BI opval
= LTQI (tmp_tmpd
, 0);
10876 CPU (h_nbit
) = opval
;
10877 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10880 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10881 CPU (h_zbit
) = opval
;
10882 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10884 SET_H_CBIT_MOVE (0);
10885 SET_H_VBIT_MOVE (0);
10889 CPU (h_xbit
) = opval
;
10890 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10894 SET_H_INSN_PREFIXED_P (opval
);
10895 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10905 CASE (sem
, INSN_ORR_W_R
) : /* orr.w $Rs,$Rd */
10907 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10908 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10909 #define FLD(f) abuf->fields.sfmt_addc_m.f
10910 int UNUSED written
= 0;
10911 IADDR UNUSED pc
= abuf
->addr
;
10912 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10916 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10919 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10921 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10922 SET_H_GR (FLD (f_operand2
), opval
);
10923 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10928 BI opval
= LTHI (tmp_tmpd
, 0);
10929 CPU (h_nbit
) = opval
;
10930 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10933 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10934 CPU (h_zbit
) = opval
;
10935 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10937 SET_H_CBIT_MOVE (0);
10938 SET_H_VBIT_MOVE (0);
10942 CPU (h_xbit
) = opval
;
10943 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10947 SET_H_INSN_PREFIXED_P (opval
);
10948 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10958 CASE (sem
, INSN_ORR_D_R
) : /* orr.d $Rs,$Rd */
10960 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10961 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10962 #define FLD(f) abuf->fields.sfmt_addc_m.f
10963 int UNUSED written
= 0;
10964 IADDR UNUSED pc
= abuf
->addr
;
10965 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10969 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10971 SI opval
= tmp_tmpd
;
10972 SET_H_GR (FLD (f_operand2
), opval
);
10973 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10977 BI opval
= LTSI (tmp_tmpd
, 0);
10978 CPU (h_nbit
) = opval
;
10979 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10982 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10983 CPU (h_zbit
) = opval
;
10984 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10986 SET_H_CBIT_MOVE (0);
10987 SET_H_VBIT_MOVE (0);
10991 CPU (h_xbit
) = opval
;
10992 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10996 SET_H_INSN_PREFIXED_P (opval
);
10997 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11007 CASE (sem
, INSN_OR_M_B_M
) : /* or-m.b [${Rs}${inc}],${Rd} */
11009 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11010 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11011 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
11012 int UNUSED written
= 0;
11013 IADDR UNUSED pc
= abuf
->addr
;
11014 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11018 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
11021 tmp_postinc
= FLD (f_memmode
);
11022 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
11023 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
11024 ; if (NEBI (tmp_postinc
, 0)) {
11026 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
11027 tmp_addr
= ADDSI (tmp_addr
, 1);
11030 SI opval
= tmp_addr
;
11031 SET_H_GR (FLD (f_operand1
), opval
);
11032 written
|= (1 << 11);
11033 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11037 ; tmp_tmp_mem
; }));
11040 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
11042 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11043 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
11044 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11049 BI opval
= LTQI (tmp_tmpd
, 0);
11050 CPU (h_nbit
) = opval
;
11051 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11054 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11055 CPU (h_zbit
) = opval
;
11056 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11058 SET_H_CBIT_MOVE (0);
11059 SET_H_VBIT_MOVE (0);
11063 CPU (h_xbit
) = opval
;
11064 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11068 SET_H_INSN_PREFIXED_P (opval
);
11069 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11075 abuf
->written
= written
;
11080 CASE (sem
, INSN_OR_M_W_M
) : /* or-m.w [${Rs}${inc}],${Rd} */
11082 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11083 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11084 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
11085 int UNUSED written
= 0;
11086 IADDR UNUSED pc
= abuf
->addr
;
11087 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11091 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
11094 tmp_postinc
= FLD (f_memmode
);
11095 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
11096 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
11097 ; if (NEBI (tmp_postinc
, 0)) {
11099 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
11100 tmp_addr
= ADDSI (tmp_addr
, 2);
11103 SI opval
= tmp_addr
;
11104 SET_H_GR (FLD (f_operand1
), opval
);
11105 written
|= (1 << 11);
11106 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11110 ; tmp_tmp_mem
; }));
11113 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
11115 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11116 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
11117 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11122 BI opval
= LTHI (tmp_tmpd
, 0);
11123 CPU (h_nbit
) = opval
;
11124 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11127 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11128 CPU (h_zbit
) = opval
;
11129 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11131 SET_H_CBIT_MOVE (0);
11132 SET_H_VBIT_MOVE (0);
11136 CPU (h_xbit
) = opval
;
11137 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11141 SET_H_INSN_PREFIXED_P (opval
);
11142 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11148 abuf
->written
= written
;
11153 CASE (sem
, INSN_OR_M_D_M
) : /* or-m.d [${Rs}${inc}],${Rd} */
11155 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11156 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11157 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
11158 int UNUSED written
= 0;
11159 IADDR UNUSED pc
= abuf
->addr
;
11160 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11164 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
11167 tmp_postinc
= FLD (f_memmode
);
11168 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
11169 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
11170 ; if (NEBI (tmp_postinc
, 0)) {
11172 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
11173 tmp_addr
= ADDSI (tmp_addr
, 4);
11176 SI opval
= tmp_addr
;
11177 SET_H_GR (FLD (f_operand1
), opval
);
11178 written
|= (1 << 10);
11179 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11183 ; tmp_tmp_mem
; }));
11185 SI opval
= tmp_tmpd
;
11186 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
11187 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11191 BI opval
= LTSI (tmp_tmpd
, 0);
11192 CPU (h_nbit
) = opval
;
11193 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11196 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11197 CPU (h_zbit
) = opval
;
11198 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11200 SET_H_CBIT_MOVE (0);
11201 SET_H_VBIT_MOVE (0);
11205 CPU (h_xbit
) = opval
;
11206 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11210 SET_H_INSN_PREFIXED_P (opval
);
11211 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11217 abuf
->written
= written
;
11222 CASE (sem
, INSN_ORCBR
) : /* or.b ${sconst8}],${Rd} */
11224 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11225 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11226 #define FLD(f) abuf->fields.sfmt_addcbr.f
11227 int UNUSED written
= 0;
11228 IADDR UNUSED pc
= abuf
->addr
;
11229 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11233 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
11236 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11238 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11239 SET_H_GR (FLD (f_operand2
), opval
);
11240 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11245 BI opval
= LTQI (tmp_tmpd
, 0);
11246 CPU (h_nbit
) = opval
;
11247 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11250 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11251 CPU (h_zbit
) = opval
;
11252 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11254 SET_H_CBIT_MOVE (0);
11255 SET_H_VBIT_MOVE (0);
11259 CPU (h_xbit
) = opval
;
11260 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11264 SET_H_INSN_PREFIXED_P (opval
);
11265 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11275 CASE (sem
, INSN_ORCWR
) : /* or.w ${sconst16}],${Rd} */
11277 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11278 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11279 #define FLD(f) abuf->fields.sfmt_addcwr.f
11280 int UNUSED written
= 0;
11281 IADDR UNUSED pc
= abuf
->addr
;
11282 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11286 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
11289 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11291 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11292 SET_H_GR (FLD (f_operand2
), opval
);
11293 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11298 BI opval
= LTHI (tmp_tmpd
, 0);
11299 CPU (h_nbit
) = opval
;
11300 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11303 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11304 CPU (h_zbit
) = opval
;
11305 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11307 SET_H_CBIT_MOVE (0);
11308 SET_H_VBIT_MOVE (0);
11312 CPU (h_xbit
) = opval
;
11313 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11317 SET_H_INSN_PREFIXED_P (opval
);
11318 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11328 CASE (sem
, INSN_ORCDR
) : /* or.d ${const32}],${Rd} */
11330 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11331 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11332 #define FLD(f) abuf->fields.sfmt_addcdr.f
11333 int UNUSED written
= 0;
11334 IADDR UNUSED pc
= abuf
->addr
;
11335 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
11339 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
11341 SI opval
= tmp_tmpd
;
11342 SET_H_GR (FLD (f_operand2
), opval
);
11343 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11347 BI opval
= LTSI (tmp_tmpd
, 0);
11348 CPU (h_nbit
) = opval
;
11349 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11352 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11353 CPU (h_zbit
) = opval
;
11354 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11356 SET_H_CBIT_MOVE (0);
11357 SET_H_VBIT_MOVE (0);
11361 CPU (h_xbit
) = opval
;
11362 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11366 SET_H_INSN_PREFIXED_P (opval
);
11367 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11377 CASE (sem
, INSN_ORQ
) : /* orq $i,$Rd */
11379 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11380 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11381 #define FLD(f) abuf->fields.sfmt_andq.f
11382 int UNUSED written
= 0;
11383 IADDR UNUSED pc
= abuf
->addr
;
11384 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11388 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
11390 SI opval
= tmp_tmpd
;
11391 SET_H_GR (FLD (f_operand2
), opval
);
11392 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11396 BI opval
= LTSI (tmp_tmpd
, 0);
11397 CPU (h_nbit
) = opval
;
11398 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11401 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11402 CPU (h_zbit
) = opval
;
11403 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11405 SET_H_CBIT_MOVE (0);
11406 SET_H_VBIT_MOVE (0);
11410 CPU (h_xbit
) = opval
;
11411 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11415 SET_H_INSN_PREFIXED_P (opval
);
11416 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11426 CASE (sem
, INSN_XOR
) : /* xor $Rs,$Rd */
11428 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11429 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11430 #define FLD(f) abuf->fields.sfmt_muls_b.f
11431 int UNUSED written
= 0;
11432 IADDR UNUSED pc
= abuf
->addr
;
11433 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11437 tmp_tmpd
= XORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
11439 SI opval
= tmp_tmpd
;
11440 SET_H_GR (FLD (f_operand2
), opval
);
11441 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11445 BI opval
= LTSI (tmp_tmpd
, 0);
11446 CPU (h_nbit
) = opval
;
11447 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11450 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11451 CPU (h_zbit
) = opval
;
11452 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11454 SET_H_CBIT_MOVE (0);
11455 SET_H_VBIT_MOVE (0);
11459 CPU (h_xbit
) = opval
;
11460 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11464 SET_H_INSN_PREFIXED_P (opval
);
11465 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11475 CASE (sem
, INSN_SWAP
) : /* swap${swapoption} ${Rs} */
11477 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11478 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11479 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11480 int UNUSED written
= 0;
11481 IADDR UNUSED pc
= abuf
->addr
;
11482 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11487 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
11488 tmp_tmpd
= ({ SI tmp_tmpcode
;
11491 tmp_tmpcode
= FLD (f_operand2
);
11492 ; tmp_tmpval
= tmp_tmps
;
11493 ; if (EQSI (tmp_tmpcode
, 0)) {
11494 tmp_tmpres
= (cgen_rtx_error (current_cpu
, "SWAP without swap modifier isn't implemented"), 0);
11496 else if (EQSI (tmp_tmpcode
, 1)) {
11497 tmp_tmpres
= ({ SI tmp_tmpr
;
11498 tmp_tmpr
= tmp_tmpval
;
11499 ; 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)))))))); });
11501 else if (EQSI (tmp_tmpcode
, 2)) {
11502 tmp_tmpres
= ({ SI tmp_tmpb
;
11503 tmp_tmpb
= tmp_tmpval
;
11504 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11506 else if (EQSI (tmp_tmpcode
, 3)) {
11507 tmp_tmpres
= ({ SI tmp_tmpr
;
11508 tmp_tmpr
= ({ SI tmp_tmpb
;
11509 tmp_tmpb
= tmp_tmpval
;
11510 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11511 ; 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)))))))); });
11513 else if (EQSI (tmp_tmpcode
, 4)) {
11514 tmp_tmpres
= ({ SI tmp_tmpb
;
11515 tmp_tmpb
= tmp_tmpval
;
11516 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11518 else if (EQSI (tmp_tmpcode
, 5)) {
11519 tmp_tmpres
= ({ SI tmp_tmpr
;
11520 tmp_tmpr
= ({ SI tmp_tmpb
;
11521 tmp_tmpb
= tmp_tmpval
;
11522 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11523 ; 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)))))))); });
11525 else if (EQSI (tmp_tmpcode
, 6)) {
11526 tmp_tmpres
= ({ SI tmp_tmpb
;
11527 tmp_tmpb
= ({ SI tmp_tmpb
;
11528 tmp_tmpb
= tmp_tmpval
;
11529 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11530 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11532 else if (EQSI (tmp_tmpcode
, 7)) {
11533 tmp_tmpres
= ({ SI tmp_tmpr
;
11534 tmp_tmpr
= ({ SI tmp_tmpb
;
11535 tmp_tmpb
= ({ SI tmp_tmpb
;
11536 tmp_tmpb
= tmp_tmpval
;
11537 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11538 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11539 ; 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)))))))); });
11541 else if (EQSI (tmp_tmpcode
, 8)) {
11542 tmp_tmpres
= INVSI (tmp_tmpval
);
11544 else if (EQSI (tmp_tmpcode
, 9)) {
11545 tmp_tmpres
= ({ SI tmp_tmpr
;
11546 tmp_tmpr
= INVSI (tmp_tmpval
);
11547 ; 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)))))))); });
11549 else if (EQSI (tmp_tmpcode
, 10)) {
11550 tmp_tmpres
= ({ SI tmp_tmpb
;
11551 tmp_tmpb
= INVSI (tmp_tmpval
);
11552 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11554 else if (EQSI (tmp_tmpcode
, 11)) {
11555 tmp_tmpres
= ({ SI tmp_tmpr
;
11556 tmp_tmpr
= ({ SI tmp_tmpb
;
11557 tmp_tmpb
= INVSI (tmp_tmpval
);
11558 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11559 ; 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)))))))); });
11561 else if (EQSI (tmp_tmpcode
, 12)) {
11562 tmp_tmpres
= ({ SI tmp_tmpb
;
11563 tmp_tmpb
= INVSI (tmp_tmpval
);
11564 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11566 else if (EQSI (tmp_tmpcode
, 13)) {
11567 tmp_tmpres
= ({ SI tmp_tmpr
;
11568 tmp_tmpr
= ({ SI tmp_tmpb
;
11569 tmp_tmpb
= INVSI (tmp_tmpval
);
11570 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11571 ; 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)))))))); });
11573 else if (EQSI (tmp_tmpcode
, 14)) {
11574 tmp_tmpres
= ({ SI tmp_tmpb
;
11575 tmp_tmpb
= ({ SI tmp_tmpb
;
11576 tmp_tmpb
= INVSI (tmp_tmpval
);
11577 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11578 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11580 else if (EQSI (tmp_tmpcode
, 15)) {
11581 tmp_tmpres
= ({ SI tmp_tmpr
;
11582 tmp_tmpr
= ({ SI tmp_tmpb
;
11583 tmp_tmpb
= ({ SI tmp_tmpb
;
11584 tmp_tmpb
= INVSI (tmp_tmpval
);
11585 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11586 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11587 ; 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)))))))); });
11591 SI opval
= tmp_tmpd
;
11592 SET_H_GR (FLD (f_operand1
), opval
);
11593 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11597 BI opval
= LTSI (tmp_tmpd
, 0);
11598 CPU (h_nbit
) = opval
;
11599 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11602 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11603 CPU (h_zbit
) = opval
;
11604 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11606 SET_H_CBIT_MOVE (0);
11607 SET_H_VBIT_MOVE (0);
11611 CPU (h_xbit
) = opval
;
11612 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11616 SET_H_INSN_PREFIXED_P (opval
);
11617 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11627 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11631 #define FLD(f) abuf->fields.sfmt_addc_m.f
11632 int UNUSED written
= 0;
11633 IADDR UNUSED pc
= abuf
->addr
;
11634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11640 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11641 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11642 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11645 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11647 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11648 SET_H_GR (FLD (f_operand2
), opval
);
11649 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11654 BI opval
= LTQI (tmp_tmpd
, 0);
11655 CPU (h_nbit
) = opval
;
11656 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11659 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11660 CPU (h_zbit
) = opval
;
11661 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11663 SET_H_CBIT_MOVE (0);
11664 SET_H_VBIT_MOVE (0);
11668 CPU (h_xbit
) = opval
;
11669 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11673 SET_H_INSN_PREFIXED_P (opval
);
11674 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11684 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11686 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11687 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11688 #define FLD(f) abuf->fields.sfmt_addc_m.f
11689 int UNUSED written
= 0;
11690 IADDR UNUSED pc
= abuf
->addr
;
11691 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11697 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11698 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11699 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11702 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11704 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11705 SET_H_GR (FLD (f_operand2
), opval
);
11706 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11711 BI opval
= LTHI (tmp_tmpd
, 0);
11712 CPU (h_nbit
) = opval
;
11713 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11716 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11717 CPU (h_zbit
) = opval
;
11718 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11720 SET_H_CBIT_MOVE (0);
11721 SET_H_VBIT_MOVE (0);
11725 CPU (h_xbit
) = opval
;
11726 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11730 SET_H_INSN_PREFIXED_P (opval
);
11731 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11741 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11743 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11744 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11745 #define FLD(f) abuf->fields.sfmt_addc_m.f
11746 int UNUSED written
= 0;
11747 IADDR UNUSED pc
= abuf
->addr
;
11748 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11754 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11755 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11756 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11758 SI opval
= tmp_tmpd
;
11759 SET_H_GR (FLD (f_operand2
), opval
);
11760 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11764 BI opval
= LTSI (tmp_tmpd
, 0);
11765 CPU (h_nbit
) = opval
;
11766 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11769 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11770 CPU (h_zbit
) = opval
;
11771 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11773 SET_H_CBIT_MOVE (0);
11774 SET_H_VBIT_MOVE (0);
11778 CPU (h_xbit
) = opval
;
11779 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11783 SET_H_INSN_PREFIXED_P (opval
);
11784 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11794 CASE (sem
, INSN_ASRQ
) : /* asrq $c,${Rd} */
11796 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11797 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11798 #define FLD(f) abuf->fields.sfmt_asrq.f
11799 int UNUSED written
= 0;
11800 IADDR UNUSED pc
= abuf
->addr
;
11801 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11805 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11807 SI opval
= tmp_tmpd
;
11808 SET_H_GR (FLD (f_operand2
), opval
);
11809 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11813 BI opval
= LTSI (tmp_tmpd
, 0);
11814 CPU (h_nbit
) = opval
;
11815 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11818 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11819 CPU (h_zbit
) = opval
;
11820 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11822 SET_H_CBIT_MOVE (0);
11823 SET_H_VBIT_MOVE (0);
11827 CPU (h_xbit
) = opval
;
11828 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11832 SET_H_INSN_PREFIXED_P (opval
);
11833 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11843 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11845 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11846 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11847 #define FLD(f) abuf->fields.sfmt_addc_m.f
11848 int UNUSED written
= 0;
11849 IADDR UNUSED pc
= abuf
->addr
;
11850 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11855 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11856 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11859 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11861 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11862 SET_H_GR (FLD (f_operand2
), opval
);
11863 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11868 BI opval
= LTQI (tmp_tmpd
, 0);
11869 CPU (h_nbit
) = opval
;
11870 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11873 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11874 CPU (h_zbit
) = opval
;
11875 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11877 SET_H_CBIT_MOVE (0);
11878 SET_H_VBIT_MOVE (0);
11882 CPU (h_xbit
) = opval
;
11883 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11887 SET_H_INSN_PREFIXED_P (opval
);
11888 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11898 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11900 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11901 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11902 #define FLD(f) abuf->fields.sfmt_addc_m.f
11903 int UNUSED written
= 0;
11904 IADDR UNUSED pc
= abuf
->addr
;
11905 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11910 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11911 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11914 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11916 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11917 SET_H_GR (FLD (f_operand2
), opval
);
11918 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11923 BI opval
= LTHI (tmp_tmpd
, 0);
11924 CPU (h_nbit
) = opval
;
11925 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11928 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11929 CPU (h_zbit
) = opval
;
11930 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11932 SET_H_CBIT_MOVE (0);
11933 SET_H_VBIT_MOVE (0);
11937 CPU (h_xbit
) = opval
;
11938 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11942 SET_H_INSN_PREFIXED_P (opval
);
11943 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11953 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11955 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11957 #define FLD(f) abuf->fields.sfmt_addc_m.f
11958 int UNUSED written
= 0;
11959 IADDR UNUSED pc
= abuf
->addr
;
11960 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11965 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11966 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11968 SI opval
= tmp_tmpd
;
11969 SET_H_GR (FLD (f_operand2
), opval
);
11970 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11974 BI opval
= LTSI (tmp_tmpd
, 0);
11975 CPU (h_nbit
) = opval
;
11976 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11979 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11980 CPU (h_zbit
) = opval
;
11981 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11983 SET_H_CBIT_MOVE (0);
11984 SET_H_VBIT_MOVE (0);
11988 CPU (h_xbit
) = opval
;
11989 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11993 SET_H_INSN_PREFIXED_P (opval
);
11994 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12004 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
12006 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12007 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12008 #define FLD(f) abuf->fields.sfmt_asrq.f
12009 int UNUSED written
= 0;
12010 IADDR UNUSED pc
= abuf
->addr
;
12011 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12015 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
12017 SI opval
= tmp_tmpd
;
12018 SET_H_GR (FLD (f_operand2
), opval
);
12019 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12023 BI opval
= LTSI (tmp_tmpd
, 0);
12024 CPU (h_nbit
) = opval
;
12025 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12028 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12029 CPU (h_zbit
) = opval
;
12030 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12032 SET_H_CBIT_MOVE (0);
12033 SET_H_VBIT_MOVE (0);
12037 CPU (h_xbit
) = opval
;
12038 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12042 SET_H_INSN_PREFIXED_P (opval
);
12043 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12053 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
12055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12057 #define FLD(f) abuf->fields.sfmt_addc_m.f
12058 int UNUSED written
= 0;
12059 IADDR UNUSED pc
= abuf
->addr
;
12060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12065 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
12066 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
12069 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
12071 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
12072 SET_H_GR (FLD (f_operand2
), opval
);
12073 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12078 BI opval
= LTQI (tmp_tmpd
, 0);
12079 CPU (h_nbit
) = opval
;
12080 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12083 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12084 CPU (h_zbit
) = opval
;
12085 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12087 SET_H_CBIT_MOVE (0);
12088 SET_H_VBIT_MOVE (0);
12092 CPU (h_xbit
) = opval
;
12093 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12097 SET_H_INSN_PREFIXED_P (opval
);
12098 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12108 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
12110 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12111 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12112 #define FLD(f) abuf->fields.sfmt_addc_m.f
12113 int UNUSED written
= 0;
12114 IADDR UNUSED pc
= abuf
->addr
;
12115 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12120 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
12121 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
12124 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
12126 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
12127 SET_H_GR (FLD (f_operand2
), opval
);
12128 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12133 BI opval
= LTHI (tmp_tmpd
, 0);
12134 CPU (h_nbit
) = opval
;
12135 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12138 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12139 CPU (h_zbit
) = opval
;
12140 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12142 SET_H_CBIT_MOVE (0);
12143 SET_H_VBIT_MOVE (0);
12147 CPU (h_xbit
) = opval
;
12148 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12152 SET_H_INSN_PREFIXED_P (opval
);
12153 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12163 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
12165 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12166 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12167 #define FLD(f) abuf->fields.sfmt_addc_m.f
12168 int UNUSED written
= 0;
12169 IADDR UNUSED pc
= abuf
->addr
;
12170 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12175 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
12176 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
12178 SI opval
= tmp_tmpd
;
12179 SET_H_GR (FLD (f_operand2
), opval
);
12180 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12184 BI opval
= LTSI (tmp_tmpd
, 0);
12185 CPU (h_nbit
) = opval
;
12186 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12189 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12190 CPU (h_zbit
) = opval
;
12191 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12193 SET_H_CBIT_MOVE (0);
12194 SET_H_VBIT_MOVE (0);
12198 CPU (h_xbit
) = opval
;
12199 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12203 SET_H_INSN_PREFIXED_P (opval
);
12204 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12214 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
12216 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12217 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12218 #define FLD(f) abuf->fields.sfmt_asrq.f
12219 int UNUSED written
= 0;
12220 IADDR UNUSED pc
= abuf
->addr
;
12221 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12225 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
12227 SI opval
= tmp_tmpd
;
12228 SET_H_GR (FLD (f_operand2
), opval
);
12229 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12233 BI opval
= LTSI (tmp_tmpd
, 0);
12234 CPU (h_nbit
) = opval
;
12235 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12238 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12239 CPU (h_zbit
) = opval
;
12240 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12242 SET_H_CBIT_MOVE (0);
12243 SET_H_VBIT_MOVE (0);
12247 CPU (h_xbit
) = opval
;
12248 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12252 SET_H_INSN_PREFIXED_P (opval
);
12253 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12263 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
12265 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12266 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12267 #define FLD(f) abuf->fields.sfmt_muls_b.f
12268 int UNUSED written
= 0;
12269 IADDR UNUSED pc
= abuf
->addr
;
12270 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12275 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31)));
12278 BI opval
= LTSI (tmp_tmpd
, 0);
12279 CPU (h_nbit
) = opval
;
12280 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12283 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12284 CPU (h_zbit
) = opval
;
12285 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12287 SET_H_CBIT_MOVE (0);
12288 SET_H_VBIT_MOVE (0);
12292 CPU (h_xbit
) = opval
;
12293 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12297 SET_H_INSN_PREFIXED_P (opval
);
12298 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12308 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
12310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12312 #define FLD(f) abuf->fields.sfmt_asrq.f
12313 int UNUSED written
= 0;
12314 IADDR UNUSED pc
= abuf
->addr
;
12315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12319 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
12322 BI opval
= LTSI (tmp_tmpd
, 0);
12323 CPU (h_nbit
) = opval
;
12324 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12327 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12328 CPU (h_zbit
) = opval
;
12329 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12331 SET_H_CBIT_MOVE (0);
12332 SET_H_VBIT_MOVE (0);
12336 CPU (h_xbit
) = opval
;
12337 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12341 SET_H_INSN_PREFIXED_P (opval
);
12342 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12352 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
12354 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12355 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12356 #define FLD(f) abuf->fields.sfmt_setf.f
12357 int UNUSED written
= 0;
12358 IADDR UNUSED pc
= abuf
->addr
;
12359 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12363 tmp_tmp
= FLD (f_dstsrc
);
12364 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12367 CPU (h_cbit
) = opval
;
12368 written
|= (1 << 1);
12369 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12372 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12375 CPU (h_vbit
) = opval
;
12376 written
|= (1 << 7);
12377 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12380 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12383 CPU (h_zbit
) = opval
;
12384 written
|= (1 << 9);
12385 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12388 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12391 CPU (h_nbit
) = opval
;
12392 written
|= (1 << 3);
12393 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12396 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12399 CPU (h_xbit
) = opval
;
12400 written
|= (1 << 8);
12401 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12404 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12407 SET_H_IBIT (opval
);
12408 written
|= (1 << 2);
12409 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12412 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12415 SET_H_UBIT (opval
);
12416 written
|= (1 << 6);
12417 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12420 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12423 CPU (h_pbit
) = opval
;
12424 written
|= (1 << 4);
12425 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12430 SET_H_INSN_PREFIXED_P (opval
);
12431 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12433 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12436 CPU (h_xbit
) = opval
;
12437 written
|= (1 << 8);
12438 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12443 abuf
->written
= written
;
12448 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
12450 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12452 #define FLD(f) abuf->fields.sfmt_setf.f
12453 int UNUSED written
= 0;
12454 IADDR UNUSED pc
= abuf
->addr
;
12455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12459 tmp_tmp
= FLD (f_dstsrc
);
12460 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12463 CPU (h_cbit
) = opval
;
12464 written
|= (1 << 1);
12465 TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12468 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12471 CPU (h_vbit
) = opval
;
12472 written
|= (1 << 7);
12473 TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12476 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12479 CPU (h_zbit
) = opval
;
12480 written
|= (1 << 9);
12481 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12484 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12487 CPU (h_nbit
) = opval
;
12488 written
|= (1 << 3);
12489 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12492 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12495 CPU (h_xbit
) = opval
;
12496 written
|= (1 << 8);
12497 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12500 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12503 SET_H_IBIT (opval
);
12504 written
|= (1 << 2);
12505 TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12508 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12511 SET_H_UBIT (opval
);
12512 written
|= (1 << 6);
12513 TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12516 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12519 CPU (h_pbit
) = opval
;
12520 written
|= (1 << 4);
12521 TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12527 CPU (h_xbit
) = opval
;
12528 written
|= (1 << 8);
12529 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12533 SET_H_INSN_PREFIXED_P (opval
);
12534 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12539 abuf
->written
= written
;
12544 CASE (sem
, INSN_RFE
) : /* rfe */
12546 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12547 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12548 #define FLD(f) abuf->fields.sfmt_rfe.f
12549 int UNUSED written
= 0;
12550 IADDR UNUSED pc
= abuf
->addr
;
12551 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12559 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12560 tmp_keepmask
= 0xc0000000;
12561 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12562 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12563 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12565 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12566 SET_H_SR (((UINT
) 13), opval
);
12567 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12575 CASE (sem
, INSN_SFE
) : /* sfe */
12577 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12578 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12579 #define FLD(f) abuf->fields.sfmt_rfe.f
12580 int UNUSED written
= 0;
12581 IADDR UNUSED pc
= abuf
->addr
;
12582 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12587 tmp_savemask
= 0xc0000000;
12588 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12590 SI opval
= ORSI (ANDSI (tmp_savemask
, tmp_oldccs
), ANDSI (INVSI (tmp_savemask
), SLLSI (tmp_oldccs
, 10)));
12591 SET_H_SR (((UINT
) 13), opval
);
12592 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12600 CASE (sem
, INSN_RFG
) : /* rfg */
12602 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12603 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12604 #define FLD(f) abuf->fields.fmt_empty.f
12605 int UNUSED written
= 0;
12606 IADDR UNUSED pc
= abuf
->addr
;
12607 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12609 crisv32f_rfg_handler (current_cpu
, pc
);
12615 CASE (sem
, INSN_RFN
) : /* rfn */
12617 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12618 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12619 #define FLD(f) abuf->fields.sfmt_rfe.f
12620 int UNUSED written
= 0;
12621 IADDR UNUSED pc
= abuf
->addr
;
12622 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12631 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12632 tmp_keepmask
= 0xc0000000;
12633 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12634 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12635 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12637 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12638 SET_H_SR (((UINT
) 13), opval
);
12639 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12644 SET_H_MBIT (opval
);
12645 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
12653 CASE (sem
, INSN_HALT
) : /* halt */
12655 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12656 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12657 #define FLD(f) abuf->fields.fmt_empty.f
12658 int UNUSED written
= 0;
12659 IADDR UNUSED pc
= abuf
->addr
;
12661 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12664 USI opval
= crisv32f_halt_handler (current_cpu
, pc
);
12665 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12666 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12669 SEM_BRANCH_FINI (vpc
);
12674 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12676 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12677 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12678 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12679 int UNUSED written
= 0;
12680 IADDR UNUSED pc
= abuf
->addr
;
12682 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12686 tmp_truthval
= ({ SI tmp_tmpcond
;
12688 tmp_tmpcond
= FLD (f_operand2
);
12689 ; if (EQSI (tmp_tmpcond
, 0)) {
12690 tmp_condres
= NOTBI (CPU (h_cbit
));
12692 else if (EQSI (tmp_tmpcond
, 1)) {
12693 tmp_condres
= CPU (h_cbit
);
12695 else if (EQSI (tmp_tmpcond
, 2)) {
12696 tmp_condres
= NOTBI (CPU (h_zbit
));
12698 else if (EQSI (tmp_tmpcond
, 3)) {
12699 tmp_condres
= CPU (h_zbit
);
12701 else if (EQSI (tmp_tmpcond
, 4)) {
12702 tmp_condres
= NOTBI (CPU (h_vbit
));
12704 else if (EQSI (tmp_tmpcond
, 5)) {
12705 tmp_condres
= CPU (h_vbit
);
12707 else if (EQSI (tmp_tmpcond
, 6)) {
12708 tmp_condres
= NOTBI (CPU (h_nbit
));
12710 else if (EQSI (tmp_tmpcond
, 7)) {
12711 tmp_condres
= CPU (h_nbit
);
12713 else if (EQSI (tmp_tmpcond
, 8)) {
12714 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12716 else if (EQSI (tmp_tmpcond
, 9)) {
12717 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12719 else if (EQSI (tmp_tmpcond
, 10)) {
12720 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12722 else if (EQSI (tmp_tmpcond
, 11)) {
12723 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12725 else if (EQSI (tmp_tmpcond
, 12)) {
12726 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12728 else if (EQSI (tmp_tmpcond
, 13)) {
12729 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12731 else if (EQSI (tmp_tmpcond
, 14)) {
12734 else if (EQSI (tmp_tmpcond
, 15)) {
12735 tmp_condres
= CPU (h_pbit
);
12738 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12742 CPU (h_xbit
) = opval
;
12743 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12747 SET_H_INSN_PREFIXED_P (opval
);
12748 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12751 if (tmp_truthval
) {
12754 USI opval
= FLD (i_o_pcrel
);
12755 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12756 written
|= (1 << 8);
12757 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12763 abuf
->written
= written
;
12764 SEM_BRANCH_FINI (vpc
);
12769 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12771 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12772 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12773 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12774 int UNUSED written
= 0;
12775 IADDR UNUSED pc
= abuf
->addr
;
12777 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12783 CPU (h_xbit
) = opval
;
12784 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12788 SET_H_INSN_PREFIXED_P (opval
);
12789 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12794 USI opval
= FLD (i_o_pcrel
);
12795 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12796 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12801 SEM_BRANCH_FINI (vpc
);
12806 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12808 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12809 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12810 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12811 int UNUSED written
= 0;
12812 IADDR UNUSED pc
= abuf
->addr
;
12814 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12818 tmp_truthval
= ({ SI tmp_tmpcond
;
12820 tmp_tmpcond
= FLD (f_operand2
);
12821 ; if (EQSI (tmp_tmpcond
, 0)) {
12822 tmp_condres
= NOTBI (CPU (h_cbit
));
12824 else if (EQSI (tmp_tmpcond
, 1)) {
12825 tmp_condres
= CPU (h_cbit
);
12827 else if (EQSI (tmp_tmpcond
, 2)) {
12828 tmp_condres
= NOTBI (CPU (h_zbit
));
12830 else if (EQSI (tmp_tmpcond
, 3)) {
12831 tmp_condres
= CPU (h_zbit
);
12833 else if (EQSI (tmp_tmpcond
, 4)) {
12834 tmp_condres
= NOTBI (CPU (h_vbit
));
12836 else if (EQSI (tmp_tmpcond
, 5)) {
12837 tmp_condres
= CPU (h_vbit
);
12839 else if (EQSI (tmp_tmpcond
, 6)) {
12840 tmp_condres
= NOTBI (CPU (h_nbit
));
12842 else if (EQSI (tmp_tmpcond
, 7)) {
12843 tmp_condres
= CPU (h_nbit
);
12845 else if (EQSI (tmp_tmpcond
, 8)) {
12846 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12848 else if (EQSI (tmp_tmpcond
, 9)) {
12849 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12851 else if (EQSI (tmp_tmpcond
, 10)) {
12852 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12854 else if (EQSI (tmp_tmpcond
, 11)) {
12855 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12857 else if (EQSI (tmp_tmpcond
, 12)) {
12858 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12860 else if (EQSI (tmp_tmpcond
, 13)) {
12861 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12863 else if (EQSI (tmp_tmpcond
, 14)) {
12866 else if (EQSI (tmp_tmpcond
, 15)) {
12867 tmp_condres
= CPU (h_pbit
);
12870 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12874 CPU (h_xbit
) = opval
;
12875 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12879 SET_H_INSN_PREFIXED_P (opval
);
12880 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12883 if (tmp_truthval
) {
12886 USI opval
= FLD (i_o_word_pcrel
);
12887 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12888 written
|= (1 << 8);
12889 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12895 abuf
->written
= written
;
12896 SEM_BRANCH_FINI (vpc
);
12901 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12903 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12904 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12905 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12906 int UNUSED written
= 0;
12907 IADDR UNUSED pc
= abuf
->addr
;
12909 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12915 CPU (h_xbit
) = opval
;
12916 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12920 SET_H_INSN_PREFIXED_P (opval
);
12921 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12926 USI opval
= FLD (i_o_word_pcrel
);
12927 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12928 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12933 SEM_BRANCH_FINI (vpc
);
12938 CASE (sem
, INSN_JAS_R
) : /* jas ${Rs},${Pd} */
12940 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12941 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12942 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12943 int UNUSED written
= 0;
12944 IADDR UNUSED pc
= abuf
->addr
;
12946 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12952 CPU (h_xbit
) = opval
;
12953 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12957 SET_H_INSN_PREFIXED_P (opval
);
12958 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12961 if (ANDIF (EQSI (FLD (f_operand1
), 1), EQSI (FLD (f_operand2
), 11))) {
12962 cris_flush_simulator_decode_cache (current_cpu
, pc
);
12967 SI opval
= ADDSI (pc
, 4);
12968 SET_H_SR (FLD (f_operand2
), opval
);
12969 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12972 USI opval
= GET_H_GR (FLD (f_operand1
));
12973 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12974 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12980 SEM_BRANCH_FINI (vpc
);
12985 CASE (sem
, INSN_JAS_C
) : /* jas ${const32},${Pd} */
12987 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12989 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
12990 int UNUSED written
= 0;
12991 IADDR UNUSED pc
= abuf
->addr
;
12993 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12999 CPU (h_xbit
) = opval
;
13000 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13004 SET_H_INSN_PREFIXED_P (opval
);
13005 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13011 SI opval
= ADDSI (pc
, 8);
13012 SET_H_SR (FLD (f_operand2
), opval
);
13013 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13016 USI opval
= FLD (f_indir_pc__dword
);
13017 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
13018 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13024 SEM_BRANCH_FINI (vpc
);
13029 CASE (sem
, INSN_JUMP_P
) : /* jump ${Ps} */
13031 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13032 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13033 #define FLD(f) abuf->fields.sfmt_mcp.f
13034 int UNUSED written
= 0;
13035 IADDR UNUSED pc
= abuf
->addr
;
13037 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13043 CPU (h_xbit
) = opval
;
13044 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13048 SET_H_INSN_PREFIXED_P (opval
);
13049 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13054 USI opval
= GET_H_SR (FLD (f_operand2
));
13055 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13056 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13061 SEM_BRANCH_FINI (vpc
);
13066 CASE (sem
, INSN_BAS_C
) : /* bas ${const32},${Pd} */
13068 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13069 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13070 #define FLD(f) abuf->fields.sfmt_bas_c.f
13071 int UNUSED written
= 0;
13072 IADDR UNUSED pc
= abuf
->addr
;
13074 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13080 CPU (h_xbit
) = opval
;
13081 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13085 SET_H_INSN_PREFIXED_P (opval
);
13086 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13092 SI opval
= ADDSI (pc
, 8);
13093 SET_H_SR (FLD (f_operand2
), opval
);
13094 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13097 USI opval
= FLD (i_const32_pcrel
);
13098 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13099 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13105 SEM_BRANCH_FINI (vpc
);
13110 CASE (sem
, INSN_JASC_R
) : /* jasc ${Rs},${Pd} */
13112 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13113 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13114 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
13115 int UNUSED written
= 0;
13116 IADDR UNUSED pc
= abuf
->addr
;
13118 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13124 CPU (h_xbit
) = opval
;
13125 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13129 SET_H_INSN_PREFIXED_P (opval
);
13130 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13136 SI opval
= ADDSI (pc
, 8);
13137 SET_H_SR (FLD (f_operand2
), opval
);
13138 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13141 USI opval
= GET_H_GR (FLD (f_operand1
));
13142 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13143 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13149 SEM_BRANCH_FINI (vpc
);
13154 CASE (sem
, INSN_JASC_C
) : /* jasc ${const32},${Pd} */
13156 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13157 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13158 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p0.f
13159 int UNUSED written
= 0;
13160 IADDR UNUSED pc
= abuf
->addr
;
13162 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13168 CPU (h_xbit
) = opval
;
13169 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13173 SET_H_INSN_PREFIXED_P (opval
);
13174 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13180 SI opval
= ADDSI (pc
, 12);
13181 SET_H_SR (FLD (f_operand2
), opval
);
13182 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13185 USI opval
= FLD (f_indir_pc__dword
);
13186 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
13187 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13193 SEM_BRANCH_FINI (vpc
);
13198 CASE (sem
, INSN_BASC_C
) : /* basc ${const32},${Pd} */
13200 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13201 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13202 #define FLD(f) abuf->fields.sfmt_bas_c.f
13203 int UNUSED written
= 0;
13204 IADDR UNUSED pc
= abuf
->addr
;
13206 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13212 CPU (h_xbit
) = opval
;
13213 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13217 SET_H_INSN_PREFIXED_P (opval
);
13218 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13224 SI opval
= ADDSI (pc
, 12);
13225 SET_H_SR (FLD (f_operand2
), opval
);
13226 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13229 USI opval
= FLD (i_const32_pcrel
);
13230 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13231 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13237 SEM_BRANCH_FINI (vpc
);
13242 CASE (sem
, INSN_BREAK
) : /* break $n */
13244 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13245 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13246 #define FLD(f) abuf->fields.sfmt_break.f
13247 int UNUSED written
= 0;
13248 IADDR UNUSED pc
= abuf
->addr
;
13250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13256 CPU (h_xbit
) = opval
;
13257 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13261 SET_H_INSN_PREFIXED_P (opval
);
13262 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13266 USI opval
= crisv32f_break_handler (current_cpu
, FLD (f_u4
), pc
);
13267 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13268 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13272 SEM_BRANCH_FINI (vpc
);
13277 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
13279 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13280 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13281 #define FLD(f) abuf->fields.sfmt_muls_b.f
13282 int UNUSED written
= 0;
13283 IADDR UNUSED pc
= abuf
->addr
;
13284 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13290 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
13291 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13292 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13294 SI opval
= tmp_newval
;
13295 SET_H_GR (FLD (f_operand2
), opval
);
13296 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13300 BI opval
= LTSI (tmp_newval
, 0);
13301 CPU (h_nbit
) = opval
;
13302 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13305 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13306 CPU (h_zbit
) = opval
;
13307 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13309 SET_H_CBIT_MOVE (0);
13310 SET_H_VBIT_MOVE (0);
13314 CPU (h_xbit
) = opval
;
13315 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13319 SET_H_INSN_PREFIXED_P (opval
);
13320 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13330 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
13332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13334 #define FLD(f) abuf->fields.sfmt_muls_b.f
13335 int UNUSED written
= 0;
13336 IADDR UNUSED pc
= abuf
->addr
;
13337 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13343 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
13344 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13345 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13347 SI opval
= tmp_newval
;
13348 SET_H_GR (FLD (f_operand2
), opval
);
13349 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13353 BI opval
= LTSI (tmp_newval
, 0);
13354 CPU (h_nbit
) = opval
;
13355 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13358 BI opval
= ANDIF (EQSI (tmp_newval
, 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_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
13385 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13386 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13387 #define FLD(f) abuf->fields.sfmt_muls_b.f
13388 int UNUSED written
= 0;
13389 IADDR UNUSED pc
= abuf
->addr
;
13390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13396 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
13397 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13398 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13400 SI opval
= tmp_newval
;
13401 SET_H_GR (FLD (f_operand2
), opval
);
13402 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13406 BI opval
= LTSI (tmp_newval
, 0);
13407 CPU (h_nbit
) = opval
;
13408 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13411 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13412 CPU (h_zbit
) = opval
;
13413 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13415 SET_H_CBIT_MOVE (0);
13416 SET_H_VBIT_MOVE (0);
13420 CPU (h_xbit
) = opval
;
13421 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13425 SET_H_INSN_PREFIXED_P (opval
);
13426 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13436 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
13438 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13439 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13440 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13441 int UNUSED written
= 0;
13442 IADDR UNUSED pc
= abuf
->addr
;
13443 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13449 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
13450 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13451 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13453 SI opval
= tmp_newval
;
13454 SET_H_GR (FLD (f_operand2
), opval
);
13455 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13459 BI opval
= LTSI (tmp_newval
, 0);
13460 CPU (h_nbit
) = opval
;
13461 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13464 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13465 CPU (h_zbit
) = opval
;
13466 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13468 SET_H_CBIT_MOVE (0);
13469 SET_H_VBIT_MOVE (0);
13473 CPU (h_xbit
) = opval
;
13474 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13478 SET_H_INSN_PREFIXED_P (opval
);
13479 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13489 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
13491 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13492 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13493 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13494 int UNUSED written
= 0;
13495 IADDR UNUSED pc
= abuf
->addr
;
13496 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13502 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
13503 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13504 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13506 SI opval
= tmp_newval
;
13507 SET_H_GR (FLD (f_operand2
), opval
);
13508 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13512 BI opval
= LTSI (tmp_newval
, 0);
13513 CPU (h_nbit
) = opval
;
13514 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13517 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13518 CPU (h_zbit
) = opval
;
13519 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13521 SET_H_CBIT_MOVE (0);
13522 SET_H_VBIT_MOVE (0);
13526 CPU (h_xbit
) = opval
;
13527 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13531 SET_H_INSN_PREFIXED_P (opval
);
13532 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13542 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13544 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13545 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13546 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13547 int UNUSED written
= 0;
13548 IADDR UNUSED pc
= abuf
->addr
;
13549 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13555 tmp_tmpops
= FLD (f_indir_pc__dword
);
13556 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13557 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13559 SI opval
= tmp_newval
;
13560 SET_H_GR (FLD (f_operand2
), opval
);
13561 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13565 BI opval
= LTSI (tmp_newval
, 0);
13566 CPU (h_nbit
) = opval
;
13567 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13570 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13571 CPU (h_zbit
) = opval
;
13572 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13574 SET_H_CBIT_MOVE (0);
13575 SET_H_VBIT_MOVE (0);
13579 CPU (h_xbit
) = opval
;
13580 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13584 SET_H_INSN_PREFIXED_P (opval
);
13585 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13595 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13597 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13598 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13599 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13600 int UNUSED written
= 0;
13601 IADDR UNUSED pc
= abuf
->addr
;
13602 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13606 tmp_truthval
= ({ SI tmp_tmpcond
;
13608 tmp_tmpcond
= FLD (f_operand2
);
13609 ; if (EQSI (tmp_tmpcond
, 0)) {
13610 tmp_condres
= NOTBI (CPU (h_cbit
));
13612 else if (EQSI (tmp_tmpcond
, 1)) {
13613 tmp_condres
= CPU (h_cbit
);
13615 else if (EQSI (tmp_tmpcond
, 2)) {
13616 tmp_condres
= NOTBI (CPU (h_zbit
));
13618 else if (EQSI (tmp_tmpcond
, 3)) {
13619 tmp_condres
= CPU (h_zbit
);
13621 else if (EQSI (tmp_tmpcond
, 4)) {
13622 tmp_condres
= NOTBI (CPU (h_vbit
));
13624 else if (EQSI (tmp_tmpcond
, 5)) {
13625 tmp_condres
= CPU (h_vbit
);
13627 else if (EQSI (tmp_tmpcond
, 6)) {
13628 tmp_condres
= NOTBI (CPU (h_nbit
));
13630 else if (EQSI (tmp_tmpcond
, 7)) {
13631 tmp_condres
= CPU (h_nbit
);
13633 else if (EQSI (tmp_tmpcond
, 8)) {
13634 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13636 else if (EQSI (tmp_tmpcond
, 9)) {
13637 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13639 else if (EQSI (tmp_tmpcond
, 10)) {
13640 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13642 else if (EQSI (tmp_tmpcond
, 11)) {
13643 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13645 else if (EQSI (tmp_tmpcond
, 12)) {
13646 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13648 else if (EQSI (tmp_tmpcond
, 13)) {
13649 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13651 else if (EQSI (tmp_tmpcond
, 14)) {
13654 else if (EQSI (tmp_tmpcond
, 15)) {
13655 tmp_condres
= CPU (h_pbit
);
13659 SI opval
= ZEXTBISI (tmp_truthval
);
13660 SET_H_GR (FLD (f_operand1
), opval
);
13661 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13666 CPU (h_xbit
) = opval
;
13667 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13671 SET_H_INSN_PREFIXED_P (opval
);
13672 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13681 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13683 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13684 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13685 #define FLD(f) abuf->fields.sfmt_muls_b.f
13686 int UNUSED written
= 0;
13687 IADDR UNUSED pc
= abuf
->addr
;
13688 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13693 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13696 if (GESI (tmp_tmp
, 0)) {
13698 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13699 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13702 if (GESI (tmp_tmp
, 0)) {
13704 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13705 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13708 if (GESI (tmp_tmp
, 0)) {
13710 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13711 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13714 if (GESI (tmp_tmp
, 0)) {
13716 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13717 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13720 if (GESI (tmp_tmp
, 0)) {
13722 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13723 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13726 if (GESI (tmp_tmp
, 0)) {
13728 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13729 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13732 if (GESI (tmp_tmp
, 0)) {
13734 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13735 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13738 if (GESI (tmp_tmp
, 0)) {
13740 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13741 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13744 if (GESI (tmp_tmp
, 0)) {
13746 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13747 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13750 if (GESI (tmp_tmp
, 0)) {
13752 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13753 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13756 if (GESI (tmp_tmp
, 0)) {
13758 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13759 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13762 if (GESI (tmp_tmp
, 0)) {
13764 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13765 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13768 if (GESI (tmp_tmp
, 0)) {
13770 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13771 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13774 if (GESI (tmp_tmp
, 0)) {
13776 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13777 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13780 if (GESI (tmp_tmp
, 0)) {
13782 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13783 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13786 if (GESI (tmp_tmp
, 0)) {
13788 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13789 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13792 if (GESI (tmp_tmp
, 0)) {
13794 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13795 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13798 if (GESI (tmp_tmp
, 0)) {
13800 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13801 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13804 if (GESI (tmp_tmp
, 0)) {
13806 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13807 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13810 if (GESI (tmp_tmp
, 0)) {
13812 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13813 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13816 if (GESI (tmp_tmp
, 0)) {
13818 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13819 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13822 if (GESI (tmp_tmp
, 0)) {
13824 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13825 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13828 if (GESI (tmp_tmp
, 0)) {
13830 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13831 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13834 if (GESI (tmp_tmp
, 0)) {
13836 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13837 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13840 if (GESI (tmp_tmp
, 0)) {
13842 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13843 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13846 if (GESI (tmp_tmp
, 0)) {
13848 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13849 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13852 if (GESI (tmp_tmp
, 0)) {
13854 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13855 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13858 if (GESI (tmp_tmp
, 0)) {
13860 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13861 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13864 if (GESI (tmp_tmp
, 0)) {
13866 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13867 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13870 if (GESI (tmp_tmp
, 0)) {
13872 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13873 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13876 if (GESI (tmp_tmp
, 0)) {
13878 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13879 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13882 if (GESI (tmp_tmp
, 0)) {
13884 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13885 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13890 SI opval
= tmp_tmpd
;
13891 SET_H_GR (FLD (f_operand2
), opval
);
13892 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13896 BI opval
= LTSI (tmp_tmpd
, 0);
13897 CPU (h_nbit
) = opval
;
13898 TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13901 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13902 CPU (h_zbit
) = opval
;
13903 TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13905 SET_H_CBIT_MOVE (0);
13906 SET_H_VBIT_MOVE (0);
13910 CPU (h_xbit
) = opval
;
13911 TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13915 SET_H_INSN_PREFIXED_P (opval
);
13916 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13926 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13928 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13929 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13930 #define FLD(f) abuf->fields.sfmt_addoq.f
13931 int UNUSED written
= 0;
13932 IADDR UNUSED pc
= abuf
->addr
;
13933 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13937 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13938 SET_H_PREFIXREG_V32 (opval
);
13939 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13943 SET_H_INSN_PREFIXED_P (opval
);
13944 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13952 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13954 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13955 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13956 #define FLD(f) abuf->fields.sfmt_addc_m.f
13957 int UNUSED written
= 0;
13958 IADDR UNUSED pc
= abuf
->addr
;
13959 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13963 tmp_tmps
= ({ SI tmp_addr
;
13966 tmp_postinc
= FLD (f_memmode
);
13967 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13968 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13969 ; if (NEBI (tmp_postinc
, 0)) {
13971 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13972 tmp_addr
= ADDSI (tmp_addr
, 1);
13975 SI opval
= tmp_addr
;
13976 SET_H_GR (FLD (f_operand1
), opval
);
13977 written
|= (1 << 6);
13978 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13984 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13985 SET_H_PREFIXREG_V32 (opval
);
13986 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13990 SET_H_INSN_PREFIXED_P (opval
);
13991 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13995 abuf
->written
= written
;
14000 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
14002 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14003 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14004 #define FLD(f) abuf->fields.sfmt_addc_m.f
14005 int UNUSED written
= 0;
14006 IADDR UNUSED pc
= abuf
->addr
;
14007 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14011 tmp_tmps
= ({ SI tmp_addr
;
14014 tmp_postinc
= FLD (f_memmode
);
14015 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
14016 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
14017 ; if (NEBI (tmp_postinc
, 0)) {
14019 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
14020 tmp_addr
= ADDSI (tmp_addr
, 2);
14023 SI opval
= tmp_addr
;
14024 SET_H_GR (FLD (f_operand1
), opval
);
14025 written
|= (1 << 6);
14026 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
14032 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
14033 SET_H_PREFIXREG_V32 (opval
);
14034 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14038 SET_H_INSN_PREFIXED_P (opval
);
14039 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14043 abuf
->written
= written
;
14048 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
14050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14052 #define FLD(f) abuf->fields.sfmt_addc_m.f
14053 int UNUSED written
= 0;
14054 IADDR UNUSED pc
= abuf
->addr
;
14055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14059 tmp_tmps
= ({ SI tmp_addr
;
14062 tmp_postinc
= FLD (f_memmode
);
14063 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
14064 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
14065 ; if (NEBI (tmp_postinc
, 0)) {
14067 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
14068 tmp_addr
= ADDSI (tmp_addr
, 4);
14071 SI opval
= tmp_addr
;
14072 SET_H_GR (FLD (f_operand1
), opval
);
14073 written
|= (1 << 6);
14074 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
14080 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
14081 SET_H_PREFIXREG_V32 (opval
);
14082 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14086 SET_H_INSN_PREFIXED_P (opval
);
14087 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14091 abuf
->written
= written
;
14096 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
14098 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14099 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14100 #define FLD(f) abuf->fields.sfmt_bound_cb.f
14101 int UNUSED written
= 0;
14102 IADDR UNUSED pc
= abuf
->addr
;
14103 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
14107 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
14108 SET_H_PREFIXREG_V32 (opval
);
14109 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14113 SET_H_INSN_PREFIXED_P (opval
);
14114 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14122 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
14124 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14126 #define FLD(f) abuf->fields.sfmt_bound_cw.f
14127 int UNUSED written
= 0;
14128 IADDR UNUSED pc
= abuf
->addr
;
14129 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
14133 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
14134 SET_H_PREFIXREG_V32 (opval
);
14135 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14139 SET_H_INSN_PREFIXED_P (opval
);
14140 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14148 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
14150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14152 #define FLD(f) abuf->fields.sfmt_bound_cd.f
14153 int UNUSED written
= 0;
14154 IADDR UNUSED pc
= abuf
->addr
;
14155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
14159 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
14160 SET_H_PREFIXREG_V32 (opval
);
14161 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14165 SET_H_INSN_PREFIXED_P (opval
);
14166 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14174 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
14176 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14177 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14178 #define FLD(f) abuf->fields.sfmt_muls_b.f
14179 int UNUSED written
= 0;
14180 IADDR UNUSED pc
= abuf
->addr
;
14181 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14185 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
14186 SET_H_PREFIXREG_V32 (opval
);
14187 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14191 SET_H_INSN_PREFIXED_P (opval
);
14192 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14200 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
14202 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14203 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14204 #define FLD(f) abuf->fields.sfmt_muls_b.f
14205 int UNUSED written
= 0;
14206 IADDR UNUSED pc
= abuf
->addr
;
14207 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14211 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
14212 SET_H_PREFIXREG_V32 (opval
);
14213 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14217 SET_H_INSN_PREFIXED_P (opval
);
14218 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14226 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14228 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14229 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14230 #define FLD(f) abuf->fields.sfmt_muls_b.f
14231 int UNUSED written
= 0;
14232 IADDR UNUSED pc
= abuf
->addr
;
14233 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14237 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14238 SET_H_PREFIXREG_V32 (opval
);
14239 TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14243 SET_H_INSN_PREFIXED_P (opval
);
14244 TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14252 CASE (sem
, INSN_FIDXI
) : /* fidxi [$Rs] */
14254 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14255 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14256 #define FLD(f) abuf->fields.sfmt_mcp.f
14257 int UNUSED written
= 0;
14258 IADDR UNUSED pc
= abuf
->addr
;
14260 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14263 USI opval
= crisv32f_fidxi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14264 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14265 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14268 SEM_BRANCH_FINI (vpc
);
14273 CASE (sem
, INSN_FTAGI
) : /* fidxi [$Rs] */
14275 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14276 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14277 #define FLD(f) abuf->fields.sfmt_mcp.f
14278 int UNUSED written
= 0;
14279 IADDR UNUSED pc
= abuf
->addr
;
14281 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14284 USI opval
= crisv32f_ftagi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14285 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14286 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14289 SEM_BRANCH_FINI (vpc
);
14294 CASE (sem
, INSN_FIDXD
) : /* fidxd [$Rs] */
14296 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14297 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14298 #define FLD(f) abuf->fields.sfmt_mcp.f
14299 int UNUSED written
= 0;
14300 IADDR UNUSED pc
= abuf
->addr
;
14302 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14305 USI opval
= crisv32f_fidxd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14306 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14307 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14310 SEM_BRANCH_FINI (vpc
);
14315 CASE (sem
, INSN_FTAGD
) : /* ftagd [$Rs] */
14317 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14318 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14319 #define FLD(f) abuf->fields.sfmt_mcp.f
14320 int UNUSED written
= 0;
14321 IADDR UNUSED pc
= abuf
->addr
;
14323 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14326 USI opval
= crisv32f_ftagd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14327 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14328 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14331 SEM_BRANCH_FINI (vpc
);
14338 ENDSWITCH (sem
) /* End of semantic switch. */
14340 /* At this point `vpc' contains the next insn to execute. */
14343 #undef DEFINE_SWITCH
14344 #endif /* DEFINE_SWITCH */