1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996-2024 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { CRISV32F_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
36 { CRISV32F_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
37 { CRISV32F_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
38 { CRISV32F_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
39 { CRISV32F_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
40 { CRISV32F_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
41 { CRISV32F_INSN_MOVE_B_R
, && case_sem_INSN_MOVE_B_R
},
42 { CRISV32F_INSN_MOVE_W_R
, && case_sem_INSN_MOVE_W_R
},
43 { CRISV32F_INSN_MOVE_D_R
, && case_sem_INSN_MOVE_D_R
},
44 { CRISV32F_INSN_MOVEQ
, && case_sem_INSN_MOVEQ
},
45 { CRISV32F_INSN_MOVS_B_R
, && case_sem_INSN_MOVS_B_R
},
46 { CRISV32F_INSN_MOVS_W_R
, && case_sem_INSN_MOVS_W_R
},
47 { CRISV32F_INSN_MOVU_B_R
, && case_sem_INSN_MOVU_B_R
},
48 { CRISV32F_INSN_MOVU_W_R
, && case_sem_INSN_MOVU_W_R
},
49 { CRISV32F_INSN_MOVECBR
, && case_sem_INSN_MOVECBR
},
50 { CRISV32F_INSN_MOVECWR
, && case_sem_INSN_MOVECWR
},
51 { CRISV32F_INSN_MOVECDR
, && case_sem_INSN_MOVECDR
},
52 { CRISV32F_INSN_MOVSCBR
, && case_sem_INSN_MOVSCBR
},
53 { CRISV32F_INSN_MOVSCWR
, && case_sem_INSN_MOVSCWR
},
54 { CRISV32F_INSN_MOVUCBR
, && case_sem_INSN_MOVUCBR
},
55 { CRISV32F_INSN_MOVUCWR
, && case_sem_INSN_MOVUCWR
},
56 { CRISV32F_INSN_ADDQ
, && case_sem_INSN_ADDQ
},
57 { CRISV32F_INSN_SUBQ
, && case_sem_INSN_SUBQ
},
58 { CRISV32F_INSN_CMP_R_B_R
, && case_sem_INSN_CMP_R_B_R
},
59 { CRISV32F_INSN_CMP_R_W_R
, && case_sem_INSN_CMP_R_W_R
},
60 { CRISV32F_INSN_CMP_R_D_R
, && case_sem_INSN_CMP_R_D_R
},
61 { CRISV32F_INSN_CMP_M_B_M
, && case_sem_INSN_CMP_M_B_M
},
62 { CRISV32F_INSN_CMP_M_W_M
, && case_sem_INSN_CMP_M_W_M
},
63 { CRISV32F_INSN_CMP_M_D_M
, && case_sem_INSN_CMP_M_D_M
},
64 { CRISV32F_INSN_CMPCBR
, && case_sem_INSN_CMPCBR
},
65 { CRISV32F_INSN_CMPCWR
, && case_sem_INSN_CMPCWR
},
66 { CRISV32F_INSN_CMPCDR
, && case_sem_INSN_CMPCDR
},
67 { CRISV32F_INSN_CMPQ
, && case_sem_INSN_CMPQ
},
68 { CRISV32F_INSN_CMPS_M_B_M
, && case_sem_INSN_CMPS_M_B_M
},
69 { CRISV32F_INSN_CMPS_M_W_M
, && case_sem_INSN_CMPS_M_W_M
},
70 { CRISV32F_INSN_CMPSCBR
, && case_sem_INSN_CMPSCBR
},
71 { CRISV32F_INSN_CMPSCWR
, && case_sem_INSN_CMPSCWR
},
72 { CRISV32F_INSN_CMPU_M_B_M
, && case_sem_INSN_CMPU_M_B_M
},
73 { CRISV32F_INSN_CMPU_M_W_M
, && case_sem_INSN_CMPU_M_W_M
},
74 { CRISV32F_INSN_CMPUCBR
, && case_sem_INSN_CMPUCBR
},
75 { CRISV32F_INSN_CMPUCWR
, && case_sem_INSN_CMPUCWR
},
76 { CRISV32F_INSN_MOVE_M_B_M
, && case_sem_INSN_MOVE_M_B_M
},
77 { CRISV32F_INSN_MOVE_M_W_M
, && case_sem_INSN_MOVE_M_W_M
},
78 { CRISV32F_INSN_MOVE_M_D_M
, && case_sem_INSN_MOVE_M_D_M
},
79 { CRISV32F_INSN_MOVS_M_B_M
, && case_sem_INSN_MOVS_M_B_M
},
80 { CRISV32F_INSN_MOVS_M_W_M
, && case_sem_INSN_MOVS_M_W_M
},
81 { CRISV32F_INSN_MOVU_M_B_M
, && case_sem_INSN_MOVU_M_B_M
},
82 { CRISV32F_INSN_MOVU_M_W_M
, && case_sem_INSN_MOVU_M_W_M
},
83 { CRISV32F_INSN_MOVE_R_SPRV32
, && case_sem_INSN_MOVE_R_SPRV32
},
84 { CRISV32F_INSN_MOVE_SPR_RV32
, && case_sem_INSN_MOVE_SPR_RV32
},
85 { CRISV32F_INSN_MOVE_M_SPRV32
, && case_sem_INSN_MOVE_M_SPRV32
},
86 { CRISV32F_INSN_MOVE_C_SPRV32_P2
, && case_sem_INSN_MOVE_C_SPRV32_P2
},
87 { CRISV32F_INSN_MOVE_C_SPRV32_P3
, && case_sem_INSN_MOVE_C_SPRV32_P3
},
88 { CRISV32F_INSN_MOVE_C_SPRV32_P5
, && case_sem_INSN_MOVE_C_SPRV32_P5
},
89 { CRISV32F_INSN_MOVE_C_SPRV32_P6
, && case_sem_INSN_MOVE_C_SPRV32_P6
},
90 { CRISV32F_INSN_MOVE_C_SPRV32_P7
, && case_sem_INSN_MOVE_C_SPRV32_P7
},
91 { CRISV32F_INSN_MOVE_C_SPRV32_P9
, && case_sem_INSN_MOVE_C_SPRV32_P9
},
92 { CRISV32F_INSN_MOVE_C_SPRV32_P10
, && case_sem_INSN_MOVE_C_SPRV32_P10
},
93 { CRISV32F_INSN_MOVE_C_SPRV32_P11
, && case_sem_INSN_MOVE_C_SPRV32_P11
},
94 { CRISV32F_INSN_MOVE_C_SPRV32_P12
, && case_sem_INSN_MOVE_C_SPRV32_P12
},
95 { CRISV32F_INSN_MOVE_C_SPRV32_P13
, && case_sem_INSN_MOVE_C_SPRV32_P13
},
96 { CRISV32F_INSN_MOVE_C_SPRV32_P14
, && case_sem_INSN_MOVE_C_SPRV32_P14
},
97 { CRISV32F_INSN_MOVE_C_SPRV32_P15
, && case_sem_INSN_MOVE_C_SPRV32_P15
},
98 { CRISV32F_INSN_MOVE_SPR_MV32
, && case_sem_INSN_MOVE_SPR_MV32
},
99 { CRISV32F_INSN_MOVE_SS_R
, && case_sem_INSN_MOVE_SS_R
},
100 { CRISV32F_INSN_MOVE_R_SS
, && case_sem_INSN_MOVE_R_SS
},
101 { CRISV32F_INSN_MOVEM_R_M_V32
, && case_sem_INSN_MOVEM_R_M_V32
},
102 { CRISV32F_INSN_MOVEM_M_R_V32
, && case_sem_INSN_MOVEM_M_R_V32
},
103 { CRISV32F_INSN_ADD_B_R
, && case_sem_INSN_ADD_B_R
},
104 { CRISV32F_INSN_ADD_W_R
, && case_sem_INSN_ADD_W_R
},
105 { CRISV32F_INSN_ADD_D_R
, && case_sem_INSN_ADD_D_R
},
106 { CRISV32F_INSN_ADD_M_B_M
, && case_sem_INSN_ADD_M_B_M
},
107 { CRISV32F_INSN_ADD_M_W_M
, && case_sem_INSN_ADD_M_W_M
},
108 { CRISV32F_INSN_ADD_M_D_M
, && case_sem_INSN_ADD_M_D_M
},
109 { CRISV32F_INSN_ADDCBR
, && case_sem_INSN_ADDCBR
},
110 { CRISV32F_INSN_ADDCWR
, && case_sem_INSN_ADDCWR
},
111 { CRISV32F_INSN_ADDCDR
, && case_sem_INSN_ADDCDR
},
112 { CRISV32F_INSN_ADDS_B_R
, && case_sem_INSN_ADDS_B_R
},
113 { CRISV32F_INSN_ADDS_W_R
, && case_sem_INSN_ADDS_W_R
},
114 { CRISV32F_INSN_ADDS_M_B_M
, && case_sem_INSN_ADDS_M_B_M
},
115 { CRISV32F_INSN_ADDS_M_W_M
, && case_sem_INSN_ADDS_M_W_M
},
116 { CRISV32F_INSN_ADDSCBR
, && case_sem_INSN_ADDSCBR
},
117 { CRISV32F_INSN_ADDSCWR
, && case_sem_INSN_ADDSCWR
},
118 { CRISV32F_INSN_ADDU_B_R
, && case_sem_INSN_ADDU_B_R
},
119 { CRISV32F_INSN_ADDU_W_R
, && case_sem_INSN_ADDU_W_R
},
120 { CRISV32F_INSN_ADDU_M_B_M
, && case_sem_INSN_ADDU_M_B_M
},
121 { CRISV32F_INSN_ADDU_M_W_M
, && case_sem_INSN_ADDU_M_W_M
},
122 { CRISV32F_INSN_ADDUCBR
, && case_sem_INSN_ADDUCBR
},
123 { CRISV32F_INSN_ADDUCWR
, && case_sem_INSN_ADDUCWR
},
124 { CRISV32F_INSN_SUB_B_R
, && case_sem_INSN_SUB_B_R
},
125 { CRISV32F_INSN_SUB_W_R
, && case_sem_INSN_SUB_W_R
},
126 { CRISV32F_INSN_SUB_D_R
, && case_sem_INSN_SUB_D_R
},
127 { CRISV32F_INSN_SUB_M_B_M
, && case_sem_INSN_SUB_M_B_M
},
128 { CRISV32F_INSN_SUB_M_W_M
, && case_sem_INSN_SUB_M_W_M
},
129 { CRISV32F_INSN_SUB_M_D_M
, && case_sem_INSN_SUB_M_D_M
},
130 { CRISV32F_INSN_SUBCBR
, && case_sem_INSN_SUBCBR
},
131 { CRISV32F_INSN_SUBCWR
, && case_sem_INSN_SUBCWR
},
132 { CRISV32F_INSN_SUBCDR
, && case_sem_INSN_SUBCDR
},
133 { CRISV32F_INSN_SUBS_B_R
, && case_sem_INSN_SUBS_B_R
},
134 { CRISV32F_INSN_SUBS_W_R
, && case_sem_INSN_SUBS_W_R
},
135 { CRISV32F_INSN_SUBS_M_B_M
, && case_sem_INSN_SUBS_M_B_M
},
136 { CRISV32F_INSN_SUBS_M_W_M
, && case_sem_INSN_SUBS_M_W_M
},
137 { CRISV32F_INSN_SUBSCBR
, && case_sem_INSN_SUBSCBR
},
138 { CRISV32F_INSN_SUBSCWR
, && case_sem_INSN_SUBSCWR
},
139 { CRISV32F_INSN_SUBU_B_R
, && case_sem_INSN_SUBU_B_R
},
140 { CRISV32F_INSN_SUBU_W_R
, && case_sem_INSN_SUBU_W_R
},
141 { CRISV32F_INSN_SUBU_M_B_M
, && case_sem_INSN_SUBU_M_B_M
},
142 { CRISV32F_INSN_SUBU_M_W_M
, && case_sem_INSN_SUBU_M_W_M
},
143 { CRISV32F_INSN_SUBUCBR
, && case_sem_INSN_SUBUCBR
},
144 { CRISV32F_INSN_SUBUCWR
, && case_sem_INSN_SUBUCWR
},
145 { CRISV32F_INSN_ADDC_R
, && case_sem_INSN_ADDC_R
},
146 { CRISV32F_INSN_ADDC_M
, && case_sem_INSN_ADDC_M
},
147 { CRISV32F_INSN_ADDC_C
, && case_sem_INSN_ADDC_C
},
148 { CRISV32F_INSN_LAPC_D
, && case_sem_INSN_LAPC_D
},
149 { CRISV32F_INSN_LAPCQ
, && case_sem_INSN_LAPCQ
},
150 { CRISV32F_INSN_ADDI_B_R
, && case_sem_INSN_ADDI_B_R
},
151 { CRISV32F_INSN_ADDI_W_R
, && case_sem_INSN_ADDI_W_R
},
152 { CRISV32F_INSN_ADDI_D_R
, && case_sem_INSN_ADDI_D_R
},
153 { CRISV32F_INSN_NEG_B_R
, && case_sem_INSN_NEG_B_R
},
154 { CRISV32F_INSN_NEG_W_R
, && case_sem_INSN_NEG_W_R
},
155 { CRISV32F_INSN_NEG_D_R
, && case_sem_INSN_NEG_D_R
},
156 { CRISV32F_INSN_TEST_M_B_M
, && case_sem_INSN_TEST_M_B_M
},
157 { CRISV32F_INSN_TEST_M_W_M
, && case_sem_INSN_TEST_M_W_M
},
158 { CRISV32F_INSN_TEST_M_D_M
, && case_sem_INSN_TEST_M_D_M
},
159 { CRISV32F_INSN_MOVE_R_M_B_M
, && case_sem_INSN_MOVE_R_M_B_M
},
160 { CRISV32F_INSN_MOVE_R_M_W_M
, && case_sem_INSN_MOVE_R_M_W_M
},
161 { CRISV32F_INSN_MOVE_R_M_D_M
, && case_sem_INSN_MOVE_R_M_D_M
},
162 { CRISV32F_INSN_MULS_B
, && case_sem_INSN_MULS_B
},
163 { CRISV32F_INSN_MULS_W
, && case_sem_INSN_MULS_W
},
164 { CRISV32F_INSN_MULS_D
, && case_sem_INSN_MULS_D
},
165 { CRISV32F_INSN_MULU_B
, && case_sem_INSN_MULU_B
},
166 { CRISV32F_INSN_MULU_W
, && case_sem_INSN_MULU_W
},
167 { CRISV32F_INSN_MULU_D
, && case_sem_INSN_MULU_D
},
168 { CRISV32F_INSN_MCP
, && case_sem_INSN_MCP
},
169 { CRISV32F_INSN_DSTEP
, && case_sem_INSN_DSTEP
},
170 { CRISV32F_INSN_ABS
, && case_sem_INSN_ABS
},
171 { CRISV32F_INSN_AND_B_R
, && case_sem_INSN_AND_B_R
},
172 { CRISV32F_INSN_AND_W_R
, && case_sem_INSN_AND_W_R
},
173 { CRISV32F_INSN_AND_D_R
, && case_sem_INSN_AND_D_R
},
174 { CRISV32F_INSN_AND_M_B_M
, && case_sem_INSN_AND_M_B_M
},
175 { CRISV32F_INSN_AND_M_W_M
, && case_sem_INSN_AND_M_W_M
},
176 { CRISV32F_INSN_AND_M_D_M
, && case_sem_INSN_AND_M_D_M
},
177 { CRISV32F_INSN_ANDCBR
, && case_sem_INSN_ANDCBR
},
178 { CRISV32F_INSN_ANDCWR
, && case_sem_INSN_ANDCWR
},
179 { CRISV32F_INSN_ANDCDR
, && case_sem_INSN_ANDCDR
},
180 { CRISV32F_INSN_ANDQ
, && case_sem_INSN_ANDQ
},
181 { CRISV32F_INSN_ORR_B_R
, && case_sem_INSN_ORR_B_R
},
182 { CRISV32F_INSN_ORR_W_R
, && case_sem_INSN_ORR_W_R
},
183 { CRISV32F_INSN_ORR_D_R
, && case_sem_INSN_ORR_D_R
},
184 { CRISV32F_INSN_OR_M_B_M
, && case_sem_INSN_OR_M_B_M
},
185 { CRISV32F_INSN_OR_M_W_M
, && case_sem_INSN_OR_M_W_M
},
186 { CRISV32F_INSN_OR_M_D_M
, && case_sem_INSN_OR_M_D_M
},
187 { CRISV32F_INSN_ORCBR
, && case_sem_INSN_ORCBR
},
188 { CRISV32F_INSN_ORCWR
, && case_sem_INSN_ORCWR
},
189 { CRISV32F_INSN_ORCDR
, && case_sem_INSN_ORCDR
},
190 { CRISV32F_INSN_ORQ
, && case_sem_INSN_ORQ
},
191 { CRISV32F_INSN_XOR
, && case_sem_INSN_XOR
},
192 { CRISV32F_INSN_SWAP
, && case_sem_INSN_SWAP
},
193 { CRISV32F_INSN_ASRR_B_R
, && case_sem_INSN_ASRR_B_R
},
194 { CRISV32F_INSN_ASRR_W_R
, && case_sem_INSN_ASRR_W_R
},
195 { CRISV32F_INSN_ASRR_D_R
, && case_sem_INSN_ASRR_D_R
},
196 { CRISV32F_INSN_ASRQ
, && case_sem_INSN_ASRQ
},
197 { CRISV32F_INSN_LSRR_B_R
, && case_sem_INSN_LSRR_B_R
},
198 { CRISV32F_INSN_LSRR_W_R
, && case_sem_INSN_LSRR_W_R
},
199 { CRISV32F_INSN_LSRR_D_R
, && case_sem_INSN_LSRR_D_R
},
200 { CRISV32F_INSN_LSRQ
, && case_sem_INSN_LSRQ
},
201 { CRISV32F_INSN_LSLR_B_R
, && case_sem_INSN_LSLR_B_R
},
202 { CRISV32F_INSN_LSLR_W_R
, && case_sem_INSN_LSLR_W_R
},
203 { CRISV32F_INSN_LSLR_D_R
, && case_sem_INSN_LSLR_D_R
},
204 { CRISV32F_INSN_LSLQ
, && case_sem_INSN_LSLQ
},
205 { CRISV32F_INSN_BTST
, && case_sem_INSN_BTST
},
206 { CRISV32F_INSN_BTSTQ
, && case_sem_INSN_BTSTQ
},
207 { CRISV32F_INSN_SETF
, && case_sem_INSN_SETF
},
208 { CRISV32F_INSN_CLEARF
, && case_sem_INSN_CLEARF
},
209 { CRISV32F_INSN_RFE
, && case_sem_INSN_RFE
},
210 { CRISV32F_INSN_SFE
, && case_sem_INSN_SFE
},
211 { CRISV32F_INSN_RFG
, && case_sem_INSN_RFG
},
212 { CRISV32F_INSN_RFN
, && case_sem_INSN_RFN
},
213 { CRISV32F_INSN_HALT
, && case_sem_INSN_HALT
},
214 { CRISV32F_INSN_BCC_B
, && case_sem_INSN_BCC_B
},
215 { CRISV32F_INSN_BA_B
, && case_sem_INSN_BA_B
},
216 { CRISV32F_INSN_BCC_W
, && case_sem_INSN_BCC_W
},
217 { CRISV32F_INSN_BA_W
, && case_sem_INSN_BA_W
},
218 { CRISV32F_INSN_JAS_R
, && case_sem_INSN_JAS_R
},
219 { CRISV32F_INSN_JAS_C
, && case_sem_INSN_JAS_C
},
220 { CRISV32F_INSN_JUMP_P
, && case_sem_INSN_JUMP_P
},
221 { CRISV32F_INSN_BAS_C
, && case_sem_INSN_BAS_C
},
222 { CRISV32F_INSN_JASC_R
, && case_sem_INSN_JASC_R
},
223 { CRISV32F_INSN_JASC_C
, && case_sem_INSN_JASC_C
},
224 { CRISV32F_INSN_BASC_C
, && case_sem_INSN_BASC_C
},
225 { CRISV32F_INSN_BREAK
, && case_sem_INSN_BREAK
},
226 { CRISV32F_INSN_BOUND_R_B_R
, && case_sem_INSN_BOUND_R_B_R
},
227 { CRISV32F_INSN_BOUND_R_W_R
, && case_sem_INSN_BOUND_R_W_R
},
228 { CRISV32F_INSN_BOUND_R_D_R
, && case_sem_INSN_BOUND_R_D_R
},
229 { CRISV32F_INSN_BOUND_CB
, && case_sem_INSN_BOUND_CB
},
230 { CRISV32F_INSN_BOUND_CW
, && case_sem_INSN_BOUND_CW
},
231 { CRISV32F_INSN_BOUND_CD
, && case_sem_INSN_BOUND_CD
},
232 { CRISV32F_INSN_SCC
, && case_sem_INSN_SCC
},
233 { CRISV32F_INSN_LZ
, && case_sem_INSN_LZ
},
234 { CRISV32F_INSN_ADDOQ
, && case_sem_INSN_ADDOQ
},
235 { CRISV32F_INSN_ADDO_M_B_M
, && case_sem_INSN_ADDO_M_B_M
},
236 { CRISV32F_INSN_ADDO_M_W_M
, && case_sem_INSN_ADDO_M_W_M
},
237 { CRISV32F_INSN_ADDO_M_D_M
, && case_sem_INSN_ADDO_M_D_M
},
238 { CRISV32F_INSN_ADDO_CB
, && case_sem_INSN_ADDO_CB
},
239 { CRISV32F_INSN_ADDO_CW
, && case_sem_INSN_ADDO_CW
},
240 { CRISV32F_INSN_ADDO_CD
, && case_sem_INSN_ADDO_CD
},
241 { CRISV32F_INSN_ADDI_ACR_B_R
, && case_sem_INSN_ADDI_ACR_B_R
},
242 { CRISV32F_INSN_ADDI_ACR_W_R
, && case_sem_INSN_ADDI_ACR_W_R
},
243 { CRISV32F_INSN_ADDI_ACR_D_R
, && case_sem_INSN_ADDI_ACR_D_R
},
244 { CRISV32F_INSN_FIDXI
, && case_sem_INSN_FIDXI
},
245 { CRISV32F_INSN_FTAGI
, && case_sem_INSN_FTAGI
},
246 { CRISV32F_INSN_FIDXD
, && case_sem_INSN_FIDXD
},
247 { CRISV32F_INSN_FTAGD
, && case_sem_INSN_FTAGD
},
252 for (i
= 0; labels
[i
].label
!= 0; ++i
)
255 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
257 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
262 #endif /* DEFINE_LABELS */
266 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
267 off frills like tracing and profiling. */
268 /* FIXME: A better way would be to have CGEN_TRACE_RESULT check for something
269 that can cause it to be optimized out. Another way would be to emit
270 special handlers into the instruction "stream". */
273 #undef CGEN_TRACE_RESULT
274 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
278 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
284 /* Branch to next handler without going around main loop. */
285 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
286 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
288 #else /* ! WITH_SCACHE_PBB */
290 #define NEXT(vpc) BREAK (sem)
293 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
295 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
298 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
301 #endif /* ! WITH_SCACHE_PBB */
305 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
307 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
308 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
309 #define FLD(f) abuf->fields.sfmt_empty.f
310 int UNUSED written
= 0;
311 IADDR UNUSED pc
= abuf
->addr
;
312 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
315 /* Update the recorded pc in the cpu state struct.
316 Only necessary for WITH_SCACHE case, but to avoid the
317 conditional compilation .... */
319 /* Virtual insns have zero size. Overwrite vpc with address of next insn
320 using the default-insn-bitsize spec. When executing insns in parallel
321 we may want to queue the fault and continue execution. */
322 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
323 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
330 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
334 #define FLD(f) abuf->fields.sfmt_empty.f
335 int UNUSED written
= 0;
336 IADDR UNUSED pc
= abuf
->addr
;
337 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
340 #if WITH_SCACHE_PBB_CRISV32F
341 crisv32f_pbb_after (current_cpu
, sem_arg
);
349 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
351 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
352 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
353 #define FLD(f) abuf->fields.sfmt_empty.f
354 int UNUSED written
= 0;
355 IADDR UNUSED pc
= abuf
->addr
;
356 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
359 #if WITH_SCACHE_PBB_CRISV32F
360 crisv32f_pbb_before (current_cpu
, sem_arg
);
368 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
370 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
371 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
372 #define FLD(f) abuf->fields.sfmt_empty.f
373 int UNUSED written
= 0;
374 IADDR UNUSED pc
= abuf
->addr
;
375 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
378 #if WITH_SCACHE_PBB_CRISV32F
380 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
381 pbb_br_type
, pbb_br_npc
);
384 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
385 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
386 CPU_PBB_BR_TYPE (current_cpu
),
387 CPU_PBB_BR_NPC (current_cpu
));
396 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
398 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
399 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
400 #define FLD(f) abuf->fields.sfmt_empty.f
401 int UNUSED written
= 0;
402 IADDR UNUSED pc
= abuf
->addr
;
403 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
406 #if WITH_SCACHE_PBB_CRISV32F
407 vpc
= crisv32f_pbb_chain (current_cpu
, sem_arg
);
418 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
420 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
421 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
422 #define FLD(f) abuf->fields.sfmt_empty.f
423 int UNUSED written
= 0;
424 IADDR UNUSED pc
= abuf
->addr
;
425 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
428 #if WITH_SCACHE_PBB_CRISV32F
429 #if defined DEFINE_SWITCH || defined FAST_P
430 /* In the switch case FAST_P is a constant, allowing several optimizations
431 in any called inline functions. */
432 vpc
= crisv32f_pbb_begin (current_cpu
, FAST_P
);
434 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
435 vpc
= crisv32f_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
437 vpc
= crisv32f_pbb_begin (current_cpu
, 0);
447 CASE (sem
, INSN_MOVE_B_R
) : /* move.b move.m ${Rs},${Rd} */
449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
451 #define FLD(f) abuf->fields.sfmt_addc_m.f
452 int UNUSED written
= 0;
453 IADDR UNUSED pc
= abuf
->addr
;
454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
458 tmp_newval
= GET_H_GR (FLD (f_operand1
));
461 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
463 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
464 SET_H_GR (FLD (f_operand2
), opval
);
465 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
470 BI opval
= LTQI (tmp_newval
, 0);
471 CPU (h_nbit
) = opval
;
472 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
475 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
476 CPU (h_zbit
) = opval
;
477 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
484 CPU (h_xbit
) = opval
;
485 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
489 SET_H_INSN_PREFIXED_P (opval
);
490 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
500 CASE (sem
, INSN_MOVE_W_R
) : /* move.w move.m ${Rs},${Rd} */
502 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
503 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
504 #define FLD(f) abuf->fields.sfmt_addc_m.f
505 int UNUSED written
= 0;
506 IADDR UNUSED pc
= abuf
->addr
;
507 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
511 tmp_newval
= GET_H_GR (FLD (f_operand1
));
514 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
516 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
517 SET_H_GR (FLD (f_operand2
), opval
);
518 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
523 BI opval
= LTHI (tmp_newval
, 0);
524 CPU (h_nbit
) = opval
;
525 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
528 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
529 CPU (h_zbit
) = opval
;
530 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
537 CPU (h_xbit
) = opval
;
538 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
542 SET_H_INSN_PREFIXED_P (opval
);
543 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
553 CASE (sem
, INSN_MOVE_D_R
) : /* move.d move.m ${Rs},${Rd} */
555 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
556 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
557 #define FLD(f) abuf->fields.sfmt_addc_m.f
558 int UNUSED written
= 0;
559 IADDR UNUSED pc
= abuf
->addr
;
560 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
564 tmp_newval
= GET_H_GR (FLD (f_operand1
));
566 SI opval
= tmp_newval
;
567 SET_H_GR (FLD (f_operand2
), opval
);
568 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
572 BI opval
= LTSI (tmp_newval
, 0);
573 CPU (h_nbit
) = opval
;
574 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
577 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
578 CPU (h_zbit
) = opval
;
579 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
586 CPU (h_xbit
) = opval
;
587 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
591 SET_H_INSN_PREFIXED_P (opval
);
592 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
602 CASE (sem
, INSN_MOVEQ
) : /* moveq $i,$Rd */
604 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
605 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
606 #define FLD(f) abuf->fields.sfmt_moveq.f
607 int UNUSED written
= 0;
608 IADDR UNUSED pc
= abuf
->addr
;
609 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
613 tmp_newval
= FLD (f_s6
);
615 SI opval
= tmp_newval
;
616 SET_H_GR (FLD (f_operand2
), opval
);
617 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
620 SET_H_NBIT_MOVE (LTSI (tmp_newval
, 0));
621 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1))));
627 CPU (h_xbit
) = opval
;
628 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
632 SET_H_INSN_PREFIXED_P (opval
);
633 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
643 CASE (sem
, INSN_MOVS_B_R
) : /* movs.b movs.m ${Rs},${Rd} */
645 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
646 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
647 #define FLD(f) abuf->fields.sfmt_muls_b.f
648 int UNUSED written
= 0;
649 IADDR UNUSED pc
= abuf
->addr
;
650 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
655 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
656 tmp_newval
= EXTQISI (tmp_tmpops
);
658 SI opval
= tmp_newval
;
659 SET_H_GR (FLD (f_operand2
), opval
);
660 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
664 BI opval
= LTSI (tmp_newval
, 0);
665 CPU (h_nbit
) = opval
;
666 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
669 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
670 CPU (h_zbit
) = opval
;
671 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
678 CPU (h_xbit
) = opval
;
679 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
683 SET_H_INSN_PREFIXED_P (opval
);
684 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
694 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
696 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
697 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
698 #define FLD(f) abuf->fields.sfmt_muls_b.f
699 int UNUSED written
= 0;
700 IADDR UNUSED pc
= abuf
->addr
;
701 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
706 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
707 tmp_newval
= EXTHISI (tmp_tmpops
);
709 SI opval
= tmp_newval
;
710 SET_H_GR (FLD (f_operand2
), opval
);
711 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
715 BI opval
= LTSI (tmp_newval
, 0);
716 CPU (h_nbit
) = opval
;
717 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
720 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
721 CPU (h_zbit
) = opval
;
722 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
729 CPU (h_xbit
) = opval
;
730 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
734 SET_H_INSN_PREFIXED_P (opval
);
735 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
745 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
747 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
748 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
749 #define FLD(f) abuf->fields.sfmt_muls_b.f
750 int UNUSED written
= 0;
751 IADDR UNUSED pc
= abuf
->addr
;
752 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
757 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
758 tmp_newval
= ZEXTQISI (tmp_tmpops
);
760 SI opval
= tmp_newval
;
761 SET_H_GR (FLD (f_operand2
), opval
);
762 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
766 BI opval
= LTSI (tmp_newval
, 0);
767 CPU (h_nbit
) = opval
;
768 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
771 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
772 CPU (h_zbit
) = opval
;
773 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
780 CPU (h_xbit
) = opval
;
781 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
785 SET_H_INSN_PREFIXED_P (opval
);
786 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
796 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
798 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
799 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
800 #define FLD(f) abuf->fields.sfmt_muls_b.f
801 int UNUSED written
= 0;
802 IADDR UNUSED pc
= abuf
->addr
;
803 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
808 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
809 tmp_newval
= ZEXTHISI (tmp_tmpops
);
811 SI opval
= tmp_newval
;
812 SET_H_GR (FLD (f_operand2
), opval
);
813 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
817 BI opval
= LTSI (tmp_newval
, 0);
818 CPU (h_nbit
) = opval
;
819 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
831 CPU (h_xbit
) = opval
;
832 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
836 SET_H_INSN_PREFIXED_P (opval
);
837 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
870 BI opval
= LTQI (tmp_newval
, 0);
871 CPU (h_nbit
) = opval
;
872 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
884 CPU (h_xbit
) = opval
;
885 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
889 SET_H_INSN_PREFIXED_P (opval
);
890 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
923 BI opval
= LTHI (tmp_newval
, 0);
924 CPU (h_nbit
) = opval
;
925 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
937 CPU (h_xbit
) = opval
;
938 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
942 SET_H_INSN_PREFIXED_P (opval
);
943 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
972 BI opval
= LTSI (tmp_newval
, 0);
973 CPU (h_nbit
) = opval
;
974 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
986 CPU (h_xbit
) = opval
;
987 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
991 SET_H_INSN_PREFIXED_P (opval
);
992 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1021 BI opval
= LTSI (tmp_newval
, 0);
1022 CPU (h_nbit
) = opval
;
1023 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1040 SET_H_INSN_PREFIXED_P (opval
);
1041 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1070 BI opval
= LTSI (tmp_newval
, 0);
1071 CPU (h_nbit
) = opval
;
1072 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1089 SET_H_INSN_PREFIXED_P (opval
);
1090 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1119 BI opval
= LTSI (tmp_newval
, 0);
1120 CPU (h_nbit
) = opval
;
1121 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1138 SET_H_INSN_PREFIXED_P (opval
);
1139 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1168 BI opval
= LTSI (tmp_newval
, 0);
1169 CPU (h_nbit
) = opval
;
1170 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1187 SET_H_INSN_PREFIXED_P (opval
);
1188 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1228 BI opval
= LTSI (tmp_newval
, 0);
1229 CPU (h_nbit
) = opval
;
1230 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1245 CPU (h_xbit
) = opval
;
1246 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1250 SET_H_INSN_PREFIXED_P (opval
);
1251 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1291 BI opval
= LTSI (tmp_newval
, 0);
1292 CPU (h_nbit
) = opval
;
1293 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1308 CPU (h_xbit
) = opval
;
1309 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1313 SET_H_INSN_PREFIXED_P (opval
);
1314 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1350 BI opval
= LTQI (tmp_newval
, 0);
1351 CPU (h_nbit
) = opval
;
1352 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1367 CPU (h_xbit
) = opval
;
1368 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1372 SET_H_INSN_PREFIXED_P (opval
);
1373 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1409 BI opval
= LTHI (tmp_newval
, 0);
1410 CPU (h_nbit
) = opval
;
1411 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1426 CPU (h_xbit
) = opval
;
1427 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1431 SET_H_INSN_PREFIXED_P (opval
);
1432 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1468 BI opval
= LTSI (tmp_newval
, 0);
1469 CPU (h_nbit
) = opval
;
1470 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1485 CPU (h_xbit
) = opval
;
1486 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1490 SET_H_INSN_PREFIXED_P (opval
);
1491 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1546 BI opval
= LTQI (tmp_newval
, 0);
1547 CPU (h_nbit
) = opval
;
1548 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1563 CPU (h_xbit
) = opval
;
1564 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1568 SET_H_INSN_PREFIXED_P (opval
);
1569 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1625 BI opval
= LTHI (tmp_newval
, 0);
1626 CPU (h_nbit
) = opval
;
1627 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1642 CPU (h_xbit
) = opval
;
1643 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1647 SET_H_INSN_PREFIXED_P (opval
);
1648 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1704 BI opval
= LTSI (tmp_newval
, 0);
1705 CPU (h_nbit
) = opval
;
1706 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1721 CPU (h_xbit
) = opval
;
1722 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1726 SET_H_INSN_PREFIXED_P (opval
);
1727 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1764 BI opval
= LTQI (tmp_newval
, 0);
1765 CPU (h_nbit
) = opval
;
1766 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1781 CPU (h_xbit
) = opval
;
1782 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1786 SET_H_INSN_PREFIXED_P (opval
);
1787 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1823 BI opval
= LTHI (tmp_newval
, 0);
1824 CPU (h_nbit
) = opval
;
1825 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1840 CPU (h_xbit
) = opval
;
1841 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1845 SET_H_INSN_PREFIXED_P (opval
);
1846 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1882 BI opval
= LTSI (tmp_newval
, 0);
1883 CPU (h_nbit
) = opval
;
1884 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1899 CPU (h_xbit
) = opval
;
1900 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1904 SET_H_INSN_PREFIXED_P (opval
);
1905 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1941 BI opval
= LTSI (tmp_newval
, 0);
1942 CPU (h_nbit
) = opval
;
1943 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1958 CPU (h_xbit
) = opval
;
1959 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1963 SET_H_INSN_PREFIXED_P (opval
);
1964 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2019 BI opval
= LTSI (tmp_newval
, 0);
2020 CPU (h_nbit
) = opval
;
2021 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2036 CPU (h_xbit
) = opval
;
2037 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2041 SET_H_INSN_PREFIXED_P (opval
);
2042 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2098 BI opval
= LTSI (tmp_newval
, 0);
2099 CPU (h_nbit
) = opval
;
2100 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2115 CPU (h_xbit
) = opval
;
2116 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2120 SET_H_INSN_PREFIXED_P (opval
);
2121 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2158 BI opval
= LTSI (tmp_newval
, 0);
2159 CPU (h_nbit
) = opval
;
2160 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2175 CPU (h_xbit
) = opval
;
2176 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2180 SET_H_INSN_PREFIXED_P (opval
);
2181 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2217 BI opval
= LTSI (tmp_newval
, 0);
2218 CPU (h_nbit
) = opval
;
2219 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2234 CPU (h_xbit
) = opval
;
2235 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2239 SET_H_INSN_PREFIXED_P (opval
);
2240 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2295 BI opval
= LTSI (tmp_newval
, 0);
2296 CPU (h_nbit
) = opval
;
2297 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2312 CPU (h_xbit
) = opval
;
2313 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2317 SET_H_INSN_PREFIXED_P (opval
);
2318 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2374 BI opval
= LTSI (tmp_newval
, 0);
2375 CPU (h_nbit
) = opval
;
2376 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2391 CPU (h_xbit
) = opval
;
2392 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2396 SET_H_INSN_PREFIXED_P (opval
);
2397 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2434 BI opval
= LTSI (tmp_newval
, 0);
2435 CPU (h_nbit
) = opval
;
2436 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2451 CPU (h_xbit
) = opval
;
2452 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2456 SET_H_INSN_PREFIXED_P (opval
);
2457 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2493 BI opval
= LTSI (tmp_newval
, 0);
2494 CPU (h_nbit
) = opval
;
2495 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2510 CPU (h_xbit
) = opval
;
2511 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2515 SET_H_INSN_PREFIXED_P (opval
);
2516 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2568 BI opval
= LTQI (tmp_tmp
, 0);
2569 CPU (h_nbit
) = opval
;
2570 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2587 SET_H_INSN_PREFIXED_P (opval
);
2588 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2641 BI opval
= LTHI (tmp_tmp
, 0);
2642 CPU (h_nbit
) = opval
;
2643 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2660 SET_H_INSN_PREFIXED_P (opval
);
2661 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2710 BI opval
= LTSI (tmp_tmp
, 0);
2711 CPU (h_nbit
) = opval
;
2712 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2729 SET_H_INSN_PREFIXED_P (opval
);
2730 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2782 SET_H_GR (FLD (f_operand2
), opval
);
2783 written
|= (1 << 7);
2784 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2789 BI opval
= LTSI (tmp_tmp
, 0);
2790 CPU (h_nbit
) = opval
;
2791 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2808 SET_H_INSN_PREFIXED_P (opval
);
2809 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2861 SET_H_GR (FLD (f_operand2
), opval
);
2862 written
|= (1 << 7);
2863 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2868 BI opval
= LTSI (tmp_tmp
, 0);
2869 CPU (h_nbit
) = opval
;
2870 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2887 SET_H_INSN_PREFIXED_P (opval
);
2888 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2940 SET_H_GR (FLD (f_operand2
), opval
);
2941 written
|= (1 << 7);
2942 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2947 BI opval
= LTSI (tmp_tmp
, 0);
2948 CPU (h_nbit
) = opval
;
2949 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2966 SET_H_INSN_PREFIXED_P (opval
);
2967 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3019 SET_H_GR (FLD (f_operand2
), opval
);
3020 written
|= (1 << 7);
3021 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3026 BI opval
= LTSI (tmp_tmp
, 0);
3027 CPU (h_nbit
) = opval
;
3028 CGEN_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 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3045 SET_H_INSN_PREFIXED_P (opval
);
3046 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3085 CPU (h_xbit
) = opval
;
3086 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3090 SET_H_INSN_PREFIXED_P (opval
);
3091 CGEN_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);
3113 tmp_prno
= FLD (f_operand2
);
3114 tmp_newval
= GET_H_SR (FLD (f_operand2
));
3115 if (EQSI (tmp_prno
, 2)) {
3117 SI opval
= tmp_newval
;
3118 SET_H_GR (FLD (f_operand1
), opval
);
3119 written
|= (1 << 4);
3120 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3123 else if (EQSI (tmp_prno
, 3)) {
3126 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3128 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3129 SET_H_GR (FLD (f_operand1
), opval
);
3130 written
|= (1 << 4);
3131 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3135 else if (EQSI (tmp_prno
, 5)) {
3137 SI opval
= tmp_newval
;
3138 SET_H_GR (FLD (f_operand1
), opval
);
3139 written
|= (1 << 4);
3140 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3143 else if (EQSI (tmp_prno
, 6)) {
3145 SI opval
= tmp_newval
;
3146 SET_H_GR (FLD (f_operand1
), opval
);
3147 written
|= (1 << 4);
3148 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3151 else if (EQSI (tmp_prno
, 7)) {
3153 SI opval
= tmp_newval
;
3154 SET_H_GR (FLD (f_operand1
), opval
);
3155 written
|= (1 << 4);
3156 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3159 else if (EQSI (tmp_prno
, 9)) {
3161 SI opval
= tmp_newval
;
3162 SET_H_GR (FLD (f_operand1
), opval
);
3163 written
|= (1 << 4);
3164 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3167 else if (EQSI (tmp_prno
, 10)) {
3169 SI opval
= tmp_newval
;
3170 SET_H_GR (FLD (f_operand1
), opval
);
3171 written
|= (1 << 4);
3172 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3175 else if (EQSI (tmp_prno
, 11)) {
3177 SI opval
= tmp_newval
;
3178 SET_H_GR (FLD (f_operand1
), opval
);
3179 written
|= (1 << 4);
3180 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3183 else if (EQSI (tmp_prno
, 12)) {
3185 SI opval
= tmp_newval
;
3186 SET_H_GR (FLD (f_operand1
), opval
);
3187 written
|= (1 << 4);
3188 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3191 else if (EQSI (tmp_prno
, 13)) {
3193 SI opval
= tmp_newval
;
3194 SET_H_GR (FLD (f_operand1
), opval
);
3195 written
|= (1 << 4);
3196 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3199 else if (EQSI (tmp_prno
, 14)) {
3201 SI opval
= tmp_newval
;
3202 SET_H_GR (FLD (f_operand1
), opval
);
3203 written
|= (1 << 4);
3204 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3207 else if (EQSI (tmp_prno
, 15)) {
3209 SI opval
= tmp_newval
;
3210 SET_H_GR (FLD (f_operand1
), opval
);
3211 written
|= (1 << 4);
3212 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3215 else if (EQSI (tmp_prno
, 0)) {
3218 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3220 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3221 SET_H_GR (FLD (f_operand1
), opval
);
3222 written
|= (1 << 4);
3223 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3227 else if (EQSI (tmp_prno
, 1)) {
3230 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3232 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
3233 SET_H_GR (FLD (f_operand1
), opval
);
3234 written
|= (1 << 4);
3235 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3239 else if (EQSI (tmp_prno
, 4)) {
3242 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand1
));
3244 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
3245 SET_H_GR (FLD (f_operand1
), opval
);
3246 written
|= (1 << 4);
3247 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3251 else if (EQSI (tmp_prno
, 8)) {
3253 SI opval
= tmp_newval
;
3254 SET_H_GR (FLD (f_operand1
), opval
);
3255 written
|= (1 << 4);
3256 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3260 cgen_rtx_error (current_cpu
, "move-spr-r from unimplemented register");
3265 CPU (h_xbit
) = opval
;
3266 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3270 SET_H_INSN_PREFIXED_P (opval
);
3271 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3276 abuf
->written
= written
;
3281 CASE (sem
, INSN_MOVE_M_SPRV32
) : /* move [${Rs}${inc}],${Pd} */
3283 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3284 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3285 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3286 int UNUSED written
= 0;
3287 IADDR UNUSED pc
= abuf
->addr
;
3288 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3293 tmp_rno
= FLD (f_operand2
);
3294 if (EQSI (tmp_rno
, 2)) {
3295 tmp_newval
= ({ SI tmp_addr
;
3298 tmp_postinc
= FLD (f_memmode
);
3299 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3300 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3301 ; if (NEBI (tmp_postinc
, 0)) {
3303 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3304 tmp_addr
= ADDSI (tmp_addr
, 4);
3307 SI opval
= tmp_addr
;
3308 SET_H_GR (FLD (f_operand1
), opval
);
3309 written
|= (1 << 8);
3310 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3316 else if (EQSI (tmp_rno
, 3)) {
3317 tmp_newval
= EXTQISI (({ SI tmp_addr
;
3320 tmp_postinc
= FLD (f_memmode
);
3321 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3322 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
3323 ; if (NEBI (tmp_postinc
, 0)) {
3325 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3326 tmp_addr
= ADDSI (tmp_addr
, 1);
3329 SI opval
= tmp_addr
;
3330 SET_H_GR (FLD (f_operand1
), opval
);
3331 written
|= (1 << 8);
3332 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3338 else if (EQSI (tmp_rno
, 5)) {
3339 tmp_newval
= ({ SI tmp_addr
;
3342 tmp_postinc
= FLD (f_memmode
);
3343 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3344 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3345 ; if (NEBI (tmp_postinc
, 0)) {
3347 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3348 tmp_addr
= ADDSI (tmp_addr
, 4);
3351 SI opval
= tmp_addr
;
3352 SET_H_GR (FLD (f_operand1
), opval
);
3353 written
|= (1 << 8);
3354 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3360 else if (EQSI (tmp_rno
, 6)) {
3361 tmp_newval
= ({ SI tmp_addr
;
3364 tmp_postinc
= FLD (f_memmode
);
3365 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3366 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3367 ; if (NEBI (tmp_postinc
, 0)) {
3369 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3370 tmp_addr
= ADDSI (tmp_addr
, 4);
3373 SI opval
= tmp_addr
;
3374 SET_H_GR (FLD (f_operand1
), opval
);
3375 written
|= (1 << 8);
3376 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3382 else if (EQSI (tmp_rno
, 7)) {
3383 tmp_newval
= ({ SI tmp_addr
;
3386 tmp_postinc
= FLD (f_memmode
);
3387 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3388 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3389 ; if (NEBI (tmp_postinc
, 0)) {
3391 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3392 tmp_addr
= ADDSI (tmp_addr
, 4);
3395 SI opval
= tmp_addr
;
3396 SET_H_GR (FLD (f_operand1
), opval
);
3397 written
|= (1 << 8);
3398 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3404 else if (EQSI (tmp_rno
, 9)) {
3405 tmp_newval
= ({ SI tmp_addr
;
3408 tmp_postinc
= FLD (f_memmode
);
3409 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3410 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3411 ; if (NEBI (tmp_postinc
, 0)) {
3413 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3414 tmp_addr
= ADDSI (tmp_addr
, 4);
3417 SI opval
= tmp_addr
;
3418 SET_H_GR (FLD (f_operand1
), opval
);
3419 written
|= (1 << 8);
3420 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3426 else if (EQSI (tmp_rno
, 10)) {
3427 tmp_newval
= ({ SI tmp_addr
;
3430 tmp_postinc
= FLD (f_memmode
);
3431 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3432 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3433 ; if (NEBI (tmp_postinc
, 0)) {
3435 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3436 tmp_addr
= ADDSI (tmp_addr
, 4);
3439 SI opval
= tmp_addr
;
3440 SET_H_GR (FLD (f_operand1
), opval
);
3441 written
|= (1 << 8);
3442 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3448 else if (EQSI (tmp_rno
, 11)) {
3449 tmp_newval
= ({ SI tmp_addr
;
3452 tmp_postinc
= FLD (f_memmode
);
3453 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3454 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3455 ; if (NEBI (tmp_postinc
, 0)) {
3457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3458 tmp_addr
= ADDSI (tmp_addr
, 4);
3461 SI opval
= tmp_addr
;
3462 SET_H_GR (FLD (f_operand1
), opval
);
3463 written
|= (1 << 8);
3464 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3470 else if (EQSI (tmp_rno
, 12)) {
3471 tmp_newval
= ({ SI tmp_addr
;
3474 tmp_postinc
= FLD (f_memmode
);
3475 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3476 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3477 ; if (NEBI (tmp_postinc
, 0)) {
3479 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3480 tmp_addr
= ADDSI (tmp_addr
, 4);
3483 SI opval
= tmp_addr
;
3484 SET_H_GR (FLD (f_operand1
), opval
);
3485 written
|= (1 << 8);
3486 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3492 else if (EQSI (tmp_rno
, 13)) {
3493 tmp_newval
= ({ SI tmp_addr
;
3496 tmp_postinc
= FLD (f_memmode
);
3497 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3498 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3499 ; if (NEBI (tmp_postinc
, 0)) {
3501 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3502 tmp_addr
= ADDSI (tmp_addr
, 4);
3505 SI opval
= tmp_addr
;
3506 SET_H_GR (FLD (f_operand1
), opval
);
3507 written
|= (1 << 8);
3508 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3514 else if (EQSI (tmp_rno
, 14)) {
3515 tmp_newval
= ({ SI tmp_addr
;
3518 tmp_postinc
= FLD (f_memmode
);
3519 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3520 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3521 ; if (NEBI (tmp_postinc
, 0)) {
3523 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3524 tmp_addr
= ADDSI (tmp_addr
, 4);
3527 SI opval
= tmp_addr
;
3528 SET_H_GR (FLD (f_operand1
), opval
);
3529 written
|= (1 << 8);
3530 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3536 else if (EQSI (tmp_rno
, 15)) {
3537 tmp_newval
= ({ SI tmp_addr
;
3540 tmp_postinc
= FLD (f_memmode
);
3541 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3542 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3543 ; if (NEBI (tmp_postinc
, 0)) {
3545 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
3546 tmp_addr
= ADDSI (tmp_addr
, 4);
3549 SI opval
= tmp_addr
;
3550 SET_H_GR (FLD (f_operand1
), opval
);
3551 written
|= (1 << 8);
3552 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3559 cgen_rtx_error (current_cpu
, "Trying to set unimplemented special register");
3562 SI opval
= tmp_newval
;
3563 SET_H_SR (FLD (f_operand2
), opval
);
3564 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3569 CPU (h_xbit
) = opval
;
3570 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3574 SET_H_INSN_PREFIXED_P (opval
);
3575 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3580 abuf
->written
= written
;
3585 CASE (sem
, INSN_MOVE_C_SPRV32_P2
) : /* move ${const32},${Pd} */
3587 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3588 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3589 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3590 int UNUSED written
= 0;
3591 IADDR UNUSED pc
= abuf
->addr
;
3592 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3596 SI opval
= FLD (f_indir_pc__dword
);
3597 SET_H_SR (FLD (f_operand2
), opval
);
3598 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3603 CPU (h_xbit
) = opval
;
3604 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3608 SET_H_INSN_PREFIXED_P (opval
);
3609 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3618 CASE (sem
, INSN_MOVE_C_SPRV32_P3
) : /* move ${const32},${Pd} */
3620 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3621 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3622 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3623 int UNUSED written
= 0;
3624 IADDR UNUSED pc
= abuf
->addr
;
3625 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3629 SI opval
= FLD (f_indir_pc__dword
);
3630 SET_H_SR (FLD (f_operand2
), opval
);
3631 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3636 CPU (h_xbit
) = opval
;
3637 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3641 SET_H_INSN_PREFIXED_P (opval
);
3642 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3651 CASE (sem
, INSN_MOVE_C_SPRV32_P5
) : /* move ${const32},${Pd} */
3653 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3654 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3655 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3656 int UNUSED written
= 0;
3657 IADDR UNUSED pc
= abuf
->addr
;
3658 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3662 SI opval
= FLD (f_indir_pc__dword
);
3663 SET_H_SR (FLD (f_operand2
), opval
);
3664 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3669 CPU (h_xbit
) = opval
;
3670 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3674 SET_H_INSN_PREFIXED_P (opval
);
3675 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3684 CASE (sem
, INSN_MOVE_C_SPRV32_P6
) : /* move ${const32},${Pd} */
3686 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3687 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3688 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3689 int UNUSED written
= 0;
3690 IADDR UNUSED pc
= abuf
->addr
;
3691 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3695 SI opval
= FLD (f_indir_pc__dword
);
3696 SET_H_SR (FLD (f_operand2
), opval
);
3697 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3702 CPU (h_xbit
) = opval
;
3703 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3707 SET_H_INSN_PREFIXED_P (opval
);
3708 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3717 CASE (sem
, INSN_MOVE_C_SPRV32_P7
) : /* move ${const32},${Pd} */
3719 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3720 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3721 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3722 int UNUSED written
= 0;
3723 IADDR UNUSED pc
= abuf
->addr
;
3724 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3728 SI opval
= FLD (f_indir_pc__dword
);
3729 SET_H_SR (FLD (f_operand2
), opval
);
3730 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3735 CPU (h_xbit
) = opval
;
3736 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3740 SET_H_INSN_PREFIXED_P (opval
);
3741 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3750 CASE (sem
, INSN_MOVE_C_SPRV32_P9
) : /* move ${const32},${Pd} */
3752 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3753 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3754 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3755 int UNUSED written
= 0;
3756 IADDR UNUSED pc
= abuf
->addr
;
3757 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3761 SI opval
= FLD (f_indir_pc__dword
);
3762 SET_H_SR (FLD (f_operand2
), opval
);
3763 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3768 CPU (h_xbit
) = opval
;
3769 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3773 SET_H_INSN_PREFIXED_P (opval
);
3774 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3783 CASE (sem
, INSN_MOVE_C_SPRV32_P10
) : /* move ${const32},${Pd} */
3785 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3786 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3787 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3788 int UNUSED written
= 0;
3789 IADDR UNUSED pc
= abuf
->addr
;
3790 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3794 SI opval
= FLD (f_indir_pc__dword
);
3795 SET_H_SR (FLD (f_operand2
), opval
);
3796 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3801 CPU (h_xbit
) = opval
;
3802 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3806 SET_H_INSN_PREFIXED_P (opval
);
3807 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3816 CASE (sem
, INSN_MOVE_C_SPRV32_P11
) : /* move ${const32},${Pd} */
3818 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3819 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3820 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3821 int UNUSED written
= 0;
3822 IADDR UNUSED pc
= abuf
->addr
;
3823 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3827 SI opval
= FLD (f_indir_pc__dword
);
3828 SET_H_SR (FLD (f_operand2
), opval
);
3829 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3834 CPU (h_xbit
) = opval
;
3835 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3839 SET_H_INSN_PREFIXED_P (opval
);
3840 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3849 CASE (sem
, INSN_MOVE_C_SPRV32_P12
) : /* move ${const32},${Pd} */
3851 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3852 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3853 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3854 int UNUSED written
= 0;
3855 IADDR UNUSED pc
= abuf
->addr
;
3856 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3860 SI opval
= FLD (f_indir_pc__dword
);
3861 SET_H_SR (FLD (f_operand2
), opval
);
3862 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3867 CPU (h_xbit
) = opval
;
3868 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3872 SET_H_INSN_PREFIXED_P (opval
);
3873 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3882 CASE (sem
, INSN_MOVE_C_SPRV32_P13
) : /* move ${const32},${Pd} */
3884 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3885 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3886 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3887 int UNUSED written
= 0;
3888 IADDR UNUSED pc
= abuf
->addr
;
3889 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3893 SI opval
= FLD (f_indir_pc__dword
);
3894 SET_H_SR (FLD (f_operand2
), opval
);
3895 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3900 CPU (h_xbit
) = opval
;
3901 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3905 SET_H_INSN_PREFIXED_P (opval
);
3906 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3915 CASE (sem
, INSN_MOVE_C_SPRV32_P14
) : /* move ${const32},${Pd} */
3917 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3918 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3919 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3920 int UNUSED written
= 0;
3921 IADDR UNUSED pc
= abuf
->addr
;
3922 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3926 SI opval
= FLD (f_indir_pc__dword
);
3927 SET_H_SR (FLD (f_operand2
), opval
);
3928 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3933 CPU (h_xbit
) = opval
;
3934 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3938 SET_H_INSN_PREFIXED_P (opval
);
3939 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3948 CASE (sem
, INSN_MOVE_C_SPRV32_P15
) : /* move ${const32},${Pd} */
3950 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3951 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3952 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
3953 int UNUSED written
= 0;
3954 IADDR UNUSED pc
= abuf
->addr
;
3955 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
3959 SI opval
= FLD (f_indir_pc__dword
);
3960 SET_H_SR (FLD (f_operand2
), opval
);
3961 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3966 CPU (h_xbit
) = opval
;
3967 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3971 SET_H_INSN_PREFIXED_P (opval
);
3972 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3981 CASE (sem
, INSN_MOVE_SPR_MV32
) : /* move ${Ps},[${Rd-sfield}${inc}] */
3983 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3984 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3985 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3986 int UNUSED written
= 0;
3987 IADDR UNUSED pc
= abuf
->addr
;
3988 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3992 tmp_rno
= FLD (f_operand2
);
3993 if (EQSI (tmp_rno
, 2)) {
3997 tmp_postinc
= FLD (f_memmode
);
3998 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
3999 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4000 if (EQBI (CPU (h_pbit
), 0)) {
4003 SI opval
= GET_H_SR (FLD (f_operand2
));
4004 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4005 written
|= (1 << 13);
4006 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4009 BI opval
= CPU (h_pbit
);
4010 CPU (h_cbit
) = opval
;
4011 written
|= (1 << 10);
4012 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4018 CPU (h_cbit
) = opval
;
4019 written
|= (1 << 10);
4020 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4025 SI opval
= GET_H_SR (FLD (f_operand2
));
4026 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4027 written
|= (1 << 13);
4028 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4031 if (NEBI (tmp_postinc
, 0)) {
4033 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4034 tmp_addr
= ADDSI (tmp_addr
, 4);
4037 SI opval
= tmp_addr
;
4038 SET_H_GR (FLD (f_operand1
), opval
);
4039 written
|= (1 << 9);
4040 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4046 else if (EQSI (tmp_rno
, 3)) {
4050 tmp_postinc
= FLD (f_memmode
);
4051 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4052 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4053 if (EQBI (CPU (h_pbit
), 0)) {
4056 QI opval
= GET_H_SR (FLD (f_operand2
));
4057 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4058 written
|= (1 << 12);
4059 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4062 BI opval
= CPU (h_pbit
);
4063 CPU (h_cbit
) = opval
;
4064 written
|= (1 << 10);
4065 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4071 CPU (h_cbit
) = opval
;
4072 written
|= (1 << 10);
4073 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4078 QI opval
= GET_H_SR (FLD (f_operand2
));
4079 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4080 written
|= (1 << 12);
4081 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4084 if (NEBI (tmp_postinc
, 0)) {
4086 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4087 tmp_addr
= ADDSI (tmp_addr
, 1);
4090 SI opval
= tmp_addr
;
4091 SET_H_GR (FLD (f_operand1
), opval
);
4092 written
|= (1 << 9);
4093 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4099 else if (EQSI (tmp_rno
, 5)) {
4103 tmp_postinc
= FLD (f_memmode
);
4104 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4105 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4106 if (EQBI (CPU (h_pbit
), 0)) {
4109 SI opval
= GET_H_SR (FLD (f_operand2
));
4110 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4111 written
|= (1 << 13);
4112 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4115 BI opval
= CPU (h_pbit
);
4116 CPU (h_cbit
) = opval
;
4117 written
|= (1 << 10);
4118 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4124 CPU (h_cbit
) = opval
;
4125 written
|= (1 << 10);
4126 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4131 SI opval
= GET_H_SR (FLD (f_operand2
));
4132 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4133 written
|= (1 << 13);
4134 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4137 if (NEBI (tmp_postinc
, 0)) {
4139 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4140 tmp_addr
= ADDSI (tmp_addr
, 4);
4143 SI opval
= tmp_addr
;
4144 SET_H_GR (FLD (f_operand1
), opval
);
4145 written
|= (1 << 9);
4146 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4152 else if (EQSI (tmp_rno
, 6)) {
4156 tmp_postinc
= FLD (f_memmode
);
4157 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4158 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4159 if (EQBI (CPU (h_pbit
), 0)) {
4162 SI opval
= GET_H_SR (FLD (f_operand2
));
4163 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4164 written
|= (1 << 13);
4165 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4168 BI opval
= CPU (h_pbit
);
4169 CPU (h_cbit
) = opval
;
4170 written
|= (1 << 10);
4171 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4177 CPU (h_cbit
) = opval
;
4178 written
|= (1 << 10);
4179 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4184 SI opval
= GET_H_SR (FLD (f_operand2
));
4185 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4186 written
|= (1 << 13);
4187 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4190 if (NEBI (tmp_postinc
, 0)) {
4192 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4193 tmp_addr
= ADDSI (tmp_addr
, 4);
4196 SI opval
= tmp_addr
;
4197 SET_H_GR (FLD (f_operand1
), opval
);
4198 written
|= (1 << 9);
4199 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4205 else if (EQSI (tmp_rno
, 7)) {
4209 tmp_postinc
= FLD (f_memmode
);
4210 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4211 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4212 if (EQBI (CPU (h_pbit
), 0)) {
4215 SI opval
= GET_H_SR (FLD (f_operand2
));
4216 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4217 written
|= (1 << 13);
4218 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4221 BI opval
= CPU (h_pbit
);
4222 CPU (h_cbit
) = opval
;
4223 written
|= (1 << 10);
4224 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4230 CPU (h_cbit
) = opval
;
4231 written
|= (1 << 10);
4232 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4237 SI opval
= GET_H_SR (FLD (f_operand2
));
4238 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4239 written
|= (1 << 13);
4240 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4243 if (NEBI (tmp_postinc
, 0)) {
4245 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4246 tmp_addr
= ADDSI (tmp_addr
, 4);
4249 SI opval
= tmp_addr
;
4250 SET_H_GR (FLD (f_operand1
), opval
);
4251 written
|= (1 << 9);
4252 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4258 else if (EQSI (tmp_rno
, 9)) {
4262 tmp_postinc
= FLD (f_memmode
);
4263 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4264 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4265 if (EQBI (CPU (h_pbit
), 0)) {
4268 SI opval
= GET_H_SR (FLD (f_operand2
));
4269 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4270 written
|= (1 << 13);
4271 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4274 BI opval
= CPU (h_pbit
);
4275 CPU (h_cbit
) = opval
;
4276 written
|= (1 << 10);
4277 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4283 CPU (h_cbit
) = opval
;
4284 written
|= (1 << 10);
4285 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4290 SI opval
= GET_H_SR (FLD (f_operand2
));
4291 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4292 written
|= (1 << 13);
4293 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4296 if (NEBI (tmp_postinc
, 0)) {
4298 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4299 tmp_addr
= ADDSI (tmp_addr
, 4);
4302 SI opval
= tmp_addr
;
4303 SET_H_GR (FLD (f_operand1
), opval
);
4304 written
|= (1 << 9);
4305 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4311 else if (EQSI (tmp_rno
, 10)) {
4315 tmp_postinc
= FLD (f_memmode
);
4316 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4317 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4318 if (EQBI (CPU (h_pbit
), 0)) {
4321 SI opval
= GET_H_SR (FLD (f_operand2
));
4322 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4323 written
|= (1 << 13);
4324 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4327 BI opval
= CPU (h_pbit
);
4328 CPU (h_cbit
) = opval
;
4329 written
|= (1 << 10);
4330 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4336 CPU (h_cbit
) = opval
;
4337 written
|= (1 << 10);
4338 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4343 SI opval
= GET_H_SR (FLD (f_operand2
));
4344 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4345 written
|= (1 << 13);
4346 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4349 if (NEBI (tmp_postinc
, 0)) {
4351 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4352 tmp_addr
= ADDSI (tmp_addr
, 4);
4355 SI opval
= tmp_addr
;
4356 SET_H_GR (FLD (f_operand1
), opval
);
4357 written
|= (1 << 9);
4358 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4364 else if (EQSI (tmp_rno
, 11)) {
4368 tmp_postinc
= FLD (f_memmode
);
4369 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4370 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4371 if (EQBI (CPU (h_pbit
), 0)) {
4374 SI opval
= GET_H_SR (FLD (f_operand2
));
4375 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4376 written
|= (1 << 13);
4377 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4380 BI opval
= CPU (h_pbit
);
4381 CPU (h_cbit
) = opval
;
4382 written
|= (1 << 10);
4383 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4389 CPU (h_cbit
) = opval
;
4390 written
|= (1 << 10);
4391 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4396 SI opval
= GET_H_SR (FLD (f_operand2
));
4397 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4398 written
|= (1 << 13);
4399 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4402 if (NEBI (tmp_postinc
, 0)) {
4404 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4405 tmp_addr
= ADDSI (tmp_addr
, 4);
4408 SI opval
= tmp_addr
;
4409 SET_H_GR (FLD (f_operand1
), opval
);
4410 written
|= (1 << 9);
4411 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4417 else if (EQSI (tmp_rno
, 12)) {
4421 tmp_postinc
= FLD (f_memmode
);
4422 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4423 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4424 if (EQBI (CPU (h_pbit
), 0)) {
4427 SI opval
= GET_H_SR (FLD (f_operand2
));
4428 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4429 written
|= (1 << 13);
4430 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4433 BI opval
= CPU (h_pbit
);
4434 CPU (h_cbit
) = opval
;
4435 written
|= (1 << 10);
4436 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4442 CPU (h_cbit
) = opval
;
4443 written
|= (1 << 10);
4444 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4449 SI opval
= GET_H_SR (FLD (f_operand2
));
4450 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4451 written
|= (1 << 13);
4452 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4455 if (NEBI (tmp_postinc
, 0)) {
4457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4458 tmp_addr
= ADDSI (tmp_addr
, 4);
4461 SI opval
= tmp_addr
;
4462 SET_H_GR (FLD (f_operand1
), opval
);
4463 written
|= (1 << 9);
4464 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4470 else if (EQSI (tmp_rno
, 13)) {
4474 tmp_postinc
= FLD (f_memmode
);
4475 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4476 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4477 if (EQBI (CPU (h_pbit
), 0)) {
4480 SI opval
= GET_H_SR (FLD (f_operand2
));
4481 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4482 written
|= (1 << 13);
4483 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4486 BI opval
= CPU (h_pbit
);
4487 CPU (h_cbit
) = opval
;
4488 written
|= (1 << 10);
4489 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4495 CPU (h_cbit
) = opval
;
4496 written
|= (1 << 10);
4497 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4502 SI opval
= GET_H_SR (FLD (f_operand2
));
4503 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4504 written
|= (1 << 13);
4505 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4508 if (NEBI (tmp_postinc
, 0)) {
4510 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4511 tmp_addr
= ADDSI (tmp_addr
, 4);
4514 SI opval
= tmp_addr
;
4515 SET_H_GR (FLD (f_operand1
), opval
);
4516 written
|= (1 << 9);
4517 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4523 else if (EQSI (tmp_rno
, 14)) {
4527 tmp_postinc
= FLD (f_memmode
);
4528 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4529 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4530 if (EQBI (CPU (h_pbit
), 0)) {
4533 SI opval
= GET_H_SR (FLD (f_operand2
));
4534 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4535 written
|= (1 << 13);
4536 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4539 BI opval
= CPU (h_pbit
);
4540 CPU (h_cbit
) = opval
;
4541 written
|= (1 << 10);
4542 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4548 CPU (h_cbit
) = opval
;
4549 written
|= (1 << 10);
4550 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4555 SI opval
= GET_H_SR (FLD (f_operand2
));
4556 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4557 written
|= (1 << 13);
4558 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4561 if (NEBI (tmp_postinc
, 0)) {
4563 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4564 tmp_addr
= ADDSI (tmp_addr
, 4);
4567 SI opval
= tmp_addr
;
4568 SET_H_GR (FLD (f_operand1
), opval
);
4569 written
|= (1 << 9);
4570 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4576 else if (EQSI (tmp_rno
, 15)) {
4580 tmp_postinc
= FLD (f_memmode
);
4581 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4582 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4583 if (EQBI (CPU (h_pbit
), 0)) {
4586 SI opval
= GET_H_SR (FLD (f_operand2
));
4587 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4588 written
|= (1 << 13);
4589 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4592 BI opval
= CPU (h_pbit
);
4593 CPU (h_cbit
) = opval
;
4594 written
|= (1 << 10);
4595 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4601 CPU (h_cbit
) = opval
;
4602 written
|= (1 << 10);
4603 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4608 SI opval
= GET_H_SR (FLD (f_operand2
));
4609 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4610 written
|= (1 << 13);
4611 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4614 if (NEBI (tmp_postinc
, 0)) {
4616 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4617 tmp_addr
= ADDSI (tmp_addr
, 4);
4620 SI opval
= tmp_addr
;
4621 SET_H_GR (FLD (f_operand1
), opval
);
4622 written
|= (1 << 9);
4623 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4629 else if (EQSI (tmp_rno
, 0)) {
4633 tmp_postinc
= FLD (f_memmode
);
4634 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4635 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4636 if (EQBI (CPU (h_pbit
), 0)) {
4639 QI opval
= GET_H_SR (FLD (f_operand2
));
4640 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4641 written
|= (1 << 12);
4642 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4645 BI opval
= CPU (h_pbit
);
4646 CPU (h_cbit
) = opval
;
4647 written
|= (1 << 10);
4648 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4654 CPU (h_cbit
) = opval
;
4655 written
|= (1 << 10);
4656 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4661 QI opval
= GET_H_SR (FLD (f_operand2
));
4662 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4663 written
|= (1 << 12);
4664 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4667 if (NEBI (tmp_postinc
, 0)) {
4669 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4670 tmp_addr
= ADDSI (tmp_addr
, 1);
4673 SI opval
= tmp_addr
;
4674 SET_H_GR (FLD (f_operand1
), opval
);
4675 written
|= (1 << 9);
4676 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4682 else if (EQSI (tmp_rno
, 1)) {
4686 tmp_postinc
= FLD (f_memmode
);
4687 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4688 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4689 if (EQBI (CPU (h_pbit
), 0)) {
4692 QI opval
= GET_H_SR (FLD (f_operand2
));
4693 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4694 written
|= (1 << 12);
4695 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4698 BI opval
= CPU (h_pbit
);
4699 CPU (h_cbit
) = opval
;
4700 written
|= (1 << 10);
4701 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4707 CPU (h_cbit
) = opval
;
4708 written
|= (1 << 10);
4709 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4714 QI opval
= GET_H_SR (FLD (f_operand2
));
4715 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
4716 written
|= (1 << 12);
4717 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4720 if (NEBI (tmp_postinc
, 0)) {
4722 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4723 tmp_addr
= ADDSI (tmp_addr
, 1);
4726 SI opval
= tmp_addr
;
4727 SET_H_GR (FLD (f_operand1
), opval
);
4728 written
|= (1 << 9);
4729 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4735 else if (EQSI (tmp_rno
, 4)) {
4739 tmp_postinc
= FLD (f_memmode
);
4740 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4741 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4742 if (EQBI (CPU (h_pbit
), 0)) {
4745 HI opval
= GET_H_SR (FLD (f_operand2
));
4746 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4747 written
|= (1 << 11);
4748 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4751 BI opval
= CPU (h_pbit
);
4752 CPU (h_cbit
) = opval
;
4753 written
|= (1 << 10);
4754 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4760 CPU (h_cbit
) = opval
;
4761 written
|= (1 << 10);
4762 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4767 HI opval
= GET_H_SR (FLD (f_operand2
));
4768 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
4769 written
|= (1 << 11);
4770 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4773 if (NEBI (tmp_postinc
, 0)) {
4775 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4776 tmp_addr
= ADDSI (tmp_addr
, 2);
4779 SI opval
= tmp_addr
;
4780 SET_H_GR (FLD (f_operand1
), opval
);
4781 written
|= (1 << 9);
4782 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4788 else if (EQSI (tmp_rno
, 8)) {
4792 tmp_postinc
= FLD (f_memmode
);
4793 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
4794 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
4795 if (EQBI (CPU (h_pbit
), 0)) {
4798 SI opval
= GET_H_SR (FLD (f_operand2
));
4799 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4800 written
|= (1 << 13);
4801 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4804 BI opval
= CPU (h_pbit
);
4805 CPU (h_cbit
) = opval
;
4806 written
|= (1 << 10);
4807 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4813 CPU (h_cbit
) = opval
;
4814 written
|= (1 << 10);
4815 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
4820 SI opval
= GET_H_SR (FLD (f_operand2
));
4821 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4822 written
|= (1 << 13);
4823 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4826 if (NEBI (tmp_postinc
, 0)) {
4828 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
4829 tmp_addr
= ADDSI (tmp_addr
, 4);
4832 SI opval
= tmp_addr
;
4833 SET_H_GR (FLD (f_operand1
), opval
);
4834 written
|= (1 << 9);
4835 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4842 cgen_rtx_error (current_cpu
, "write from unimplemented special register");
4847 CPU (h_xbit
) = opval
;
4848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4852 SET_H_INSN_PREFIXED_P (opval
);
4853 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4858 abuf
->written
= written
;
4863 CASE (sem
, INSN_MOVE_SS_R
) : /* move ${Ss},${Rd-sfield} */
4865 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4866 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4867 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4868 int UNUSED written
= 0;
4869 IADDR UNUSED pc
= abuf
->addr
;
4870 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4874 SI opval
= GET_H_SUPR (FLD (f_operand2
));
4875 SET_H_GR (FLD (f_operand1
), opval
);
4876 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4881 CPU (h_xbit
) = opval
;
4882 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4886 SET_H_INSN_PREFIXED_P (opval
);
4887 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4896 CASE (sem
, INSN_MOVE_R_SS
) : /* move ${Rs},${Sd} */
4898 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4899 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4900 #define FLD(f) abuf->fields.sfmt_mcp.f
4901 int UNUSED written
= 0;
4902 IADDR UNUSED pc
= abuf
->addr
;
4903 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4907 SI opval
= GET_H_GR (FLD (f_operand1
));
4908 SET_H_SUPR (FLD (f_operand2
), opval
);
4909 CGEN_TRACE_RESULT (current_cpu
, abuf
, "supr", 'x', opval
);
4914 CPU (h_xbit
) = opval
;
4915 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
4919 SET_H_INSN_PREFIXED_P (opval
);
4920 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
4929 CASE (sem
, INSN_MOVEM_R_M_V32
) : /* movem ${Rs-dfield},[${Rd-sfield}${inc}] */
4931 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4932 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4933 #define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
4934 int UNUSED written
= 0;
4935 IADDR UNUSED pc
= abuf
->addr
;
4936 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4941 tmp_postinc
= FLD (f_memmode
);
4944 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
4946 tmp_addr
= GET_H_GR (FLD (f_operand1
));
4948 if (GESI (FLD (f_operand2
), 0)) {
4951 tmp_tmp
= GET_H_GR (((UINT
) 0));
4954 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4955 written
|= (1 << 21);
4956 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4958 tmp_addr
= ADDSI (tmp_addr
, 4);
4961 if (GESI (FLD (f_operand2
), 1)) {
4964 tmp_tmp
= GET_H_GR (((UINT
) 1));
4967 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4968 written
|= (1 << 21);
4969 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4971 tmp_addr
= ADDSI (tmp_addr
, 4);
4974 if (GESI (FLD (f_operand2
), 2)) {
4977 tmp_tmp
= GET_H_GR (((UINT
) 2));
4980 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4981 written
|= (1 << 21);
4982 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4984 tmp_addr
= ADDSI (tmp_addr
, 4);
4987 if (GESI (FLD (f_operand2
), 3)) {
4990 tmp_tmp
= GET_H_GR (((UINT
) 3));
4993 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4994 written
|= (1 << 21);
4995 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4997 tmp_addr
= ADDSI (tmp_addr
, 4);
5000 if (GESI (FLD (f_operand2
), 4)) {
5003 tmp_tmp
= GET_H_GR (((UINT
) 4));
5006 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5007 written
|= (1 << 21);
5008 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5010 tmp_addr
= ADDSI (tmp_addr
, 4);
5013 if (GESI (FLD (f_operand2
), 5)) {
5016 tmp_tmp
= GET_H_GR (((UINT
) 5));
5019 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5020 written
|= (1 << 21);
5021 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5023 tmp_addr
= ADDSI (tmp_addr
, 4);
5026 if (GESI (FLD (f_operand2
), 6)) {
5029 tmp_tmp
= GET_H_GR (((UINT
) 6));
5032 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5033 written
|= (1 << 21);
5034 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5036 tmp_addr
= ADDSI (tmp_addr
, 4);
5039 if (GESI (FLD (f_operand2
), 7)) {
5042 tmp_tmp
= GET_H_GR (((UINT
) 7));
5045 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5046 written
|= (1 << 21);
5047 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5049 tmp_addr
= ADDSI (tmp_addr
, 4);
5052 if (GESI (FLD (f_operand2
), 8)) {
5055 tmp_tmp
= GET_H_GR (((UINT
) 8));
5058 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5059 written
|= (1 << 21);
5060 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5062 tmp_addr
= ADDSI (tmp_addr
, 4);
5065 if (GESI (FLD (f_operand2
), 9)) {
5068 tmp_tmp
= GET_H_GR (((UINT
) 9));
5071 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5072 written
|= (1 << 21);
5073 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5075 tmp_addr
= ADDSI (tmp_addr
, 4);
5078 if (GESI (FLD (f_operand2
), 10)) {
5081 tmp_tmp
= GET_H_GR (((UINT
) 10));
5084 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5085 written
|= (1 << 21);
5086 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5088 tmp_addr
= ADDSI (tmp_addr
, 4);
5091 if (GESI (FLD (f_operand2
), 11)) {
5094 tmp_tmp
= GET_H_GR (((UINT
) 11));
5097 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5098 written
|= (1 << 21);
5099 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5101 tmp_addr
= ADDSI (tmp_addr
, 4);
5104 if (GESI (FLD (f_operand2
), 12)) {
5107 tmp_tmp
= GET_H_GR (((UINT
) 12));
5110 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5111 written
|= (1 << 21);
5112 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5114 tmp_addr
= ADDSI (tmp_addr
, 4);
5117 if (GESI (FLD (f_operand2
), 13)) {
5120 tmp_tmp
= GET_H_GR (((UINT
) 13));
5123 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5124 written
|= (1 << 21);
5125 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5127 tmp_addr
= ADDSI (tmp_addr
, 4);
5130 if (GESI (FLD (f_operand2
), 14)) {
5133 tmp_tmp
= GET_H_GR (((UINT
) 14));
5136 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5137 written
|= (1 << 21);
5138 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5140 tmp_addr
= ADDSI (tmp_addr
, 4);
5143 if (GESI (FLD (f_operand2
), 15)) {
5146 tmp_tmp
= GET_H_GR (((UINT
) 15));
5149 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5150 written
|= (1 << 21);
5151 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5153 tmp_addr
= ADDSI (tmp_addr
, 4);
5157 if (NEBI (tmp_postinc
, 0)) {
5159 SI opval
= tmp_addr
;
5160 SET_H_GR (FLD (f_operand1
), opval
);
5161 written
|= (1 << 20);
5162 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5168 CPU (h_xbit
) = opval
;
5169 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5173 SET_H_INSN_PREFIXED_P (opval
);
5174 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5179 abuf
->written
= written
;
5184 CASE (sem
, INSN_MOVEM_M_R_V32
) : /* movem [${Rs}${inc}],${Rd} */
5186 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5187 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5188 #define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
5189 int UNUSED written
= 0;
5190 IADDR UNUSED pc
= abuf
->addr
;
5191 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5196 tmp_postinc
= FLD (f_memmode
);
5197 tmp_addr
= GET_H_GR (FLD (f_operand1
));
5200 tmp_dummy
= GET_H_GR (FLD (f_operand2
));
5203 if (GESI (FLD (f_operand2
), 0)) {
5206 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5209 SET_H_GR (((UINT
) 0), opval
);
5210 written
|= (1 << 6);
5211 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5213 tmp_addr
= ADDSI (tmp_addr
, 4);
5216 if (GESI (FLD (f_operand2
), 1)) {
5219 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5222 SET_H_GR (((UINT
) 1), opval
);
5223 written
|= (1 << 7);
5224 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5226 tmp_addr
= ADDSI (tmp_addr
, 4);
5229 if (GESI (FLD (f_operand2
), 2)) {
5232 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5235 SET_H_GR (((UINT
) 2), opval
);
5236 written
|= (1 << 14);
5237 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5239 tmp_addr
= ADDSI (tmp_addr
, 4);
5242 if (GESI (FLD (f_operand2
), 3)) {
5245 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5248 SET_H_GR (((UINT
) 3), opval
);
5249 written
|= (1 << 15);
5250 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5252 tmp_addr
= ADDSI (tmp_addr
, 4);
5255 if (GESI (FLD (f_operand2
), 4)) {
5258 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5261 SET_H_GR (((UINT
) 4), opval
);
5262 written
|= (1 << 16);
5263 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5265 tmp_addr
= ADDSI (tmp_addr
, 4);
5268 if (GESI (FLD (f_operand2
), 5)) {
5271 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5274 SET_H_GR (((UINT
) 5), opval
);
5275 written
|= (1 << 17);
5276 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5278 tmp_addr
= ADDSI (tmp_addr
, 4);
5281 if (GESI (FLD (f_operand2
), 6)) {
5284 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5287 SET_H_GR (((UINT
) 6), opval
);
5288 written
|= (1 << 18);
5289 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5291 tmp_addr
= ADDSI (tmp_addr
, 4);
5294 if (GESI (FLD (f_operand2
), 7)) {
5297 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5300 SET_H_GR (((UINT
) 7), opval
);
5301 written
|= (1 << 19);
5302 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5304 tmp_addr
= ADDSI (tmp_addr
, 4);
5307 if (GESI (FLD (f_operand2
), 8)) {
5310 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5313 SET_H_GR (((UINT
) 8), opval
);
5314 written
|= (1 << 20);
5315 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5317 tmp_addr
= ADDSI (tmp_addr
, 4);
5320 if (GESI (FLD (f_operand2
), 9)) {
5323 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5326 SET_H_GR (((UINT
) 9), opval
);
5327 written
|= (1 << 21);
5328 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5330 tmp_addr
= ADDSI (tmp_addr
, 4);
5333 if (GESI (FLD (f_operand2
), 10)) {
5336 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5339 SET_H_GR (((UINT
) 10), opval
);
5340 written
|= (1 << 8);
5341 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5343 tmp_addr
= ADDSI (tmp_addr
, 4);
5346 if (GESI (FLD (f_operand2
), 11)) {
5349 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5352 SET_H_GR (((UINT
) 11), opval
);
5353 written
|= (1 << 9);
5354 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5356 tmp_addr
= ADDSI (tmp_addr
, 4);
5359 if (GESI (FLD (f_operand2
), 12)) {
5362 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5365 SET_H_GR (((UINT
) 12), opval
);
5366 written
|= (1 << 10);
5367 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5369 tmp_addr
= ADDSI (tmp_addr
, 4);
5372 if (GESI (FLD (f_operand2
), 13)) {
5375 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5378 SET_H_GR (((UINT
) 13), opval
);
5379 written
|= (1 << 11);
5380 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5382 tmp_addr
= ADDSI (tmp_addr
, 4);
5385 if (GESI (FLD (f_operand2
), 14)) {
5388 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5391 SET_H_GR (((UINT
) 14), opval
);
5392 written
|= (1 << 12);
5393 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5395 tmp_addr
= ADDSI (tmp_addr
, 4);
5398 if (GESI (FLD (f_operand2
), 15)) {
5401 tmp_tmp
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5404 SET_H_GR (((UINT
) 15), opval
);
5405 written
|= (1 << 13);
5406 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5408 tmp_addr
= ADDSI (tmp_addr
, 4);
5412 if (NEBI (tmp_postinc
, 0)) {
5414 SI opval
= tmp_addr
;
5415 SET_H_GR (FLD (f_operand1
), opval
);
5416 written
|= (1 << 5);
5417 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5423 CPU (h_xbit
) = opval
;
5424 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5428 SET_H_INSN_PREFIXED_P (opval
);
5429 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5434 abuf
->written
= written
;
5439 CASE (sem
, INSN_ADD_B_R
) : /* add.b $Rs,$Rd */
5441 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5442 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5443 #define FLD(f) abuf->fields.sfmt_addc_m.f
5444 int UNUSED written
= 0;
5445 IADDR UNUSED pc
= abuf
->addr
;
5446 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5453 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5454 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5455 tmp_carry
= CPU (h_cbit
);
5456 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5459 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5461 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5462 SET_H_GR (FLD (f_operand2
), opval
);
5463 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5468 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))));
5469 CPU (h_cbit
) = opval
;
5470 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5473 BI opval
= LTQI (tmp_newval
, 0);
5474 CPU (h_nbit
) = opval
;
5475 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5478 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5479 CPU (h_zbit
) = opval
;
5480 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5483 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)));
5484 CPU (h_vbit
) = opval
;
5485 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5490 CPU (h_xbit
) = opval
;
5491 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5495 SET_H_INSN_PREFIXED_P (opval
);
5496 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5506 CASE (sem
, INSN_ADD_W_R
) : /* add.w $Rs,$Rd */
5508 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5509 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5510 #define FLD(f) abuf->fields.sfmt_addc_m.f
5511 int UNUSED written
= 0;
5512 IADDR UNUSED pc
= abuf
->addr
;
5513 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5520 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5521 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5522 tmp_carry
= CPU (h_cbit
);
5523 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5526 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5528 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5529 SET_H_GR (FLD (f_operand2
), opval
);
5530 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5535 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))));
5536 CPU (h_cbit
) = opval
;
5537 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5540 BI opval
= LTHI (tmp_newval
, 0);
5541 CPU (h_nbit
) = opval
;
5542 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5545 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5546 CPU (h_zbit
) = opval
;
5547 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5550 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)));
5551 CPU (h_vbit
) = opval
;
5552 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5557 CPU (h_xbit
) = opval
;
5558 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5562 SET_H_INSN_PREFIXED_P (opval
);
5563 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5573 CASE (sem
, INSN_ADD_D_R
) : /* add.d $Rs,$Rd */
5575 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5576 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5577 #define FLD(f) abuf->fields.sfmt_addc_m.f
5578 int UNUSED written
= 0;
5579 IADDR UNUSED pc
= abuf
->addr
;
5580 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5587 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
5588 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5589 tmp_carry
= CPU (h_cbit
);
5590 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5592 SI opval
= tmp_newval
;
5593 SET_H_GR (FLD (f_operand2
), opval
);
5594 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5598 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))));
5599 CPU (h_cbit
) = opval
;
5600 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5603 BI opval
= LTSI (tmp_newval
, 0);
5604 CPU (h_nbit
) = opval
;
5605 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5608 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5609 CPU (h_zbit
) = opval
;
5610 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5613 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)));
5614 CPU (h_vbit
) = opval
;
5615 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5620 CPU (h_xbit
) = opval
;
5621 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5625 SET_H_INSN_PREFIXED_P (opval
);
5626 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5636 CASE (sem
, INSN_ADD_M_B_M
) : /* add-m.b [${Rs}${inc}],${Rd} */
5638 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5639 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5640 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5641 int UNUSED written
= 0;
5642 IADDR UNUSED pc
= abuf
->addr
;
5643 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5650 tmp_tmpops
= ({ SI tmp_addr
;
5653 tmp_postinc
= FLD (f_memmode
);
5654 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5655 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
5656 ; if (NEBI (tmp_postinc
, 0)) {
5658 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5659 tmp_addr
= ADDSI (tmp_addr
, 1);
5662 SI opval
= tmp_addr
;
5663 SET_H_GR (FLD (f_operand1
), opval
);
5664 written
|= (1 << 12);
5665 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5670 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5671 tmp_carry
= CPU (h_cbit
);
5672 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5675 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5677 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5678 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5679 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5684 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))));
5685 CPU (h_cbit
) = opval
;
5686 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5689 BI opval
= LTQI (tmp_newval
, 0);
5690 CPU (h_nbit
) = opval
;
5691 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5694 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5695 CPU (h_zbit
) = opval
;
5696 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5699 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)));
5700 CPU (h_vbit
) = opval
;
5701 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5706 CPU (h_xbit
) = opval
;
5707 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5711 SET_H_INSN_PREFIXED_P (opval
);
5712 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5718 abuf
->written
= written
;
5723 CASE (sem
, INSN_ADD_M_W_M
) : /* add-m.w [${Rs}${inc}],${Rd} */
5725 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5726 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5727 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5728 int UNUSED written
= 0;
5729 IADDR UNUSED pc
= abuf
->addr
;
5730 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5737 tmp_tmpops
= ({ SI tmp_addr
;
5740 tmp_postinc
= FLD (f_memmode
);
5741 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5742 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
5743 ; if (NEBI (tmp_postinc
, 0)) {
5745 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5746 tmp_addr
= ADDSI (tmp_addr
, 2);
5749 SI opval
= tmp_addr
;
5750 SET_H_GR (FLD (f_operand1
), opval
);
5751 written
|= (1 << 12);
5752 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5757 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5758 tmp_carry
= CPU (h_cbit
);
5759 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5762 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
5764 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5765 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5766 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5771 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))));
5772 CPU (h_cbit
) = opval
;
5773 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5776 BI opval
= LTHI (tmp_newval
, 0);
5777 CPU (h_nbit
) = opval
;
5778 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5781 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5782 CPU (h_zbit
) = opval
;
5783 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5786 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)));
5787 CPU (h_vbit
) = opval
;
5788 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5793 CPU (h_xbit
) = opval
;
5794 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5798 SET_H_INSN_PREFIXED_P (opval
);
5799 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5805 abuf
->written
= written
;
5810 CASE (sem
, INSN_ADD_M_D_M
) : /* add-m.d [${Rs}${inc}],${Rd} */
5812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5814 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
5815 int UNUSED written
= 0;
5816 IADDR UNUSED pc
= abuf
->addr
;
5817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5824 tmp_tmpops
= ({ SI tmp_addr
;
5827 tmp_postinc
= FLD (f_memmode
);
5828 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
5829 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
5830 ; if (NEBI (tmp_postinc
, 0)) {
5832 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
5833 tmp_addr
= ADDSI (tmp_addr
, 4);
5836 SI opval
= tmp_addr
;
5837 SET_H_GR (FLD (f_operand1
), opval
);
5838 written
|= (1 << 11);
5839 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5844 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5845 tmp_carry
= CPU (h_cbit
);
5846 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5848 SI opval
= tmp_newval
;
5849 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
5850 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5854 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))));
5855 CPU (h_cbit
) = opval
;
5856 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5859 BI opval
= LTSI (tmp_newval
, 0);
5860 CPU (h_nbit
) = opval
;
5861 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5864 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5865 CPU (h_zbit
) = opval
;
5866 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5869 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)));
5870 CPU (h_vbit
) = opval
;
5871 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5876 CPU (h_xbit
) = opval
;
5877 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5881 SET_H_INSN_PREFIXED_P (opval
);
5882 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5888 abuf
->written
= written
;
5893 CASE (sem
, INSN_ADDCBR
) : /* add.b ${sconst8}],${Rd} */
5895 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5896 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5897 #define FLD(f) abuf->fields.sfmt_addcbr.f
5898 int UNUSED written
= 0;
5899 IADDR UNUSED pc
= abuf
->addr
;
5900 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5907 tmp_tmpops
= FLD (f_indir_pc__byte
);
5908 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5909 tmp_carry
= CPU (h_cbit
);
5910 tmp_newval
= ADDCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5913 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5915 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
5916 SET_H_GR (FLD (f_operand2
), opval
);
5917 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5922 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))));
5923 CPU (h_cbit
) = opval
;
5924 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5927 BI opval
= LTQI (tmp_newval
, 0);
5928 CPU (h_nbit
) = opval
;
5929 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5932 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
5933 CPU (h_zbit
) = opval
;
5934 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
5937 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)));
5938 CPU (h_vbit
) = opval
;
5939 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
5944 CPU (h_xbit
) = opval
;
5945 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
5949 SET_H_INSN_PREFIXED_P (opval
);
5950 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
5960 CASE (sem
, INSN_ADDCWR
) : /* add.w ${sconst16}],${Rd} */
5962 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5963 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5964 #define FLD(f) abuf->fields.sfmt_addcwr.f
5965 int UNUSED written
= 0;
5966 IADDR UNUSED pc
= abuf
->addr
;
5967 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5974 tmp_tmpops
= FLD (f_indir_pc__word
);
5975 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
5976 tmp_carry
= CPU (h_cbit
);
5977 tmp_newval
= ADDCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
5980 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
5982 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
5983 SET_H_GR (FLD (f_operand2
), opval
);
5984 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5989 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))));
5990 CPU (h_cbit
) = opval
;
5991 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
5994 BI opval
= LTHI (tmp_newval
, 0);
5995 CPU (h_nbit
) = opval
;
5996 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
5999 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6000 CPU (h_zbit
) = opval
;
6001 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6004 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)));
6005 CPU (h_vbit
) = opval
;
6006 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6011 CPU (h_xbit
) = opval
;
6012 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6016 SET_H_INSN_PREFIXED_P (opval
);
6017 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6027 CASE (sem
, INSN_ADDCDR
) : /* add.d ${const32}],${Rd} */
6029 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6031 #define FLD(f) abuf->fields.sfmt_addcdr.f
6032 int UNUSED written
= 0;
6033 IADDR UNUSED pc
= abuf
->addr
;
6034 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
6041 tmp_tmpops
= FLD (f_indir_pc__dword
);
6042 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6043 tmp_carry
= CPU (h_cbit
);
6044 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6046 SI opval
= tmp_newval
;
6047 SET_H_GR (FLD (f_operand2
), opval
);
6048 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6052 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))));
6053 CPU (h_cbit
) = opval
;
6054 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6057 BI opval
= LTSI (tmp_newval
, 0);
6058 CPU (h_nbit
) = opval
;
6059 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6062 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6063 CPU (h_zbit
) = opval
;
6064 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6067 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)));
6068 CPU (h_vbit
) = opval
;
6069 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6074 CPU (h_xbit
) = opval
;
6075 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6079 SET_H_INSN_PREFIXED_P (opval
);
6080 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6090 CASE (sem
, INSN_ADDS_B_R
) : /* adds.b $Rs,$Rd */
6092 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6093 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6094 #define FLD(f) abuf->fields.sfmt_addc_m.f
6095 int UNUSED written
= 0;
6096 IADDR UNUSED pc
= abuf
->addr
;
6097 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6104 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6105 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6106 tmp_carry
= CPU (h_cbit
);
6107 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6109 SI opval
= tmp_newval
;
6110 SET_H_GR (FLD (f_operand2
), opval
);
6111 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6115 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))));
6116 CPU (h_cbit
) = opval
;
6117 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6120 BI opval
= LTSI (tmp_newval
, 0);
6121 CPU (h_nbit
) = opval
;
6122 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6125 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6126 CPU (h_zbit
) = opval
;
6127 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6130 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)));
6131 CPU (h_vbit
) = opval
;
6132 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6137 CPU (h_xbit
) = opval
;
6138 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6142 SET_H_INSN_PREFIXED_P (opval
);
6143 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6153 CASE (sem
, INSN_ADDS_W_R
) : /* adds.w $Rs,$Rd */
6155 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6156 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6157 #define FLD(f) abuf->fields.sfmt_addc_m.f
6158 int UNUSED written
= 0;
6159 IADDR UNUSED pc
= abuf
->addr
;
6160 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6167 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6168 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6169 tmp_carry
= CPU (h_cbit
);
6170 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6172 SI opval
= tmp_newval
;
6173 SET_H_GR (FLD (f_operand2
), opval
);
6174 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6178 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))));
6179 CPU (h_cbit
) = opval
;
6180 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6183 BI opval
= LTSI (tmp_newval
, 0);
6184 CPU (h_nbit
) = opval
;
6185 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6188 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6189 CPU (h_zbit
) = opval
;
6190 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6193 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)));
6194 CPU (h_vbit
) = opval
;
6195 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6200 CPU (h_xbit
) = opval
;
6201 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6205 SET_H_INSN_PREFIXED_P (opval
);
6206 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6216 CASE (sem
, INSN_ADDS_M_B_M
) : /* adds-m.b [${Rs}${inc}],$Rd */
6218 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6219 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6220 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6221 int UNUSED written
= 0;
6222 IADDR UNUSED pc
= abuf
->addr
;
6223 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6230 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
6233 tmp_postinc
= FLD (f_memmode
);
6234 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6235 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6236 ; if (NEBI (tmp_postinc
, 0)) {
6238 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6239 tmp_addr
= ADDSI (tmp_addr
, 1);
6242 SI opval
= tmp_addr
;
6243 SET_H_GR (FLD (f_operand1
), opval
);
6244 written
|= (1 << 11);
6245 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6250 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6251 tmp_carry
= CPU (h_cbit
);
6252 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6254 SI opval
= tmp_newval
;
6255 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6256 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6260 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))));
6261 CPU (h_cbit
) = opval
;
6262 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6265 BI opval
= LTSI (tmp_newval
, 0);
6266 CPU (h_nbit
) = opval
;
6267 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6270 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6271 CPU (h_zbit
) = opval
;
6272 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6275 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)));
6276 CPU (h_vbit
) = opval
;
6277 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6282 CPU (h_xbit
) = opval
;
6283 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6287 SET_H_INSN_PREFIXED_P (opval
);
6288 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6294 abuf
->written
= written
;
6299 CASE (sem
, INSN_ADDS_M_W_M
) : /* adds-m.w [${Rs}${inc}],$Rd */
6301 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6302 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6303 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6304 int UNUSED written
= 0;
6305 IADDR UNUSED pc
= abuf
->addr
;
6306 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6313 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
6316 tmp_postinc
= FLD (f_memmode
);
6317 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6318 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6319 ; if (NEBI (tmp_postinc
, 0)) {
6321 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6322 tmp_addr
= ADDSI (tmp_addr
, 2);
6325 SI opval
= tmp_addr
;
6326 SET_H_GR (FLD (f_operand1
), opval
);
6327 written
|= (1 << 11);
6328 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6333 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6334 tmp_carry
= CPU (h_cbit
);
6335 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6337 SI opval
= tmp_newval
;
6338 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6339 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6343 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))));
6344 CPU (h_cbit
) = opval
;
6345 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6348 BI opval
= LTSI (tmp_newval
, 0);
6349 CPU (h_nbit
) = opval
;
6350 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6353 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6354 CPU (h_zbit
) = opval
;
6355 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6358 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)));
6359 CPU (h_vbit
) = opval
;
6360 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6365 CPU (h_xbit
) = opval
;
6366 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6370 SET_H_INSN_PREFIXED_P (opval
);
6371 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6377 abuf
->written
= written
;
6382 CASE (sem
, INSN_ADDSCBR
) : /* [${Rs}${inc}],$Rd */
6384 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6385 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6386 #define FLD(f) abuf->fields.sfmt_addcbr.f
6387 int UNUSED written
= 0;
6388 IADDR UNUSED pc
= abuf
->addr
;
6389 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6396 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6397 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6398 tmp_carry
= CPU (h_cbit
);
6399 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6401 SI opval
= tmp_newval
;
6402 SET_H_GR (FLD (f_operand2
), opval
);
6403 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6407 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))));
6408 CPU (h_cbit
) = opval
;
6409 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6412 BI opval
= LTSI (tmp_newval
, 0);
6413 CPU (h_nbit
) = opval
;
6414 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6417 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6418 CPU (h_zbit
) = opval
;
6419 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6422 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)));
6423 CPU (h_vbit
) = opval
;
6424 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6429 CPU (h_xbit
) = opval
;
6430 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6434 SET_H_INSN_PREFIXED_P (opval
);
6435 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6445 CASE (sem
, INSN_ADDSCWR
) : /* [${Rs}${inc}],$Rd */
6447 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6448 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6449 #define FLD(f) abuf->fields.sfmt_addcwr.f
6450 int UNUSED written
= 0;
6451 IADDR UNUSED pc
= abuf
->addr
;
6452 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6459 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6460 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6461 tmp_carry
= CPU (h_cbit
);
6462 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6464 SI opval
= tmp_newval
;
6465 SET_H_GR (FLD (f_operand2
), opval
);
6466 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6470 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))));
6471 CPU (h_cbit
) = opval
;
6472 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6475 BI opval
= LTSI (tmp_newval
, 0);
6476 CPU (h_nbit
) = opval
;
6477 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6480 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6481 CPU (h_zbit
) = opval
;
6482 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6485 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)));
6486 CPU (h_vbit
) = opval
;
6487 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6492 CPU (h_xbit
) = opval
;
6493 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6497 SET_H_INSN_PREFIXED_P (opval
);
6498 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6508 CASE (sem
, INSN_ADDU_B_R
) : /* addu.b $Rs,$Rd */
6510 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6511 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6512 #define FLD(f) abuf->fields.sfmt_addc_m.f
6513 int UNUSED written
= 0;
6514 IADDR UNUSED pc
= abuf
->addr
;
6515 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6522 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
6523 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6524 tmp_carry
= CPU (h_cbit
);
6525 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6527 SI opval
= tmp_newval
;
6528 SET_H_GR (FLD (f_operand2
), opval
);
6529 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6533 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))));
6534 CPU (h_cbit
) = opval
;
6535 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6538 BI opval
= LTSI (tmp_newval
, 0);
6539 CPU (h_nbit
) = opval
;
6540 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6543 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6544 CPU (h_zbit
) = opval
;
6545 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6548 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)));
6549 CPU (h_vbit
) = opval
;
6550 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6555 CPU (h_xbit
) = opval
;
6556 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6560 SET_H_INSN_PREFIXED_P (opval
);
6561 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6571 CASE (sem
, INSN_ADDU_W_R
) : /* addu.w $Rs,$Rd */
6573 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6574 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6575 #define FLD(f) abuf->fields.sfmt_addc_m.f
6576 int UNUSED written
= 0;
6577 IADDR UNUSED pc
= abuf
->addr
;
6578 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6585 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
6586 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6587 tmp_carry
= CPU (h_cbit
);
6588 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6590 SI opval
= tmp_newval
;
6591 SET_H_GR (FLD (f_operand2
), opval
);
6592 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6596 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))));
6597 CPU (h_cbit
) = opval
;
6598 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6601 BI opval
= LTSI (tmp_newval
, 0);
6602 CPU (h_nbit
) = opval
;
6603 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6606 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6607 CPU (h_zbit
) = opval
;
6608 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6611 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)));
6612 CPU (h_vbit
) = opval
;
6613 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6618 CPU (h_xbit
) = opval
;
6619 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6623 SET_H_INSN_PREFIXED_P (opval
);
6624 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6634 CASE (sem
, INSN_ADDU_M_B_M
) : /* addu-m.b [${Rs}${inc}],$Rd */
6636 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6637 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6638 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6639 int UNUSED written
= 0;
6640 IADDR UNUSED pc
= abuf
->addr
;
6641 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6648 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
6651 tmp_postinc
= FLD (f_memmode
);
6652 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6653 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
6654 ; if (NEBI (tmp_postinc
, 0)) {
6656 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6657 tmp_addr
= ADDSI (tmp_addr
, 1);
6660 SI opval
= tmp_addr
;
6661 SET_H_GR (FLD (f_operand1
), opval
);
6662 written
|= (1 << 11);
6663 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6668 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6669 tmp_carry
= CPU (h_cbit
);
6670 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6672 SI opval
= tmp_newval
;
6673 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6674 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6678 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))));
6679 CPU (h_cbit
) = opval
;
6680 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6683 BI opval
= LTSI (tmp_newval
, 0);
6684 CPU (h_nbit
) = opval
;
6685 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6688 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6689 CPU (h_zbit
) = opval
;
6690 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6693 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)));
6694 CPU (h_vbit
) = opval
;
6695 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6700 CPU (h_xbit
) = opval
;
6701 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6705 SET_H_INSN_PREFIXED_P (opval
);
6706 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6712 abuf
->written
= written
;
6717 CASE (sem
, INSN_ADDU_M_W_M
) : /* addu-m.w [${Rs}${inc}],$Rd */
6719 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6720 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6721 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
6722 int UNUSED written
= 0;
6723 IADDR UNUSED pc
= abuf
->addr
;
6724 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6731 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
6734 tmp_postinc
= FLD (f_memmode
);
6735 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
6736 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
6737 ; if (NEBI (tmp_postinc
, 0)) {
6739 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
6740 tmp_addr
= ADDSI (tmp_addr
, 2);
6743 SI opval
= tmp_addr
;
6744 SET_H_GR (FLD (f_operand1
), opval
);
6745 written
|= (1 << 11);
6746 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6751 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6752 tmp_carry
= CPU (h_cbit
);
6753 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6755 SI opval
= tmp_newval
;
6756 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
6757 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6761 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))));
6762 CPU (h_cbit
) = opval
;
6763 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6766 BI opval
= LTSI (tmp_newval
, 0);
6767 CPU (h_nbit
) = opval
;
6768 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6771 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6772 CPU (h_zbit
) = opval
;
6773 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6776 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)));
6777 CPU (h_vbit
) = opval
;
6778 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6783 CPU (h_xbit
) = opval
;
6784 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6788 SET_H_INSN_PREFIXED_P (opval
);
6789 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6795 abuf
->written
= written
;
6800 CASE (sem
, INSN_ADDUCBR
) : /* [${Rs}${inc}],$Rd */
6802 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6803 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6804 #define FLD(f) abuf->fields.sfmt_addcbr.f
6805 int UNUSED written
= 0;
6806 IADDR UNUSED pc
= abuf
->addr
;
6807 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6814 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
6815 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6816 tmp_carry
= CPU (h_cbit
);
6817 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6819 SI opval
= tmp_newval
;
6820 SET_H_GR (FLD (f_operand2
), opval
);
6821 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6825 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))));
6826 CPU (h_cbit
) = opval
;
6827 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6830 BI opval
= LTSI (tmp_newval
, 0);
6831 CPU (h_nbit
) = opval
;
6832 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6835 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6836 CPU (h_zbit
) = opval
;
6837 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6840 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)));
6841 CPU (h_vbit
) = opval
;
6842 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6847 CPU (h_xbit
) = opval
;
6848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6852 SET_H_INSN_PREFIXED_P (opval
);
6853 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6863 CASE (sem
, INSN_ADDUCWR
) : /* [${Rs}${inc}],$Rd */
6865 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6866 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6867 #define FLD(f) abuf->fields.sfmt_addcwr.f
6868 int UNUSED written
= 0;
6869 IADDR UNUSED pc
= abuf
->addr
;
6870 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
6877 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
6878 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6879 tmp_carry
= CPU (h_cbit
);
6880 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6882 SI opval
= tmp_newval
;
6883 SET_H_GR (FLD (f_operand2
), opval
);
6884 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6888 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))));
6889 CPU (h_cbit
) = opval
;
6890 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6893 BI opval
= LTSI (tmp_newval
, 0);
6894 CPU (h_nbit
) = opval
;
6895 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6898 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6899 CPU (h_zbit
) = opval
;
6900 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6903 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)));
6904 CPU (h_vbit
) = opval
;
6905 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6910 CPU (h_xbit
) = opval
;
6911 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6915 SET_H_INSN_PREFIXED_P (opval
);
6916 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6926 CASE (sem
, INSN_SUB_B_R
) : /* sub.b $Rs,$Rd */
6928 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6929 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6930 #define FLD(f) abuf->fields.sfmt_addc_m.f
6931 int UNUSED written
= 0;
6932 IADDR UNUSED pc
= abuf
->addr
;
6933 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6940 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
6941 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
6942 tmp_carry
= CPU (h_cbit
);
6943 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
6946 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
6948 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
6949 SET_H_GR (FLD (f_operand2
), opval
);
6950 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6955 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))));
6956 CPU (h_cbit
) = opval
;
6957 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
6960 BI opval
= LTQI (tmp_newval
, 0);
6961 CPU (h_nbit
) = opval
;
6962 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
6965 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
6966 CPU (h_zbit
) = opval
;
6967 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
6970 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)));
6971 CPU (h_vbit
) = opval
;
6972 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
6977 CPU (h_xbit
) = opval
;
6978 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
6982 SET_H_INSN_PREFIXED_P (opval
);
6983 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
6993 CASE (sem
, INSN_SUB_W_R
) : /* sub.w $Rs,$Rd */
6995 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6996 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6997 #define FLD(f) abuf->fields.sfmt_addc_m.f
6998 int UNUSED written
= 0;
6999 IADDR UNUSED pc
= abuf
->addr
;
7000 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7007 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7008 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7009 tmp_carry
= CPU (h_cbit
);
7010 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7013 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7015 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7016 SET_H_GR (FLD (f_operand2
), opval
);
7017 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7022 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))));
7023 CPU (h_cbit
) = opval
;
7024 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7027 BI opval
= LTHI (tmp_newval
, 0);
7028 CPU (h_nbit
) = opval
;
7029 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7032 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7033 CPU (h_zbit
) = opval
;
7034 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7037 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)));
7038 CPU (h_vbit
) = opval
;
7039 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7044 CPU (h_xbit
) = opval
;
7045 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7049 SET_H_INSN_PREFIXED_P (opval
);
7050 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7060 CASE (sem
, INSN_SUB_D_R
) : /* sub.d $Rs,$Rd */
7062 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7063 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7064 #define FLD(f) abuf->fields.sfmt_addc_m.f
7065 int UNUSED written
= 0;
7066 IADDR UNUSED pc
= abuf
->addr
;
7067 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7074 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
7075 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7076 tmp_carry
= CPU (h_cbit
);
7077 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7079 SI opval
= tmp_newval
;
7080 SET_H_GR (FLD (f_operand2
), opval
);
7081 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7085 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))));
7086 CPU (h_cbit
) = opval
;
7087 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7090 BI opval
= LTSI (tmp_newval
, 0);
7091 CPU (h_nbit
) = opval
;
7092 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7095 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7096 CPU (h_zbit
) = opval
;
7097 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7100 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)));
7101 CPU (h_vbit
) = opval
;
7102 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7107 CPU (h_xbit
) = opval
;
7108 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7112 SET_H_INSN_PREFIXED_P (opval
);
7113 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7123 CASE (sem
, INSN_SUB_M_B_M
) : /* sub-m.b [${Rs}${inc}],${Rd} */
7125 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7126 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7127 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7128 int UNUSED written
= 0;
7129 IADDR UNUSED pc
= abuf
->addr
;
7130 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7137 tmp_tmpops
= ({ SI tmp_addr
;
7140 tmp_postinc
= FLD (f_memmode
);
7141 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7142 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7143 ; if (NEBI (tmp_postinc
, 0)) {
7145 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7146 tmp_addr
= ADDSI (tmp_addr
, 1);
7149 SI opval
= tmp_addr
;
7150 SET_H_GR (FLD (f_operand1
), opval
);
7151 written
|= (1 << 12);
7152 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7157 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7158 tmp_carry
= CPU (h_cbit
);
7159 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7162 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7164 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7165 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7166 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7171 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))));
7172 CPU (h_cbit
) = opval
;
7173 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7176 BI opval
= LTQI (tmp_newval
, 0);
7177 CPU (h_nbit
) = opval
;
7178 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7181 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7182 CPU (h_zbit
) = opval
;
7183 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7186 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)));
7187 CPU (h_vbit
) = opval
;
7188 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7193 CPU (h_xbit
) = opval
;
7194 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7198 SET_H_INSN_PREFIXED_P (opval
);
7199 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7205 abuf
->written
= written
;
7210 CASE (sem
, INSN_SUB_M_W_M
) : /* sub-m.w [${Rs}${inc}],${Rd} */
7212 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7213 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7214 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7215 int UNUSED written
= 0;
7216 IADDR UNUSED pc
= abuf
->addr
;
7217 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7224 tmp_tmpops
= ({ SI tmp_addr
;
7227 tmp_postinc
= FLD (f_memmode
);
7228 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7229 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7230 ; if (NEBI (tmp_postinc
, 0)) {
7232 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7233 tmp_addr
= ADDSI (tmp_addr
, 2);
7236 SI opval
= tmp_addr
;
7237 SET_H_GR (FLD (f_operand1
), opval
);
7238 written
|= (1 << 12);
7239 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7244 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7245 tmp_carry
= CPU (h_cbit
);
7246 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7249 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
7251 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7252 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7253 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7258 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))));
7259 CPU (h_cbit
) = opval
;
7260 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7263 BI opval
= LTHI (tmp_newval
, 0);
7264 CPU (h_nbit
) = opval
;
7265 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7268 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7269 CPU (h_zbit
) = opval
;
7270 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7273 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)));
7274 CPU (h_vbit
) = opval
;
7275 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7280 CPU (h_xbit
) = opval
;
7281 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7285 SET_H_INSN_PREFIXED_P (opval
);
7286 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7292 abuf
->written
= written
;
7297 CASE (sem
, INSN_SUB_M_D_M
) : /* sub-m.d [${Rs}${inc}],${Rd} */
7299 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7300 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7301 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7302 int UNUSED written
= 0;
7303 IADDR UNUSED pc
= abuf
->addr
;
7304 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7311 tmp_tmpops
= ({ SI tmp_addr
;
7314 tmp_postinc
= FLD (f_memmode
);
7315 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7316 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
7317 ; if (NEBI (tmp_postinc
, 0)) {
7319 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7320 tmp_addr
= ADDSI (tmp_addr
, 4);
7323 SI opval
= tmp_addr
;
7324 SET_H_GR (FLD (f_operand1
), opval
);
7325 written
|= (1 << 11);
7326 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7331 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7332 tmp_carry
= CPU (h_cbit
);
7333 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7335 SI opval
= tmp_newval
;
7336 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7337 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7341 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))));
7342 CPU (h_cbit
) = opval
;
7343 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7346 BI opval
= LTSI (tmp_newval
, 0);
7347 CPU (h_nbit
) = opval
;
7348 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7351 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7352 CPU (h_zbit
) = opval
;
7353 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7356 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)));
7357 CPU (h_vbit
) = opval
;
7358 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7363 CPU (h_xbit
) = opval
;
7364 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7368 SET_H_INSN_PREFIXED_P (opval
);
7369 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7375 abuf
->written
= written
;
7380 CASE (sem
, INSN_SUBCBR
) : /* sub.b ${sconst8}],${Rd} */
7382 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7383 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7384 #define FLD(f) abuf->fields.sfmt_addcbr.f
7385 int UNUSED written
= 0;
7386 IADDR UNUSED pc
= abuf
->addr
;
7387 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7394 tmp_tmpops
= FLD (f_indir_pc__byte
);
7395 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7396 tmp_carry
= CPU (h_cbit
);
7397 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7400 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7402 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
7403 SET_H_GR (FLD (f_operand2
), opval
);
7404 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7409 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))));
7410 CPU (h_cbit
) = opval
;
7411 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7414 BI opval
= LTQI (tmp_newval
, 0);
7415 CPU (h_nbit
) = opval
;
7416 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7419 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7420 CPU (h_zbit
) = opval
;
7421 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7424 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)));
7425 CPU (h_vbit
) = opval
;
7426 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7431 CPU (h_xbit
) = opval
;
7432 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7436 SET_H_INSN_PREFIXED_P (opval
);
7437 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7447 CASE (sem
, INSN_SUBCWR
) : /* sub.w ${sconst16}],${Rd} */
7449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7451 #define FLD(f) abuf->fields.sfmt_addcwr.f
7452 int UNUSED written
= 0;
7453 IADDR UNUSED pc
= abuf
->addr
;
7454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7461 tmp_tmpops
= FLD (f_indir_pc__word
);
7462 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7463 tmp_carry
= CPU (h_cbit
);
7464 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7467 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
7469 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
7470 SET_H_GR (FLD (f_operand2
), opval
);
7471 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7476 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))));
7477 CPU (h_cbit
) = opval
;
7478 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7481 BI opval
= LTHI (tmp_newval
, 0);
7482 CPU (h_nbit
) = opval
;
7483 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7486 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7487 CPU (h_zbit
) = opval
;
7488 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7491 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)));
7492 CPU (h_vbit
) = opval
;
7493 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7498 CPU (h_xbit
) = opval
;
7499 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7503 SET_H_INSN_PREFIXED_P (opval
);
7504 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7514 CASE (sem
, INSN_SUBCDR
) : /* sub.d ${const32}],${Rd} */
7516 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7517 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7518 #define FLD(f) abuf->fields.sfmt_addcdr.f
7519 int UNUSED written
= 0;
7520 IADDR UNUSED pc
= abuf
->addr
;
7521 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
7528 tmp_tmpops
= FLD (f_indir_pc__dword
);
7529 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7530 tmp_carry
= CPU (h_cbit
);
7531 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7533 SI opval
= tmp_newval
;
7534 SET_H_GR (FLD (f_operand2
), opval
);
7535 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7539 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))));
7540 CPU (h_cbit
) = opval
;
7541 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7544 BI opval
= LTSI (tmp_newval
, 0);
7545 CPU (h_nbit
) = opval
;
7546 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7549 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7550 CPU (h_zbit
) = opval
;
7551 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7554 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)));
7555 CPU (h_vbit
) = opval
;
7556 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7561 CPU (h_xbit
) = opval
;
7562 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7566 SET_H_INSN_PREFIXED_P (opval
);
7567 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7577 CASE (sem
, INSN_SUBS_B_R
) : /* subs.b $Rs,$Rd */
7579 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7580 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7581 #define FLD(f) abuf->fields.sfmt_addc_m.f
7582 int UNUSED written
= 0;
7583 IADDR UNUSED pc
= abuf
->addr
;
7584 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7591 tmp_tmpops
= EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
7592 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7593 tmp_carry
= CPU (h_cbit
);
7594 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7596 SI opval
= tmp_newval
;
7597 SET_H_GR (FLD (f_operand2
), opval
);
7598 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7602 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))));
7603 CPU (h_cbit
) = opval
;
7604 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7607 BI opval
= LTSI (tmp_newval
, 0);
7608 CPU (h_nbit
) = opval
;
7609 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7612 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7613 CPU (h_zbit
) = opval
;
7614 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7617 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)));
7618 CPU (h_vbit
) = opval
;
7619 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7624 CPU (h_xbit
) = opval
;
7625 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7629 SET_H_INSN_PREFIXED_P (opval
);
7630 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7640 CASE (sem
, INSN_SUBS_W_R
) : /* subs.w $Rs,$Rd */
7642 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7643 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7644 #define FLD(f) abuf->fields.sfmt_addc_m.f
7645 int UNUSED written
= 0;
7646 IADDR UNUSED pc
= abuf
->addr
;
7647 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7654 tmp_tmpops
= EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
7655 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7656 tmp_carry
= CPU (h_cbit
);
7657 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7659 SI opval
= tmp_newval
;
7660 SET_H_GR (FLD (f_operand2
), opval
);
7661 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7665 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))));
7666 CPU (h_cbit
) = opval
;
7667 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7670 BI opval
= LTSI (tmp_newval
, 0);
7671 CPU (h_nbit
) = opval
;
7672 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7675 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7676 CPU (h_zbit
) = opval
;
7677 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7680 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)));
7681 CPU (h_vbit
) = opval
;
7682 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7687 CPU (h_xbit
) = opval
;
7688 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7692 SET_H_INSN_PREFIXED_P (opval
);
7693 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7703 CASE (sem
, INSN_SUBS_M_B_M
) : /* subs-m.b [${Rs}${inc}],$Rd */
7705 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7706 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7707 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7708 int UNUSED written
= 0;
7709 IADDR UNUSED pc
= abuf
->addr
;
7710 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7717 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
7720 tmp_postinc
= FLD (f_memmode
);
7721 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7722 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
7723 ; if (NEBI (tmp_postinc
, 0)) {
7725 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7726 tmp_addr
= ADDSI (tmp_addr
, 1);
7729 SI opval
= tmp_addr
;
7730 SET_H_GR (FLD (f_operand1
), opval
);
7731 written
|= (1 << 11);
7732 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7737 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7738 tmp_carry
= CPU (h_cbit
);
7739 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7741 SI opval
= tmp_newval
;
7742 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7743 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7747 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))));
7748 CPU (h_cbit
) = opval
;
7749 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7752 BI opval
= LTSI (tmp_newval
, 0);
7753 CPU (h_nbit
) = opval
;
7754 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7757 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7758 CPU (h_zbit
) = opval
;
7759 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7762 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)));
7763 CPU (h_vbit
) = opval
;
7764 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7769 CPU (h_xbit
) = opval
;
7770 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7774 SET_H_INSN_PREFIXED_P (opval
);
7775 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7781 abuf
->written
= written
;
7786 CASE (sem
, INSN_SUBS_M_W_M
) : /* subs-m.w [${Rs}${inc}],$Rd */
7788 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7789 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7790 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
7791 int UNUSED written
= 0;
7792 IADDR UNUSED pc
= abuf
->addr
;
7793 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
7800 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
7803 tmp_postinc
= FLD (f_memmode
);
7804 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
7805 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
7806 ; if (NEBI (tmp_postinc
, 0)) {
7808 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
7809 tmp_addr
= ADDSI (tmp_addr
, 2);
7812 SI opval
= tmp_addr
;
7813 SET_H_GR (FLD (f_operand1
), opval
);
7814 written
|= (1 << 11);
7815 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7820 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7821 tmp_carry
= CPU (h_cbit
);
7822 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7824 SI opval
= tmp_newval
;
7825 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
7826 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7830 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))));
7831 CPU (h_cbit
) = opval
;
7832 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7835 BI opval
= LTSI (tmp_newval
, 0);
7836 CPU (h_nbit
) = opval
;
7837 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7840 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7841 CPU (h_zbit
) = opval
;
7842 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7845 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)));
7846 CPU (h_vbit
) = opval
;
7847 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7852 CPU (h_xbit
) = opval
;
7853 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7857 SET_H_INSN_PREFIXED_P (opval
);
7858 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7864 abuf
->written
= written
;
7869 CASE (sem
, INSN_SUBSCBR
) : /* [${Rs}${inc}],$Rd */
7871 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7872 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7873 #define FLD(f) abuf->fields.sfmt_addcbr.f
7874 int UNUSED written
= 0;
7875 IADDR UNUSED pc
= abuf
->addr
;
7876 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7883 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
7884 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7885 tmp_carry
= CPU (h_cbit
);
7886 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7888 SI opval
= tmp_newval
;
7889 SET_H_GR (FLD (f_operand2
), opval
);
7890 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7894 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))));
7895 CPU (h_cbit
) = opval
;
7896 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7899 BI opval
= LTSI (tmp_newval
, 0);
7900 CPU (h_nbit
) = opval
;
7901 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7904 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7905 CPU (h_zbit
) = opval
;
7906 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7909 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)));
7910 CPU (h_vbit
) = opval
;
7911 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7916 CPU (h_xbit
) = opval
;
7917 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7921 SET_H_INSN_PREFIXED_P (opval
);
7922 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7932 CASE (sem
, INSN_SUBSCWR
) : /* [${Rs}${inc}],$Rd */
7934 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7936 #define FLD(f) abuf->fields.sfmt_addcwr.f
7937 int UNUSED written
= 0;
7938 IADDR UNUSED pc
= abuf
->addr
;
7939 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
7946 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
7947 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
7948 tmp_carry
= CPU (h_cbit
);
7949 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
7951 SI opval
= tmp_newval
;
7952 SET_H_GR (FLD (f_operand2
), opval
);
7953 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
7957 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))));
7958 CPU (h_cbit
) = opval
;
7959 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
7962 BI opval
= LTSI (tmp_newval
, 0);
7963 CPU (h_nbit
) = opval
;
7964 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
7967 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
7968 CPU (h_zbit
) = opval
;
7969 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
7972 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)));
7973 CPU (h_vbit
) = opval
;
7974 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
7979 CPU (h_xbit
) = opval
;
7980 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
7984 SET_H_INSN_PREFIXED_P (opval
);
7985 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
7995 CASE (sem
, INSN_SUBU_B_R
) : /* subu.b $Rs,$Rd */
7997 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
7998 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
7999 #define FLD(f) abuf->fields.sfmt_addc_m.f
8000 int UNUSED written
= 0;
8001 IADDR UNUSED pc
= abuf
->addr
;
8002 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8009 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
8010 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8011 tmp_carry
= CPU (h_cbit
);
8012 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8014 SI opval
= tmp_newval
;
8015 SET_H_GR (FLD (f_operand2
), opval
);
8016 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8020 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))));
8021 CPU (h_cbit
) = opval
;
8022 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8025 BI opval
= LTSI (tmp_newval
, 0);
8026 CPU (h_nbit
) = opval
;
8027 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8030 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8031 CPU (h_zbit
) = opval
;
8032 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8035 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)));
8036 CPU (h_vbit
) = opval
;
8037 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8042 CPU (h_xbit
) = opval
;
8043 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8047 SET_H_INSN_PREFIXED_P (opval
);
8048 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8058 CASE (sem
, INSN_SUBU_W_R
) : /* subu.w $Rs,$Rd */
8060 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8061 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8062 #define FLD(f) abuf->fields.sfmt_addc_m.f
8063 int UNUSED written
= 0;
8064 IADDR UNUSED pc
= abuf
->addr
;
8065 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8072 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
8073 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8074 tmp_carry
= CPU (h_cbit
);
8075 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8077 SI opval
= tmp_newval
;
8078 SET_H_GR (FLD (f_operand2
), opval
);
8079 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8083 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))));
8084 CPU (h_cbit
) = opval
;
8085 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8088 BI opval
= LTSI (tmp_newval
, 0);
8089 CPU (h_nbit
) = opval
;
8090 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8093 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8094 CPU (h_zbit
) = opval
;
8095 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8098 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)));
8099 CPU (h_vbit
) = opval
;
8100 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8105 CPU (h_xbit
) = opval
;
8106 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8110 SET_H_INSN_PREFIXED_P (opval
);
8111 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8121 CASE (sem
, INSN_SUBU_M_B_M
) : /* subu-m.b [${Rs}${inc}],$Rd */
8123 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8125 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8126 int UNUSED written
= 0;
8127 IADDR UNUSED pc
= abuf
->addr
;
8128 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8135 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
8138 tmp_postinc
= FLD (f_memmode
);
8139 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8140 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
8141 ; if (NEBI (tmp_postinc
, 0)) {
8143 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8144 tmp_addr
= ADDSI (tmp_addr
, 1);
8147 SI opval
= tmp_addr
;
8148 SET_H_GR (FLD (f_operand1
), opval
);
8149 written
|= (1 << 11);
8150 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8155 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8156 tmp_carry
= CPU (h_cbit
);
8157 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8159 SI opval
= tmp_newval
;
8160 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8161 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8165 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))));
8166 CPU (h_cbit
) = opval
;
8167 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8170 BI opval
= LTSI (tmp_newval
, 0);
8171 CPU (h_nbit
) = opval
;
8172 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8175 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8176 CPU (h_zbit
) = opval
;
8177 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8180 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)));
8181 CPU (h_vbit
) = opval
;
8182 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8187 CPU (h_xbit
) = opval
;
8188 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8192 SET_H_INSN_PREFIXED_P (opval
);
8193 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8199 abuf
->written
= written
;
8204 CASE (sem
, INSN_SUBU_M_W_M
) : /* subu-m.w [${Rs}${inc}],$Rd */
8206 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8207 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8208 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
8209 int UNUSED written
= 0;
8210 IADDR UNUSED pc
= abuf
->addr
;
8211 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8218 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
8221 tmp_postinc
= FLD (f_memmode
);
8222 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8223 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
8224 ; if (NEBI (tmp_postinc
, 0)) {
8226 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8227 tmp_addr
= ADDSI (tmp_addr
, 2);
8230 SI opval
= tmp_addr
;
8231 SET_H_GR (FLD (f_operand1
), opval
);
8232 written
|= (1 << 11);
8233 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8238 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8239 tmp_carry
= CPU (h_cbit
);
8240 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8242 SI opval
= tmp_newval
;
8243 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
8244 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8248 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))));
8249 CPU (h_cbit
) = opval
;
8250 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8253 BI opval
= LTSI (tmp_newval
, 0);
8254 CPU (h_nbit
) = opval
;
8255 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8258 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8259 CPU (h_zbit
) = opval
;
8260 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8263 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)));
8264 CPU (h_vbit
) = opval
;
8265 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8270 CPU (h_xbit
) = opval
;
8271 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8275 SET_H_INSN_PREFIXED_P (opval
);
8276 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8282 abuf
->written
= written
;
8287 CASE (sem
, INSN_SUBUCBR
) : /* [${Rs}${inc}],$Rd */
8289 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8290 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8291 #define FLD(f) abuf->fields.sfmt_addcbr.f
8292 int UNUSED written
= 0;
8293 IADDR UNUSED pc
= abuf
->addr
;
8294 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8301 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
8302 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8303 tmp_carry
= CPU (h_cbit
);
8304 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8306 SI opval
= tmp_newval
;
8307 SET_H_GR (FLD (f_operand2
), opval
);
8308 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8312 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))));
8313 CPU (h_cbit
) = opval
;
8314 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8317 BI opval
= LTSI (tmp_newval
, 0);
8318 CPU (h_nbit
) = opval
;
8319 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8322 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8323 CPU (h_zbit
) = opval
;
8324 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8327 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)));
8328 CPU (h_vbit
) = opval
;
8329 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8334 CPU (h_xbit
) = opval
;
8335 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8339 SET_H_INSN_PREFIXED_P (opval
);
8340 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8350 CASE (sem
, INSN_SUBUCWR
) : /* [${Rs}${inc}],$Rd */
8352 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8354 #define FLD(f) abuf->fields.sfmt_addcwr.f
8355 int UNUSED written
= 0;
8356 IADDR UNUSED pc
= abuf
->addr
;
8357 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
8364 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
8365 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8366 tmp_carry
= CPU (h_cbit
);
8367 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8369 SI opval
= tmp_newval
;
8370 SET_H_GR (FLD (f_operand2
), opval
);
8371 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8375 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))));
8376 CPU (h_cbit
) = opval
;
8377 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8380 BI opval
= LTSI (tmp_newval
, 0);
8381 CPU (h_nbit
) = opval
;
8382 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8385 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8386 CPU (h_zbit
) = opval
;
8387 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8390 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)));
8391 CPU (h_vbit
) = opval
;
8392 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8397 CPU (h_xbit
) = opval
;
8398 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8402 SET_H_INSN_PREFIXED_P (opval
);
8403 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8413 CASE (sem
, INSN_ADDC_R
) : /* addc $Rs,$Rd */
8415 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8417 #define FLD(f) abuf->fields.sfmt_addc_m.f
8418 int UNUSED written
= 0;
8419 IADDR UNUSED pc
= abuf
->addr
;
8420 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8429 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8430 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8431 tmp_carry
= CPU (h_cbit
);
8432 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8434 SI opval
= tmp_newval
;
8435 SET_H_GR (FLD (f_operand2
), opval
);
8436 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8440 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))));
8441 CPU (h_cbit
) = opval
;
8442 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8445 BI opval
= LTSI (tmp_newval
, 0);
8446 CPU (h_nbit
) = opval
;
8447 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8450 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8451 CPU (h_zbit
) = opval
;
8452 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8455 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)));
8456 CPU (h_vbit
) = opval
;
8457 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8462 CPU (h_xbit
) = opval
;
8463 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8467 SET_H_INSN_PREFIXED_P (opval
);
8468 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8479 CASE (sem
, INSN_ADDC_M
) : /* addc [${Rs}${inc}],${Rd} */
8481 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8482 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8483 #define FLD(f) abuf->fields.sfmt_addc_m.f
8484 int UNUSED written
= 0;
8485 IADDR UNUSED pc
= abuf
->addr
;
8486 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8495 tmp_tmpops
= ({ SI tmp_addr
;
8498 tmp_postinc
= FLD (f_memmode
);
8499 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
8500 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
8501 ; if (NEBI (tmp_postinc
, 0)) {
8503 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
8504 tmp_addr
= ADDSI (tmp_addr
, 4);
8507 SI opval
= tmp_addr
;
8508 SET_H_GR (FLD (f_operand1
), opval
);
8509 written
|= (1 << 10);
8510 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8515 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8516 tmp_carry
= CPU (h_cbit
);
8517 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8519 SI opval
= tmp_newval
;
8520 SET_H_GR (FLD (f_operand2
), opval
);
8521 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8525 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))));
8526 CPU (h_cbit
) = opval
;
8527 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8530 BI opval
= LTSI (tmp_newval
, 0);
8531 CPU (h_nbit
) = opval
;
8532 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8535 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8536 CPU (h_zbit
) = opval
;
8537 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8540 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)));
8541 CPU (h_vbit
) = opval
;
8542 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8547 CPU (h_xbit
) = opval
;
8548 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8552 SET_H_INSN_PREFIXED_P (opval
);
8553 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8560 abuf
->written
= written
;
8565 CASE (sem
, INSN_ADDC_C
) : /* addc ${const32},${Rd} */
8567 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8568 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8569 #define FLD(f) abuf->fields.sfmt_addcdr.f
8570 int UNUSED written
= 0;
8571 IADDR UNUSED pc
= abuf
->addr
;
8572 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8581 tmp_tmpops
= FLD (f_indir_pc__dword
);
8582 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
8583 tmp_carry
= CPU (h_cbit
);
8584 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8586 SI opval
= tmp_newval
;
8587 SET_H_GR (FLD (f_operand2
), opval
);
8588 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8592 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))));
8593 CPU (h_cbit
) = opval
;
8594 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8597 BI opval
= LTSI (tmp_newval
, 0);
8598 CPU (h_nbit
) = opval
;
8599 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8602 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8603 CPU (h_zbit
) = opval
;
8604 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8607 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)));
8608 CPU (h_vbit
) = opval
;
8609 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8614 CPU (h_xbit
) = opval
;
8615 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8619 SET_H_INSN_PREFIXED_P (opval
);
8620 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8631 CASE (sem
, INSN_LAPC_D
) : /* lapc.d ${const32-pcrel},${Rd} */
8633 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8634 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8635 #define FLD(f) abuf->fields.sfmt_lapc_d.f
8636 int UNUSED written
= 0;
8637 IADDR UNUSED pc
= abuf
->addr
;
8638 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
8642 SI opval
= FLD (i_const32_pcrel
);
8643 SET_H_GR (FLD (f_operand2
), opval
);
8644 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8649 CPU (h_xbit
) = opval
;
8650 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8654 SET_H_INSN_PREFIXED_P (opval
);
8655 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8664 CASE (sem
, INSN_LAPCQ
) : /* lapcq ${qo},${Rd} */
8666 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8667 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8668 #define FLD(f) abuf->fields.sfmt_lapcq.f
8669 int UNUSED written
= 0;
8670 IADDR UNUSED pc
= abuf
->addr
;
8671 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8675 SI opval
= FLD (i_qo
);
8676 SET_H_GR (FLD (f_operand2
), opval
);
8677 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8682 CPU (h_xbit
) = opval
;
8683 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8687 SET_H_INSN_PREFIXED_P (opval
);
8688 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8697 CASE (sem
, INSN_ADDI_B_R
) : /* addi.b ${Rs-dfield}.m,${Rd-sfield} */
8699 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8700 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8701 #define FLD(f) abuf->fields.sfmt_addc_m.f
8702 int UNUSED written
= 0;
8703 IADDR UNUSED pc
= abuf
->addr
;
8704 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8708 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
8709 SET_H_GR (FLD (f_operand1
), opval
);
8710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8715 CPU (h_xbit
) = opval
;
8716 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8720 SET_H_INSN_PREFIXED_P (opval
);
8721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8730 CASE (sem
, INSN_ADDI_W_R
) : /* addi.w ${Rs-dfield}.m,${Rd-sfield} */
8732 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8733 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8734 #define FLD(f) abuf->fields.sfmt_addc_m.f
8735 int UNUSED written
= 0;
8736 IADDR UNUSED pc
= abuf
->addr
;
8737 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8741 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
8742 SET_H_GR (FLD (f_operand1
), opval
);
8743 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8748 CPU (h_xbit
) = opval
;
8749 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8753 SET_H_INSN_PREFIXED_P (opval
);
8754 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8763 CASE (sem
, INSN_ADDI_D_R
) : /* addi.d ${Rs-dfield}.m,${Rd-sfield} */
8765 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8766 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8767 #define FLD(f) abuf->fields.sfmt_addc_m.f
8768 int UNUSED written
= 0;
8769 IADDR UNUSED pc
= abuf
->addr
;
8770 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8774 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
8775 SET_H_GR (FLD (f_operand1
), opval
);
8776 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8781 CPU (h_xbit
) = opval
;
8782 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8786 SET_H_INSN_PREFIXED_P (opval
);
8787 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8796 CASE (sem
, INSN_NEG_B_R
) : /* neg.b $Rs,$Rd */
8798 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8799 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8800 #define FLD(f) abuf->fields.sfmt_addc_m.f
8801 int UNUSED written
= 0;
8802 IADDR UNUSED pc
= abuf
->addr
;
8803 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8810 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8812 tmp_carry
= CPU (h_cbit
);
8813 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8816 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
8818 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
8819 SET_H_GR (FLD (f_operand2
), opval
);
8820 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8825 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))));
8826 CPU (h_cbit
) = opval
;
8827 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8830 BI opval
= LTQI (tmp_newval
, 0);
8831 CPU (h_nbit
) = opval
;
8832 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8835 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8836 CPU (h_zbit
) = opval
;
8837 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8840 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)));
8841 CPU (h_vbit
) = opval
;
8842 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8847 CPU (h_xbit
) = opval
;
8848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8852 SET_H_INSN_PREFIXED_P (opval
);
8853 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8863 CASE (sem
, INSN_NEG_W_R
) : /* neg.w $Rs,$Rd */
8865 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8866 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8867 #define FLD(f) abuf->fields.sfmt_addc_m.f
8868 int UNUSED written
= 0;
8869 IADDR UNUSED pc
= abuf
->addr
;
8870 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8877 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8879 tmp_carry
= CPU (h_cbit
);
8880 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8883 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
8885 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
8886 SET_H_GR (FLD (f_operand2
), opval
);
8887 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8892 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))));
8893 CPU (h_cbit
) = opval
;
8894 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8897 BI opval
= LTHI (tmp_newval
, 0);
8898 CPU (h_nbit
) = opval
;
8899 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8902 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8903 CPU (h_zbit
) = opval
;
8904 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8907 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)));
8908 CPU (h_vbit
) = opval
;
8909 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8914 CPU (h_xbit
) = opval
;
8915 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8919 SET_H_INSN_PREFIXED_P (opval
);
8920 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8930 CASE (sem
, INSN_NEG_D_R
) : /* neg.d $Rs,$Rd */
8932 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8933 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8934 #define FLD(f) abuf->fields.sfmt_addc_m.f
8935 int UNUSED written
= 0;
8936 IADDR UNUSED pc
= abuf
->addr
;
8937 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
8944 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
8946 tmp_carry
= CPU (h_cbit
);
8947 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
8949 SI opval
= tmp_newval
;
8950 SET_H_GR (FLD (f_operand2
), opval
);
8951 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
8955 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))));
8956 CPU (h_cbit
) = opval
;
8957 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
8960 BI opval
= LTSI (tmp_newval
, 0);
8961 CPU (h_nbit
) = opval
;
8962 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
8965 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
8966 CPU (h_zbit
) = opval
;
8967 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
8970 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)));
8971 CPU (h_vbit
) = opval
;
8972 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
8977 CPU (h_xbit
) = opval
;
8978 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
8982 SET_H_INSN_PREFIXED_P (opval
);
8983 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
8993 CASE (sem
, INSN_TEST_M_B_M
) : /* test-m.b [${Rs}${inc}] */
8995 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
8996 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
8997 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
8998 int UNUSED written
= 0;
8999 IADDR UNUSED pc
= abuf
->addr
;
9000 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9004 tmp_tmpd
= ({ SI tmp_addr
;
9007 tmp_postinc
= FLD (f_memmode
);
9008 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9009 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
9010 ; if (NEBI (tmp_postinc
, 0)) {
9012 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9013 tmp_addr
= ADDSI (tmp_addr
, 1);
9016 SI opval
= tmp_addr
;
9017 SET_H_GR (FLD (f_operand1
), opval
);
9018 written
|= (1 << 8);
9019 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9030 tmp_tmpopd
= tmp_tmpd
;
9031 tmp_carry
= CPU (h_cbit
);
9032 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9036 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))));
9037 CPU (h_cbit
) = opval
;
9038 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9041 BI opval
= LTQI (tmp_newval
, 0);
9042 CPU (h_nbit
) = opval
;
9043 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9046 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9047 CPU (h_zbit
) = opval
;
9048 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9051 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)));
9052 CPU (h_vbit
) = opval
;
9053 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9058 CPU (h_xbit
) = opval
;
9059 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9063 SET_H_INSN_PREFIXED_P (opval
);
9064 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9071 abuf
->written
= written
;
9076 CASE (sem
, INSN_TEST_M_W_M
) : /* test-m.w [${Rs}${inc}] */
9078 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9079 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9080 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9081 int UNUSED written
= 0;
9082 IADDR UNUSED pc
= abuf
->addr
;
9083 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9087 tmp_tmpd
= ({ SI tmp_addr
;
9090 tmp_postinc
= FLD (f_memmode
);
9091 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9092 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
9093 ; if (NEBI (tmp_postinc
, 0)) {
9095 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9096 tmp_addr
= ADDSI (tmp_addr
, 2);
9099 SI opval
= tmp_addr
;
9100 SET_H_GR (FLD (f_operand1
), opval
);
9101 written
|= (1 << 8);
9102 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9113 tmp_tmpopd
= tmp_tmpd
;
9114 tmp_carry
= CPU (h_cbit
);
9115 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9119 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))));
9120 CPU (h_cbit
) = opval
;
9121 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9124 BI opval
= LTHI (tmp_newval
, 0);
9125 CPU (h_nbit
) = opval
;
9126 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9129 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9130 CPU (h_zbit
) = opval
;
9131 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9134 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)));
9135 CPU (h_vbit
) = opval
;
9136 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9141 CPU (h_xbit
) = opval
;
9142 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9146 SET_H_INSN_PREFIXED_P (opval
);
9147 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9154 abuf
->written
= written
;
9159 CASE (sem
, INSN_TEST_M_D_M
) : /* test-m.d [${Rs}${inc}] */
9161 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9162 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9163 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
9164 int UNUSED written
= 0;
9165 IADDR UNUSED pc
= abuf
->addr
;
9166 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9170 tmp_tmpd
= ({ SI tmp_addr
;
9173 tmp_postinc
= FLD (f_memmode
);
9174 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9175 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
9176 ; if (NEBI (tmp_postinc
, 0)) {
9178 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9179 tmp_addr
= ADDSI (tmp_addr
, 4);
9182 SI opval
= tmp_addr
;
9183 SET_H_GR (FLD (f_operand1
), opval
);
9184 written
|= (1 << 8);
9185 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9196 tmp_tmpopd
= tmp_tmpd
;
9197 tmp_carry
= CPU (h_cbit
);
9198 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9202 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))));
9203 CPU (h_cbit
) = opval
;
9204 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9207 BI opval
= LTSI (tmp_newval
, 0);
9208 CPU (h_nbit
) = opval
;
9209 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9212 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9213 CPU (h_zbit
) = opval
;
9214 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9217 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)));
9218 CPU (h_vbit
) = opval
;
9219 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9224 CPU (h_xbit
) = opval
;
9225 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9229 SET_H_INSN_PREFIXED_P (opval
);
9230 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9237 abuf
->written
= written
;
9242 CASE (sem
, INSN_MOVE_R_M_B_M
) : /* move-r-m.b ${Rs-dfield},[${Rd-sfield}${inc}] */
9244 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9245 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9246 #define FLD(f) abuf->fields.sfmt_addc_m.f
9247 int UNUSED written
= 0;
9248 IADDR UNUSED pc
= abuf
->addr
;
9249 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9253 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9257 tmp_postinc
= FLD (f_memmode
);
9258 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9259 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9260 if (EQBI (CPU (h_pbit
), 0)) {
9263 QI opval
= tmp_tmpd
;
9264 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9265 written
|= (1 << 10);
9266 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9269 BI opval
= CPU (h_pbit
);
9270 CPU (h_cbit
) = opval
;
9271 written
|= (1 << 9);
9272 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9278 CPU (h_cbit
) = opval
;
9279 written
|= (1 << 9);
9280 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9285 QI opval
= tmp_tmpd
;
9286 SETMEMQI (current_cpu
, pc
, tmp_addr
, opval
);
9287 written
|= (1 << 10);
9288 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9291 if (NEBI (tmp_postinc
, 0)) {
9293 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9294 tmp_addr
= ADDSI (tmp_addr
, 1);
9297 SI opval
= tmp_addr
;
9298 SET_H_GR (FLD (f_operand1
), opval
);
9299 written
|= (1 << 8);
9300 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9308 CPU (h_xbit
) = opval
;
9309 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9313 SET_H_INSN_PREFIXED_P (opval
);
9314 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9319 abuf
->written
= written
;
9324 CASE (sem
, INSN_MOVE_R_M_W_M
) : /* move-r-m.w ${Rs-dfield},[${Rd-sfield}${inc}] */
9326 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9327 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9328 #define FLD(f) abuf->fields.sfmt_addc_m.f
9329 int UNUSED written
= 0;
9330 IADDR UNUSED pc
= abuf
->addr
;
9331 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9335 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9339 tmp_postinc
= FLD (f_memmode
);
9340 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9341 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9342 if (EQBI (CPU (h_pbit
), 0)) {
9345 HI opval
= tmp_tmpd
;
9346 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9347 written
|= (1 << 10);
9348 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9351 BI opval
= CPU (h_pbit
);
9352 CPU (h_cbit
) = opval
;
9353 written
|= (1 << 9);
9354 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9360 CPU (h_cbit
) = opval
;
9361 written
|= (1 << 9);
9362 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9367 HI opval
= tmp_tmpd
;
9368 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
9369 written
|= (1 << 10);
9370 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9373 if (NEBI (tmp_postinc
, 0)) {
9375 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9376 tmp_addr
= ADDSI (tmp_addr
, 2);
9379 SI opval
= tmp_addr
;
9380 SET_H_GR (FLD (f_operand1
), opval
);
9381 written
|= (1 << 8);
9382 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9390 CPU (h_xbit
) = opval
;
9391 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9395 SET_H_INSN_PREFIXED_P (opval
);
9396 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9401 abuf
->written
= written
;
9406 CASE (sem
, INSN_MOVE_R_M_D_M
) : /* move-r-m.d ${Rs-dfield},[${Rd-sfield}${inc}] */
9408 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9409 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9410 #define FLD(f) abuf->fields.sfmt_addc_m.f
9411 int UNUSED written
= 0;
9412 IADDR UNUSED pc
= abuf
->addr
;
9413 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9417 tmp_tmpd
= GET_H_GR (FLD (f_operand2
));
9421 tmp_postinc
= FLD (f_memmode
);
9422 tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
9423 if (ANDIF (GET_H_V32_V32 (), NEBI (CPU (h_xbit
), 0))) {
9424 if (EQBI (CPU (h_pbit
), 0)) {
9427 SI opval
= tmp_tmpd
;
9428 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9429 written
|= (1 << 10);
9430 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9433 BI opval
= CPU (h_pbit
);
9434 CPU (h_cbit
) = opval
;
9435 written
|= (1 << 9);
9436 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9442 CPU (h_cbit
) = opval
;
9443 written
|= (1 << 9);
9444 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9449 SI opval
= tmp_tmpd
;
9450 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
9451 written
|= (1 << 10);
9452 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
9455 if (NEBI (tmp_postinc
, 0)) {
9457 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
9458 tmp_addr
= ADDSI (tmp_addr
, 4);
9461 SI opval
= tmp_addr
;
9462 SET_H_GR (FLD (f_operand1
), opval
);
9463 written
|= (1 << 8);
9464 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9472 CPU (h_xbit
) = opval
;
9473 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9477 SET_H_INSN_PREFIXED_P (opval
);
9478 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9483 abuf
->written
= written
;
9488 CASE (sem
, INSN_MULS_B
) : /* muls.b $Rs,$Rd */
9490 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9491 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9492 #define FLD(f) abuf->fields.sfmt_muls_b.f
9493 int UNUSED written
= 0;
9494 IADDR UNUSED pc
= abuf
->addr
;
9495 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9501 tmp_src1
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9502 tmp_src2
= EXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9503 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9505 SI opval
= TRUNCDISI (tmp_tmpr
);
9506 SET_H_GR (FLD (f_operand2
), opval
);
9507 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9510 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9511 SET_H_SR (((UINT
) 7), opval
);
9512 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9516 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9517 CPU (h_cbit
) = opval
;
9518 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9521 BI opval
= LTDI (tmp_tmpr
, 0);
9522 CPU (h_nbit
) = opval
;
9523 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9526 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9527 CPU (h_zbit
) = opval
;
9528 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9531 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9532 CPU (h_vbit
) = opval
;
9533 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9538 CPU (h_xbit
) = opval
;
9539 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9543 SET_H_INSN_PREFIXED_P (opval
);
9544 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9554 CASE (sem
, INSN_MULS_W
) : /* muls.w $Rs,$Rd */
9556 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9557 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9558 #define FLD(f) abuf->fields.sfmt_muls_b.f
9559 int UNUSED written
= 0;
9560 IADDR UNUSED pc
= abuf
->addr
;
9561 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9567 tmp_src1
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9568 tmp_src2
= EXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9569 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9571 SI opval
= TRUNCDISI (tmp_tmpr
);
9572 SET_H_GR (FLD (f_operand2
), opval
);
9573 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9576 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9577 SET_H_SR (((UINT
) 7), opval
);
9578 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9582 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9583 CPU (h_cbit
) = opval
;
9584 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9587 BI opval
= LTDI (tmp_tmpr
, 0);
9588 CPU (h_nbit
) = opval
;
9589 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9592 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9593 CPU (h_zbit
) = opval
;
9594 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9597 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9598 CPU (h_vbit
) = opval
;
9599 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9604 CPU (h_xbit
) = opval
;
9605 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9609 SET_H_INSN_PREFIXED_P (opval
);
9610 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9620 CASE (sem
, INSN_MULS_D
) : /* muls.d $Rs,$Rd */
9622 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9623 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9624 #define FLD(f) abuf->fields.sfmt_muls_b.f
9625 int UNUSED written
= 0;
9626 IADDR UNUSED pc
= abuf
->addr
;
9627 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9633 tmp_src1
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9634 tmp_src2
= EXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9635 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9637 SI opval
= TRUNCDISI (tmp_tmpr
);
9638 SET_H_GR (FLD (f_operand2
), opval
);
9639 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9642 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9643 SET_H_SR (((UINT
) 7), opval
);
9644 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9648 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9649 CPU (h_cbit
) = opval
;
9650 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9653 BI opval
= LTDI (tmp_tmpr
, 0);
9654 CPU (h_nbit
) = opval
;
9655 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9658 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9659 CPU (h_zbit
) = opval
;
9660 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9663 BI opval
= NEDI (tmp_tmpr
, EXTSIDI (TRUNCDISI (tmp_tmpr
)));
9664 CPU (h_vbit
) = opval
;
9665 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9670 CPU (h_xbit
) = opval
;
9671 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9675 SET_H_INSN_PREFIXED_P (opval
);
9676 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9686 CASE (sem
, INSN_MULU_B
) : /* mulu.b $Rs,$Rd */
9688 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9689 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9690 #define FLD(f) abuf->fields.sfmt_muls_b.f
9691 int UNUSED written
= 0;
9692 IADDR UNUSED pc
= abuf
->addr
;
9693 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9699 tmp_src1
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
9700 tmp_src2
= ZEXTQIDI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
))));
9701 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9703 SI opval
= TRUNCDISI (tmp_tmpr
);
9704 SET_H_GR (FLD (f_operand2
), opval
);
9705 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9708 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9709 SET_H_SR (((UINT
) 7), opval
);
9710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9714 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9715 CPU (h_cbit
) = opval
;
9716 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9719 BI opval
= LTDI (tmp_tmpr
, 0);
9720 CPU (h_nbit
) = opval
;
9721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9724 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9725 CPU (h_zbit
) = opval
;
9726 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9729 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9730 CPU (h_vbit
) = opval
;
9731 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9736 CPU (h_xbit
) = opval
;
9737 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9741 SET_H_INSN_PREFIXED_P (opval
);
9742 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9752 CASE (sem
, INSN_MULU_W
) : /* mulu.w $Rs,$Rd */
9754 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9755 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9756 #define FLD(f) abuf->fields.sfmt_muls_b.f
9757 int UNUSED written
= 0;
9758 IADDR UNUSED pc
= abuf
->addr
;
9759 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9765 tmp_src1
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
9766 tmp_src2
= ZEXTHIDI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
))));
9767 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9769 SI opval
= TRUNCDISI (tmp_tmpr
);
9770 SET_H_GR (FLD (f_operand2
), opval
);
9771 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9774 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9775 SET_H_SR (((UINT
) 7), opval
);
9776 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9780 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9781 CPU (h_cbit
) = opval
;
9782 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9785 BI opval
= LTDI (tmp_tmpr
, 0);
9786 CPU (h_nbit
) = opval
;
9787 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9790 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9791 CPU (h_zbit
) = opval
;
9792 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9795 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9796 CPU (h_vbit
) = opval
;
9797 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9802 CPU (h_xbit
) = opval
;
9803 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9807 SET_H_INSN_PREFIXED_P (opval
);
9808 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9818 CASE (sem
, INSN_MULU_D
) : /* mulu.d $Rs,$Rd */
9820 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9821 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9822 #define FLD(f) abuf->fields.sfmt_muls_b.f
9823 int UNUSED written
= 0;
9824 IADDR UNUSED pc
= abuf
->addr
;
9825 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9831 tmp_src1
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand1
))));
9832 tmp_src2
= ZEXTSIDI (TRUNCSISI (GET_H_GR (FLD (f_operand2
))));
9833 tmp_tmpr
= MULDI (tmp_src1
, tmp_src2
);
9835 SI opval
= TRUNCDISI (tmp_tmpr
);
9836 SET_H_GR (FLD (f_operand2
), opval
);
9837 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9840 SI opval
= TRUNCDISI (SRLDI (tmp_tmpr
, 32));
9841 SET_H_SR (((UINT
) 7), opval
);
9842 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
9846 BI opval
= ANDIF (GET_H_V32_V32 (), CPU (h_cbit
));
9847 CPU (h_cbit
) = opval
;
9848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
9851 BI opval
= LTDI (tmp_tmpr
, 0);
9852 CPU (h_nbit
) = opval
;
9853 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9856 BI opval
= ANDIF (EQDI (tmp_tmpr
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9857 CPU (h_zbit
) = opval
;
9858 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9861 BI opval
= NEDI (tmp_tmpr
, ZEXTSIDI (TRUNCDISI (tmp_tmpr
)));
9862 CPU (h_vbit
) = opval
;
9863 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9868 CPU (h_xbit
) = opval
;
9869 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9873 SET_H_INSN_PREFIXED_P (opval
);
9874 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9884 CASE (sem
, INSN_MCP
) : /* mcp $Ps,$Rd */
9886 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9887 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9888 #define FLD(f) abuf->fields.sfmt_mcp.f
9889 int UNUSED written
= 0;
9890 IADDR UNUSED pc
= abuf
->addr
;
9891 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9901 tmp_tmpops
= GET_H_SR (FLD (f_operand2
));
9902 tmp_tmpopd
= GET_H_GR (FLD (f_operand1
));
9903 tmp_carry
= CPU (h_rbit
);
9904 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
9906 SI opval
= tmp_newval
;
9907 SET_H_GR (FLD (f_operand1
), opval
);
9908 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9912 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))));
9913 CPU (h_rbit
) = opval
;
9914 CGEN_TRACE_RESULT (current_cpu
, abuf
, "rbit", 'x', opval
);
9917 BI opval
= LTSI (tmp_newval
, 0);
9918 CPU (h_nbit
) = opval
;
9919 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9922 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
9923 CPU (h_zbit
) = opval
;
9924 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9927 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)));
9928 CPU (h_vbit
) = opval
;
9929 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
9934 CPU (h_xbit
) = opval
;
9935 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9939 SET_H_INSN_PREFIXED_P (opval
);
9940 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
9951 CASE (sem
, INSN_DSTEP
) : /* dstep $Rs,$Rd */
9953 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
9954 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
9955 #define FLD(f) abuf->fields.sfmt_muls_b.f
9956 int UNUSED written
= 0;
9957 IADDR UNUSED pc
= abuf
->addr
;
9958 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
9964 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
9965 tmp_tmp
= SLLSI (GET_H_GR (FLD (f_operand2
)), 1);
9966 tmp_tmpd
= ((GEUSI (tmp_tmp
, tmp_tmps
)) ? (SUBSI (tmp_tmp
, tmp_tmps
)) : (tmp_tmp
));
9968 SI opval
= tmp_tmpd
;
9969 SET_H_GR (FLD (f_operand2
), opval
);
9970 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
9974 BI opval
= LTSI (tmp_tmpd
, 0);
9975 CPU (h_nbit
) = opval
;
9976 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
9979 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
9980 CPU (h_zbit
) = opval
;
9981 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
9983 SET_H_CBIT_MOVE (0);
9984 SET_H_VBIT_MOVE (0);
9988 CPU (h_xbit
) = opval
;
9989 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
9993 SET_H_INSN_PREFIXED_P (opval
);
9994 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10004 CASE (sem
, INSN_ABS
) : /* abs $Rs,$Rd */
10006 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10007 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10008 #define FLD(f) abuf->fields.sfmt_muls_b.f
10009 int UNUSED written
= 0;
10010 IADDR UNUSED pc
= abuf
->addr
;
10011 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10015 tmp_tmpd
= ABSSI (GET_H_GR (FLD (f_operand1
)));
10017 SI opval
= tmp_tmpd
;
10018 SET_H_GR (FLD (f_operand2
), opval
);
10019 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10023 BI opval
= LTSI (tmp_tmpd
, 0);
10024 CPU (h_nbit
) = opval
;
10025 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10028 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10029 CPU (h_zbit
) = opval
;
10030 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10032 SET_H_CBIT_MOVE (0);
10033 SET_H_VBIT_MOVE (0);
10037 CPU (h_xbit
) = opval
;
10038 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10042 SET_H_INSN_PREFIXED_P (opval
);
10043 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10053 CASE (sem
, INSN_AND_B_R
) : /* and.b $Rs,$Rd */
10055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10057 #define FLD(f) abuf->fields.sfmt_addc_m.f
10058 int UNUSED written
= 0;
10059 IADDR UNUSED pc
= abuf
->addr
;
10060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10064 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10067 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10069 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10070 SET_H_GR (FLD (f_operand2
), opval
);
10071 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10076 BI opval
= LTQI (tmp_tmpd
, 0);
10077 CPU (h_nbit
) = opval
;
10078 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10081 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10082 CPU (h_zbit
) = opval
;
10083 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10085 SET_H_CBIT_MOVE (0);
10086 SET_H_VBIT_MOVE (0);
10090 CPU (h_xbit
) = opval
;
10091 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10095 SET_H_INSN_PREFIXED_P (opval
);
10096 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10106 CASE (sem
, INSN_AND_W_R
) : /* and.w $Rs,$Rd */
10108 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10109 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10110 #define FLD(f) abuf->fields.sfmt_addc_m.f
10111 int UNUSED written
= 0;
10112 IADDR UNUSED pc
= abuf
->addr
;
10113 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10117 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10120 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10122 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10123 SET_H_GR (FLD (f_operand2
), opval
);
10124 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10129 BI opval
= LTHI (tmp_tmpd
, 0);
10130 CPU (h_nbit
) = opval
;
10131 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10134 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10135 CPU (h_zbit
) = opval
;
10136 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10138 SET_H_CBIT_MOVE (0);
10139 SET_H_VBIT_MOVE (0);
10143 CPU (h_xbit
) = opval
;
10144 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10148 SET_H_INSN_PREFIXED_P (opval
);
10149 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10159 CASE (sem
, INSN_AND_D_R
) : /* and.d $Rs,$Rd */
10161 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10162 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10163 #define FLD(f) abuf->fields.sfmt_addc_m.f
10164 int UNUSED written
= 0;
10165 IADDR UNUSED pc
= abuf
->addr
;
10166 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10170 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10172 SI opval
= tmp_tmpd
;
10173 SET_H_GR (FLD (f_operand2
), opval
);
10174 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10178 BI opval
= LTSI (tmp_tmpd
, 0);
10179 CPU (h_nbit
) = opval
;
10180 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10183 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10184 CPU (h_zbit
) = opval
;
10185 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10187 SET_H_CBIT_MOVE (0);
10188 SET_H_VBIT_MOVE (0);
10192 CPU (h_xbit
) = opval
;
10193 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10197 SET_H_INSN_PREFIXED_P (opval
);
10198 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10208 CASE (sem
, INSN_AND_M_B_M
) : /* and-m.b [${Rs}${inc}],${Rd} */
10210 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10211 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10212 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10213 int UNUSED written
= 0;
10214 IADDR UNUSED pc
= abuf
->addr
;
10215 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10219 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10222 tmp_postinc
= FLD (f_memmode
);
10223 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10224 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10225 ; if (NEBI (tmp_postinc
, 0)) {
10227 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10228 tmp_addr
= ADDSI (tmp_addr
, 1);
10231 SI opval
= tmp_addr
;
10232 SET_H_GR (FLD (f_operand1
), opval
);
10233 written
|= (1 << 11);
10234 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10238 ; tmp_tmp_mem
; }));
10241 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10243 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10244 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10245 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10250 BI opval
= LTQI (tmp_tmpd
, 0);
10251 CPU (h_nbit
) = opval
;
10252 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10255 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10256 CPU (h_zbit
) = opval
;
10257 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10259 SET_H_CBIT_MOVE (0);
10260 SET_H_VBIT_MOVE (0);
10264 CPU (h_xbit
) = opval
;
10265 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10269 SET_H_INSN_PREFIXED_P (opval
);
10270 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10276 abuf
->written
= written
;
10281 CASE (sem
, INSN_AND_M_W_M
) : /* and-m.w [${Rs}${inc}],${Rd} */
10283 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10284 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10285 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10286 int UNUSED written
= 0;
10287 IADDR UNUSED pc
= abuf
->addr
;
10288 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10292 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10295 tmp_postinc
= FLD (f_memmode
);
10296 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10297 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10298 ; if (NEBI (tmp_postinc
, 0)) {
10300 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10301 tmp_addr
= ADDSI (tmp_addr
, 2);
10304 SI opval
= tmp_addr
;
10305 SET_H_GR (FLD (f_operand1
), opval
);
10306 written
|= (1 << 11);
10307 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10311 ; tmp_tmp_mem
; }));
10314 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10316 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10317 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10318 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10323 BI opval
= LTHI (tmp_tmpd
, 0);
10324 CPU (h_nbit
) = opval
;
10325 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10328 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10329 CPU (h_zbit
) = opval
;
10330 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10332 SET_H_CBIT_MOVE (0);
10333 SET_H_VBIT_MOVE (0);
10337 CPU (h_xbit
) = opval
;
10338 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10342 SET_H_INSN_PREFIXED_P (opval
);
10343 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10349 abuf
->written
= written
;
10354 CASE (sem
, INSN_AND_M_D_M
) : /* and-m.d [${Rs}${inc}],${Rd} */
10356 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10357 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10358 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10359 int UNUSED written
= 0;
10360 IADDR UNUSED pc
= abuf
->addr
;
10361 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10365 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10368 tmp_postinc
= FLD (f_memmode
);
10369 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10370 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10371 ; if (NEBI (tmp_postinc
, 0)) {
10373 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10374 tmp_addr
= ADDSI (tmp_addr
, 4);
10377 SI opval
= tmp_addr
;
10378 SET_H_GR (FLD (f_operand1
), opval
);
10379 written
|= (1 << 10);
10380 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10384 ; tmp_tmp_mem
; }));
10386 SI opval
= tmp_tmpd
;
10387 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10388 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10392 BI opval
= LTSI (tmp_tmpd
, 0);
10393 CPU (h_nbit
) = opval
;
10394 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10397 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10398 CPU (h_zbit
) = opval
;
10399 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10401 SET_H_CBIT_MOVE (0);
10402 SET_H_VBIT_MOVE (0);
10406 CPU (h_xbit
) = opval
;
10407 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10411 SET_H_INSN_PREFIXED_P (opval
);
10412 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10418 abuf
->written
= written
;
10423 CASE (sem
, INSN_ANDCBR
) : /* and.b ${sconst8}],${Rd} */
10425 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10426 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10427 #define FLD(f) abuf->fields.sfmt_addcbr.f
10428 int UNUSED written
= 0;
10429 IADDR UNUSED pc
= abuf
->addr
;
10430 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10434 tmp_tmpd
= ANDQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
10437 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10439 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10440 SET_H_GR (FLD (f_operand2
), opval
);
10441 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10446 BI opval
= LTQI (tmp_tmpd
, 0);
10447 CPU (h_nbit
) = opval
;
10448 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10451 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10452 CPU (h_zbit
) = opval
;
10453 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10455 SET_H_CBIT_MOVE (0);
10456 SET_H_VBIT_MOVE (0);
10460 CPU (h_xbit
) = opval
;
10461 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10465 SET_H_INSN_PREFIXED_P (opval
);
10466 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10476 CASE (sem
, INSN_ANDCWR
) : /* and.w ${sconst16}],${Rd} */
10478 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10479 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10480 #define FLD(f) abuf->fields.sfmt_addcwr.f
10481 int UNUSED written
= 0;
10482 IADDR UNUSED pc
= abuf
->addr
;
10483 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
10487 tmp_tmpd
= ANDHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
10490 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10492 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10493 SET_H_GR (FLD (f_operand2
), opval
);
10494 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10499 BI opval
= LTHI (tmp_tmpd
, 0);
10500 CPU (h_nbit
) = opval
;
10501 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10504 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10505 CPU (h_zbit
) = opval
;
10506 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10508 SET_H_CBIT_MOVE (0);
10509 SET_H_VBIT_MOVE (0);
10513 CPU (h_xbit
) = opval
;
10514 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10518 SET_H_INSN_PREFIXED_P (opval
);
10519 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10529 CASE (sem
, INSN_ANDCDR
) : /* and.d ${const32}],${Rd} */
10531 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10532 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10533 #define FLD(f) abuf->fields.sfmt_addcdr.f
10534 int UNUSED written
= 0;
10535 IADDR UNUSED pc
= abuf
->addr
;
10536 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
10540 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
10542 SI opval
= tmp_tmpd
;
10543 SET_H_GR (FLD (f_operand2
), opval
);
10544 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10548 BI opval
= LTSI (tmp_tmpd
, 0);
10549 CPU (h_nbit
) = opval
;
10550 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10553 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10554 CPU (h_zbit
) = opval
;
10555 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10567 SET_H_INSN_PREFIXED_P (opval
);
10568 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10578 CASE (sem
, INSN_ANDQ
) : /* andq $i,$Rd */
10580 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10581 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10582 #define FLD(f) abuf->fields.sfmt_andq.f
10583 int UNUSED written
= 0;
10584 IADDR UNUSED pc
= abuf
->addr
;
10585 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10589 tmp_tmpd
= ANDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
10591 SI opval
= tmp_tmpd
;
10592 SET_H_GR (FLD (f_operand2
), opval
);
10593 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10597 BI opval
= LTSI (tmp_tmpd
, 0);
10598 CPU (h_nbit
) = opval
;
10599 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10602 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10603 CPU (h_zbit
) = opval
;
10604 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10606 SET_H_CBIT_MOVE (0);
10607 SET_H_VBIT_MOVE (0);
10611 CPU (h_xbit
) = opval
;
10612 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10616 SET_H_INSN_PREFIXED_P (opval
);
10617 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10627 CASE (sem
, INSN_ORR_B_R
) : /* orr.b $Rs,$Rd */
10629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10631 #define FLD(f) abuf->fields.sfmt_addc_m.f
10632 int UNUSED written
= 0;
10633 IADDR UNUSED pc
= abuf
->addr
;
10634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10638 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10641 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10643 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10644 SET_H_GR (FLD (f_operand2
), opval
);
10645 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10650 BI opval
= LTQI (tmp_tmpd
, 0);
10651 CPU (h_nbit
) = opval
;
10652 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10655 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10656 CPU (h_zbit
) = opval
;
10657 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10659 SET_H_CBIT_MOVE (0);
10660 SET_H_VBIT_MOVE (0);
10664 CPU (h_xbit
) = opval
;
10665 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10669 SET_H_INSN_PREFIXED_P (opval
);
10670 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10680 CASE (sem
, INSN_ORR_W_R
) : /* orr.w $Rs,$Rd */
10682 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10683 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10684 #define FLD(f) abuf->fields.sfmt_addc_m.f
10685 int UNUSED written
= 0;
10686 IADDR UNUSED pc
= abuf
->addr
;
10687 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10691 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10694 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
10696 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10697 SET_H_GR (FLD (f_operand2
), opval
);
10698 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10703 BI opval
= LTHI (tmp_tmpd
, 0);
10704 CPU (h_nbit
) = opval
;
10705 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10708 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10709 CPU (h_zbit
) = opval
;
10710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10712 SET_H_CBIT_MOVE (0);
10713 SET_H_VBIT_MOVE (0);
10717 CPU (h_xbit
) = opval
;
10718 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10722 SET_H_INSN_PREFIXED_P (opval
);
10723 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10733 CASE (sem
, INSN_ORR_D_R
) : /* orr.d $Rs,$Rd */
10735 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10736 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10737 #define FLD(f) abuf->fields.sfmt_addc_m.f
10738 int UNUSED written
= 0;
10739 IADDR UNUSED pc
= abuf
->addr
;
10740 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10744 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
10746 SI opval
= tmp_tmpd
;
10747 SET_H_GR (FLD (f_operand2
), opval
);
10748 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10752 BI opval
= LTSI (tmp_tmpd
, 0);
10753 CPU (h_nbit
) = opval
;
10754 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10757 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10758 CPU (h_zbit
) = opval
;
10759 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10761 SET_H_CBIT_MOVE (0);
10762 SET_H_VBIT_MOVE (0);
10766 CPU (h_xbit
) = opval
;
10767 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10771 SET_H_INSN_PREFIXED_P (opval
);
10772 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10782 CASE (sem
, INSN_OR_M_B_M
) : /* or-m.b [${Rs}${inc}],${Rd} */
10784 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10785 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10786 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10787 int UNUSED written
= 0;
10788 IADDR UNUSED pc
= abuf
->addr
;
10789 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10793 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10796 tmp_postinc
= FLD (f_memmode
);
10797 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10798 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
10799 ; if (NEBI (tmp_postinc
, 0)) {
10801 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10802 tmp_addr
= ADDSI (tmp_addr
, 1);
10805 SI opval
= tmp_addr
;
10806 SET_H_GR (FLD (f_operand1
), opval
);
10807 written
|= (1 << 11);
10808 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10812 ; tmp_tmp_mem
; }));
10815 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10817 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
10818 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10819 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10824 BI opval
= LTQI (tmp_tmpd
, 0);
10825 CPU (h_nbit
) = opval
;
10826 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10829 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10830 CPU (h_zbit
) = opval
;
10831 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10833 SET_H_CBIT_MOVE (0);
10834 SET_H_VBIT_MOVE (0);
10838 CPU (h_xbit
) = opval
;
10839 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10843 SET_H_INSN_PREFIXED_P (opval
);
10844 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10850 abuf
->written
= written
;
10855 CASE (sem
, INSN_OR_M_W_M
) : /* or-m.w [${Rs}${inc}],${Rd} */
10857 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10858 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10859 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10860 int UNUSED written
= 0;
10861 IADDR UNUSED pc
= abuf
->addr
;
10862 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10866 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10869 tmp_postinc
= FLD (f_memmode
);
10870 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10871 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
10872 ; if (NEBI (tmp_postinc
, 0)) {
10874 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10875 tmp_addr
= ADDSI (tmp_addr
, 2);
10878 SI opval
= tmp_addr
;
10879 SET_H_GR (FLD (f_operand1
), opval
);
10880 written
|= (1 << 11);
10881 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10885 ; tmp_tmp_mem
; }));
10888 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
10890 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
10891 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10892 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10897 BI opval
= LTHI (tmp_tmpd
, 0);
10898 CPU (h_nbit
) = opval
;
10899 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10902 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10903 CPU (h_zbit
) = opval
;
10904 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10906 SET_H_CBIT_MOVE (0);
10907 SET_H_VBIT_MOVE (0);
10911 CPU (h_xbit
) = opval
;
10912 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10916 SET_H_INSN_PREFIXED_P (opval
);
10917 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10923 abuf
->written
= written
;
10928 CASE (sem
, INSN_OR_M_D_M
) : /* or-m.d [${Rs}${inc}],${Rd} */
10930 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
10931 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
10932 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
10933 int UNUSED written
= 0;
10934 IADDR UNUSED pc
= abuf
->addr
;
10935 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
10939 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), ({ SI tmp_addr
;
10942 tmp_postinc
= FLD (f_memmode
);
10943 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
10944 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
10945 ; if (NEBI (tmp_postinc
, 0)) {
10947 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
10948 tmp_addr
= ADDSI (tmp_addr
, 4);
10951 SI opval
= tmp_addr
;
10952 SET_H_GR (FLD (f_operand1
), opval
);
10953 written
|= (1 << 10);
10954 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10958 ; tmp_tmp_mem
; }));
10960 SI opval
= tmp_tmpd
;
10961 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
10962 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
10966 BI opval
= LTSI (tmp_tmpd
, 0);
10967 CPU (h_nbit
) = opval
;
10968 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
10971 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
10972 CPU (h_zbit
) = opval
;
10973 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
10975 SET_H_CBIT_MOVE (0);
10976 SET_H_VBIT_MOVE (0);
10980 CPU (h_xbit
) = opval
;
10981 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
10985 SET_H_INSN_PREFIXED_P (opval
);
10986 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
10992 abuf
->written
= written
;
10997 CASE (sem
, INSN_ORCBR
) : /* or.b ${sconst8}],${Rd} */
10999 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11000 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11001 #define FLD(f) abuf->fields.sfmt_addcbr.f
11002 int UNUSED written
= 0;
11003 IADDR UNUSED pc
= abuf
->addr
;
11004 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11008 tmp_tmpd
= ORQI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__byte
));
11011 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11013 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11014 SET_H_GR (FLD (f_operand2
), opval
);
11015 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11020 BI opval
= LTQI (tmp_tmpd
, 0);
11021 CPU (h_nbit
) = opval
;
11022 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11025 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11026 CPU (h_zbit
) = opval
;
11027 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11029 SET_H_CBIT_MOVE (0);
11030 SET_H_VBIT_MOVE (0);
11034 CPU (h_xbit
) = opval
;
11035 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11039 SET_H_INSN_PREFIXED_P (opval
);
11040 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11050 CASE (sem
, INSN_ORCWR
) : /* or.w ${sconst16}],${Rd} */
11052 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11053 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11054 #define FLD(f) abuf->fields.sfmt_addcwr.f
11055 int UNUSED written
= 0;
11056 IADDR UNUSED pc
= abuf
->addr
;
11057 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
11061 tmp_tmpd
= ORHI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__word
));
11064 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11066 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11067 SET_H_GR (FLD (f_operand2
), opval
);
11068 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11073 BI opval
= LTHI (tmp_tmpd
, 0);
11074 CPU (h_nbit
) = opval
;
11075 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11078 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11079 CPU (h_zbit
) = opval
;
11080 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11082 SET_H_CBIT_MOVE (0);
11083 SET_H_VBIT_MOVE (0);
11087 CPU (h_xbit
) = opval
;
11088 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11092 SET_H_INSN_PREFIXED_P (opval
);
11093 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11103 CASE (sem
, INSN_ORCDR
) : /* or.d ${const32}],${Rd} */
11105 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11106 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11107 #define FLD(f) abuf->fields.sfmt_addcdr.f
11108 int UNUSED written
= 0;
11109 IADDR UNUSED pc
= abuf
->addr
;
11110 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
11114 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
11116 SI opval
= tmp_tmpd
;
11117 SET_H_GR (FLD (f_operand2
), opval
);
11118 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11122 BI opval
= LTSI (tmp_tmpd
, 0);
11123 CPU (h_nbit
) = opval
;
11124 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11127 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11128 CPU (h_zbit
) = opval
;
11129 CGEN_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 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11141 SET_H_INSN_PREFIXED_P (opval
);
11142 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11152 CASE (sem
, INSN_ORQ
) : /* orq $i,$Rd */
11154 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11155 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11156 #define FLD(f) abuf->fields.sfmt_andq.f
11157 int UNUSED written
= 0;
11158 IADDR UNUSED pc
= abuf
->addr
;
11159 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11163 tmp_tmpd
= ORSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s6
));
11165 SI opval
= tmp_tmpd
;
11166 SET_H_GR (FLD (f_operand2
), opval
);
11167 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11171 BI opval
= LTSI (tmp_tmpd
, 0);
11172 CPU (h_nbit
) = opval
;
11173 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11176 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11177 CPU (h_zbit
) = opval
;
11178 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11180 SET_H_CBIT_MOVE (0);
11181 SET_H_VBIT_MOVE (0);
11185 CPU (h_xbit
) = opval
;
11186 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11190 SET_H_INSN_PREFIXED_P (opval
);
11191 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11201 CASE (sem
, INSN_XOR
) : /* xor $Rs,$Rd */
11203 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11204 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11205 #define FLD(f) abuf->fields.sfmt_muls_b.f
11206 int UNUSED written
= 0;
11207 IADDR UNUSED pc
= abuf
->addr
;
11208 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11212 tmp_tmpd
= XORSI (GET_H_GR (FLD (f_operand2
)), GET_H_GR (FLD (f_operand1
)));
11214 SI opval
= tmp_tmpd
;
11215 SET_H_GR (FLD (f_operand2
), opval
);
11216 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11220 BI opval
= LTSI (tmp_tmpd
, 0);
11221 CPU (h_nbit
) = opval
;
11222 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11225 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11226 CPU (h_zbit
) = opval
;
11227 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11229 SET_H_CBIT_MOVE (0);
11230 SET_H_VBIT_MOVE (0);
11234 CPU (h_xbit
) = opval
;
11235 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11239 SET_H_INSN_PREFIXED_P (opval
);
11240 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11250 CASE (sem
, INSN_SWAP
) : /* swap${swapoption} ${Rs} */
11252 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11253 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11254 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
11255 int UNUSED written
= 0;
11256 IADDR UNUSED pc
= abuf
->addr
;
11257 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11262 tmp_tmps
= GET_H_GR (FLD (f_operand1
));
11263 tmp_tmpd
= ({ SI tmp_tmpcode
;
11266 tmp_tmpcode
= FLD (f_operand2
);
11267 ; tmp_tmpval
= tmp_tmps
;
11268 ; if (EQSI (tmp_tmpcode
, 0)) {
11269 tmp_tmpres
= (cgen_rtx_error (current_cpu
, "SWAP without swap modifier isn't implemented"), 0);
11271 else if (EQSI (tmp_tmpcode
, 1)) {
11272 tmp_tmpres
= ({ SI tmp_tmpr
;
11273 tmp_tmpr
= tmp_tmpval
;
11274 ; 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)))))))); });
11276 else if (EQSI (tmp_tmpcode
, 2)) {
11277 tmp_tmpres
= ({ SI tmp_tmpb
;
11278 tmp_tmpb
= tmp_tmpval
;
11279 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11281 else if (EQSI (tmp_tmpcode
, 3)) {
11282 tmp_tmpres
= ({ SI tmp_tmpr
;
11283 tmp_tmpr
= ({ SI tmp_tmpb
;
11284 tmp_tmpb
= tmp_tmpval
;
11285 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11286 ; 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)))))))); });
11288 else if (EQSI (tmp_tmpcode
, 4)) {
11289 tmp_tmpres
= ({ SI tmp_tmpw
;
11290 tmp_tmpw
= tmp_tmpval
;
11291 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11293 else if (EQSI (tmp_tmpcode
, 5)) {
11294 tmp_tmpres
= ({ SI tmp_tmpr
;
11295 tmp_tmpr
= ({ SI tmp_tmpw
;
11296 tmp_tmpw
= tmp_tmpval
;
11297 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11298 ; 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)))))))); });
11300 else if (EQSI (tmp_tmpcode
, 6)) {
11301 tmp_tmpres
= ({ SI tmp_tmpb
;
11302 tmp_tmpb
= ({ SI tmp_tmpw
;
11303 tmp_tmpw
= tmp_tmpval
;
11304 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11305 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11307 else if (EQSI (tmp_tmpcode
, 7)) {
11308 tmp_tmpres
= ({ SI tmp_tmpr
;
11309 tmp_tmpr
= ({ SI tmp_tmpb
;
11310 tmp_tmpb
= ({ SI tmp_tmpw
;
11311 tmp_tmpw
= tmp_tmpval
;
11312 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11313 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11314 ; 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)))))))); });
11316 else if (EQSI (tmp_tmpcode
, 8)) {
11317 tmp_tmpres
= INVSI (tmp_tmpval
);
11319 else if (EQSI (tmp_tmpcode
, 9)) {
11320 tmp_tmpres
= ({ SI tmp_tmpr
;
11321 tmp_tmpr
= INVSI (tmp_tmpval
);
11322 ; 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)))))))); });
11324 else if (EQSI (tmp_tmpcode
, 10)) {
11325 tmp_tmpres
= ({ SI tmp_tmpb
;
11326 tmp_tmpb
= INVSI (tmp_tmpval
);
11327 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11329 else if (EQSI (tmp_tmpcode
, 11)) {
11330 tmp_tmpres
= ({ SI tmp_tmpr
;
11331 tmp_tmpr
= ({ SI tmp_tmpb
;
11332 tmp_tmpb
= INVSI (tmp_tmpval
);
11333 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11334 ; 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)))))))); });
11336 else if (EQSI (tmp_tmpcode
, 12)) {
11337 tmp_tmpres
= ({ SI tmp_tmpw
;
11338 tmp_tmpw
= INVSI (tmp_tmpval
);
11339 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11341 else if (EQSI (tmp_tmpcode
, 13)) {
11342 tmp_tmpres
= ({ SI tmp_tmpr
;
11343 tmp_tmpr
= ({ SI tmp_tmpw
;
11344 tmp_tmpw
= INVSI (tmp_tmpval
);
11345 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11346 ; 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)))))))); });
11348 else if (EQSI (tmp_tmpcode
, 14)) {
11349 tmp_tmpres
= ({ SI tmp_tmpb
;
11350 tmp_tmpb
= ({ SI tmp_tmpw
;
11351 tmp_tmpw
= INVSI (tmp_tmpval
);
11352 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11353 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11355 else if (EQSI (tmp_tmpcode
, 15)) {
11356 tmp_tmpres
= ({ SI tmp_tmpr
;
11357 tmp_tmpr
= ({ SI tmp_tmpb
;
11358 tmp_tmpb
= ({ SI tmp_tmpw
;
11359 tmp_tmpw
= INVSI (tmp_tmpval
);
11360 ; ORSI (ANDSI (SLLSI (tmp_tmpw
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpw
, 16), 65535)); });
11361 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 8), 0xff00ff00), ANDSI (SRLSI (tmp_tmpb
, 8), 16711935)); });
11362 ; 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)))))))); });
11365 cgen_rtx_error (current_cpu
, "Unknown swapcode");
11369 SI opval
= tmp_tmpd
;
11370 SET_H_GR (FLD (f_operand1
), opval
);
11371 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11375 BI opval
= LTSI (tmp_tmpd
, 0);
11376 CPU (h_nbit
) = opval
;
11377 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11380 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11381 CPU (h_zbit
) = opval
;
11382 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11384 SET_H_CBIT_MOVE (0);
11385 SET_H_VBIT_MOVE (0);
11389 CPU (h_xbit
) = opval
;
11390 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11394 SET_H_INSN_PREFIXED_P (opval
);
11395 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11405 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11407 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11408 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11409 #define FLD(f) abuf->fields.sfmt_addc_m.f
11410 int UNUSED written
= 0;
11411 IADDR UNUSED pc
= abuf
->addr
;
11412 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11418 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11419 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11420 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11423 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11425 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11426 SET_H_GR (FLD (f_operand2
), opval
);
11427 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11432 BI opval
= LTQI (tmp_tmpd
, 0);
11433 CPU (h_nbit
) = opval
;
11434 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11437 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11438 CPU (h_zbit
) = opval
;
11439 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11441 SET_H_CBIT_MOVE (0);
11442 SET_H_VBIT_MOVE (0);
11446 CPU (h_xbit
) = opval
;
11447 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11451 SET_H_INSN_PREFIXED_P (opval
);
11452 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11462 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11464 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11465 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11466 #define FLD(f) abuf->fields.sfmt_addc_m.f
11467 int UNUSED written
= 0;
11468 IADDR UNUSED pc
= abuf
->addr
;
11469 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11475 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11476 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11477 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11480 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11482 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11483 SET_H_GR (FLD (f_operand2
), opval
);
11484 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11489 BI opval
= LTHI (tmp_tmpd
, 0);
11490 CPU (h_nbit
) = opval
;
11491 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11494 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11495 CPU (h_zbit
) = opval
;
11496 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11498 SET_H_CBIT_MOVE (0);
11499 SET_H_VBIT_MOVE (0);
11503 CPU (h_xbit
) = opval
;
11504 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11508 SET_H_INSN_PREFIXED_P (opval
);
11509 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11519 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11521 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11522 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11523 #define FLD(f) abuf->fields.sfmt_addc_m.f
11524 int UNUSED written
= 0;
11525 IADDR UNUSED pc
= abuf
->addr
;
11526 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11532 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11533 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11534 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11536 SI opval
= tmp_tmpd
;
11537 SET_H_GR (FLD (f_operand2
), opval
);
11538 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11542 BI opval
= LTSI (tmp_tmpd
, 0);
11543 CPU (h_nbit
) = opval
;
11544 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11547 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11548 CPU (h_zbit
) = opval
;
11549 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11551 SET_H_CBIT_MOVE (0);
11552 SET_H_VBIT_MOVE (0);
11556 CPU (h_xbit
) = opval
;
11557 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11561 SET_H_INSN_PREFIXED_P (opval
);
11562 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11572 CASE (sem
, INSN_ASRQ
) : /* asrq $c,${Rd} */
11574 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11575 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11576 #define FLD(f) abuf->fields.sfmt_asrq.f
11577 int UNUSED written
= 0;
11578 IADDR UNUSED pc
= abuf
->addr
;
11579 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11583 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11585 SI opval
= tmp_tmpd
;
11586 SET_H_GR (FLD (f_operand2
), opval
);
11587 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11591 BI opval
= LTSI (tmp_tmpd
, 0);
11592 CPU (h_nbit
) = opval
;
11593 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11596 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11597 CPU (h_zbit
) = opval
;
11598 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11600 SET_H_CBIT_MOVE (0);
11601 SET_H_VBIT_MOVE (0);
11605 CPU (h_xbit
) = opval
;
11606 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11610 SET_H_INSN_PREFIXED_P (opval
);
11611 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11621 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11623 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11624 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11625 #define FLD(f) abuf->fields.sfmt_addc_m.f
11626 int UNUSED written
= 0;
11627 IADDR UNUSED pc
= abuf
->addr
;
11628 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11633 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11634 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11637 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11639 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11640 SET_H_GR (FLD (f_operand2
), opval
);
11641 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11646 BI opval
= LTQI (tmp_tmpd
, 0);
11647 CPU (h_nbit
) = opval
;
11648 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11651 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11652 CPU (h_zbit
) = opval
;
11653 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11655 SET_H_CBIT_MOVE (0);
11656 SET_H_VBIT_MOVE (0);
11660 CPU (h_xbit
) = opval
;
11661 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11665 SET_H_INSN_PREFIXED_P (opval
);
11666 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11676 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11678 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11679 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11680 #define FLD(f) abuf->fields.sfmt_addc_m.f
11681 int UNUSED written
= 0;
11682 IADDR UNUSED pc
= abuf
->addr
;
11683 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11688 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11689 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11692 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11694 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11695 SET_H_GR (FLD (f_operand2
), opval
);
11696 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11701 BI opval
= LTHI (tmp_tmpd
, 0);
11702 CPU (h_nbit
) = opval
;
11703 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11706 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11707 CPU (h_zbit
) = opval
;
11708 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11710 SET_H_CBIT_MOVE (0);
11711 SET_H_VBIT_MOVE (0);
11715 CPU (h_xbit
) = opval
;
11716 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11720 SET_H_INSN_PREFIXED_P (opval
);
11721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11731 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11733 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11734 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11735 #define FLD(f) abuf->fields.sfmt_addc_m.f
11736 int UNUSED written
= 0;
11737 IADDR UNUSED pc
= abuf
->addr
;
11738 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11743 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11744 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11746 SI opval
= tmp_tmpd
;
11747 SET_H_GR (FLD (f_operand2
), opval
);
11748 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11752 BI opval
= LTSI (tmp_tmpd
, 0);
11753 CPU (h_nbit
) = opval
;
11754 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11757 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11758 CPU (h_zbit
) = opval
;
11759 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11761 SET_H_CBIT_MOVE (0);
11762 SET_H_VBIT_MOVE (0);
11766 CPU (h_xbit
) = opval
;
11767 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11771 SET_H_INSN_PREFIXED_P (opval
);
11772 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11782 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
11784 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11785 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11786 #define FLD(f) abuf->fields.sfmt_asrq.f
11787 int UNUSED written
= 0;
11788 IADDR UNUSED pc
= abuf
->addr
;
11789 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11793 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11795 SI opval
= tmp_tmpd
;
11796 SET_H_GR (FLD (f_operand2
), opval
);
11797 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11801 BI opval
= LTSI (tmp_tmpd
, 0);
11802 CPU (h_nbit
) = opval
;
11803 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11806 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11807 CPU (h_zbit
) = opval
;
11808 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11810 SET_H_CBIT_MOVE (0);
11811 SET_H_VBIT_MOVE (0);
11815 CPU (h_xbit
) = opval
;
11816 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11820 SET_H_INSN_PREFIXED_P (opval
);
11821 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11831 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
11833 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11835 #define FLD(f) abuf->fields.sfmt_addc_m.f
11836 int UNUSED written
= 0;
11837 IADDR UNUSED pc
= abuf
->addr
;
11838 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11843 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11844 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11847 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11849 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11850 SET_H_GR (FLD (f_operand2
), opval
);
11851 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11856 BI opval
= LTQI (tmp_tmpd
, 0);
11857 CPU (h_nbit
) = opval
;
11858 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11861 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11862 CPU (h_zbit
) = opval
;
11863 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11865 SET_H_CBIT_MOVE (0);
11866 SET_H_VBIT_MOVE (0);
11870 CPU (h_xbit
) = opval
;
11871 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11875 SET_H_INSN_PREFIXED_P (opval
);
11876 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11886 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
11888 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11889 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11890 #define FLD(f) abuf->fields.sfmt_addc_m.f
11891 int UNUSED written
= 0;
11892 IADDR UNUSED pc
= abuf
->addr
;
11893 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11898 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11899 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11902 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11904 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11905 SET_H_GR (FLD (f_operand2
), opval
);
11906 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11911 BI opval
= LTHI (tmp_tmpd
, 0);
11912 CPU (h_nbit
) = opval
;
11913 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11916 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11917 CPU (h_zbit
) = opval
;
11918 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11920 SET_H_CBIT_MOVE (0);
11921 SET_H_VBIT_MOVE (0);
11925 CPU (h_xbit
) = opval
;
11926 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11930 SET_H_INSN_PREFIXED_P (opval
);
11931 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11941 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
11943 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11944 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11945 #define FLD(f) abuf->fields.sfmt_addc_m.f
11946 int UNUSED written
= 0;
11947 IADDR UNUSED pc
= abuf
->addr
;
11948 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11953 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11954 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11956 SI opval
= tmp_tmpd
;
11957 SET_H_GR (FLD (f_operand2
), opval
);
11958 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11962 BI opval
= LTSI (tmp_tmpd
, 0);
11963 CPU (h_nbit
) = opval
;
11964 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11967 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11968 CPU (h_zbit
) = opval
;
11969 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11971 SET_H_CBIT_MOVE (0);
11972 SET_H_VBIT_MOVE (0);
11976 CPU (h_xbit
) = opval
;
11977 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11981 SET_H_INSN_PREFIXED_P (opval
);
11982 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11992 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
11994 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11995 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11996 #define FLD(f) abuf->fields.sfmt_asrq.f
11997 int UNUSED written
= 0;
11998 IADDR UNUSED pc
= abuf
->addr
;
11999 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12003 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
12005 SI opval
= tmp_tmpd
;
12006 SET_H_GR (FLD (f_operand2
), opval
);
12007 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12011 BI opval
= LTSI (tmp_tmpd
, 0);
12012 CPU (h_nbit
) = opval
;
12013 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12016 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12017 CPU (h_zbit
) = opval
;
12018 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12020 SET_H_CBIT_MOVE (0);
12021 SET_H_VBIT_MOVE (0);
12025 CPU (h_xbit
) = opval
;
12026 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12030 SET_H_INSN_PREFIXED_P (opval
);
12031 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12041 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
12043 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12044 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12045 #define FLD(f) abuf->fields.sfmt_muls_b.f
12046 int UNUSED written
= 0;
12047 IADDR UNUSED pc
= abuf
->addr
;
12048 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12053 tmp_cnt
= SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31));
12054 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), tmp_cnt
);
12057 BI opval
= LTSI (tmp_tmpd
, 0);
12058 CPU (h_nbit
) = opval
;
12059 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12062 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12063 CPU (h_zbit
) = opval
;
12064 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12066 SET_H_CBIT_MOVE (0);
12067 SET_H_VBIT_MOVE (0);
12071 CPU (h_xbit
) = opval
;
12072 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12076 SET_H_INSN_PREFIXED_P (opval
);
12077 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12087 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
12089 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12090 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12091 #define FLD(f) abuf->fields.sfmt_asrq.f
12092 int UNUSED written
= 0;
12093 IADDR UNUSED pc
= abuf
->addr
;
12094 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12098 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
12101 BI opval
= LTSI (tmp_tmpd
, 0);
12102 CPU (h_nbit
) = opval
;
12103 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12106 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12107 CPU (h_zbit
) = opval
;
12108 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12110 SET_H_CBIT_MOVE (0);
12111 SET_H_VBIT_MOVE (0);
12115 CPU (h_xbit
) = opval
;
12116 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12120 SET_H_INSN_PREFIXED_P (opval
);
12121 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12131 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
12133 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12134 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12135 #define FLD(f) abuf->fields.sfmt_setf.f
12136 int UNUSED written
= 0;
12137 IADDR UNUSED pc
= abuf
->addr
;
12138 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12142 tmp_tmp
= FLD (f_dstsrc
);
12143 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12146 CPU (h_cbit
) = opval
;
12147 written
|= (1 << 1);
12148 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12151 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12154 CPU (h_vbit
) = opval
;
12155 written
|= (1 << 7);
12156 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12159 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12162 CPU (h_zbit
) = opval
;
12163 written
|= (1 << 9);
12164 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12167 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12170 CPU (h_nbit
) = opval
;
12171 written
|= (1 << 3);
12172 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12175 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12178 CPU (h_xbit
) = opval
;
12179 written
|= (1 << 8);
12180 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12183 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12186 SET_H_IBIT (opval
);
12187 written
|= (1 << 2);
12188 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12191 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12194 SET_H_UBIT (opval
);
12195 written
|= (1 << 6);
12196 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12199 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12202 CPU (h_pbit
) = opval
;
12203 written
|= (1 << 4);
12204 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12209 SET_H_INSN_PREFIXED_P (opval
);
12210 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12212 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12215 CPU (h_xbit
) = opval
;
12216 written
|= (1 << 8);
12217 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12222 abuf
->written
= written
;
12227 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
12229 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12230 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12231 #define FLD(f) abuf->fields.sfmt_setf.f
12232 int UNUSED written
= 0;
12233 IADDR UNUSED pc
= abuf
->addr
;
12234 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12238 tmp_tmp
= FLD (f_dstsrc
);
12239 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12242 CPU (h_cbit
) = opval
;
12243 written
|= (1 << 1);
12244 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12247 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12250 CPU (h_vbit
) = opval
;
12251 written
|= (1 << 7);
12252 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12255 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12258 CPU (h_zbit
) = opval
;
12259 written
|= (1 << 9);
12260 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12263 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12266 CPU (h_nbit
) = opval
;
12267 written
|= (1 << 3);
12268 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12271 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12274 CPU (h_xbit
) = opval
;
12275 written
|= (1 << 8);
12276 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12279 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12282 SET_H_IBIT (opval
);
12283 written
|= (1 << 2);
12284 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12287 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12290 SET_H_UBIT (opval
);
12291 written
|= (1 << 6);
12292 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12295 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12298 CPU (h_pbit
) = opval
;
12299 written
|= (1 << 4);
12300 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12306 CPU (h_xbit
) = opval
;
12307 written
|= (1 << 8);
12308 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12312 SET_H_INSN_PREFIXED_P (opval
);
12313 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12318 abuf
->written
= written
;
12323 CASE (sem
, INSN_RFE
) : /* rfe */
12325 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12326 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12327 #define FLD(f) abuf->fields.sfmt_rfe.f
12328 int UNUSED written
= 0;
12329 IADDR UNUSED pc
= abuf
->addr
;
12330 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12338 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12339 tmp_keepmask
= 0xc0000000;
12340 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12341 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12342 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12344 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12345 SET_H_SR (((UINT
) 13), opval
);
12346 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12354 CASE (sem
, INSN_SFE
) : /* sfe */
12356 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12357 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12358 #define FLD(f) abuf->fields.sfmt_rfe.f
12359 int UNUSED written
= 0;
12360 IADDR UNUSED pc
= abuf
->addr
;
12361 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12366 tmp_savemask
= 0xc0000000;
12367 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12369 SI opval
= ORSI (ANDSI (tmp_savemask
, tmp_oldccs
), ANDSI (INVSI (tmp_savemask
), SLLSI (tmp_oldccs
, 10)));
12370 SET_H_SR (((UINT
) 13), opval
);
12371 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12379 CASE (sem
, INSN_RFG
) : /* rfg */
12381 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12382 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12383 #define FLD(f) abuf->fields.sfmt_empty.f
12384 int UNUSED written
= 0;
12385 IADDR UNUSED pc
= abuf
->addr
;
12386 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12388 crisv32f_rfg_handler (current_cpu
, pc
);
12394 CASE (sem
, INSN_RFN
) : /* rfn */
12396 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12398 #define FLD(f) abuf->fields.sfmt_rfe.f
12399 int UNUSED written
= 0;
12400 IADDR UNUSED pc
= abuf
->addr
;
12401 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12410 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12411 tmp_keepmask
= 0xc0000000;
12412 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12413 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12414 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12416 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12417 SET_H_SR (((UINT
) 13), opval
);
12418 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12423 SET_H_MBIT (opval
);
12424 CGEN_TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
12432 CASE (sem
, INSN_HALT
) : /* halt */
12434 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12435 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12436 #define FLD(f) abuf->fields.sfmt_empty.f
12437 int UNUSED written
= 0;
12438 IADDR UNUSED pc
= abuf
->addr
;
12440 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12443 USI opval
= crisv32f_halt_handler (current_cpu
, pc
);
12444 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12445 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12448 SEM_BRANCH_FINI (vpc
);
12453 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12455 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12456 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12457 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12458 int UNUSED written
= 0;
12459 IADDR UNUSED pc
= abuf
->addr
;
12461 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12465 tmp_truthval
= ({ SI tmp_tmpcond
;
12467 tmp_tmpcond
= FLD (f_operand2
);
12468 ; if (EQSI (tmp_tmpcond
, 0)) {
12469 tmp_condres
= NOTBI (CPU (h_cbit
));
12471 else if (EQSI (tmp_tmpcond
, 1)) {
12472 tmp_condres
= CPU (h_cbit
);
12474 else if (EQSI (tmp_tmpcond
, 2)) {
12475 tmp_condres
= NOTBI (CPU (h_zbit
));
12477 else if (EQSI (tmp_tmpcond
, 3)) {
12478 tmp_condres
= CPU (h_zbit
);
12480 else if (EQSI (tmp_tmpcond
, 4)) {
12481 tmp_condres
= NOTBI (CPU (h_vbit
));
12483 else if (EQSI (tmp_tmpcond
, 5)) {
12484 tmp_condres
= CPU (h_vbit
);
12486 else if (EQSI (tmp_tmpcond
, 6)) {
12487 tmp_condres
= NOTBI (CPU (h_nbit
));
12489 else if (EQSI (tmp_tmpcond
, 7)) {
12490 tmp_condres
= CPU (h_nbit
);
12492 else if (EQSI (tmp_tmpcond
, 8)) {
12493 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12495 else if (EQSI (tmp_tmpcond
, 9)) {
12496 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12498 else if (EQSI (tmp_tmpcond
, 10)) {
12499 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12501 else if (EQSI (tmp_tmpcond
, 11)) {
12502 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12504 else if (EQSI (tmp_tmpcond
, 12)) {
12505 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12507 else if (EQSI (tmp_tmpcond
, 13)) {
12508 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12510 else if (EQSI (tmp_tmpcond
, 14)) {
12513 else if (EQSI (tmp_tmpcond
, 15)) {
12514 tmp_condres
= CPU (h_pbit
);
12517 cgen_rtx_error (current_cpu
, "Unknown condition code");
12520 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12524 CPU (h_xbit
) = opval
;
12525 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12529 SET_H_INSN_PREFIXED_P (opval
);
12530 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12533 if (tmp_truthval
) {
12536 USI opval
= FLD (i_o_pcrel
);
12537 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12538 written
|= (1 << 8);
12539 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12545 abuf
->written
= written
;
12546 SEM_BRANCH_FINI (vpc
);
12551 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12553 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12554 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12555 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12556 int UNUSED written
= 0;
12557 IADDR UNUSED pc
= abuf
->addr
;
12559 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12565 CPU (h_xbit
) = opval
;
12566 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12570 SET_H_INSN_PREFIXED_P (opval
);
12571 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12576 USI opval
= FLD (i_o_pcrel
);
12577 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12578 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12583 SEM_BRANCH_FINI (vpc
);
12588 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12590 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12591 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12592 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12593 int UNUSED written
= 0;
12594 IADDR UNUSED pc
= abuf
->addr
;
12596 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12600 tmp_truthval
= ({ SI tmp_tmpcond
;
12602 tmp_tmpcond
= FLD (f_operand2
);
12603 ; if (EQSI (tmp_tmpcond
, 0)) {
12604 tmp_condres
= NOTBI (CPU (h_cbit
));
12606 else if (EQSI (tmp_tmpcond
, 1)) {
12607 tmp_condres
= CPU (h_cbit
);
12609 else if (EQSI (tmp_tmpcond
, 2)) {
12610 tmp_condres
= NOTBI (CPU (h_zbit
));
12612 else if (EQSI (tmp_tmpcond
, 3)) {
12613 tmp_condres
= CPU (h_zbit
);
12615 else if (EQSI (tmp_tmpcond
, 4)) {
12616 tmp_condres
= NOTBI (CPU (h_vbit
));
12618 else if (EQSI (tmp_tmpcond
, 5)) {
12619 tmp_condres
= CPU (h_vbit
);
12621 else if (EQSI (tmp_tmpcond
, 6)) {
12622 tmp_condres
= NOTBI (CPU (h_nbit
));
12624 else if (EQSI (tmp_tmpcond
, 7)) {
12625 tmp_condres
= CPU (h_nbit
);
12627 else if (EQSI (tmp_tmpcond
, 8)) {
12628 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12630 else if (EQSI (tmp_tmpcond
, 9)) {
12631 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12633 else if (EQSI (tmp_tmpcond
, 10)) {
12634 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12636 else if (EQSI (tmp_tmpcond
, 11)) {
12637 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12639 else if (EQSI (tmp_tmpcond
, 12)) {
12640 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12642 else if (EQSI (tmp_tmpcond
, 13)) {
12643 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12645 else if (EQSI (tmp_tmpcond
, 14)) {
12648 else if (EQSI (tmp_tmpcond
, 15)) {
12649 tmp_condres
= CPU (h_pbit
);
12652 cgen_rtx_error (current_cpu
, "Unknown condition code");
12655 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12659 CPU (h_xbit
) = opval
;
12660 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12664 SET_H_INSN_PREFIXED_P (opval
);
12665 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12668 if (tmp_truthval
) {
12671 USI opval
= FLD (i_o_word_pcrel
);
12672 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12673 written
|= (1 << 8);
12674 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12680 abuf
->written
= written
;
12681 SEM_BRANCH_FINI (vpc
);
12686 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12688 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12689 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12690 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12691 int UNUSED written
= 0;
12692 IADDR UNUSED pc
= abuf
->addr
;
12694 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12700 CPU (h_xbit
) = opval
;
12701 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12705 SET_H_INSN_PREFIXED_P (opval
);
12706 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12711 USI opval
= FLD (i_o_word_pcrel
);
12712 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12713 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12718 SEM_BRANCH_FINI (vpc
);
12723 CASE (sem
, INSN_JAS_R
) : /* jas ${Rs},${Pd} */
12725 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12726 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12727 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12728 int UNUSED written
= 0;
12729 IADDR UNUSED pc
= abuf
->addr
;
12731 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12737 CPU (h_xbit
) = opval
;
12738 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12742 SET_H_INSN_PREFIXED_P (opval
);
12743 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12746 if (ANDIF (EQSI (FLD (f_operand1
), 1), EQSI (FLD (f_operand2
), 11))) {
12747 cris_flush_simulator_decode_cache (current_cpu
, pc
);
12752 SI opval
= ADDSI (pc
, 4);
12753 SET_H_SR (FLD (f_operand2
), opval
);
12754 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12757 USI opval
= GET_H_GR (FLD (f_operand1
));
12758 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12759 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12765 SEM_BRANCH_FINI (vpc
);
12770 CASE (sem
, INSN_JAS_C
) : /* jas ${const32},${Pd} */
12772 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12773 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12774 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12775 int UNUSED written
= 0;
12776 IADDR UNUSED pc
= abuf
->addr
;
12778 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12784 CPU (h_xbit
) = opval
;
12785 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12789 SET_H_INSN_PREFIXED_P (opval
);
12790 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12796 SI opval
= ADDSI (pc
, 8);
12797 SET_H_SR (FLD (f_operand2
), opval
);
12798 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12801 USI opval
= FLD (f_indir_pc__dword
);
12802 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12803 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12809 SEM_BRANCH_FINI (vpc
);
12814 CASE (sem
, INSN_JUMP_P
) : /* jump ${Ps} */
12816 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12817 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12818 #define FLD(f) abuf->fields.sfmt_mcp.f
12819 int UNUSED written
= 0;
12820 IADDR UNUSED pc
= abuf
->addr
;
12822 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12828 CPU (h_xbit
) = opval
;
12829 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12833 SET_H_INSN_PREFIXED_P (opval
);
12834 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12839 USI opval
= GET_H_SR (FLD (f_operand2
));
12840 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12841 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12846 SEM_BRANCH_FINI (vpc
);
12851 CASE (sem
, INSN_BAS_C
) : /* bas ${const32},${Pd} */
12853 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12854 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12855 #define FLD(f) abuf->fields.sfmt_bas_c.f
12856 int UNUSED written
= 0;
12857 IADDR UNUSED pc
= abuf
->addr
;
12859 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12865 CPU (h_xbit
) = opval
;
12866 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12870 SET_H_INSN_PREFIXED_P (opval
);
12871 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12877 SI opval
= ADDSI (pc
, 8);
12878 SET_H_SR (FLD (f_operand2
), opval
);
12879 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12882 USI opval
= FLD (i_const32_pcrel
);
12883 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12884 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12890 SEM_BRANCH_FINI (vpc
);
12895 CASE (sem
, INSN_JASC_R
) : /* jasc ${Rs},${Pd} */
12897 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12898 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12899 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12900 int UNUSED written
= 0;
12901 IADDR UNUSED pc
= abuf
->addr
;
12903 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12909 CPU (h_xbit
) = opval
;
12910 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12914 SET_H_INSN_PREFIXED_P (opval
);
12915 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12921 SI opval
= ADDSI (pc
, 8);
12922 SET_H_SR (FLD (f_operand2
), opval
);
12923 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12926 USI opval
= GET_H_GR (FLD (f_operand1
));
12927 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12928 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12934 SEM_BRANCH_FINI (vpc
);
12939 CASE (sem
, INSN_JASC_C
) : /* jasc ${const32},${Pd} */
12941 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12943 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12944 int UNUSED written
= 0;
12945 IADDR UNUSED pc
= abuf
->addr
;
12947 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12953 CPU (h_xbit
) = opval
;
12954 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12958 SET_H_INSN_PREFIXED_P (opval
);
12959 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12965 SI opval
= ADDSI (pc
, 12);
12966 SET_H_SR (FLD (f_operand2
), opval
);
12967 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12970 USI opval
= FLD (f_indir_pc__dword
);
12971 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12972 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12978 SEM_BRANCH_FINI (vpc
);
12983 CASE (sem
, INSN_BASC_C
) : /* basc ${const32},${Pd} */
12985 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12986 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12987 #define FLD(f) abuf->fields.sfmt_bas_c.f
12988 int UNUSED written
= 0;
12989 IADDR UNUSED pc
= abuf
->addr
;
12991 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12997 CPU (h_xbit
) = opval
;
12998 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13002 SET_H_INSN_PREFIXED_P (opval
);
13003 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13009 SI opval
= ADDSI (pc
, 12);
13010 SET_H_SR (FLD (f_operand2
), opval
);
13011 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13014 USI opval
= FLD (i_const32_pcrel
);
13015 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13016 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13022 SEM_BRANCH_FINI (vpc
);
13027 CASE (sem
, INSN_BREAK
) : /* break $n */
13029 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13031 #define FLD(f) abuf->fields.sfmt_break.f
13032 int UNUSED written
= 0;
13033 IADDR UNUSED pc
= abuf
->addr
;
13035 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13041 CPU (h_xbit
) = opval
;
13042 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13046 SET_H_INSN_PREFIXED_P (opval
);
13047 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13051 USI opval
= crisv32f_break_handler (current_cpu
, FLD (f_u4
), pc
);
13052 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13053 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13057 SEM_BRANCH_FINI (vpc
);
13062 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
13064 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13065 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13066 #define FLD(f) abuf->fields.sfmt_muls_b.f
13067 int UNUSED written
= 0;
13068 IADDR UNUSED pc
= abuf
->addr
;
13069 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13075 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
13076 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13077 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13079 SI opval
= tmp_newval
;
13080 SET_H_GR (FLD (f_operand2
), opval
);
13081 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13085 BI opval
= LTSI (tmp_newval
, 0);
13086 CPU (h_nbit
) = opval
;
13087 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13090 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13091 CPU (h_zbit
) = opval
;
13092 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13094 SET_H_CBIT_MOVE (0);
13095 SET_H_VBIT_MOVE (0);
13099 CPU (h_xbit
) = opval
;
13100 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13104 SET_H_INSN_PREFIXED_P (opval
);
13105 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13115 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
13117 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13118 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13119 #define FLD(f) abuf->fields.sfmt_muls_b.f
13120 int UNUSED written
= 0;
13121 IADDR UNUSED pc
= abuf
->addr
;
13122 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13128 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
13129 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13130 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13132 SI opval
= tmp_newval
;
13133 SET_H_GR (FLD (f_operand2
), opval
);
13134 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13138 BI opval
= LTSI (tmp_newval
, 0);
13139 CPU (h_nbit
) = opval
;
13140 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13143 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13144 CPU (h_zbit
) = opval
;
13145 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13147 SET_H_CBIT_MOVE (0);
13148 SET_H_VBIT_MOVE (0);
13152 CPU (h_xbit
) = opval
;
13153 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13157 SET_H_INSN_PREFIXED_P (opval
);
13158 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13168 CASE (sem
, INSN_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
13170 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13171 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13172 #define FLD(f) abuf->fields.sfmt_muls_b.f
13173 int UNUSED written
= 0;
13174 IADDR UNUSED pc
= abuf
->addr
;
13175 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13181 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
13182 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13183 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13185 SI opval
= tmp_newval
;
13186 SET_H_GR (FLD (f_operand2
), opval
);
13187 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13191 BI opval
= LTSI (tmp_newval
, 0);
13192 CPU (h_nbit
) = opval
;
13193 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13196 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13197 CPU (h_zbit
) = opval
;
13198 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13200 SET_H_CBIT_MOVE (0);
13201 SET_H_VBIT_MOVE (0);
13205 CPU (h_xbit
) = opval
;
13206 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13210 SET_H_INSN_PREFIXED_P (opval
);
13211 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13221 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
13223 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13224 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13225 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13226 int UNUSED written
= 0;
13227 IADDR UNUSED pc
= abuf
->addr
;
13228 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13234 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
13235 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13236 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13238 SI opval
= tmp_newval
;
13239 SET_H_GR (FLD (f_operand2
), opval
);
13240 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13244 BI opval
= LTSI (tmp_newval
, 0);
13245 CPU (h_nbit
) = opval
;
13246 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13249 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13250 CPU (h_zbit
) = opval
;
13251 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13253 SET_H_CBIT_MOVE (0);
13254 SET_H_VBIT_MOVE (0);
13258 CPU (h_xbit
) = opval
;
13259 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13263 SET_H_INSN_PREFIXED_P (opval
);
13264 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13274 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
13276 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13277 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13278 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13279 int UNUSED written
= 0;
13280 IADDR UNUSED pc
= abuf
->addr
;
13281 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13287 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
13288 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13289 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13291 SI opval
= tmp_newval
;
13292 SET_H_GR (FLD (f_operand2
), opval
);
13293 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13297 BI opval
= LTSI (tmp_newval
, 0);
13298 CPU (h_nbit
) = opval
;
13299 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13302 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13303 CPU (h_zbit
) = opval
;
13304 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13306 SET_H_CBIT_MOVE (0);
13307 SET_H_VBIT_MOVE (0);
13311 CPU (h_xbit
) = opval
;
13312 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13316 SET_H_INSN_PREFIXED_P (opval
);
13317 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13327 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13329 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13330 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13331 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13332 int UNUSED written
= 0;
13333 IADDR UNUSED pc
= abuf
->addr
;
13334 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13340 tmp_tmpops
= FLD (f_indir_pc__dword
);
13341 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13342 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13344 SI opval
= tmp_newval
;
13345 SET_H_GR (FLD (f_operand2
), opval
);
13346 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13350 BI opval
= LTSI (tmp_newval
, 0);
13351 CPU (h_nbit
) = opval
;
13352 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13355 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13356 CPU (h_zbit
) = opval
;
13357 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13359 SET_H_CBIT_MOVE (0);
13360 SET_H_VBIT_MOVE (0);
13364 CPU (h_xbit
) = opval
;
13365 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13369 SET_H_INSN_PREFIXED_P (opval
);
13370 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13380 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13382 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13383 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13384 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13385 int UNUSED written
= 0;
13386 IADDR UNUSED pc
= abuf
->addr
;
13387 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13391 tmp_truthval
= ({ SI tmp_tmpcond
;
13393 tmp_tmpcond
= FLD (f_operand2
);
13394 ; if (EQSI (tmp_tmpcond
, 0)) {
13395 tmp_condres
= NOTBI (CPU (h_cbit
));
13397 else if (EQSI (tmp_tmpcond
, 1)) {
13398 tmp_condres
= CPU (h_cbit
);
13400 else if (EQSI (tmp_tmpcond
, 2)) {
13401 tmp_condres
= NOTBI (CPU (h_zbit
));
13403 else if (EQSI (tmp_tmpcond
, 3)) {
13404 tmp_condres
= CPU (h_zbit
);
13406 else if (EQSI (tmp_tmpcond
, 4)) {
13407 tmp_condres
= NOTBI (CPU (h_vbit
));
13409 else if (EQSI (tmp_tmpcond
, 5)) {
13410 tmp_condres
= CPU (h_vbit
);
13412 else if (EQSI (tmp_tmpcond
, 6)) {
13413 tmp_condres
= NOTBI (CPU (h_nbit
));
13415 else if (EQSI (tmp_tmpcond
, 7)) {
13416 tmp_condres
= CPU (h_nbit
);
13418 else if (EQSI (tmp_tmpcond
, 8)) {
13419 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13421 else if (EQSI (tmp_tmpcond
, 9)) {
13422 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13424 else if (EQSI (tmp_tmpcond
, 10)) {
13425 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13427 else if (EQSI (tmp_tmpcond
, 11)) {
13428 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13430 else if (EQSI (tmp_tmpcond
, 12)) {
13431 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13433 else if (EQSI (tmp_tmpcond
, 13)) {
13434 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13436 else if (EQSI (tmp_tmpcond
, 14)) {
13439 else if (EQSI (tmp_tmpcond
, 15)) {
13440 tmp_condres
= CPU (h_pbit
);
13443 cgen_rtx_error (current_cpu
, "Unknown condition code");
13447 SI opval
= ZEXTBISI (tmp_truthval
);
13448 SET_H_GR (FLD (f_operand1
), opval
);
13449 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13454 CPU (h_xbit
) = opval
;
13455 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13459 SET_H_INSN_PREFIXED_P (opval
);
13460 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13469 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13471 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13472 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13473 #define FLD(f) abuf->fields.sfmt_muls_b.f
13474 int UNUSED written
= 0;
13475 IADDR UNUSED pc
= abuf
->addr
;
13476 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13481 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13484 if (GESI (tmp_tmp
, 0)) {
13486 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13487 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13490 if (GESI (tmp_tmp
, 0)) {
13492 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13493 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13496 if (GESI (tmp_tmp
, 0)) {
13498 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13499 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13502 if (GESI (tmp_tmp
, 0)) {
13504 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13505 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13508 if (GESI (tmp_tmp
, 0)) {
13510 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13511 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13514 if (GESI (tmp_tmp
, 0)) {
13516 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13517 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13520 if (GESI (tmp_tmp
, 0)) {
13522 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13523 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13526 if (GESI (tmp_tmp
, 0)) {
13528 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13529 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13532 if (GESI (tmp_tmp
, 0)) {
13534 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13535 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13538 if (GESI (tmp_tmp
, 0)) {
13540 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13541 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13544 if (GESI (tmp_tmp
, 0)) {
13546 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13547 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13550 if (GESI (tmp_tmp
, 0)) {
13552 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13553 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13556 if (GESI (tmp_tmp
, 0)) {
13558 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13559 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13562 if (GESI (tmp_tmp
, 0)) {
13564 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13565 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13568 if (GESI (tmp_tmp
, 0)) {
13570 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13571 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13574 if (GESI (tmp_tmp
, 0)) {
13576 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13577 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13580 if (GESI (tmp_tmp
, 0)) {
13582 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13583 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13586 if (GESI (tmp_tmp
, 0)) {
13588 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13589 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13592 if (GESI (tmp_tmp
, 0)) {
13594 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13595 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13598 if (GESI (tmp_tmp
, 0)) {
13600 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13601 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13604 if (GESI (tmp_tmp
, 0)) {
13606 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13607 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13610 if (GESI (tmp_tmp
, 0)) {
13612 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13613 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13616 if (GESI (tmp_tmp
, 0)) {
13618 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13619 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13622 if (GESI (tmp_tmp
, 0)) {
13624 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13625 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13628 if (GESI (tmp_tmp
, 0)) {
13630 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13631 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13634 if (GESI (tmp_tmp
, 0)) {
13636 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13637 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13640 if (GESI (tmp_tmp
, 0)) {
13642 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13643 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13646 if (GESI (tmp_tmp
, 0)) {
13648 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13649 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13652 if (GESI (tmp_tmp
, 0)) {
13654 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13655 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13658 if (GESI (tmp_tmp
, 0)) {
13660 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13661 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13664 if (GESI (tmp_tmp
, 0)) {
13666 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13667 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13670 if (GESI (tmp_tmp
, 0)) {
13672 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13673 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13678 SI opval
= tmp_tmpd
;
13679 SET_H_GR (FLD (f_operand2
), opval
);
13680 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13684 BI opval
= LTSI (tmp_tmpd
, 0);
13685 CPU (h_nbit
) = opval
;
13686 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13689 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13690 CPU (h_zbit
) = opval
;
13691 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13693 SET_H_CBIT_MOVE (0);
13694 SET_H_VBIT_MOVE (0);
13698 CPU (h_xbit
) = opval
;
13699 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13703 SET_H_INSN_PREFIXED_P (opval
);
13704 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13714 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13716 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13717 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13718 #define FLD(f) abuf->fields.sfmt_addoq.f
13719 int UNUSED written
= 0;
13720 IADDR UNUSED pc
= abuf
->addr
;
13721 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13725 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13726 SET_H_PREFIXREG_V32 (opval
);
13727 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13731 SET_H_INSN_PREFIXED_P (opval
);
13732 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13740 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13742 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13743 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13744 #define FLD(f) abuf->fields.sfmt_addc_m.f
13745 int UNUSED written
= 0;
13746 IADDR UNUSED pc
= abuf
->addr
;
13747 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13751 tmp_tmps
= ({ SI tmp_addr
;
13754 tmp_postinc
= FLD (f_memmode
);
13755 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13756 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13757 ; if (NEBI (tmp_postinc
, 0)) {
13759 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13760 tmp_addr
= ADDSI (tmp_addr
, 1);
13763 SI opval
= tmp_addr
;
13764 SET_H_GR (FLD (f_operand1
), opval
);
13765 written
|= (1 << 6);
13766 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13772 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13773 SET_H_PREFIXREG_V32 (opval
);
13774 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13778 SET_H_INSN_PREFIXED_P (opval
);
13779 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13783 abuf
->written
= written
;
13788 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13790 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13791 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13792 #define FLD(f) abuf->fields.sfmt_addc_m.f
13793 int UNUSED written
= 0;
13794 IADDR UNUSED pc
= abuf
->addr
;
13795 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13799 tmp_tmps
= ({ SI tmp_addr
;
13802 tmp_postinc
= FLD (f_memmode
);
13803 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13804 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
13805 ; if (NEBI (tmp_postinc
, 0)) {
13807 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13808 tmp_addr
= ADDSI (tmp_addr
, 2);
13811 SI opval
= tmp_addr
;
13812 SET_H_GR (FLD (f_operand1
), opval
);
13813 written
|= (1 << 6);
13814 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13820 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
13821 SET_H_PREFIXREG_V32 (opval
);
13822 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13826 SET_H_INSN_PREFIXED_P (opval
);
13827 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13831 abuf
->written
= written
;
13836 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13838 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13839 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13840 #define FLD(f) abuf->fields.sfmt_addc_m.f
13841 int UNUSED written
= 0;
13842 IADDR UNUSED pc
= abuf
->addr
;
13843 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13847 tmp_tmps
= ({ SI tmp_addr
;
13850 tmp_postinc
= FLD (f_memmode
);
13851 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13852 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13853 ; if (NEBI (tmp_postinc
, 0)) {
13855 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13856 tmp_addr
= ADDSI (tmp_addr
, 4);
13859 SI opval
= tmp_addr
;
13860 SET_H_GR (FLD (f_operand1
), opval
);
13861 written
|= (1 << 6);
13862 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13868 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
13869 SET_H_PREFIXREG_V32 (opval
);
13870 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13874 SET_H_INSN_PREFIXED_P (opval
);
13875 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13879 abuf
->written
= written
;
13884 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
13886 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13887 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13888 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13889 int UNUSED written
= 0;
13890 IADDR UNUSED pc
= abuf
->addr
;
13891 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13895 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
13896 SET_H_PREFIXREG_V32 (opval
);
13897 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13901 SET_H_INSN_PREFIXED_P (opval
);
13902 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13910 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
13912 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13913 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13914 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13915 int UNUSED written
= 0;
13916 IADDR UNUSED pc
= abuf
->addr
;
13917 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13921 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
13922 SET_H_PREFIXREG_V32 (opval
);
13923 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13927 SET_H_INSN_PREFIXED_P (opval
);
13928 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13936 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
13938 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13939 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13940 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13941 int UNUSED written
= 0;
13942 IADDR UNUSED pc
= abuf
->addr
;
13943 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13947 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
13948 SET_H_PREFIXREG_V32 (opval
);
13949 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13953 SET_H_INSN_PREFIXED_P (opval
);
13954 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13962 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13964 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13965 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13966 #define FLD(f) abuf->fields.sfmt_muls_b.f
13967 int UNUSED written
= 0;
13968 IADDR UNUSED pc
= abuf
->addr
;
13969 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13973 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13974 SET_H_PREFIXREG_V32 (opval
);
13975 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13979 SET_H_INSN_PREFIXED_P (opval
);
13980 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13988 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13990 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13991 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13992 #define FLD(f) abuf->fields.sfmt_muls_b.f
13993 int UNUSED written
= 0;
13994 IADDR UNUSED pc
= abuf
->addr
;
13995 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13999 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
14000 SET_H_PREFIXREG_V32 (opval
);
14001 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14005 SET_H_INSN_PREFIXED_P (opval
);
14006 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14014 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14016 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14017 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14018 #define FLD(f) abuf->fields.sfmt_muls_b.f
14019 int UNUSED written
= 0;
14020 IADDR UNUSED pc
= abuf
->addr
;
14021 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14025 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14026 SET_H_PREFIXREG_V32 (opval
);
14027 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14031 SET_H_INSN_PREFIXED_P (opval
);
14032 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14040 CASE (sem
, INSN_FIDXI
) : /* fidxi [$Rs] */
14042 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14043 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14044 #define FLD(f) abuf->fields.sfmt_mcp.f
14045 int UNUSED written
= 0;
14046 IADDR UNUSED pc
= abuf
->addr
;
14048 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14051 USI opval
= crisv32f_fidxi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14052 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14053 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14056 SEM_BRANCH_FINI (vpc
);
14061 CASE (sem
, INSN_FTAGI
) : /* fidxi [$Rs] */
14063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14065 #define FLD(f) abuf->fields.sfmt_mcp.f
14066 int UNUSED written
= 0;
14067 IADDR UNUSED pc
= abuf
->addr
;
14069 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14072 USI opval
= crisv32f_ftagi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14073 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14074 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14077 SEM_BRANCH_FINI (vpc
);
14082 CASE (sem
, INSN_FIDXD
) : /* fidxd [$Rs] */
14084 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14085 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14086 #define FLD(f) abuf->fields.sfmt_mcp.f
14087 int UNUSED written
= 0;
14088 IADDR UNUSED pc
= abuf
->addr
;
14090 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14093 USI opval
= crisv32f_fidxd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14094 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14095 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14098 SEM_BRANCH_FINI (vpc
);
14103 CASE (sem
, INSN_FTAGD
) : /* ftagd [$Rs] */
14105 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14106 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14107 #define FLD(f) abuf->fields.sfmt_mcp.f
14108 int UNUSED written
= 0;
14109 IADDR UNUSED pc
= abuf
->addr
;
14111 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14114 USI opval
= crisv32f_ftagd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14115 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14116 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14119 SEM_BRANCH_FINI (vpc
);
14126 ENDSWITCH (sem
) /* End of semantic switch. */
14128 /* At this point `vpc' contains the next insn to execute. */
14131 #undef DEFINE_SWITCH
14132 #endif /* DEFINE_SWITCH */