1 /* Simulator instruction semantics for crisv32f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2020 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, see <http://www.gnu.org/licenses/>.
26 /* The labels have the case they have because the enum of insn types
27 is all uppercase and in the non-stdc case the insn symbol is built
28 into the enum name. */
34 { CRISV32F_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
35 { CRISV32F_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
36 { CRISV32F_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
37 { CRISV32F_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
38 { CRISV32F_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
39 { CRISV32F_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
40 { CRISV32F_INSN_MOVE_B_R
, && case_sem_INSN_MOVE_B_R
},
41 { CRISV32F_INSN_MOVE_W_R
, && case_sem_INSN_MOVE_W_R
},
42 { CRISV32F_INSN_MOVE_D_R
, && case_sem_INSN_MOVE_D_R
},
43 { CRISV32F_INSN_MOVEQ
, && case_sem_INSN_MOVEQ
},
44 { CRISV32F_INSN_MOVS_B_R
, && case_sem_INSN_MOVS_B_R
},
45 { CRISV32F_INSN_MOVS_W_R
, && case_sem_INSN_MOVS_W_R
},
46 { CRISV32F_INSN_MOVU_B_R
, && case_sem_INSN_MOVU_B_R
},
47 { CRISV32F_INSN_MOVU_W_R
, && case_sem_INSN_MOVU_W_R
},
48 { CRISV32F_INSN_MOVECBR
, && case_sem_INSN_MOVECBR
},
49 { CRISV32F_INSN_MOVECWR
, && case_sem_INSN_MOVECWR
},
50 { CRISV32F_INSN_MOVECDR
, && case_sem_INSN_MOVECDR
},
51 { CRISV32F_INSN_MOVSCBR
, && case_sem_INSN_MOVSCBR
},
52 { CRISV32F_INSN_MOVSCWR
, && case_sem_INSN_MOVSCWR
},
53 { CRISV32F_INSN_MOVUCBR
, && case_sem_INSN_MOVUCBR
},
54 { CRISV32F_INSN_MOVUCWR
, && case_sem_INSN_MOVUCWR
},
55 { CRISV32F_INSN_ADDQ
, && case_sem_INSN_ADDQ
},
56 { CRISV32F_INSN_SUBQ
, && case_sem_INSN_SUBQ
},
57 { CRISV32F_INSN_CMP_R_B_R
, && case_sem_INSN_CMP_R_B_R
},
58 { CRISV32F_INSN_CMP_R_W_R
, && case_sem_INSN_CMP_R_W_R
},
59 { CRISV32F_INSN_CMP_R_D_R
, && case_sem_INSN_CMP_R_D_R
},
60 { CRISV32F_INSN_CMP_M_B_M
, && case_sem_INSN_CMP_M_B_M
},
61 { CRISV32F_INSN_CMP_M_W_M
, && case_sem_INSN_CMP_M_W_M
},
62 { CRISV32F_INSN_CMP_M_D_M
, && case_sem_INSN_CMP_M_D_M
},
63 { CRISV32F_INSN_CMPCBR
, && case_sem_INSN_CMPCBR
},
64 { CRISV32F_INSN_CMPCWR
, && case_sem_INSN_CMPCWR
},
65 { CRISV32F_INSN_CMPCDR
, && case_sem_INSN_CMPCDR
},
66 { CRISV32F_INSN_CMPQ
, && case_sem_INSN_CMPQ
},
67 { CRISV32F_INSN_CMPS_M_B_M
, && case_sem_INSN_CMPS_M_B_M
},
68 { CRISV32F_INSN_CMPS_M_W_M
, && case_sem_INSN_CMPS_M_W_M
},
69 { CRISV32F_INSN_CMPSCBR
, && case_sem_INSN_CMPSCBR
},
70 { CRISV32F_INSN_CMPSCWR
, && case_sem_INSN_CMPSCWR
},
71 { CRISV32F_INSN_CMPU_M_B_M
, && case_sem_INSN_CMPU_M_B_M
},
72 { CRISV32F_INSN_CMPU_M_W_M
, && case_sem_INSN_CMPU_M_W_M
},
73 { CRISV32F_INSN_CMPUCBR
, && case_sem_INSN_CMPUCBR
},
74 { CRISV32F_INSN_CMPUCWR
, && case_sem_INSN_CMPUCWR
},
75 { CRISV32F_INSN_MOVE_M_B_M
, && case_sem_INSN_MOVE_M_B_M
},
76 { CRISV32F_INSN_MOVE_M_W_M
, && case_sem_INSN_MOVE_M_W_M
},
77 { CRISV32F_INSN_MOVE_M_D_M
, && case_sem_INSN_MOVE_M_D_M
},
78 { CRISV32F_INSN_MOVS_M_B_M
, && case_sem_INSN_MOVS_M_B_M
},
79 { CRISV32F_INSN_MOVS_M_W_M
, && case_sem_INSN_MOVS_M_W_M
},
80 { CRISV32F_INSN_MOVU_M_B_M
, && case_sem_INSN_MOVU_M_B_M
},
81 { CRISV32F_INSN_MOVU_M_W_M
, && case_sem_INSN_MOVU_M_W_M
},
82 { CRISV32F_INSN_MOVE_R_SPRV32
, && case_sem_INSN_MOVE_R_SPRV32
},
83 { CRISV32F_INSN_MOVE_SPR_RV32
, && case_sem_INSN_MOVE_SPR_RV32
},
84 { CRISV32F_INSN_MOVE_M_SPRV32
, && case_sem_INSN_MOVE_M_SPRV32
},
85 { CRISV32F_INSN_MOVE_C_SPRV32_P2
, && case_sem_INSN_MOVE_C_SPRV32_P2
},
86 { CRISV32F_INSN_MOVE_C_SPRV32_P3
, && case_sem_INSN_MOVE_C_SPRV32_P3
},
87 { CRISV32F_INSN_MOVE_C_SPRV32_P5
, && case_sem_INSN_MOVE_C_SPRV32_P5
},
88 { CRISV32F_INSN_MOVE_C_SPRV32_P6
, && case_sem_INSN_MOVE_C_SPRV32_P6
},
89 { CRISV32F_INSN_MOVE_C_SPRV32_P7
, && case_sem_INSN_MOVE_C_SPRV32_P7
},
90 { CRISV32F_INSN_MOVE_C_SPRV32_P9
, && case_sem_INSN_MOVE_C_SPRV32_P9
},
91 { CRISV32F_INSN_MOVE_C_SPRV32_P10
, && case_sem_INSN_MOVE_C_SPRV32_P10
},
92 { CRISV32F_INSN_MOVE_C_SPRV32_P11
, && case_sem_INSN_MOVE_C_SPRV32_P11
},
93 { CRISV32F_INSN_MOVE_C_SPRV32_P12
, && case_sem_INSN_MOVE_C_SPRV32_P12
},
94 { CRISV32F_INSN_MOVE_C_SPRV32_P13
, && case_sem_INSN_MOVE_C_SPRV32_P13
},
95 { CRISV32F_INSN_MOVE_C_SPRV32_P14
, && case_sem_INSN_MOVE_C_SPRV32_P14
},
96 { CRISV32F_INSN_MOVE_C_SPRV32_P15
, && case_sem_INSN_MOVE_C_SPRV32_P15
},
97 { CRISV32F_INSN_MOVE_SPR_MV32
, && case_sem_INSN_MOVE_SPR_MV32
},
98 { CRISV32F_INSN_MOVE_SS_R
, && case_sem_INSN_MOVE_SS_R
},
99 { CRISV32F_INSN_MOVE_R_SS
, && case_sem_INSN_MOVE_R_SS
},
100 { CRISV32F_INSN_MOVEM_R_M_V32
, && case_sem_INSN_MOVEM_R_M_V32
},
101 { CRISV32F_INSN_MOVEM_M_R_V32
, && case_sem_INSN_MOVEM_M_R_V32
},
102 { CRISV32F_INSN_ADD_B_R
, && case_sem_INSN_ADD_B_R
},
103 { CRISV32F_INSN_ADD_W_R
, && case_sem_INSN_ADD_W_R
},
104 { CRISV32F_INSN_ADD_D_R
, && case_sem_INSN_ADD_D_R
},
105 { CRISV32F_INSN_ADD_M_B_M
, && case_sem_INSN_ADD_M_B_M
},
106 { CRISV32F_INSN_ADD_M_W_M
, && case_sem_INSN_ADD_M_W_M
},
107 { CRISV32F_INSN_ADD_M_D_M
, && case_sem_INSN_ADD_M_D_M
},
108 { CRISV32F_INSN_ADDCBR
, && case_sem_INSN_ADDCBR
},
109 { CRISV32F_INSN_ADDCWR
, && case_sem_INSN_ADDCWR
},
110 { CRISV32F_INSN_ADDCDR
, && case_sem_INSN_ADDCDR
},
111 { CRISV32F_INSN_ADDS_B_R
, && case_sem_INSN_ADDS_B_R
},
112 { CRISV32F_INSN_ADDS_W_R
, && case_sem_INSN_ADDS_W_R
},
113 { CRISV32F_INSN_ADDS_M_B_M
, && case_sem_INSN_ADDS_M_B_M
},
114 { CRISV32F_INSN_ADDS_M_W_M
, && case_sem_INSN_ADDS_M_W_M
},
115 { CRISV32F_INSN_ADDSCBR
, && case_sem_INSN_ADDSCBR
},
116 { CRISV32F_INSN_ADDSCWR
, && case_sem_INSN_ADDSCWR
},
117 { CRISV32F_INSN_ADDU_B_R
, && case_sem_INSN_ADDU_B_R
},
118 { CRISV32F_INSN_ADDU_W_R
, && case_sem_INSN_ADDU_W_R
},
119 { CRISV32F_INSN_ADDU_M_B_M
, && case_sem_INSN_ADDU_M_B_M
},
120 { CRISV32F_INSN_ADDU_M_W_M
, && case_sem_INSN_ADDU_M_W_M
},
121 { CRISV32F_INSN_ADDUCBR
, && case_sem_INSN_ADDUCBR
},
122 { CRISV32F_INSN_ADDUCWR
, && case_sem_INSN_ADDUCWR
},
123 { CRISV32F_INSN_SUB_B_R
, && case_sem_INSN_SUB_B_R
},
124 { CRISV32F_INSN_SUB_W_R
, && case_sem_INSN_SUB_W_R
},
125 { CRISV32F_INSN_SUB_D_R
, && case_sem_INSN_SUB_D_R
},
126 { CRISV32F_INSN_SUB_M_B_M
, && case_sem_INSN_SUB_M_B_M
},
127 { CRISV32F_INSN_SUB_M_W_M
, && case_sem_INSN_SUB_M_W_M
},
128 { CRISV32F_INSN_SUB_M_D_M
, && case_sem_INSN_SUB_M_D_M
},
129 { CRISV32F_INSN_SUBCBR
, && case_sem_INSN_SUBCBR
},
130 { CRISV32F_INSN_SUBCWR
, && case_sem_INSN_SUBCWR
},
131 { CRISV32F_INSN_SUBCDR
, && case_sem_INSN_SUBCDR
},
132 { CRISV32F_INSN_SUBS_B_R
, && case_sem_INSN_SUBS_B_R
},
133 { CRISV32F_INSN_SUBS_W_R
, && case_sem_INSN_SUBS_W_R
},
134 { CRISV32F_INSN_SUBS_M_B_M
, && case_sem_INSN_SUBS_M_B_M
},
135 { CRISV32F_INSN_SUBS_M_W_M
, && case_sem_INSN_SUBS_M_W_M
},
136 { CRISV32F_INSN_SUBSCBR
, && case_sem_INSN_SUBSCBR
},
137 { CRISV32F_INSN_SUBSCWR
, && case_sem_INSN_SUBSCWR
},
138 { CRISV32F_INSN_SUBU_B_R
, && case_sem_INSN_SUBU_B_R
},
139 { CRISV32F_INSN_SUBU_W_R
, && case_sem_INSN_SUBU_W_R
},
140 { CRISV32F_INSN_SUBU_M_B_M
, && case_sem_INSN_SUBU_M_B_M
},
141 { CRISV32F_INSN_SUBU_M_W_M
, && case_sem_INSN_SUBU_M_W_M
},
142 { CRISV32F_INSN_SUBUCBR
, && case_sem_INSN_SUBUCBR
},
143 { CRISV32F_INSN_SUBUCWR
, && case_sem_INSN_SUBUCWR
},
144 { CRISV32F_INSN_ADDC_R
, && case_sem_INSN_ADDC_R
},
145 { CRISV32F_INSN_ADDC_M
, && case_sem_INSN_ADDC_M
},
146 { CRISV32F_INSN_ADDC_C
, && case_sem_INSN_ADDC_C
},
147 { CRISV32F_INSN_LAPC_D
, && case_sem_INSN_LAPC_D
},
148 { CRISV32F_INSN_LAPCQ
, && case_sem_INSN_LAPCQ
},
149 { CRISV32F_INSN_ADDI_B_R
, && case_sem_INSN_ADDI_B_R
},
150 { CRISV32F_INSN_ADDI_W_R
, && case_sem_INSN_ADDI_W_R
},
151 { CRISV32F_INSN_ADDI_D_R
, && case_sem_INSN_ADDI_D_R
},
152 { CRISV32F_INSN_NEG_B_R
, && case_sem_INSN_NEG_B_R
},
153 { CRISV32F_INSN_NEG_W_R
, && case_sem_INSN_NEG_W_R
},
154 { CRISV32F_INSN_NEG_D_R
, && case_sem_INSN_NEG_D_R
},
155 { CRISV32F_INSN_TEST_M_B_M
, && case_sem_INSN_TEST_M_B_M
},
156 { CRISV32F_INSN_TEST_M_W_M
, && case_sem_INSN_TEST_M_W_M
},
157 { CRISV32F_INSN_TEST_M_D_M
, && case_sem_INSN_TEST_M_D_M
},
158 { CRISV32F_INSN_MOVE_R_M_B_M
, && case_sem_INSN_MOVE_R_M_B_M
},
159 { CRISV32F_INSN_MOVE_R_M_W_M
, && case_sem_INSN_MOVE_R_M_W_M
},
160 { CRISV32F_INSN_MOVE_R_M_D_M
, && case_sem_INSN_MOVE_R_M_D_M
},
161 { CRISV32F_INSN_MULS_B
, && case_sem_INSN_MULS_B
},
162 { CRISV32F_INSN_MULS_W
, && case_sem_INSN_MULS_W
},
163 { CRISV32F_INSN_MULS_D
, && case_sem_INSN_MULS_D
},
164 { CRISV32F_INSN_MULU_B
, && case_sem_INSN_MULU_B
},
165 { CRISV32F_INSN_MULU_W
, && case_sem_INSN_MULU_W
},
166 { CRISV32F_INSN_MULU_D
, && case_sem_INSN_MULU_D
},
167 { CRISV32F_INSN_MCP
, && case_sem_INSN_MCP
},
168 { CRISV32F_INSN_DSTEP
, && case_sem_INSN_DSTEP
},
169 { CRISV32F_INSN_ABS
, && case_sem_INSN_ABS
},
170 { CRISV32F_INSN_AND_B_R
, && case_sem_INSN_AND_B_R
},
171 { CRISV32F_INSN_AND_W_R
, && case_sem_INSN_AND_W_R
},
172 { CRISV32F_INSN_AND_D_R
, && case_sem_INSN_AND_D_R
},
173 { CRISV32F_INSN_AND_M_B_M
, && case_sem_INSN_AND_M_B_M
},
174 { CRISV32F_INSN_AND_M_W_M
, && case_sem_INSN_AND_M_W_M
},
175 { CRISV32F_INSN_AND_M_D_M
, && case_sem_INSN_AND_M_D_M
},
176 { CRISV32F_INSN_ANDCBR
, && case_sem_INSN_ANDCBR
},
177 { CRISV32F_INSN_ANDCWR
, && case_sem_INSN_ANDCWR
},
178 { CRISV32F_INSN_ANDCDR
, && case_sem_INSN_ANDCDR
},
179 { CRISV32F_INSN_ANDQ
, && case_sem_INSN_ANDQ
},
180 { CRISV32F_INSN_ORR_B_R
, && case_sem_INSN_ORR_B_R
},
181 { CRISV32F_INSN_ORR_W_R
, && case_sem_INSN_ORR_W_R
},
182 { CRISV32F_INSN_ORR_D_R
, && case_sem_INSN_ORR_D_R
},
183 { CRISV32F_INSN_OR_M_B_M
, && case_sem_INSN_OR_M_B_M
},
184 { CRISV32F_INSN_OR_M_W_M
, && case_sem_INSN_OR_M_W_M
},
185 { CRISV32F_INSN_OR_M_D_M
, && case_sem_INSN_OR_M_D_M
},
186 { CRISV32F_INSN_ORCBR
, && case_sem_INSN_ORCBR
},
187 { CRISV32F_INSN_ORCWR
, && case_sem_INSN_ORCWR
},
188 { CRISV32F_INSN_ORCDR
, && case_sem_INSN_ORCDR
},
189 { CRISV32F_INSN_ORQ
, && case_sem_INSN_ORQ
},
190 { CRISV32F_INSN_XOR
, && case_sem_INSN_XOR
},
191 { CRISV32F_INSN_SWAP
, && case_sem_INSN_SWAP
},
192 { CRISV32F_INSN_ASRR_B_R
, && case_sem_INSN_ASRR_B_R
},
193 { CRISV32F_INSN_ASRR_W_R
, && case_sem_INSN_ASRR_W_R
},
194 { CRISV32F_INSN_ASRR_D_R
, && case_sem_INSN_ASRR_D_R
},
195 { CRISV32F_INSN_ASRQ
, && case_sem_INSN_ASRQ
},
196 { CRISV32F_INSN_LSRR_B_R
, && case_sem_INSN_LSRR_B_R
},
197 { CRISV32F_INSN_LSRR_W_R
, && case_sem_INSN_LSRR_W_R
},
198 { CRISV32F_INSN_LSRR_D_R
, && case_sem_INSN_LSRR_D_R
},
199 { CRISV32F_INSN_LSRQ
, && case_sem_INSN_LSRQ
},
200 { CRISV32F_INSN_LSLR_B_R
, && case_sem_INSN_LSLR_B_R
},
201 { CRISV32F_INSN_LSLR_W_R
, && case_sem_INSN_LSLR_W_R
},
202 { CRISV32F_INSN_LSLR_D_R
, && case_sem_INSN_LSLR_D_R
},
203 { CRISV32F_INSN_LSLQ
, && case_sem_INSN_LSLQ
},
204 { CRISV32F_INSN_BTST
, && case_sem_INSN_BTST
},
205 { CRISV32F_INSN_BTSTQ
, && case_sem_INSN_BTSTQ
},
206 { CRISV32F_INSN_SETF
, && case_sem_INSN_SETF
},
207 { CRISV32F_INSN_CLEARF
, && case_sem_INSN_CLEARF
},
208 { CRISV32F_INSN_RFE
, && case_sem_INSN_RFE
},
209 { CRISV32F_INSN_SFE
, && case_sem_INSN_SFE
},
210 { CRISV32F_INSN_RFG
, && case_sem_INSN_RFG
},
211 { CRISV32F_INSN_RFN
, && case_sem_INSN_RFN
},
212 { CRISV32F_INSN_HALT
, && case_sem_INSN_HALT
},
213 { CRISV32F_INSN_BCC_B
, && case_sem_INSN_BCC_B
},
214 { CRISV32F_INSN_BA_B
, && case_sem_INSN_BA_B
},
215 { CRISV32F_INSN_BCC_W
, && case_sem_INSN_BCC_W
},
216 { CRISV32F_INSN_BA_W
, && case_sem_INSN_BA_W
},
217 { CRISV32F_INSN_JAS_R
, && case_sem_INSN_JAS_R
},
218 { CRISV32F_INSN_JAS_C
, && case_sem_INSN_JAS_C
},
219 { CRISV32F_INSN_JUMP_P
, && case_sem_INSN_JUMP_P
},
220 { CRISV32F_INSN_BAS_C
, && case_sem_INSN_BAS_C
},
221 { CRISV32F_INSN_JASC_R
, && case_sem_INSN_JASC_R
},
222 { CRISV32F_INSN_JASC_C
, && case_sem_INSN_JASC_C
},
223 { CRISV32F_INSN_BASC_C
, && case_sem_INSN_BASC_C
},
224 { CRISV32F_INSN_BREAK
, && case_sem_INSN_BREAK
},
225 { CRISV32F_INSN_BOUND_R_B_R
, && case_sem_INSN_BOUND_R_B_R
},
226 { CRISV32F_INSN_BOUND_R_W_R
, && case_sem_INSN_BOUND_R_W_R
},
227 { CRISV32F_INSN_BOUND_R_D_R
, && case_sem_INSN_BOUND_R_D_R
},
228 { CRISV32F_INSN_BOUND_CB
, && case_sem_INSN_BOUND_CB
},
229 { CRISV32F_INSN_BOUND_CW
, && case_sem_INSN_BOUND_CW
},
230 { CRISV32F_INSN_BOUND_CD
, && case_sem_INSN_BOUND_CD
},
231 { CRISV32F_INSN_SCC
, && case_sem_INSN_SCC
},
232 { CRISV32F_INSN_LZ
, && case_sem_INSN_LZ
},
233 { CRISV32F_INSN_ADDOQ
, && case_sem_INSN_ADDOQ
},
234 { CRISV32F_INSN_ADDO_M_B_M
, && case_sem_INSN_ADDO_M_B_M
},
235 { CRISV32F_INSN_ADDO_M_W_M
, && case_sem_INSN_ADDO_M_W_M
},
236 { CRISV32F_INSN_ADDO_M_D_M
, && case_sem_INSN_ADDO_M_D_M
},
237 { CRISV32F_INSN_ADDO_CB
, && case_sem_INSN_ADDO_CB
},
238 { CRISV32F_INSN_ADDO_CW
, && case_sem_INSN_ADDO_CW
},
239 { CRISV32F_INSN_ADDO_CD
, && case_sem_INSN_ADDO_CD
},
240 { CRISV32F_INSN_ADDI_ACR_B_R
, && case_sem_INSN_ADDI_ACR_B_R
},
241 { CRISV32F_INSN_ADDI_ACR_W_R
, && case_sem_INSN_ADDI_ACR_W_R
},
242 { CRISV32F_INSN_ADDI_ACR_D_R
, && case_sem_INSN_ADDI_ACR_D_R
},
243 { CRISV32F_INSN_FIDXI
, && case_sem_INSN_FIDXI
},
244 { CRISV32F_INSN_FTAGI
, && case_sem_INSN_FTAGI
},
245 { CRISV32F_INSN_FIDXD
, && case_sem_INSN_FIDXD
},
246 { CRISV32F_INSN_FTAGD
, && case_sem_INSN_FTAGD
},
251 for (i
= 0; labels
[i
].label
!= 0; ++i
)
254 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
256 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
261 #endif /* DEFINE_LABELS */
265 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
266 off frills like tracing and profiling. */
267 /* FIXME: A better way would be to have CGEN_TRACE_RESULT check for something
268 that can cause it to be optimized out. Another way would be to emit
269 special handlers into the instruction "stream". */
272 #undef CGEN_TRACE_RESULT
273 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
277 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
283 /* Branch to next handler without going around main loop. */
284 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
285 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
287 #else /* ! WITH_SCACHE_PBB */
289 #define NEXT(vpc) BREAK (sem)
292 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
294 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
297 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
300 #endif /* ! WITH_SCACHE_PBB */
304 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
306 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
307 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
308 #define FLD(f) abuf->fields.sfmt_empty.f
309 int UNUSED written
= 0;
310 IADDR UNUSED pc
= abuf
->addr
;
311 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
314 /* Update the recorded pc in the cpu state struct.
315 Only necessary for WITH_SCACHE case, but to avoid the
316 conditional compilation .... */
318 /* Virtual insns have zero size. Overwrite vpc with address of next insn
319 using the default-insn-bitsize spec. When executing insns in parallel
320 we may want to queue the fault and continue execution. */
321 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
322 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
329 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
331 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
332 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
333 #define FLD(f) abuf->fields.sfmt_empty.f
334 int UNUSED written
= 0;
335 IADDR UNUSED pc
= abuf
->addr
;
336 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
339 #if WITH_SCACHE_PBB_CRISV32F
340 crisv32f_pbb_after (current_cpu
, sem_arg
);
348 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
350 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
351 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
352 #define FLD(f) abuf->fields.sfmt_empty.f
353 int UNUSED written
= 0;
354 IADDR UNUSED pc
= abuf
->addr
;
355 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
358 #if WITH_SCACHE_PBB_CRISV32F
359 crisv32f_pbb_before (current_cpu
, sem_arg
);
367 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
369 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
370 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
371 #define FLD(f) abuf->fields.sfmt_empty.f
372 int UNUSED written
= 0;
373 IADDR UNUSED pc
= abuf
->addr
;
374 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
377 #if WITH_SCACHE_PBB_CRISV32F
379 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
380 pbb_br_type
, pbb_br_npc
);
383 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
384 vpc
= crisv32f_pbb_cti_chain (current_cpu
, sem_arg
,
385 CPU_PBB_BR_TYPE (current_cpu
),
386 CPU_PBB_BR_NPC (current_cpu
));
395 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
397 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
398 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
399 #define FLD(f) abuf->fields.sfmt_empty.f
400 int UNUSED written
= 0;
401 IADDR UNUSED pc
= abuf
->addr
;
402 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
405 #if WITH_SCACHE_PBB_CRISV32F
406 vpc
= crisv32f_pbb_chain (current_cpu
, sem_arg
);
417 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
419 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
420 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
421 #define FLD(f) abuf->fields.sfmt_empty.f
422 int UNUSED written
= 0;
423 IADDR UNUSED pc
= abuf
->addr
;
424 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
427 #if WITH_SCACHE_PBB_CRISV32F
428 #if defined DEFINE_SWITCH || defined FAST_P
429 /* In the switch case FAST_P is a constant, allowing several optimizations
430 in any called inline functions. */
431 vpc
= crisv32f_pbb_begin (current_cpu
, FAST_P
);
433 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
434 vpc
= crisv32f_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
436 vpc
= crisv32f_pbb_begin (current_cpu
, 0);
446 CASE (sem
, INSN_MOVE_B_R
) : /* move.b move.m ${Rs},${Rd} */
448 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
449 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
450 #define FLD(f) abuf->fields.sfmt_addc_m.f
451 int UNUSED written
= 0;
452 IADDR UNUSED pc
= abuf
->addr
;
453 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
457 tmp_newval
= GET_H_GR (FLD (f_operand1
));
460 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
462 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
463 SET_H_GR (FLD (f_operand2
), opval
);
464 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
469 BI opval
= LTQI (tmp_newval
, 0);
470 CPU (h_nbit
) = opval
;
471 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
474 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
475 CPU (h_zbit
) = opval
;
476 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
483 CPU (h_xbit
) = opval
;
484 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
488 SET_H_INSN_PREFIXED_P (opval
);
489 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
499 CASE (sem
, INSN_MOVE_W_R
) : /* move.w move.m ${Rs},${Rd} */
501 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
502 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
503 #define FLD(f) abuf->fields.sfmt_addc_m.f
504 int UNUSED written
= 0;
505 IADDR UNUSED pc
= abuf
->addr
;
506 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
510 tmp_newval
= GET_H_GR (FLD (f_operand1
));
513 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
515 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
516 SET_H_GR (FLD (f_operand2
), opval
);
517 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
522 BI opval
= LTHI (tmp_newval
, 0);
523 CPU (h_nbit
) = opval
;
524 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
527 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
528 CPU (h_zbit
) = opval
;
529 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
536 CPU (h_xbit
) = opval
;
537 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
541 SET_H_INSN_PREFIXED_P (opval
);
542 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
552 CASE (sem
, INSN_MOVE_D_R
) : /* move.d move.m ${Rs},${Rd} */
554 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
555 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
556 #define FLD(f) abuf->fields.sfmt_addc_m.f
557 int UNUSED written
= 0;
558 IADDR UNUSED pc
= abuf
->addr
;
559 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
563 tmp_newval
= GET_H_GR (FLD (f_operand1
));
565 SI opval
= tmp_newval
;
566 SET_H_GR (FLD (f_operand2
), opval
);
567 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
571 BI opval
= LTSI (tmp_newval
, 0);
572 CPU (h_nbit
) = opval
;
573 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
576 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
577 CPU (h_zbit
) = opval
;
578 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
585 CPU (h_xbit
) = opval
;
586 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
590 SET_H_INSN_PREFIXED_P (opval
);
591 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
601 CASE (sem
, INSN_MOVEQ
) : /* moveq $i,$Rd */
603 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
605 #define FLD(f) abuf->fields.sfmt_moveq.f
606 int UNUSED written
= 0;
607 IADDR UNUSED pc
= abuf
->addr
;
608 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
612 tmp_newval
= FLD (f_s6
);
614 SI opval
= tmp_newval
;
615 SET_H_GR (FLD (f_operand2
), opval
);
616 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
619 SET_H_NBIT_MOVE (LTSI (tmp_newval
, 0));
620 SET_H_ZBIT_MOVE (ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1))));
626 CPU (h_xbit
) = opval
;
627 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
631 SET_H_INSN_PREFIXED_P (opval
);
632 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
642 CASE (sem
, INSN_MOVS_B_R
) : /* movs.b movs.m ${Rs},${Rd} */
644 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
645 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
646 #define FLD(f) abuf->fields.sfmt_muls_b.f
647 int UNUSED written
= 0;
648 IADDR UNUSED pc
= abuf
->addr
;
649 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
654 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
655 tmp_newval
= EXTQISI (tmp_tmpops
);
657 SI opval
= tmp_newval
;
658 SET_H_GR (FLD (f_operand2
), opval
);
659 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
663 BI opval
= LTSI (tmp_newval
, 0);
664 CPU (h_nbit
) = opval
;
665 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
668 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
669 CPU (h_zbit
) = opval
;
670 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
677 CPU (h_xbit
) = opval
;
678 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
682 SET_H_INSN_PREFIXED_P (opval
);
683 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
693 CASE (sem
, INSN_MOVS_W_R
) : /* movs.w movs.m ${Rs},${Rd} */
695 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
696 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
697 #define FLD(f) abuf->fields.sfmt_muls_b.f
698 int UNUSED written
= 0;
699 IADDR UNUSED pc
= abuf
->addr
;
700 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
705 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
706 tmp_newval
= EXTHISI (tmp_tmpops
);
708 SI opval
= tmp_newval
;
709 SET_H_GR (FLD (f_operand2
), opval
);
710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
714 BI opval
= LTSI (tmp_newval
, 0);
715 CPU (h_nbit
) = opval
;
716 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
719 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
720 CPU (h_zbit
) = opval
;
721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
728 CPU (h_xbit
) = opval
;
729 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
733 SET_H_INSN_PREFIXED_P (opval
);
734 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
744 CASE (sem
, INSN_MOVU_B_R
) : /* movu.b movu.m ${Rs},${Rd} */
746 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
747 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
748 #define FLD(f) abuf->fields.sfmt_muls_b.f
749 int UNUSED written
= 0;
750 IADDR UNUSED pc
= abuf
->addr
;
751 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
756 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
757 tmp_newval
= ZEXTQISI (tmp_tmpops
);
759 SI opval
= tmp_newval
;
760 SET_H_GR (FLD (f_operand2
), opval
);
761 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
765 BI opval
= LTSI (tmp_newval
, 0);
766 CPU (h_nbit
) = opval
;
767 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
770 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
771 CPU (h_zbit
) = opval
;
772 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
779 CPU (h_xbit
) = opval
;
780 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
784 SET_H_INSN_PREFIXED_P (opval
);
785 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
795 CASE (sem
, INSN_MOVU_W_R
) : /* movu.w movu.m ${Rs},${Rd} */
797 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
798 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
799 #define FLD(f) abuf->fields.sfmt_muls_b.f
800 int UNUSED written
= 0;
801 IADDR UNUSED pc
= abuf
->addr
;
802 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
807 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
808 tmp_newval
= ZEXTHISI (tmp_tmpops
);
810 SI opval
= tmp_newval
;
811 SET_H_GR (FLD (f_operand2
), opval
);
812 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
816 BI opval
= LTSI (tmp_newval
, 0);
817 CPU (h_nbit
) = opval
;
818 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
821 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
822 CPU (h_zbit
) = opval
;
823 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
830 CPU (h_xbit
) = opval
;
831 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
835 SET_H_INSN_PREFIXED_P (opval
);
836 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
846 CASE (sem
, INSN_MOVECBR
) : /* move.b ${sconst8},${Rd} */
848 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
849 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
850 #define FLD(f) abuf->fields.sfmt_addcbr.f
851 int UNUSED written
= 0;
852 IADDR UNUSED pc
= abuf
->addr
;
853 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
857 tmp_newval
= FLD (f_indir_pc__byte
);
860 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
862 SI opval
= ORSI (ANDSI (tmp_newval
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
863 SET_H_GR (FLD (f_operand2
), opval
);
864 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
869 BI opval
= LTQI (tmp_newval
, 0);
870 CPU (h_nbit
) = opval
;
871 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
874 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
875 CPU (h_zbit
) = opval
;
876 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
883 CPU (h_xbit
) = opval
;
884 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
888 SET_H_INSN_PREFIXED_P (opval
);
889 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
899 CASE (sem
, INSN_MOVECWR
) : /* move.w ${sconst16},${Rd} */
901 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
902 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
903 #define FLD(f) abuf->fields.sfmt_addcwr.f
904 int UNUSED written
= 0;
905 IADDR UNUSED pc
= abuf
->addr
;
906 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
910 tmp_newval
= FLD (f_indir_pc__word
);
913 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
915 SI opval
= ORSI (ANDSI (tmp_newval
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
916 SET_H_GR (FLD (f_operand2
), opval
);
917 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
922 BI opval
= LTHI (tmp_newval
, 0);
923 CPU (h_nbit
) = opval
;
924 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
927 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
928 CPU (h_zbit
) = opval
;
929 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
936 CPU (h_xbit
) = opval
;
937 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
941 SET_H_INSN_PREFIXED_P (opval
);
942 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
952 CASE (sem
, INSN_MOVECDR
) : /* move.d ${const32},${Rd} */
954 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
955 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
956 #define FLD(f) abuf->fields.sfmt_bound_cd.f
957 int UNUSED written
= 0;
958 IADDR UNUSED pc
= abuf
->addr
;
959 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
963 tmp_newval
= FLD (f_indir_pc__dword
);
965 SI opval
= tmp_newval
;
966 SET_H_GR (FLD (f_operand2
), opval
);
967 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
971 BI opval
= LTSI (tmp_newval
, 0);
972 CPU (h_nbit
) = opval
;
973 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
976 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
977 CPU (h_zbit
) = opval
;
978 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
985 CPU (h_xbit
) = opval
;
986 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
990 SET_H_INSN_PREFIXED_P (opval
);
991 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1001 CASE (sem
, INSN_MOVSCBR
) : /* movs.b ${sconst8},${Rd} */
1003 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1004 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1005 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1006 int UNUSED written
= 0;
1007 IADDR UNUSED pc
= abuf
->addr
;
1008 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1012 tmp_newval
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1014 SI opval
= tmp_newval
;
1015 SET_H_GR (FLD (f_operand2
), opval
);
1016 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1020 BI opval
= LTSI (tmp_newval
, 0);
1021 CPU (h_nbit
) = opval
;
1022 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1025 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1026 CPU (h_zbit
) = opval
;
1027 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1029 SET_H_CBIT_MOVE (0);
1030 SET_H_VBIT_MOVE (0);
1034 CPU (h_xbit
) = opval
;
1035 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1039 SET_H_INSN_PREFIXED_P (opval
);
1040 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1050 CASE (sem
, INSN_MOVSCWR
) : /* movs.w ${sconst16},${Rd} */
1052 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1053 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1054 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1055 int UNUSED written
= 0;
1056 IADDR UNUSED pc
= abuf
->addr
;
1057 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1061 tmp_newval
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1063 SI opval
= tmp_newval
;
1064 SET_H_GR (FLD (f_operand2
), opval
);
1065 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1069 BI opval
= LTSI (tmp_newval
, 0);
1070 CPU (h_nbit
) = opval
;
1071 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1074 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1075 CPU (h_zbit
) = opval
;
1076 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1078 SET_H_CBIT_MOVE (0);
1079 SET_H_VBIT_MOVE (0);
1083 CPU (h_xbit
) = opval
;
1084 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1088 SET_H_INSN_PREFIXED_P (opval
);
1089 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1099 CASE (sem
, INSN_MOVUCBR
) : /* movu.b ${uconst8},${Rd} */
1101 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1102 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1103 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1104 int UNUSED written
= 0;
1105 IADDR UNUSED pc
= abuf
->addr
;
1106 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1110 tmp_newval
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
1112 SI opval
= tmp_newval
;
1113 SET_H_GR (FLD (f_operand2
), opval
);
1114 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1118 BI opval
= LTSI (tmp_newval
, 0);
1119 CPU (h_nbit
) = opval
;
1120 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1123 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1124 CPU (h_zbit
) = opval
;
1125 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1127 SET_H_CBIT_MOVE (0);
1128 SET_H_VBIT_MOVE (0);
1132 CPU (h_xbit
) = opval
;
1133 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1137 SET_H_INSN_PREFIXED_P (opval
);
1138 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1148 CASE (sem
, INSN_MOVUCWR
) : /* movu.w ${uconst16},${Rd} */
1150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1152 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1153 int UNUSED written
= 0;
1154 IADDR UNUSED pc
= abuf
->addr
;
1155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1159 tmp_newval
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
1161 SI opval
= tmp_newval
;
1162 SET_H_GR (FLD (f_operand2
), opval
);
1163 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1167 BI opval
= LTSI (tmp_newval
, 0);
1168 CPU (h_nbit
) = opval
;
1169 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1172 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
1173 CPU (h_zbit
) = opval
;
1174 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1176 SET_H_CBIT_MOVE (0);
1177 SET_H_VBIT_MOVE (0);
1181 CPU (h_xbit
) = opval
;
1182 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1186 SET_H_INSN_PREFIXED_P (opval
);
1187 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1197 CASE (sem
, INSN_ADDQ
) : /* addq $j,$Rd */
1199 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1200 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1201 #define FLD(f) abuf->fields.sfmt_addq.f
1202 int UNUSED written
= 0;
1203 IADDR UNUSED pc
= abuf
->addr
;
1204 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1211 tmp_tmpops
= FLD (f_u6
);
1212 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1213 tmp_carry
= CPU (h_cbit
);
1214 tmp_newval
= ADDCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1216 SI opval
= tmp_newval
;
1217 SET_H_GR (FLD (f_operand2
), opval
);
1218 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1222 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))));
1223 CPU (h_cbit
) = opval
;
1224 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1227 BI opval
= LTSI (tmp_newval
, 0);
1228 CPU (h_nbit
) = opval
;
1229 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1232 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1233 CPU (h_zbit
) = opval
;
1234 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1237 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)));
1238 CPU (h_vbit
) = opval
;
1239 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1244 CPU (h_xbit
) = opval
;
1245 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1249 SET_H_INSN_PREFIXED_P (opval
);
1250 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1260 CASE (sem
, INSN_SUBQ
) : /* subq $j,$Rd */
1262 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1263 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1264 #define FLD(f) abuf->fields.sfmt_addq.f
1265 int UNUSED written
= 0;
1266 IADDR UNUSED pc
= abuf
->addr
;
1267 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1274 tmp_tmpops
= FLD (f_u6
);
1275 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1276 tmp_carry
= CPU (h_cbit
);
1277 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1279 SI opval
= tmp_newval
;
1280 SET_H_GR (FLD (f_operand2
), opval
);
1281 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1285 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))));
1286 CPU (h_cbit
) = opval
;
1287 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1290 BI opval
= LTSI (tmp_newval
, 0);
1291 CPU (h_nbit
) = opval
;
1292 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1295 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1296 CPU (h_zbit
) = opval
;
1297 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1300 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)));
1301 CPU (h_vbit
) = opval
;
1302 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1307 CPU (h_xbit
) = opval
;
1308 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1312 SET_H_INSN_PREFIXED_P (opval
);
1313 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1323 CASE (sem
, INSN_CMP_R_B_R
) : /* cmp-r.b $Rs,$Rd */
1325 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1326 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1327 #define FLD(f) abuf->fields.sfmt_muls_b.f
1328 int UNUSED written
= 0;
1329 IADDR UNUSED pc
= abuf
->addr
;
1330 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1337 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1338 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1339 tmp_carry
= CPU (h_cbit
);
1340 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1344 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))));
1345 CPU (h_cbit
) = opval
;
1346 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1349 BI opval
= LTQI (tmp_newval
, 0);
1350 CPU (h_nbit
) = opval
;
1351 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1354 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1355 CPU (h_zbit
) = opval
;
1356 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1359 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)));
1360 CPU (h_vbit
) = opval
;
1361 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1366 CPU (h_xbit
) = opval
;
1367 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1371 SET_H_INSN_PREFIXED_P (opval
);
1372 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1382 CASE (sem
, INSN_CMP_R_W_R
) : /* cmp-r.w $Rs,$Rd */
1384 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1385 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1386 #define FLD(f) abuf->fields.sfmt_muls_b.f
1387 int UNUSED written
= 0;
1388 IADDR UNUSED pc
= abuf
->addr
;
1389 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1396 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1397 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1398 tmp_carry
= CPU (h_cbit
);
1399 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1403 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))));
1404 CPU (h_cbit
) = opval
;
1405 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1408 BI opval
= LTHI (tmp_newval
, 0);
1409 CPU (h_nbit
) = opval
;
1410 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1413 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1414 CPU (h_zbit
) = opval
;
1415 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1418 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)));
1419 CPU (h_vbit
) = opval
;
1420 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1425 CPU (h_xbit
) = opval
;
1426 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1430 SET_H_INSN_PREFIXED_P (opval
);
1431 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1441 CASE (sem
, INSN_CMP_R_D_R
) : /* cmp-r.d $Rs,$Rd */
1443 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1444 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1445 #define FLD(f) abuf->fields.sfmt_muls_b.f
1446 int UNUSED written
= 0;
1447 IADDR UNUSED pc
= abuf
->addr
;
1448 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1455 tmp_tmpops
= GET_H_GR (FLD (f_operand1
));
1456 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1457 tmp_carry
= CPU (h_cbit
);
1458 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1462 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))));
1463 CPU (h_cbit
) = opval
;
1464 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1467 BI opval
= LTSI (tmp_newval
, 0);
1468 CPU (h_nbit
) = opval
;
1469 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1472 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1473 CPU (h_zbit
) = opval
;
1474 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1477 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)));
1478 CPU (h_vbit
) = opval
;
1479 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1484 CPU (h_xbit
) = opval
;
1485 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1489 SET_H_INSN_PREFIXED_P (opval
);
1490 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1500 CASE (sem
, INSN_CMP_M_B_M
) : /* cmp-m.b [${Rs}${inc}],${Rd} */
1502 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1503 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1504 #define FLD(f) abuf->fields.sfmt_addc_m.f
1505 int UNUSED written
= 0;
1506 IADDR UNUSED pc
= abuf
->addr
;
1507 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1514 tmp_tmpops
= ({ SI tmp_addr
;
1517 tmp_postinc
= FLD (f_memmode
);
1518 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1519 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1520 ; if (NEBI (tmp_postinc
, 0)) {
1522 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1523 tmp_addr
= ADDSI (tmp_addr
, 1);
1526 SI opval
= tmp_addr
;
1527 SET_H_GR (FLD (f_operand1
), opval
);
1528 written
|= (1 << 9);
1529 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1534 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1535 tmp_carry
= CPU (h_cbit
);
1536 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1540 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))));
1541 CPU (h_cbit
) = opval
;
1542 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1545 BI opval
= LTQI (tmp_newval
, 0);
1546 CPU (h_nbit
) = opval
;
1547 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1550 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1551 CPU (h_zbit
) = opval
;
1552 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1555 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)));
1556 CPU (h_vbit
) = opval
;
1557 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1562 CPU (h_xbit
) = opval
;
1563 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1567 SET_H_INSN_PREFIXED_P (opval
);
1568 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1574 abuf
->written
= written
;
1579 CASE (sem
, INSN_CMP_M_W_M
) : /* cmp-m.w [${Rs}${inc}],${Rd} */
1581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1582 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1583 #define FLD(f) abuf->fields.sfmt_addc_m.f
1584 int UNUSED written
= 0;
1585 IADDR UNUSED pc
= abuf
->addr
;
1586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1593 tmp_tmpops
= ({ SI tmp_addr
;
1596 tmp_postinc
= FLD (f_memmode
);
1597 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1598 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
1599 ; if (NEBI (tmp_postinc
, 0)) {
1601 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1602 tmp_addr
= ADDSI (tmp_addr
, 2);
1605 SI opval
= tmp_addr
;
1606 SET_H_GR (FLD (f_operand1
), opval
);
1607 written
|= (1 << 9);
1608 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1613 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1614 tmp_carry
= CPU (h_cbit
);
1615 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1619 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))));
1620 CPU (h_cbit
) = opval
;
1621 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1624 BI opval
= LTHI (tmp_newval
, 0);
1625 CPU (h_nbit
) = opval
;
1626 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1629 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1630 CPU (h_zbit
) = opval
;
1631 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1634 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)));
1635 CPU (h_vbit
) = opval
;
1636 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1641 CPU (h_xbit
) = opval
;
1642 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1646 SET_H_INSN_PREFIXED_P (opval
);
1647 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1653 abuf
->written
= written
;
1658 CASE (sem
, INSN_CMP_M_D_M
) : /* cmp-m.d [${Rs}${inc}],${Rd} */
1660 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1661 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1662 #define FLD(f) abuf->fields.sfmt_addc_m.f
1663 int UNUSED written
= 0;
1664 IADDR UNUSED pc
= abuf
->addr
;
1665 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1672 tmp_tmpops
= ({ SI tmp_addr
;
1675 tmp_postinc
= FLD (f_memmode
);
1676 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1677 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
1678 ; if (NEBI (tmp_postinc
, 0)) {
1680 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1681 tmp_addr
= ADDSI (tmp_addr
, 4);
1684 SI opval
= tmp_addr
;
1685 SET_H_GR (FLD (f_operand1
), opval
);
1686 written
|= (1 << 9);
1687 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1692 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1693 tmp_carry
= CPU (h_cbit
);
1694 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1698 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))));
1699 CPU (h_cbit
) = opval
;
1700 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1703 BI opval
= LTSI (tmp_newval
, 0);
1704 CPU (h_nbit
) = opval
;
1705 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1708 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1709 CPU (h_zbit
) = opval
;
1710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1713 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)));
1714 CPU (h_vbit
) = opval
;
1715 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1720 CPU (h_xbit
) = opval
;
1721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1725 SET_H_INSN_PREFIXED_P (opval
);
1726 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1732 abuf
->written
= written
;
1737 CASE (sem
, INSN_CMPCBR
) : /* cmp.b $sconst8,$Rd */
1739 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1740 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1741 #define FLD(f) abuf->fields.sfmt_bound_cb.f
1742 int UNUSED written
= 0;
1743 IADDR UNUSED pc
= abuf
->addr
;
1744 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1751 tmp_tmpops
= TRUNCSIQI (FLD (f_indir_pc__byte
));
1752 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1753 tmp_carry
= CPU (h_cbit
);
1754 tmp_newval
= SUBCQI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1758 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))));
1759 CPU (h_cbit
) = opval
;
1760 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1763 BI opval
= LTQI (tmp_newval
, 0);
1764 CPU (h_nbit
) = opval
;
1765 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1768 BI opval
= ANDIF (EQQI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1769 CPU (h_zbit
) = opval
;
1770 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1773 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)));
1774 CPU (h_vbit
) = opval
;
1775 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1780 CPU (h_xbit
) = opval
;
1781 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1785 SET_H_INSN_PREFIXED_P (opval
);
1786 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1796 CASE (sem
, INSN_CMPCWR
) : /* cmp.w $sconst16,$Rd */
1798 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1799 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1800 #define FLD(f) abuf->fields.sfmt_bound_cw.f
1801 int UNUSED written
= 0;
1802 IADDR UNUSED pc
= abuf
->addr
;
1803 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1810 tmp_tmpops
= TRUNCSIHI (FLD (f_indir_pc__word
));
1811 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1812 tmp_carry
= CPU (h_cbit
);
1813 tmp_newval
= SUBCHI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1817 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))));
1818 CPU (h_cbit
) = opval
;
1819 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1822 BI opval
= LTHI (tmp_newval
, 0);
1823 CPU (h_nbit
) = opval
;
1824 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1827 BI opval
= ANDIF (EQHI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1828 CPU (h_zbit
) = opval
;
1829 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1832 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)));
1833 CPU (h_vbit
) = opval
;
1834 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1839 CPU (h_xbit
) = opval
;
1840 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1844 SET_H_INSN_PREFIXED_P (opval
);
1845 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1855 CASE (sem
, INSN_CMPCDR
) : /* cmp.d $const32,$Rd */
1857 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1858 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1859 #define FLD(f) abuf->fields.sfmt_bound_cd.f
1860 int UNUSED written
= 0;
1861 IADDR UNUSED pc
= abuf
->addr
;
1862 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
1869 tmp_tmpops
= FLD (f_indir_pc__dword
);
1870 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1871 tmp_carry
= CPU (h_cbit
);
1872 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1876 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))));
1877 CPU (h_cbit
) = opval
;
1878 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1881 BI opval
= LTSI (tmp_newval
, 0);
1882 CPU (h_nbit
) = opval
;
1883 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1886 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1887 CPU (h_zbit
) = opval
;
1888 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1891 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)));
1892 CPU (h_vbit
) = opval
;
1893 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1898 CPU (h_xbit
) = opval
;
1899 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1903 SET_H_INSN_PREFIXED_P (opval
);
1904 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1914 CASE (sem
, INSN_CMPQ
) : /* cmpq $i,$Rd */
1916 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1917 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1918 #define FLD(f) abuf->fields.sfmt_andq.f
1919 int UNUSED written
= 0;
1920 IADDR UNUSED pc
= abuf
->addr
;
1921 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1928 tmp_tmpops
= FLD (f_s6
);
1929 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
1930 tmp_carry
= CPU (h_cbit
);
1931 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
1935 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))));
1936 CPU (h_cbit
) = opval
;
1937 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
1940 BI opval
= LTSI (tmp_newval
, 0);
1941 CPU (h_nbit
) = opval
;
1942 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
1945 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
1946 CPU (h_zbit
) = opval
;
1947 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
1950 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)));
1951 CPU (h_vbit
) = opval
;
1952 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
1957 CPU (h_xbit
) = opval
;
1958 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
1962 SET_H_INSN_PREFIXED_P (opval
);
1963 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
1973 CASE (sem
, INSN_CMPS_M_B_M
) : /* cmps-m.b [${Rs}${inc}],$Rd */
1975 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1976 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1977 #define FLD(f) abuf->fields.sfmt_addc_m.f
1978 int UNUSED written
= 0;
1979 IADDR UNUSED pc
= abuf
->addr
;
1980 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1987 tmp_tmpops
= EXTQISI (({ SI tmp_addr
;
1990 tmp_postinc
= FLD (f_memmode
);
1991 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
1992 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
1993 ; if (NEBI (tmp_postinc
, 0)) {
1995 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
1996 tmp_addr
= ADDSI (tmp_addr
, 1);
1999 SI opval
= tmp_addr
;
2000 SET_H_GR (FLD (f_operand1
), opval
);
2001 written
|= (1 << 9);
2002 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2007 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2008 tmp_carry
= CPU (h_cbit
);
2009 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2013 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))));
2014 CPU (h_cbit
) = opval
;
2015 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2018 BI opval
= LTSI (tmp_newval
, 0);
2019 CPU (h_nbit
) = opval
;
2020 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2023 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2024 CPU (h_zbit
) = opval
;
2025 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2028 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)));
2029 CPU (h_vbit
) = opval
;
2030 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2035 CPU (h_xbit
) = opval
;
2036 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2040 SET_H_INSN_PREFIXED_P (opval
);
2041 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2047 abuf
->written
= written
;
2052 CASE (sem
, INSN_CMPS_M_W_M
) : /* cmps-m.w [${Rs}${inc}],$Rd */
2054 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2055 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2056 #define FLD(f) abuf->fields.sfmt_addc_m.f
2057 int UNUSED written
= 0;
2058 IADDR UNUSED pc
= abuf
->addr
;
2059 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2066 tmp_tmpops
= EXTHISI (({ SI tmp_addr
;
2069 tmp_postinc
= FLD (f_memmode
);
2070 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2071 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2072 ; if (NEBI (tmp_postinc
, 0)) {
2074 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2075 tmp_addr
= ADDSI (tmp_addr
, 2);
2078 SI opval
= tmp_addr
;
2079 SET_H_GR (FLD (f_operand1
), opval
);
2080 written
|= (1 << 9);
2081 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2086 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2087 tmp_carry
= CPU (h_cbit
);
2088 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2092 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))));
2093 CPU (h_cbit
) = opval
;
2094 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2097 BI opval
= LTSI (tmp_newval
, 0);
2098 CPU (h_nbit
) = opval
;
2099 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2102 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2103 CPU (h_zbit
) = opval
;
2104 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2107 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)));
2108 CPU (h_vbit
) = opval
;
2109 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2114 CPU (h_xbit
) = opval
;
2115 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2119 SET_H_INSN_PREFIXED_P (opval
);
2120 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2126 abuf
->written
= written
;
2131 CASE (sem
, INSN_CMPSCBR
) : /* [${Rs}${inc}],$Rd */
2133 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2134 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2135 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2136 int UNUSED written
= 0;
2137 IADDR UNUSED pc
= abuf
->addr
;
2138 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2145 tmp_tmpops
= EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2146 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2147 tmp_carry
= CPU (h_cbit
);
2148 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2152 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))));
2153 CPU (h_cbit
) = opval
;
2154 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2157 BI opval
= LTSI (tmp_newval
, 0);
2158 CPU (h_nbit
) = opval
;
2159 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2162 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2163 CPU (h_zbit
) = opval
;
2164 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2167 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)));
2168 CPU (h_vbit
) = opval
;
2169 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2174 CPU (h_xbit
) = opval
;
2175 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2179 SET_H_INSN_PREFIXED_P (opval
);
2180 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2190 CASE (sem
, INSN_CMPSCWR
) : /* [${Rs}${inc}],$Rd */
2192 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2193 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2194 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2195 int UNUSED written
= 0;
2196 IADDR UNUSED pc
= abuf
->addr
;
2197 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2204 tmp_tmpops
= EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2205 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2206 tmp_carry
= CPU (h_cbit
);
2207 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2211 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))));
2212 CPU (h_cbit
) = opval
;
2213 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2216 BI opval
= LTSI (tmp_newval
, 0);
2217 CPU (h_nbit
) = opval
;
2218 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2221 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2222 CPU (h_zbit
) = opval
;
2223 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2226 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)));
2227 CPU (h_vbit
) = opval
;
2228 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2233 CPU (h_xbit
) = opval
;
2234 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2238 SET_H_INSN_PREFIXED_P (opval
);
2239 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2249 CASE (sem
, INSN_CMPU_M_B_M
) : /* cmpu-m.b [${Rs}${inc}],$Rd */
2251 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2252 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2253 #define FLD(f) abuf->fields.sfmt_addc_m.f
2254 int UNUSED written
= 0;
2255 IADDR UNUSED pc
= abuf
->addr
;
2256 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2263 tmp_tmpops
= ZEXTQISI (({ SI tmp_addr
;
2266 tmp_postinc
= FLD (f_memmode
);
2267 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2268 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2269 ; if (NEBI (tmp_postinc
, 0)) {
2271 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2272 tmp_addr
= ADDSI (tmp_addr
, 1);
2275 SI opval
= tmp_addr
;
2276 SET_H_GR (FLD (f_operand1
), opval
);
2277 written
|= (1 << 9);
2278 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2283 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2284 tmp_carry
= CPU (h_cbit
);
2285 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2289 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))));
2290 CPU (h_cbit
) = opval
;
2291 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2294 BI opval
= LTSI (tmp_newval
, 0);
2295 CPU (h_nbit
) = opval
;
2296 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2299 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2300 CPU (h_zbit
) = opval
;
2301 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2304 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)));
2305 CPU (h_vbit
) = opval
;
2306 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2311 CPU (h_xbit
) = opval
;
2312 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2316 SET_H_INSN_PREFIXED_P (opval
);
2317 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2323 abuf
->written
= written
;
2328 CASE (sem
, INSN_CMPU_M_W_M
) : /* cmpu-m.w [${Rs}${inc}],$Rd */
2330 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2331 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2332 #define FLD(f) abuf->fields.sfmt_addc_m.f
2333 int UNUSED written
= 0;
2334 IADDR UNUSED pc
= abuf
->addr
;
2335 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2342 tmp_tmpops
= ZEXTHISI (({ SI tmp_addr
;
2345 tmp_postinc
= FLD (f_memmode
);
2346 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2347 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2348 ; if (NEBI (tmp_postinc
, 0)) {
2350 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2351 tmp_addr
= ADDSI (tmp_addr
, 2);
2354 SI opval
= tmp_addr
;
2355 SET_H_GR (FLD (f_operand1
), opval
);
2356 written
|= (1 << 9);
2357 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2362 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2363 tmp_carry
= CPU (h_cbit
);
2364 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2368 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))));
2369 CPU (h_cbit
) = opval
;
2370 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2373 BI opval
= LTSI (tmp_newval
, 0);
2374 CPU (h_nbit
) = opval
;
2375 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2378 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2379 CPU (h_zbit
) = opval
;
2380 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2383 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)));
2384 CPU (h_vbit
) = opval
;
2385 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2390 CPU (h_xbit
) = opval
;
2391 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2395 SET_H_INSN_PREFIXED_P (opval
);
2396 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2402 abuf
->written
= written
;
2407 CASE (sem
, INSN_CMPUCBR
) : /* [${Rs}${inc}],$Rd */
2409 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2410 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2411 #define FLD(f) abuf->fields.sfmt_bound_cb.f
2412 int UNUSED written
= 0;
2413 IADDR UNUSED pc
= abuf
->addr
;
2414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2421 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
2422 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2423 tmp_carry
= CPU (h_cbit
);
2424 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2428 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))));
2429 CPU (h_cbit
) = opval
;
2430 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2433 BI opval
= LTSI (tmp_newval
, 0);
2434 CPU (h_nbit
) = opval
;
2435 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2438 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2439 CPU (h_zbit
) = opval
;
2440 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2443 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)));
2444 CPU (h_vbit
) = opval
;
2445 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2450 CPU (h_xbit
) = opval
;
2451 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2455 SET_H_INSN_PREFIXED_P (opval
);
2456 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2466 CASE (sem
, INSN_CMPUCWR
) : /* [${Rs}${inc}],$Rd */
2468 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2469 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2470 #define FLD(f) abuf->fields.sfmt_bound_cw.f
2471 int UNUSED written
= 0;
2472 IADDR UNUSED pc
= abuf
->addr
;
2473 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2480 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
)));
2481 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
2482 tmp_carry
= CPU (h_cbit
);
2483 tmp_newval
= SUBCSI (tmp_tmpopd
, tmp_tmpops
, ((EQBI (CPU (h_xbit
), 0)) ? (0) : (tmp_carry
)));
2487 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))));
2488 CPU (h_cbit
) = opval
;
2489 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
2492 BI opval
= LTSI (tmp_newval
, 0);
2493 CPU (h_nbit
) = opval
;
2494 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2497 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ORIF (CPU (h_zbit
), NOTBI (CPU (h_xbit
))));
2498 CPU (h_zbit
) = opval
;
2499 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2502 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)));
2503 CPU (h_vbit
) = opval
;
2504 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
2509 CPU (h_xbit
) = opval
;
2510 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2514 SET_H_INSN_PREFIXED_P (opval
);
2515 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2525 CASE (sem
, INSN_MOVE_M_B_M
) : /* move-m.b [${Rs}${inc}],${Rd} */
2527 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2528 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2529 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2530 int UNUSED written
= 0;
2531 IADDR UNUSED pc
= abuf
->addr
;
2532 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2536 tmp_tmp
= ({ SI tmp_addr
;
2539 tmp_postinc
= FLD (f_memmode
);
2540 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2541 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2542 ; if (NEBI (tmp_postinc
, 0)) {
2544 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2545 tmp_addr
= ADDSI (tmp_addr
, 1);
2548 SI opval
= tmp_addr
;
2549 SET_H_GR (FLD (f_operand1
), opval
);
2550 written
|= (1 << 10);
2551 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2558 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2560 SI opval
= ORSI (ANDSI (tmp_tmp
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
2561 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2562 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2567 BI opval
= LTQI (tmp_tmp
, 0);
2568 CPU (h_nbit
) = opval
;
2569 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2572 BI opval
= ANDIF (EQQI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2573 CPU (h_zbit
) = opval
;
2574 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2576 SET_H_CBIT_MOVE (0);
2577 SET_H_VBIT_MOVE (0);
2581 CPU (h_xbit
) = opval
;
2582 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2586 SET_H_INSN_PREFIXED_P (opval
);
2587 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2593 abuf
->written
= written
;
2598 CASE (sem
, INSN_MOVE_M_W_M
) : /* move-m.w [${Rs}${inc}],${Rd} */
2600 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2601 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2602 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2603 int UNUSED written
= 0;
2604 IADDR UNUSED pc
= abuf
->addr
;
2605 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2609 tmp_tmp
= ({ SI tmp_addr
;
2612 tmp_postinc
= FLD (f_memmode
);
2613 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2614 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2615 ; if (NEBI (tmp_postinc
, 0)) {
2617 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2618 tmp_addr
= ADDSI (tmp_addr
, 2);
2621 SI opval
= tmp_addr
;
2622 SET_H_GR (FLD (f_operand1
), opval
);
2623 written
|= (1 << 10);
2624 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2631 tmp_oldregval
= GET_H_RAW_GR_ACR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))));
2633 SI opval
= ORSI (ANDSI (tmp_tmp
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
2634 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2635 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2640 BI opval
= LTHI (tmp_tmp
, 0);
2641 CPU (h_nbit
) = opval
;
2642 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2645 BI opval
= ANDIF (EQHI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2646 CPU (h_zbit
) = opval
;
2647 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2649 SET_H_CBIT_MOVE (0);
2650 SET_H_VBIT_MOVE (0);
2654 CPU (h_xbit
) = opval
;
2655 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2659 SET_H_INSN_PREFIXED_P (opval
);
2660 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2666 abuf
->written
= written
;
2671 CASE (sem
, INSN_MOVE_M_D_M
) : /* move-m.d [${Rs}${inc}],${Rd} */
2673 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2674 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2675 #define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2676 int UNUSED written
= 0;
2677 IADDR UNUSED pc
= abuf
->addr
;
2678 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2682 tmp_tmp
= ({ SI tmp_addr
;
2685 tmp_postinc
= FLD (f_memmode
);
2686 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2687 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
2688 ; if (NEBI (tmp_postinc
, 0)) {
2690 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2691 tmp_addr
= ADDSI (tmp_addr
, 4);
2694 SI opval
= tmp_addr
;
2695 SET_H_GR (FLD (f_operand1
), opval
);
2696 written
|= (1 << 9);
2697 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2704 SET_H_GR (((ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) ? (FLD (f_operand1
)) : (FLD (f_operand2
))), opval
);
2705 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2709 BI opval
= LTSI (tmp_tmp
, 0);
2710 CPU (h_nbit
) = opval
;
2711 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2714 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2715 CPU (h_zbit
) = opval
;
2716 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2718 SET_H_CBIT_MOVE (0);
2719 SET_H_VBIT_MOVE (0);
2723 CPU (h_xbit
) = opval
;
2724 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2728 SET_H_INSN_PREFIXED_P (opval
);
2729 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2735 abuf
->written
= written
;
2740 CASE (sem
, INSN_MOVS_M_B_M
) : /* movs-m.b [${Rs}${inc}],${Rd} */
2742 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2743 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2744 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2745 int UNUSED written
= 0;
2746 IADDR UNUSED pc
= abuf
->addr
;
2747 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2751 tmp_tmp
= EXTQISI (({ SI tmp_addr
;
2754 tmp_postinc
= FLD (f_memmode
);
2755 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2756 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2757 ; if (NEBI (tmp_postinc
, 0)) {
2759 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2760 tmp_addr
= ADDSI (tmp_addr
, 1);
2763 SI opval
= tmp_addr
;
2764 SET_H_GR (FLD (f_operand1
), opval
);
2765 written
|= (1 << 8);
2766 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2771 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2774 SET_H_GR (FLD (f_operand1
), opval
);
2775 written
|= (1 << 8);
2776 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2781 SET_H_GR (FLD (f_operand2
), opval
);
2782 written
|= (1 << 7);
2783 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2788 BI opval
= LTSI (tmp_tmp
, 0);
2789 CPU (h_nbit
) = opval
;
2790 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2793 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2794 CPU (h_zbit
) = opval
;
2795 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2797 SET_H_CBIT_MOVE (0);
2798 SET_H_VBIT_MOVE (0);
2802 CPU (h_xbit
) = opval
;
2803 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2807 SET_H_INSN_PREFIXED_P (opval
);
2808 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2814 abuf
->written
= written
;
2819 CASE (sem
, INSN_MOVS_M_W_M
) : /* movs-m.w [${Rs}${inc}],${Rd} */
2821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2823 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2824 int UNUSED written
= 0;
2825 IADDR UNUSED pc
= abuf
->addr
;
2826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2830 tmp_tmp
= EXTHISI (({ SI tmp_addr
;
2833 tmp_postinc
= FLD (f_memmode
);
2834 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2835 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2836 ; if (NEBI (tmp_postinc
, 0)) {
2838 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2839 tmp_addr
= ADDSI (tmp_addr
, 2);
2842 SI opval
= tmp_addr
;
2843 SET_H_GR (FLD (f_operand1
), opval
);
2844 written
|= (1 << 8);
2845 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2850 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2853 SET_H_GR (FLD (f_operand1
), opval
);
2854 written
|= (1 << 8);
2855 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2860 SET_H_GR (FLD (f_operand2
), opval
);
2861 written
|= (1 << 7);
2862 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2867 BI opval
= LTSI (tmp_tmp
, 0);
2868 CPU (h_nbit
) = opval
;
2869 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2872 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2873 CPU (h_zbit
) = opval
;
2874 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2876 SET_H_CBIT_MOVE (0);
2877 SET_H_VBIT_MOVE (0);
2881 CPU (h_xbit
) = opval
;
2882 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2886 SET_H_INSN_PREFIXED_P (opval
);
2887 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2893 abuf
->written
= written
;
2898 CASE (sem
, INSN_MOVU_M_B_M
) : /* movu-m.b [${Rs}${inc}],${Rd} */
2900 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2901 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2902 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2903 int UNUSED written
= 0;
2904 IADDR UNUSED pc
= abuf
->addr
;
2905 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2909 tmp_tmp
= ZEXTQISI (({ SI tmp_addr
;
2912 tmp_postinc
= FLD (f_memmode
);
2913 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2914 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
2915 ; if (NEBI (tmp_postinc
, 0)) {
2917 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2918 tmp_addr
= ADDSI (tmp_addr
, 1);
2921 SI opval
= tmp_addr
;
2922 SET_H_GR (FLD (f_operand1
), opval
);
2923 written
|= (1 << 8);
2924 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2929 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
2932 SET_H_GR (FLD (f_operand1
), opval
);
2933 written
|= (1 << 8);
2934 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2939 SET_H_GR (FLD (f_operand2
), opval
);
2940 written
|= (1 << 7);
2941 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2946 BI opval
= LTSI (tmp_tmp
, 0);
2947 CPU (h_nbit
) = opval
;
2948 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
2951 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
2952 CPU (h_zbit
) = opval
;
2953 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
2955 SET_H_CBIT_MOVE (0);
2956 SET_H_VBIT_MOVE (0);
2960 CPU (h_xbit
) = opval
;
2961 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
2965 SET_H_INSN_PREFIXED_P (opval
);
2966 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
2972 abuf
->written
= written
;
2977 CASE (sem
, INSN_MOVU_M_W_M
) : /* movu-m.w [${Rs}${inc}],${Rd} */
2979 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2980 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2981 #define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
2982 int UNUSED written
= 0;
2983 IADDR UNUSED pc
= abuf
->addr
;
2984 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2988 tmp_tmp
= ZEXTHISI (({ SI tmp_addr
;
2991 tmp_postinc
= FLD (f_memmode
);
2992 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
2993 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
2994 ; if (NEBI (tmp_postinc
, 0)) {
2996 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
2997 tmp_addr
= ADDSI (tmp_addr
, 2);
3000 SI opval
= tmp_addr
;
3001 SET_H_GR (FLD (f_operand1
), opval
);
3002 written
|= (1 << 8);
3003 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3008 if (ANDIF (GET_H_INSN_PREFIXED_P (), NOTSI (FLD (f_memmode
)))) {
3011 SET_H_GR (FLD (f_operand1
), opval
);
3012 written
|= (1 << 8);
3013 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3018 SET_H_GR (FLD (f_operand2
), opval
);
3019 written
|= (1 << 7);
3020 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3025 BI opval
= LTSI (tmp_tmp
, 0);
3026 CPU (h_nbit
) = opval
;
3027 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
3030 BI opval
= ANDIF (EQSI (tmp_tmp
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
3031 CPU (h_zbit
) = opval
;
3032 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
3034 SET_H_CBIT_MOVE (0);
3035 SET_H_VBIT_MOVE (0);
3039 CPU (h_xbit
) = opval
;
3040 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3044 SET_H_INSN_PREFIXED_P (opval
);
3045 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3051 abuf
->written
= written
;
3056 CASE (sem
, INSN_MOVE_R_SPRV32
) : /* move ${Rs},${Pd} */
3058 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3059 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3060 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
3061 int UNUSED written
= 0;
3062 IADDR UNUSED pc
= abuf
->addr
;
3063 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3068 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
3069 tmp_rno
= FLD (f_operand2
);
3070 if (ORIF (ORIF (EQSI (tmp_rno
, 0), EQSI (tmp_rno
, 1)), ORIF (EQSI (tmp_rno
, 4), EQSI (tmp_rno
, 8)))) {
3071 cgen_rtx_error (current_cpu
, "move-r-spr: trying to set a read-only special register");
3076 SET_H_SR (FLD (f_operand2
), opval
);
3077 written
|= (1 << 2);
3078 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
3084 CPU (h_xbit
) = opval
;
3085 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
3089 SET_H_INSN_PREFIXED_P (opval
);
3090 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
3095 abuf
->written
= written
;
3100 CASE (sem
, INSN_MOVE_SPR_RV32
) : /* move ${Ps},${Rd-sfield} */
3102 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3103 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3104 #define FLD(f) abuf->fields.sfmt_mcp.f
3105 int UNUSED written
= 0;
3106 IADDR UNUSED pc
= abuf
->addr
;
3107 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_tmpb
;
11290 tmp_tmpb
= tmp_tmpval
;
11291 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11293 else if (EQSI (tmp_tmpcode
, 5)) {
11294 tmp_tmpres
= ({ SI tmp_tmpr
;
11295 tmp_tmpr
= ({ SI tmp_tmpb
;
11296 tmp_tmpb
= tmp_tmpval
;
11297 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 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_tmpb
;
11303 tmp_tmpb
= tmp_tmpval
;
11304 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 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_tmpb
;
11311 tmp_tmpb
= tmp_tmpval
;
11312 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 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_tmpb
;
11338 tmp_tmpb
= INVSI (tmp_tmpval
);
11339 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 16), 65535)); });
11341 else if (EQSI (tmp_tmpcode
, 13)) {
11342 tmp_tmpres
= ({ SI tmp_tmpr
;
11343 tmp_tmpr
= ({ SI tmp_tmpb
;
11344 tmp_tmpb
= INVSI (tmp_tmpval
);
11345 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 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_tmpb
;
11351 tmp_tmpb
= INVSI (tmp_tmpval
);
11352 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 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_tmpb
;
11359 tmp_tmpb
= INVSI (tmp_tmpval
);
11360 ; ORSI (ANDSI (SLLSI (tmp_tmpb
, 16), 0xffff0000), ANDSI (SRLSI (tmp_tmpb
, 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)))))))); });
11366 SI opval
= tmp_tmpd
;
11367 SET_H_GR (FLD (f_operand1
), opval
);
11368 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11372 BI opval
= LTSI (tmp_tmpd
, 0);
11373 CPU (h_nbit
) = opval
;
11374 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11377 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11378 CPU (h_zbit
) = opval
;
11379 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11381 SET_H_CBIT_MOVE (0);
11382 SET_H_VBIT_MOVE (0);
11386 CPU (h_xbit
) = opval
;
11387 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11391 SET_H_INSN_PREFIXED_P (opval
);
11392 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11402 CASE (sem
, INSN_ASRR_B_R
) : /* asrr.b $Rs,$Rd */
11404 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11405 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11406 #define FLD(f) abuf->fields.sfmt_addc_m.f
11407 int UNUSED written
= 0;
11408 IADDR UNUSED pc
= abuf
->addr
;
11409 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11415 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11416 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11417 tmp_tmpd
= SRASI (EXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11420 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11422 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11423 SET_H_GR (FLD (f_operand2
), opval
);
11424 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11429 BI opval
= LTQI (tmp_tmpd
, 0);
11430 CPU (h_nbit
) = opval
;
11431 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11434 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11435 CPU (h_zbit
) = opval
;
11436 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11438 SET_H_CBIT_MOVE (0);
11439 SET_H_VBIT_MOVE (0);
11443 CPU (h_xbit
) = opval
;
11444 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11448 SET_H_INSN_PREFIXED_P (opval
);
11449 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11459 CASE (sem
, INSN_ASRR_W_R
) : /* asrr.w $Rs,$Rd */
11461 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11462 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11463 #define FLD(f) abuf->fields.sfmt_addc_m.f
11464 int UNUSED written
= 0;
11465 IADDR UNUSED pc
= abuf
->addr
;
11466 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11472 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11473 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11474 tmp_tmpd
= SRASI (EXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11477 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11479 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11480 SET_H_GR (FLD (f_operand2
), opval
);
11481 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11486 BI opval
= LTHI (tmp_tmpd
, 0);
11487 CPU (h_nbit
) = opval
;
11488 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11491 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11492 CPU (h_zbit
) = opval
;
11493 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11495 SET_H_CBIT_MOVE (0);
11496 SET_H_VBIT_MOVE (0);
11500 CPU (h_xbit
) = opval
;
11501 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11505 SET_H_INSN_PREFIXED_P (opval
);
11506 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11516 CASE (sem
, INSN_ASRR_D_R
) : /* asrr.d $Rs,$Rd */
11518 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11519 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11520 #define FLD(f) abuf->fields.sfmt_addc_m.f
11521 int UNUSED written
= 0;
11522 IADDR UNUSED pc
= abuf
->addr
;
11523 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11529 tmp_cnt1
= GET_H_GR (FLD (f_operand1
));
11530 tmp_cnt2
= ((NESI (ANDSI (tmp_cnt1
, 32), 0)) ? (31) : (ANDSI (tmp_cnt1
, 31)));
11531 tmp_tmpd
= SRASI (EXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), tmp_cnt2
);
11533 SI opval
= tmp_tmpd
;
11534 SET_H_GR (FLD (f_operand2
), opval
);
11535 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11539 BI opval
= LTSI (tmp_tmpd
, 0);
11540 CPU (h_nbit
) = opval
;
11541 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11544 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11545 CPU (h_zbit
) = opval
;
11546 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11548 SET_H_CBIT_MOVE (0);
11549 SET_H_VBIT_MOVE (0);
11553 CPU (h_xbit
) = opval
;
11554 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11558 SET_H_INSN_PREFIXED_P (opval
);
11559 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11569 CASE (sem
, INSN_ASRQ
) : /* asrq $c,${Rd} */
11571 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11572 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11573 #define FLD(f) abuf->fields.sfmt_asrq.f
11574 int UNUSED written
= 0;
11575 IADDR UNUSED pc
= abuf
->addr
;
11576 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11580 tmp_tmpd
= SRASI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11582 SI opval
= tmp_tmpd
;
11583 SET_H_GR (FLD (f_operand2
), opval
);
11584 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11588 BI opval
= LTSI (tmp_tmpd
, 0);
11589 CPU (h_nbit
) = opval
;
11590 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11593 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11594 CPU (h_zbit
) = opval
;
11595 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11597 SET_H_CBIT_MOVE (0);
11598 SET_H_VBIT_MOVE (0);
11602 CPU (h_xbit
) = opval
;
11603 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11607 SET_H_INSN_PREFIXED_P (opval
);
11608 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11618 CASE (sem
, INSN_LSRR_B_R
) : /* lsrr.b $Rs,$Rd */
11620 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11621 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11622 #define FLD(f) abuf->fields.sfmt_addc_m.f
11623 int UNUSED written
= 0;
11624 IADDR UNUSED pc
= abuf
->addr
;
11625 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11630 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11631 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11634 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11636 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11637 SET_H_GR (FLD (f_operand2
), opval
);
11638 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11643 BI opval
= LTQI (tmp_tmpd
, 0);
11644 CPU (h_nbit
) = opval
;
11645 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11648 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11649 CPU (h_zbit
) = opval
;
11650 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11652 SET_H_CBIT_MOVE (0);
11653 SET_H_VBIT_MOVE (0);
11657 CPU (h_xbit
) = opval
;
11658 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11662 SET_H_INSN_PREFIXED_P (opval
);
11663 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11673 CASE (sem
, INSN_LSRR_W_R
) : /* lsrr.w $Rs,$Rd */
11675 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11676 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11677 #define FLD(f) abuf->fields.sfmt_addc_m.f
11678 int UNUSED written
= 0;
11679 IADDR UNUSED pc
= abuf
->addr
;
11680 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11685 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11686 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11689 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11691 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11692 SET_H_GR (FLD (f_operand2
), opval
);
11693 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11698 BI opval
= LTHI (tmp_tmpd
, 0);
11699 CPU (h_nbit
) = opval
;
11700 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11703 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11704 CPU (h_zbit
) = opval
;
11705 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11707 SET_H_CBIT_MOVE (0);
11708 SET_H_VBIT_MOVE (0);
11712 CPU (h_xbit
) = opval
;
11713 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11717 SET_H_INSN_PREFIXED_P (opval
);
11718 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11728 CASE (sem
, INSN_LSRR_D_R
) : /* lsrr.d $Rs,$Rd */
11730 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11731 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11732 #define FLD(f) abuf->fields.sfmt_addc_m.f
11733 int UNUSED written
= 0;
11734 IADDR UNUSED pc
= abuf
->addr
;
11735 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11740 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11741 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SRLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11743 SI opval
= tmp_tmpd
;
11744 SET_H_GR (FLD (f_operand2
), opval
);
11745 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11749 BI opval
= LTSI (tmp_tmpd
, 0);
11750 CPU (h_nbit
) = opval
;
11751 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11754 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11755 CPU (h_zbit
) = opval
;
11756 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11758 SET_H_CBIT_MOVE (0);
11759 SET_H_VBIT_MOVE (0);
11763 CPU (h_xbit
) = opval
;
11764 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11768 SET_H_INSN_PREFIXED_P (opval
);
11769 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11779 CASE (sem
, INSN_LSRQ
) : /* lsrq $c,${Rd} */
11781 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11782 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11783 #define FLD(f) abuf->fields.sfmt_asrq.f
11784 int UNUSED written
= 0;
11785 IADDR UNUSED pc
= abuf
->addr
;
11786 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11790 tmp_tmpd
= SRLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
11792 SI opval
= tmp_tmpd
;
11793 SET_H_GR (FLD (f_operand2
), opval
);
11794 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11798 BI opval
= LTSI (tmp_tmpd
, 0);
11799 CPU (h_nbit
) = opval
;
11800 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11803 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11804 CPU (h_zbit
) = opval
;
11805 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11807 SET_H_CBIT_MOVE (0);
11808 SET_H_VBIT_MOVE (0);
11812 CPU (h_xbit
) = opval
;
11813 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11817 SET_H_INSN_PREFIXED_P (opval
);
11818 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11828 CASE (sem
, INSN_LSLR_B_R
) : /* lslr.b $Rs,$Rd */
11830 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11831 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11832 #define FLD(f) abuf->fields.sfmt_addc_m.f
11833 int UNUSED written
= 0;
11834 IADDR UNUSED pc
= abuf
->addr
;
11835 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11840 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11841 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11844 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11846 SI opval
= ORSI (ANDSI (tmp_tmpd
, 255), ANDSI (tmp_oldregval
, 0xffffff00));
11847 SET_H_GR (FLD (f_operand2
), opval
);
11848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11853 BI opval
= LTQI (tmp_tmpd
, 0);
11854 CPU (h_nbit
) = opval
;
11855 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11858 BI opval
= ANDIF (EQQI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11859 CPU (h_zbit
) = opval
;
11860 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11862 SET_H_CBIT_MOVE (0);
11863 SET_H_VBIT_MOVE (0);
11867 CPU (h_xbit
) = opval
;
11868 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11872 SET_H_INSN_PREFIXED_P (opval
);
11873 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11883 CASE (sem
, INSN_LSLR_W_R
) : /* lslr.w $Rs,$Rd */
11885 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11886 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11887 #define FLD(f) abuf->fields.sfmt_addc_m.f
11888 int UNUSED written
= 0;
11889 IADDR UNUSED pc
= abuf
->addr
;
11890 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11895 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11896 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11899 tmp_oldregval
= GET_H_RAW_GR_ACR (FLD (f_operand2
));
11901 SI opval
= ORSI (ANDSI (tmp_tmpd
, 65535), ANDSI (tmp_oldregval
, 0xffff0000));
11902 SET_H_GR (FLD (f_operand2
), opval
);
11903 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11908 BI opval
= LTHI (tmp_tmpd
, 0);
11909 CPU (h_nbit
) = opval
;
11910 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11913 BI opval
= ANDIF (EQHI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11914 CPU (h_zbit
) = opval
;
11915 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11917 SET_H_CBIT_MOVE (0);
11918 SET_H_VBIT_MOVE (0);
11922 CPU (h_xbit
) = opval
;
11923 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11927 SET_H_INSN_PREFIXED_P (opval
);
11928 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11938 CASE (sem
, INSN_LSLR_D_R
) : /* lslr.d $Rs,$Rd */
11940 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11941 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11942 #define FLD(f) abuf->fields.sfmt_addc_m.f
11943 int UNUSED written
= 0;
11944 IADDR UNUSED pc
= abuf
->addr
;
11945 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
11950 tmp_cnt
= ANDSI (GET_H_GR (FLD (f_operand1
)), 63);
11951 tmp_tmpd
= ((NESI (ANDSI (tmp_cnt
, 32), 0)) ? (0) : (SLLSI (ZEXTSISI (TRUNCSISI (GET_H_GR (FLD (f_operand2
)))), ANDSI (tmp_cnt
, 31))));
11953 SI opval
= tmp_tmpd
;
11954 SET_H_GR (FLD (f_operand2
), opval
);
11955 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
11959 BI opval
= LTSI (tmp_tmpd
, 0);
11960 CPU (h_nbit
) = opval
;
11961 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
11964 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
11965 CPU (h_zbit
) = opval
;
11966 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
11968 SET_H_CBIT_MOVE (0);
11969 SET_H_VBIT_MOVE (0);
11973 CPU (h_xbit
) = opval
;
11974 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
11978 SET_H_INSN_PREFIXED_P (opval
);
11979 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
11989 CASE (sem
, INSN_LSLQ
) : /* lslq $c,${Rd} */
11991 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
11992 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
11993 #define FLD(f) abuf->fields.sfmt_asrq.f
11994 int UNUSED written
= 0;
11995 IADDR UNUSED pc
= abuf
->addr
;
11996 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12000 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), FLD (f_u5
));
12002 SI opval
= tmp_tmpd
;
12003 SET_H_GR (FLD (f_operand2
), opval
);
12004 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
12008 BI opval
= LTSI (tmp_tmpd
, 0);
12009 CPU (h_nbit
) = opval
;
12010 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12013 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12014 CPU (h_zbit
) = opval
;
12015 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12017 SET_H_CBIT_MOVE (0);
12018 SET_H_VBIT_MOVE (0);
12022 CPU (h_xbit
) = opval
;
12023 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12027 SET_H_INSN_PREFIXED_P (opval
);
12028 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12038 CASE (sem
, INSN_BTST
) : /* $Rs,$Rd */
12040 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12041 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12042 #define FLD(f) abuf->fields.sfmt_muls_b.f
12043 int UNUSED written
= 0;
12044 IADDR UNUSED pc
= abuf
->addr
;
12045 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12050 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, ANDSI (GET_H_GR (FLD (f_operand1
)), 31)));
12053 BI opval
= LTSI (tmp_tmpd
, 0);
12054 CPU (h_nbit
) = opval
;
12055 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12058 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12059 CPU (h_zbit
) = opval
;
12060 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12062 SET_H_CBIT_MOVE (0);
12063 SET_H_VBIT_MOVE (0);
12067 CPU (h_xbit
) = opval
;
12068 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12072 SET_H_INSN_PREFIXED_P (opval
);
12073 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12083 CASE (sem
, INSN_BTSTQ
) : /* btstq $c,${Rd} */
12085 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12086 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12087 #define FLD(f) abuf->fields.sfmt_asrq.f
12088 int UNUSED written
= 0;
12089 IADDR UNUSED pc
= abuf
->addr
;
12090 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12094 tmp_tmpd
= SLLSI (GET_H_GR (FLD (f_operand2
)), SUBSI (31, FLD (f_u5
)));
12097 BI opval
= LTSI (tmp_tmpd
, 0);
12098 CPU (h_nbit
) = opval
;
12099 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12102 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
12103 CPU (h_zbit
) = opval
;
12104 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12106 SET_H_CBIT_MOVE (0);
12107 SET_H_VBIT_MOVE (0);
12111 CPU (h_xbit
) = opval
;
12112 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12116 SET_H_INSN_PREFIXED_P (opval
);
12117 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12127 CASE (sem
, INSN_SETF
) : /* setf ${list-of-flags} */
12129 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12130 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12131 #define FLD(f) abuf->fields.sfmt_setf.f
12132 int UNUSED written
= 0;
12133 IADDR UNUSED pc
= abuf
->addr
;
12134 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12138 tmp_tmp
= FLD (f_dstsrc
);
12139 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12142 CPU (h_cbit
) = opval
;
12143 written
|= (1 << 1);
12144 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12147 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12150 CPU (h_vbit
) = opval
;
12151 written
|= (1 << 7);
12152 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12155 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12158 CPU (h_zbit
) = opval
;
12159 written
|= (1 << 9);
12160 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12163 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12166 CPU (h_nbit
) = opval
;
12167 written
|= (1 << 3);
12168 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12171 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12174 CPU (h_xbit
) = opval
;
12175 written
|= (1 << 8);
12176 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12179 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12182 SET_H_IBIT (opval
);
12183 written
|= (1 << 2);
12184 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12187 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12190 SET_H_UBIT (opval
);
12191 written
|= (1 << 6);
12192 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12195 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12198 CPU (h_pbit
) = opval
;
12199 written
|= (1 << 4);
12200 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12205 SET_H_INSN_PREFIXED_P (opval
);
12206 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12208 if (EQSI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12211 CPU (h_xbit
) = opval
;
12212 written
|= (1 << 8);
12213 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12218 abuf
->written
= written
;
12223 CASE (sem
, INSN_CLEARF
) : /* clearf ${list-of-flags} */
12225 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12226 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12227 #define FLD(f) abuf->fields.sfmt_setf.f
12228 int UNUSED written
= 0;
12229 IADDR UNUSED pc
= abuf
->addr
;
12230 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12234 tmp_tmp
= FLD (f_dstsrc
);
12235 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 0)), 0)) {
12238 CPU (h_cbit
) = opval
;
12239 written
|= (1 << 1);
12240 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cbit", 'x', opval
);
12243 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 1)), 0)) {
12246 CPU (h_vbit
) = opval
;
12247 written
|= (1 << 7);
12248 CGEN_TRACE_RESULT (current_cpu
, abuf
, "vbit", 'x', opval
);
12251 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 2)), 0)) {
12254 CPU (h_zbit
) = opval
;
12255 written
|= (1 << 9);
12256 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
12259 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 3)), 0)) {
12262 CPU (h_nbit
) = opval
;
12263 written
|= (1 << 3);
12264 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
12267 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 4)), 0)) {
12270 CPU (h_xbit
) = opval
;
12271 written
|= (1 << 8);
12272 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12275 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 5)), 0)) {
12278 SET_H_IBIT (opval
);
12279 written
|= (1 << 2);
12280 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ibit", 'x', opval
);
12283 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 6)), 0)) {
12286 SET_H_UBIT (opval
);
12287 written
|= (1 << 6);
12288 CGEN_TRACE_RESULT (current_cpu
, abuf
, "ubit", 'x', opval
);
12291 if (NESI (ANDSI (tmp_tmp
, SLLSI (1, 7)), 0)) {
12294 CPU (h_pbit
) = opval
;
12295 written
|= (1 << 4);
12296 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pbit", 'x', opval
);
12302 CPU (h_xbit
) = opval
;
12303 written
|= (1 << 8);
12304 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12308 SET_H_INSN_PREFIXED_P (opval
);
12309 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12314 abuf
->written
= written
;
12319 CASE (sem
, INSN_RFE
) : /* rfe */
12321 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12322 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12323 #define FLD(f) abuf->fields.sfmt_rfe.f
12324 int UNUSED written
= 0;
12325 IADDR UNUSED pc
= abuf
->addr
;
12326 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12334 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12335 tmp_keepmask
= 0xc0000000;
12336 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12337 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12338 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12340 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12341 SET_H_SR (((UINT
) 13), opval
);
12342 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12350 CASE (sem
, INSN_SFE
) : /* sfe */
12352 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12354 #define FLD(f) abuf->fields.sfmt_rfe.f
12355 int UNUSED written
= 0;
12356 IADDR UNUSED pc
= abuf
->addr
;
12357 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12362 tmp_savemask
= 0xc0000000;
12363 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12365 SI opval
= ORSI (ANDSI (tmp_savemask
, tmp_oldccs
), ANDSI (INVSI (tmp_savemask
), SLLSI (tmp_oldccs
, 10)));
12366 SET_H_SR (((UINT
) 13), opval
);
12367 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12375 CASE (sem
, INSN_RFG
) : /* rfg */
12377 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12378 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12379 #define FLD(f) abuf->fields.sfmt_empty.f
12380 int UNUSED written
= 0;
12381 IADDR UNUSED pc
= abuf
->addr
;
12382 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12384 crisv32f_rfg_handler (current_cpu
, pc
);
12390 CASE (sem
, INSN_RFN
) : /* rfn */
12392 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12393 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12394 #define FLD(f) abuf->fields.sfmt_rfe.f
12395 int UNUSED written
= 0;
12396 IADDR UNUSED pc
= abuf
->addr
;
12397 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12406 tmp_oldccs
= GET_H_SR (((UINT
) 13));
12407 tmp_keepmask
= 0xc0000000;
12408 tmp_samebits
= ANDSI (tmp_oldccs
, tmp_keepmask
);
12409 tmp_shiftbits
= ANDSI (SRLSI (ANDSI (tmp_oldccs
, 1073609728), 10), INVSI (tmp_keepmask
));
12410 tmp_p1
= NESI (0, ANDSI (tmp_oldccs
, 131072));
12412 SI opval
= ORSI (ORSI (tmp_samebits
, tmp_shiftbits
), ((ANDBI (CPU (h_rbit
), NOTBI (tmp_p1
))) ? (0) : (128)));
12413 SET_H_SR (((UINT
) 13), opval
);
12414 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12419 SET_H_MBIT (opval
);
12420 CGEN_TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
12428 CASE (sem
, INSN_HALT
) : /* halt */
12430 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12431 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12432 #define FLD(f) abuf->fields.sfmt_empty.f
12433 int UNUSED written
= 0;
12434 IADDR UNUSED pc
= abuf
->addr
;
12436 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12439 USI opval
= crisv32f_halt_handler (current_cpu
, pc
);
12440 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12441 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12444 SEM_BRANCH_FINI (vpc
);
12449 CASE (sem
, INSN_BCC_B
) : /* b${cc} ${o-pcrel} */
12451 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12452 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12453 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12454 int UNUSED written
= 0;
12455 IADDR UNUSED pc
= abuf
->addr
;
12457 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12461 tmp_truthval
= ({ SI tmp_tmpcond
;
12463 tmp_tmpcond
= FLD (f_operand2
);
12464 ; if (EQSI (tmp_tmpcond
, 0)) {
12465 tmp_condres
= NOTBI (CPU (h_cbit
));
12467 else if (EQSI (tmp_tmpcond
, 1)) {
12468 tmp_condres
= CPU (h_cbit
);
12470 else if (EQSI (tmp_tmpcond
, 2)) {
12471 tmp_condres
= NOTBI (CPU (h_zbit
));
12473 else if (EQSI (tmp_tmpcond
, 3)) {
12474 tmp_condres
= CPU (h_zbit
);
12476 else if (EQSI (tmp_tmpcond
, 4)) {
12477 tmp_condres
= NOTBI (CPU (h_vbit
));
12479 else if (EQSI (tmp_tmpcond
, 5)) {
12480 tmp_condres
= CPU (h_vbit
);
12482 else if (EQSI (tmp_tmpcond
, 6)) {
12483 tmp_condres
= NOTBI (CPU (h_nbit
));
12485 else if (EQSI (tmp_tmpcond
, 7)) {
12486 tmp_condres
= CPU (h_nbit
);
12488 else if (EQSI (tmp_tmpcond
, 8)) {
12489 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12491 else if (EQSI (tmp_tmpcond
, 9)) {
12492 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12494 else if (EQSI (tmp_tmpcond
, 10)) {
12495 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12497 else if (EQSI (tmp_tmpcond
, 11)) {
12498 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12500 else if (EQSI (tmp_tmpcond
, 12)) {
12501 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12503 else if (EQSI (tmp_tmpcond
, 13)) {
12504 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12506 else if (EQSI (tmp_tmpcond
, 14)) {
12509 else if (EQSI (tmp_tmpcond
, 15)) {
12510 tmp_condres
= CPU (h_pbit
);
12513 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_pcrel
), tmp_truthval
);
12517 CPU (h_xbit
) = opval
;
12518 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12522 SET_H_INSN_PREFIXED_P (opval
);
12523 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12526 if (tmp_truthval
) {
12529 USI opval
= FLD (i_o_pcrel
);
12530 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12531 written
|= (1 << 8);
12532 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12538 abuf
->written
= written
;
12539 SEM_BRANCH_FINI (vpc
);
12544 CASE (sem
, INSN_BA_B
) : /* ba ${o-pcrel} */
12546 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12547 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12548 #define FLD(f) abuf->fields.sfmt_bcc_b.f
12549 int UNUSED written
= 0;
12550 IADDR UNUSED pc
= abuf
->addr
;
12552 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12558 CPU (h_xbit
) = opval
;
12559 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12563 SET_H_INSN_PREFIXED_P (opval
);
12564 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12569 USI opval
= FLD (i_o_pcrel
);
12570 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12571 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12576 SEM_BRANCH_FINI (vpc
);
12581 CASE (sem
, INSN_BCC_W
) : /* b${cc} ${o-word-pcrel} */
12583 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12584 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12585 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12586 int UNUSED written
= 0;
12587 IADDR UNUSED pc
= abuf
->addr
;
12589 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12593 tmp_truthval
= ({ SI tmp_tmpcond
;
12595 tmp_tmpcond
= FLD (f_operand2
);
12596 ; if (EQSI (tmp_tmpcond
, 0)) {
12597 tmp_condres
= NOTBI (CPU (h_cbit
));
12599 else if (EQSI (tmp_tmpcond
, 1)) {
12600 tmp_condres
= CPU (h_cbit
);
12602 else if (EQSI (tmp_tmpcond
, 2)) {
12603 tmp_condres
= NOTBI (CPU (h_zbit
));
12605 else if (EQSI (tmp_tmpcond
, 3)) {
12606 tmp_condres
= CPU (h_zbit
);
12608 else if (EQSI (tmp_tmpcond
, 4)) {
12609 tmp_condres
= NOTBI (CPU (h_vbit
));
12611 else if (EQSI (tmp_tmpcond
, 5)) {
12612 tmp_condres
= CPU (h_vbit
);
12614 else if (EQSI (tmp_tmpcond
, 6)) {
12615 tmp_condres
= NOTBI (CPU (h_nbit
));
12617 else if (EQSI (tmp_tmpcond
, 7)) {
12618 tmp_condres
= CPU (h_nbit
);
12620 else if (EQSI (tmp_tmpcond
, 8)) {
12621 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
12623 else if (EQSI (tmp_tmpcond
, 9)) {
12624 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
12626 else if (EQSI (tmp_tmpcond
, 10)) {
12627 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
12629 else if (EQSI (tmp_tmpcond
, 11)) {
12630 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
12632 else if (EQSI (tmp_tmpcond
, 12)) {
12633 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
12635 else if (EQSI (tmp_tmpcond
, 13)) {
12636 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
12638 else if (EQSI (tmp_tmpcond
, 14)) {
12641 else if (EQSI (tmp_tmpcond
, 15)) {
12642 tmp_condres
= CPU (h_pbit
);
12645 crisv32f_branch_taken (current_cpu
, pc
, FLD (i_o_word_pcrel
), tmp_truthval
);
12649 CPU (h_xbit
) = opval
;
12650 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12654 SET_H_INSN_PREFIXED_P (opval
);
12655 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12658 if (tmp_truthval
) {
12661 USI opval
= FLD (i_o_word_pcrel
);
12662 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12663 written
|= (1 << 8);
12664 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12670 abuf
->written
= written
;
12671 SEM_BRANCH_FINI (vpc
);
12676 CASE (sem
, INSN_BA_W
) : /* ba ${o-word-pcrel} */
12678 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12679 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12680 #define FLD(f) abuf->fields.sfmt_bcc_w.f
12681 int UNUSED written
= 0;
12682 IADDR UNUSED pc
= abuf
->addr
;
12684 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
12690 CPU (h_xbit
) = opval
;
12691 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12695 SET_H_INSN_PREFIXED_P (opval
);
12696 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12701 USI opval
= FLD (i_o_word_pcrel
);
12702 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12703 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12708 SEM_BRANCH_FINI (vpc
);
12713 CASE (sem
, INSN_JAS_R
) : /* jas ${Rs},${Pd} */
12715 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12716 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12717 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12718 int UNUSED written
= 0;
12719 IADDR UNUSED pc
= abuf
->addr
;
12721 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12727 CPU (h_xbit
) = opval
;
12728 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12732 SET_H_INSN_PREFIXED_P (opval
);
12733 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12736 if (ANDIF (EQSI (FLD (f_operand1
), 1), EQSI (FLD (f_operand2
), 11))) {
12737 cris_flush_simulator_decode_cache (current_cpu
, pc
);
12742 SI opval
= ADDSI (pc
, 4);
12743 SET_H_SR (FLD (f_operand2
), opval
);
12744 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12747 USI opval
= GET_H_GR (FLD (f_operand1
));
12748 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12749 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12755 SEM_BRANCH_FINI (vpc
);
12760 CASE (sem
, INSN_JAS_C
) : /* jas ${const32},${Pd} */
12762 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12764 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12765 int UNUSED written
= 0;
12766 IADDR UNUSED pc
= abuf
->addr
;
12768 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12774 CPU (h_xbit
) = opval
;
12775 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12779 SET_H_INSN_PREFIXED_P (opval
);
12780 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12786 SI opval
= ADDSI (pc
, 8);
12787 SET_H_SR (FLD (f_operand2
), opval
);
12788 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12791 USI opval
= FLD (f_indir_pc__dword
);
12792 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12793 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12799 SEM_BRANCH_FINI (vpc
);
12804 CASE (sem
, INSN_JUMP_P
) : /* jump ${Ps} */
12806 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12807 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12808 #define FLD(f) abuf->fields.sfmt_mcp.f
12809 int UNUSED written
= 0;
12810 IADDR UNUSED pc
= abuf
->addr
;
12812 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12818 CPU (h_xbit
) = opval
;
12819 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12823 SET_H_INSN_PREFIXED_P (opval
);
12824 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12829 USI opval
= GET_H_SR (FLD (f_operand2
));
12830 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12831 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12836 SEM_BRANCH_FINI (vpc
);
12841 CASE (sem
, INSN_BAS_C
) : /* bas ${const32},${Pd} */
12843 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12844 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12845 #define FLD(f) abuf->fields.sfmt_bas_c.f
12846 int UNUSED written
= 0;
12847 IADDR UNUSED pc
= abuf
->addr
;
12849 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12855 CPU (h_xbit
) = opval
;
12856 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12860 SET_H_INSN_PREFIXED_P (opval
);
12861 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12867 SI opval
= ADDSI (pc
, 8);
12868 SET_H_SR (FLD (f_operand2
), opval
);
12869 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12872 USI opval
= FLD (i_const32_pcrel
);
12873 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12874 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12880 SEM_BRANCH_FINI (vpc
);
12885 CASE (sem
, INSN_JASC_R
) : /* jasc ${Rs},${Pd} */
12887 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12888 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12889 #define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
12890 int UNUSED written
= 0;
12891 IADDR UNUSED pc
= abuf
->addr
;
12893 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
12899 CPU (h_xbit
) = opval
;
12900 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12904 SET_H_INSN_PREFIXED_P (opval
);
12905 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12911 SI opval
= ADDSI (pc
, 8);
12912 SET_H_SR (FLD (f_operand2
), opval
);
12913 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12916 USI opval
= GET_H_GR (FLD (f_operand1
));
12917 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
12918 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12924 SEM_BRANCH_FINI (vpc
);
12929 CASE (sem
, INSN_JASC_C
) : /* jasc ${const32},${Pd} */
12931 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12932 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12933 #define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
12934 int UNUSED written
= 0;
12935 IADDR UNUSED pc
= abuf
->addr
;
12937 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12943 CPU (h_xbit
) = opval
;
12944 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12948 SET_H_INSN_PREFIXED_P (opval
);
12949 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12955 SI opval
= ADDSI (pc
, 12);
12956 SET_H_SR (FLD (f_operand2
), opval
);
12957 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
12960 USI opval
= FLD (f_indir_pc__dword
);
12961 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
12962 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
12968 SEM_BRANCH_FINI (vpc
);
12973 CASE (sem
, INSN_BASC_C
) : /* basc ${const32},${Pd} */
12975 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
12976 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
12977 #define FLD(f) abuf->fields.sfmt_bas_c.f
12978 int UNUSED written
= 0;
12979 IADDR UNUSED pc
= abuf
->addr
;
12981 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
12987 CPU (h_xbit
) = opval
;
12988 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
12992 SET_H_INSN_PREFIXED_P (opval
);
12993 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
12999 SI opval
= ADDSI (pc
, 12);
13000 SET_H_SR (FLD (f_operand2
), opval
);
13001 CGEN_TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
13004 USI opval
= FLD (i_const32_pcrel
);
13005 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13006 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13012 SEM_BRANCH_FINI (vpc
);
13017 CASE (sem
, INSN_BREAK
) : /* break $n */
13019 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13020 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13021 #define FLD(f) abuf->fields.sfmt_break.f
13022 int UNUSED written
= 0;
13023 IADDR UNUSED pc
= abuf
->addr
;
13025 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13031 CPU (h_xbit
) = opval
;
13032 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13036 SET_H_INSN_PREFIXED_P (opval
);
13037 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13041 USI opval
= crisv32f_break_handler (current_cpu
, FLD (f_u4
), pc
);
13042 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
13043 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
13047 SEM_BRANCH_FINI (vpc
);
13052 CASE (sem
, INSN_BOUND_R_B_R
) : /* bound-r.b ${Rs},${Rd} */
13054 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13055 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13056 #define FLD(f) abuf->fields.sfmt_muls_b.f
13057 int UNUSED written
= 0;
13058 IADDR UNUSED pc
= abuf
->addr
;
13059 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13065 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (GET_H_GR (FLD (f_operand1
))));
13066 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13067 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13069 SI opval
= tmp_newval
;
13070 SET_H_GR (FLD (f_operand2
), opval
);
13071 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13075 BI opval
= LTSI (tmp_newval
, 0);
13076 CPU (h_nbit
) = opval
;
13077 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13080 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13081 CPU (h_zbit
) = opval
;
13082 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13084 SET_H_CBIT_MOVE (0);
13085 SET_H_VBIT_MOVE (0);
13089 CPU (h_xbit
) = opval
;
13090 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13094 SET_H_INSN_PREFIXED_P (opval
);
13095 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13105 CASE (sem
, INSN_BOUND_R_W_R
) : /* bound-r.w ${Rs},${Rd} */
13107 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13108 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13109 #define FLD(f) abuf->fields.sfmt_muls_b.f
13110 int UNUSED written
= 0;
13111 IADDR UNUSED pc
= abuf
->addr
;
13112 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13118 tmp_tmpops
= ZEXTHISI (TRUNCSIHI (GET_H_GR (FLD (f_operand1
))));
13119 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13120 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13122 SI opval
= tmp_newval
;
13123 SET_H_GR (FLD (f_operand2
), opval
);
13124 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13128 BI opval
= LTSI (tmp_newval
, 0);
13129 CPU (h_nbit
) = opval
;
13130 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13133 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13134 CPU (h_zbit
) = opval
;
13135 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13137 SET_H_CBIT_MOVE (0);
13138 SET_H_VBIT_MOVE (0);
13142 CPU (h_xbit
) = opval
;
13143 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13147 SET_H_INSN_PREFIXED_P (opval
);
13148 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13158 CASE (sem
, INSN_BOUND_R_D_R
) : /* bound-r.d ${Rs},${Rd} */
13160 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13161 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13162 #define FLD(f) abuf->fields.sfmt_muls_b.f
13163 int UNUSED written
= 0;
13164 IADDR UNUSED pc
= abuf
->addr
;
13165 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13171 tmp_tmpops
= TRUNCSISI (GET_H_GR (FLD (f_operand1
)));
13172 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13173 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13175 SI opval
= tmp_newval
;
13176 SET_H_GR (FLD (f_operand2
), opval
);
13177 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13181 BI opval
= LTSI (tmp_newval
, 0);
13182 CPU (h_nbit
) = opval
;
13183 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13186 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13187 CPU (h_zbit
) = opval
;
13188 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13190 SET_H_CBIT_MOVE (0);
13191 SET_H_VBIT_MOVE (0);
13195 CPU (h_xbit
) = opval
;
13196 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13200 SET_H_INSN_PREFIXED_P (opval
);
13201 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13211 CASE (sem
, INSN_BOUND_CB
) : /* bound.b [PC+],${Rd} */
13213 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13214 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13215 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13216 int UNUSED written
= 0;
13217 IADDR UNUSED pc
= abuf
->addr
;
13218 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13224 tmp_tmpops
= ZEXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
)));
13225 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13226 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13228 SI opval
= tmp_newval
;
13229 SET_H_GR (FLD (f_operand2
), opval
);
13230 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13234 BI opval
= LTSI (tmp_newval
, 0);
13235 CPU (h_nbit
) = opval
;
13236 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13239 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13240 CPU (h_zbit
) = opval
;
13241 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13243 SET_H_CBIT_MOVE (0);
13244 SET_H_VBIT_MOVE (0);
13248 CPU (h_xbit
) = opval
;
13249 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13253 SET_H_INSN_PREFIXED_P (opval
);
13254 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13264 CASE (sem
, INSN_BOUND_CW
) : /* bound.w [PC+],${Rd} */
13266 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13267 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13268 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13269 int UNUSED written
= 0;
13270 IADDR UNUSED pc
= abuf
->addr
;
13271 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13277 tmp_tmpops
= ZEXTSISI (FLD (f_indir_pc__word
));
13278 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13279 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13281 SI opval
= tmp_newval
;
13282 SET_H_GR (FLD (f_operand2
), opval
);
13283 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13287 BI opval
= LTSI (tmp_newval
, 0);
13288 CPU (h_nbit
) = opval
;
13289 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13292 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13293 CPU (h_zbit
) = opval
;
13294 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13296 SET_H_CBIT_MOVE (0);
13297 SET_H_VBIT_MOVE (0);
13301 CPU (h_xbit
) = opval
;
13302 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13306 SET_H_INSN_PREFIXED_P (opval
);
13307 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13317 CASE (sem
, INSN_BOUND_CD
) : /* bound.d [PC+],${Rd} */
13319 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13320 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13321 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13322 int UNUSED written
= 0;
13323 IADDR UNUSED pc
= abuf
->addr
;
13324 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13330 tmp_tmpops
= FLD (f_indir_pc__dword
);
13331 tmp_tmpopd
= GET_H_GR (FLD (f_operand2
));
13332 tmp_newval
= ((LTUSI (tmp_tmpops
, tmp_tmpopd
)) ? (tmp_tmpops
) : (tmp_tmpopd
));
13334 SI opval
= tmp_newval
;
13335 SET_H_GR (FLD (f_operand2
), opval
);
13336 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13340 BI opval
= LTSI (tmp_newval
, 0);
13341 CPU (h_nbit
) = opval
;
13342 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13345 BI opval
= ANDIF (EQSI (tmp_newval
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13346 CPU (h_zbit
) = opval
;
13347 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13349 SET_H_CBIT_MOVE (0);
13350 SET_H_VBIT_MOVE (0);
13354 CPU (h_xbit
) = opval
;
13355 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13359 SET_H_INSN_PREFIXED_P (opval
);
13360 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13370 CASE (sem
, INSN_SCC
) : /* s${cc} ${Rd-sfield} */
13372 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13373 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13374 #define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
13375 int UNUSED written
= 0;
13376 IADDR UNUSED pc
= abuf
->addr
;
13377 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13381 tmp_truthval
= ({ SI tmp_tmpcond
;
13383 tmp_tmpcond
= FLD (f_operand2
);
13384 ; if (EQSI (tmp_tmpcond
, 0)) {
13385 tmp_condres
= NOTBI (CPU (h_cbit
));
13387 else if (EQSI (tmp_tmpcond
, 1)) {
13388 tmp_condres
= CPU (h_cbit
);
13390 else if (EQSI (tmp_tmpcond
, 2)) {
13391 tmp_condres
= NOTBI (CPU (h_zbit
));
13393 else if (EQSI (tmp_tmpcond
, 3)) {
13394 tmp_condres
= CPU (h_zbit
);
13396 else if (EQSI (tmp_tmpcond
, 4)) {
13397 tmp_condres
= NOTBI (CPU (h_vbit
));
13399 else if (EQSI (tmp_tmpcond
, 5)) {
13400 tmp_condres
= CPU (h_vbit
);
13402 else if (EQSI (tmp_tmpcond
, 6)) {
13403 tmp_condres
= NOTBI (CPU (h_nbit
));
13405 else if (EQSI (tmp_tmpcond
, 7)) {
13406 tmp_condres
= CPU (h_nbit
);
13408 else if (EQSI (tmp_tmpcond
, 8)) {
13409 tmp_condres
= ORBI (CPU (h_cbit
), CPU (h_zbit
));
13411 else if (EQSI (tmp_tmpcond
, 9)) {
13412 tmp_condres
= NOTBI (ORBI (CPU (h_cbit
), CPU (h_zbit
)));
13414 else if (EQSI (tmp_tmpcond
, 10)) {
13415 tmp_condres
= NOTBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)));
13417 else if (EQSI (tmp_tmpcond
, 11)) {
13418 tmp_condres
= XORBI (CPU (h_vbit
), CPU (h_nbit
));
13420 else if (EQSI (tmp_tmpcond
, 12)) {
13421 tmp_condres
= NOTBI (ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
)));
13423 else if (EQSI (tmp_tmpcond
, 13)) {
13424 tmp_condres
= ORBI (XORBI (CPU (h_vbit
), CPU (h_nbit
)), CPU (h_zbit
));
13426 else if (EQSI (tmp_tmpcond
, 14)) {
13429 else if (EQSI (tmp_tmpcond
, 15)) {
13430 tmp_condres
= CPU (h_pbit
);
13434 SI opval
= ZEXTBISI (tmp_truthval
);
13435 SET_H_GR (FLD (f_operand1
), opval
);
13436 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13441 CPU (h_xbit
) = opval
;
13442 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13446 SET_H_INSN_PREFIXED_P (opval
);
13447 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13456 CASE (sem
, INSN_LZ
) : /* lz ${Rs},${Rd} */
13458 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13459 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13460 #define FLD(f) abuf->fields.sfmt_muls_b.f
13461 int UNUSED written
= 0;
13462 IADDR UNUSED pc
= abuf
->addr
;
13463 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13468 tmp_tmp
= GET_H_GR (FLD (f_operand1
));
13471 if (GESI (tmp_tmp
, 0)) {
13473 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13474 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13477 if (GESI (tmp_tmp
, 0)) {
13479 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13480 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13483 if (GESI (tmp_tmp
, 0)) {
13485 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13486 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13489 if (GESI (tmp_tmp
, 0)) {
13491 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13492 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13495 if (GESI (tmp_tmp
, 0)) {
13497 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13498 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13501 if (GESI (tmp_tmp
, 0)) {
13503 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13504 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13507 if (GESI (tmp_tmp
, 0)) {
13509 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13510 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13513 if (GESI (tmp_tmp
, 0)) {
13515 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13516 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13519 if (GESI (tmp_tmp
, 0)) {
13521 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13522 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13525 if (GESI (tmp_tmp
, 0)) {
13527 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13528 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13531 if (GESI (tmp_tmp
, 0)) {
13533 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13534 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13537 if (GESI (tmp_tmp
, 0)) {
13539 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13540 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13543 if (GESI (tmp_tmp
, 0)) {
13545 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13546 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13549 if (GESI (tmp_tmp
, 0)) {
13551 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13552 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13555 if (GESI (tmp_tmp
, 0)) {
13557 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13558 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13561 if (GESI (tmp_tmp
, 0)) {
13563 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13564 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13567 if (GESI (tmp_tmp
, 0)) {
13569 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13570 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13573 if (GESI (tmp_tmp
, 0)) {
13575 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13576 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13579 if (GESI (tmp_tmp
, 0)) {
13581 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13582 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13585 if (GESI (tmp_tmp
, 0)) {
13587 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13588 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13591 if (GESI (tmp_tmp
, 0)) {
13593 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13594 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13597 if (GESI (tmp_tmp
, 0)) {
13599 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13600 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13603 if (GESI (tmp_tmp
, 0)) {
13605 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13606 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13609 if (GESI (tmp_tmp
, 0)) {
13611 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13612 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13615 if (GESI (tmp_tmp
, 0)) {
13617 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13618 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13621 if (GESI (tmp_tmp
, 0)) {
13623 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13624 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13627 if (GESI (tmp_tmp
, 0)) {
13629 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13630 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13633 if (GESI (tmp_tmp
, 0)) {
13635 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13636 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13639 if (GESI (tmp_tmp
, 0)) {
13641 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13642 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13645 if (GESI (tmp_tmp
, 0)) {
13647 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13648 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13651 if (GESI (tmp_tmp
, 0)) {
13653 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13654 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13657 if (GESI (tmp_tmp
, 0)) {
13659 tmp_tmp
= SLLSI (tmp_tmp
, 1);
13660 tmp_tmpd
= ADDSI (tmp_tmpd
, 1);
13665 SI opval
= tmp_tmpd
;
13666 SET_H_GR (FLD (f_operand2
), opval
);
13667 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13671 BI opval
= LTSI (tmp_tmpd
, 0);
13672 CPU (h_nbit
) = opval
;
13673 CGEN_TRACE_RESULT (current_cpu
, abuf
, "nbit", 'x', opval
);
13676 BI opval
= ANDIF (EQSI (tmp_tmpd
, 0), ((CPU (h_xbit
)) ? (CPU (h_zbit
)) : (1)));
13677 CPU (h_zbit
) = opval
;
13678 CGEN_TRACE_RESULT (current_cpu
, abuf
, "zbit", 'x', opval
);
13680 SET_H_CBIT_MOVE (0);
13681 SET_H_VBIT_MOVE (0);
13685 CPU (h_xbit
) = opval
;
13686 CGEN_TRACE_RESULT (current_cpu
, abuf
, "xbit", 'x', opval
);
13690 SET_H_INSN_PREFIXED_P (opval
);
13691 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13701 CASE (sem
, INSN_ADDOQ
) : /* addoq $o,$Rs,ACR */
13703 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13704 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13705 #define FLD(f) abuf->fields.sfmt_addoq.f
13706 int UNUSED written
= 0;
13707 IADDR UNUSED pc
= abuf
->addr
;
13708 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13712 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_s8
));
13713 SET_H_PREFIXREG_V32 (opval
);
13714 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13718 SET_H_INSN_PREFIXED_P (opval
);
13719 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13727 CASE (sem
, INSN_ADDO_M_B_M
) : /* addo-m.b [${Rs}${inc}],$Rd,ACR */
13729 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13730 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13731 #define FLD(f) abuf->fields.sfmt_addc_m.f
13732 int UNUSED written
= 0;
13733 IADDR UNUSED pc
= abuf
->addr
;
13734 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13738 tmp_tmps
= ({ SI tmp_addr
;
13741 tmp_postinc
= FLD (f_memmode
);
13742 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13743 ; tmp_tmp_mem
= GETMEMQI (current_cpu
, pc
, tmp_addr
);
13744 ; if (NEBI (tmp_postinc
, 0)) {
13746 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13747 tmp_addr
= ADDSI (tmp_addr
, 1);
13750 SI opval
= tmp_addr
;
13751 SET_H_GR (FLD (f_operand1
), opval
);
13752 written
|= (1 << 6);
13753 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13759 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (tmp_tmps
));
13760 SET_H_PREFIXREG_V32 (opval
);
13761 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13765 SET_H_INSN_PREFIXED_P (opval
);
13766 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13770 abuf
->written
= written
;
13775 CASE (sem
, INSN_ADDO_M_W_M
) : /* addo-m.w [${Rs}${inc}],$Rd,ACR */
13777 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13778 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13779 #define FLD(f) abuf->fields.sfmt_addc_m.f
13780 int UNUSED written
= 0;
13781 IADDR UNUSED pc
= abuf
->addr
;
13782 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13786 tmp_tmps
= ({ SI tmp_addr
;
13789 tmp_postinc
= FLD (f_memmode
);
13790 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13791 ; tmp_tmp_mem
= GETMEMHI (current_cpu
, pc
, tmp_addr
);
13792 ; if (NEBI (tmp_postinc
, 0)) {
13794 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13795 tmp_addr
= ADDSI (tmp_addr
, 2);
13798 SI opval
= tmp_addr
;
13799 SET_H_GR (FLD (f_operand1
), opval
);
13800 written
|= (1 << 6);
13801 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13807 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (tmp_tmps
));
13808 SET_H_PREFIXREG_V32 (opval
);
13809 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13813 SET_H_INSN_PREFIXED_P (opval
);
13814 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13818 abuf
->written
= written
;
13823 CASE (sem
, INSN_ADDO_M_D_M
) : /* addo-m.d [${Rs}${inc}],$Rd,ACR */
13825 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13826 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13827 #define FLD(f) abuf->fields.sfmt_addc_m.f
13828 int UNUSED written
= 0;
13829 IADDR UNUSED pc
= abuf
->addr
;
13830 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13834 tmp_tmps
= ({ SI tmp_addr
;
13837 tmp_postinc
= FLD (f_memmode
);
13838 ; tmp_addr
= ((EQBI (GET_H_INSN_PREFIXED_P (), 0)) ? (GET_H_GR (FLD (f_operand1
))) : (GET_H_PREFIXREG_V32 ()));
13839 ; tmp_tmp_mem
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
13840 ; if (NEBI (tmp_postinc
, 0)) {
13842 if (EQBI (GET_H_INSN_PREFIXED_P (), 0)) {
13843 tmp_addr
= ADDSI (tmp_addr
, 4);
13846 SI opval
= tmp_addr
;
13847 SET_H_GR (FLD (f_operand1
), opval
);
13848 written
|= (1 << 6);
13849 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
13855 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), tmp_tmps
);
13856 SET_H_PREFIXREG_V32 (opval
);
13857 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13861 SET_H_INSN_PREFIXED_P (opval
);
13862 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13866 abuf
->written
= written
;
13871 CASE (sem
, INSN_ADDO_CB
) : /* addo.b [PC+],$Rd,ACR */
13873 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13874 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13875 #define FLD(f) abuf->fields.sfmt_bound_cb.f
13876 int UNUSED written
= 0;
13877 IADDR UNUSED pc
= abuf
->addr
;
13878 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13882 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTQISI (TRUNCSIQI (FLD (f_indir_pc__byte
))));
13883 SET_H_PREFIXREG_V32 (opval
);
13884 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13888 SET_H_INSN_PREFIXED_P (opval
);
13889 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13897 CASE (sem
, INSN_ADDO_CW
) : /* addo.w [PC+],$Rd,ACR */
13899 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13900 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13901 #define FLD(f) abuf->fields.sfmt_bound_cw.f
13902 int UNUSED written
= 0;
13903 IADDR UNUSED pc
= abuf
->addr
;
13904 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
13908 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), EXTHISI (TRUNCSIHI (FLD (f_indir_pc__word
))));
13909 SET_H_PREFIXREG_V32 (opval
);
13910 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13914 SET_H_INSN_PREFIXED_P (opval
);
13915 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13923 CASE (sem
, INSN_ADDO_CD
) : /* addo.d [PC+],$Rd,ACR */
13925 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13926 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13927 #define FLD(f) abuf->fields.sfmt_bound_cd.f
13928 int UNUSED written
= 0;
13929 IADDR UNUSED pc
= abuf
->addr
;
13930 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 6);
13934 SI opval
= ADDSI (GET_H_GR (FLD (f_operand2
)), FLD (f_indir_pc__dword
));
13935 SET_H_PREFIXREG_V32 (opval
);
13936 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13940 SET_H_INSN_PREFIXED_P (opval
);
13941 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13949 CASE (sem
, INSN_ADDI_ACR_B_R
) : /* addi-acr.b ${Rs-dfield}.m,${Rd-sfield},ACR */
13951 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13952 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13953 #define FLD(f) abuf->fields.sfmt_muls_b.f
13954 int UNUSED written
= 0;
13955 IADDR UNUSED pc
= abuf
->addr
;
13956 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13960 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 1));
13961 SET_H_PREFIXREG_V32 (opval
);
13962 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13966 SET_H_INSN_PREFIXED_P (opval
);
13967 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
13975 CASE (sem
, INSN_ADDI_ACR_W_R
) : /* addi-acr.w ${Rs-dfield}.m,${Rd-sfield},ACR */
13977 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
13978 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
13979 #define FLD(f) abuf->fields.sfmt_muls_b.f
13980 int UNUSED written
= 0;
13981 IADDR UNUSED pc
= abuf
->addr
;
13982 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
13986 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 2));
13987 SET_H_PREFIXREG_V32 (opval
);
13988 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
13992 SET_H_INSN_PREFIXED_P (opval
);
13993 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14001 CASE (sem
, INSN_ADDI_ACR_D_R
) : /* addi-acr.d ${Rs-dfield}.m,${Rd-sfield},ACR */
14003 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14004 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14005 #define FLD(f) abuf->fields.sfmt_muls_b.f
14006 int UNUSED written
= 0;
14007 IADDR UNUSED pc
= abuf
->addr
;
14008 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14012 SI opval
= ADDSI (GET_H_GR (FLD (f_operand1
)), MULSI (GET_H_GR (FLD (f_operand2
)), 4));
14013 SET_H_PREFIXREG_V32 (opval
);
14014 CGEN_TRACE_RESULT (current_cpu
, abuf
, "prefixreg", 'x', opval
);
14018 SET_H_INSN_PREFIXED_P (opval
);
14019 CGEN_TRACE_RESULT (current_cpu
, abuf
, "insn-prefixed-p", 'x', opval
);
14027 CASE (sem
, INSN_FIDXI
) : /* fidxi [$Rs] */
14029 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14031 #define FLD(f) abuf->fields.sfmt_mcp.f
14032 int UNUSED written
= 0;
14033 IADDR UNUSED pc
= abuf
->addr
;
14035 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14038 USI opval
= crisv32f_fidxi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14039 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14040 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14043 SEM_BRANCH_FINI (vpc
);
14048 CASE (sem
, INSN_FTAGI
) : /* fidxi [$Rs] */
14050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14052 #define FLD(f) abuf->fields.sfmt_mcp.f
14053 int UNUSED written
= 0;
14054 IADDR UNUSED pc
= abuf
->addr
;
14056 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14059 USI opval
= crisv32f_ftagi_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14060 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14061 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14064 SEM_BRANCH_FINI (vpc
);
14069 CASE (sem
, INSN_FIDXD
) : /* fidxd [$Rs] */
14071 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14072 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14073 #define FLD(f) abuf->fields.sfmt_mcp.f
14074 int UNUSED written
= 0;
14075 IADDR UNUSED pc
= abuf
->addr
;
14077 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14080 USI opval
= crisv32f_fidxd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14081 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14082 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14085 SEM_BRANCH_FINI (vpc
);
14090 CASE (sem
, INSN_FTAGD
) : /* ftagd [$Rs] */
14092 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
14093 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
14094 #define FLD(f) abuf->fields.sfmt_mcp.f
14095 int UNUSED written
= 0;
14096 IADDR UNUSED pc
= abuf
->addr
;
14098 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
14101 USI opval
= crisv32f_ftagd_handler (current_cpu
, pc
, GET_H_GR (FLD (f_operand1
)));
14102 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
14103 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
14106 SEM_BRANCH_FINI (vpc
);
14113 ENDSWITCH (sem
) /* End of semantic switch. */
14115 /* At this point `vpc' contains the next insn to execute. */
14118 #undef DEFINE_SWITCH
14119 #endif /* DEFINE_SWITCH */