Update
[gdb.git] / sim / m32r / sem2-switch.c
blob090880ecee290e26cee9a8c32b09b20bd48a8b46
1 /* Simulator instruction semantics for m32r2f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifdef DEFINE_LABELS
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. */
30 static struct {
31 int index;
32 void *label;
33 } labels[] = {
34 { M32R2F_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
35 { M32R2F_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
36 { M32R2F_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
37 { M32R2F_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
38 { M32R2F_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
39 { M32R2F_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
40 { M32R2F_INSN_ADD, && case_sem_INSN_ADD },
41 { M32R2F_INSN_ADD3, && case_sem_INSN_ADD3 },
42 { M32R2F_INSN_AND, && case_sem_INSN_AND },
43 { M32R2F_INSN_AND3, && case_sem_INSN_AND3 },
44 { M32R2F_INSN_OR, && case_sem_INSN_OR },
45 { M32R2F_INSN_OR3, && case_sem_INSN_OR3 },
46 { M32R2F_INSN_XOR, && case_sem_INSN_XOR },
47 { M32R2F_INSN_XOR3, && case_sem_INSN_XOR3 },
48 { M32R2F_INSN_ADDI, && case_sem_INSN_ADDI },
49 { M32R2F_INSN_ADDV, && case_sem_INSN_ADDV },
50 { M32R2F_INSN_ADDV3, && case_sem_INSN_ADDV3 },
51 { M32R2F_INSN_ADDX, && case_sem_INSN_ADDX },
52 { M32R2F_INSN_BC8, && case_sem_INSN_BC8 },
53 { M32R2F_INSN_BC24, && case_sem_INSN_BC24 },
54 { M32R2F_INSN_BEQ, && case_sem_INSN_BEQ },
55 { M32R2F_INSN_BEQZ, && case_sem_INSN_BEQZ },
56 { M32R2F_INSN_BGEZ, && case_sem_INSN_BGEZ },
57 { M32R2F_INSN_BGTZ, && case_sem_INSN_BGTZ },
58 { M32R2F_INSN_BLEZ, && case_sem_INSN_BLEZ },
59 { M32R2F_INSN_BLTZ, && case_sem_INSN_BLTZ },
60 { M32R2F_INSN_BNEZ, && case_sem_INSN_BNEZ },
61 { M32R2F_INSN_BL8, && case_sem_INSN_BL8 },
62 { M32R2F_INSN_BL24, && case_sem_INSN_BL24 },
63 { M32R2F_INSN_BCL8, && case_sem_INSN_BCL8 },
64 { M32R2F_INSN_BCL24, && case_sem_INSN_BCL24 },
65 { M32R2F_INSN_BNC8, && case_sem_INSN_BNC8 },
66 { M32R2F_INSN_BNC24, && case_sem_INSN_BNC24 },
67 { M32R2F_INSN_BNE, && case_sem_INSN_BNE },
68 { M32R2F_INSN_BRA8, && case_sem_INSN_BRA8 },
69 { M32R2F_INSN_BRA24, && case_sem_INSN_BRA24 },
70 { M32R2F_INSN_BNCL8, && case_sem_INSN_BNCL8 },
71 { M32R2F_INSN_BNCL24, && case_sem_INSN_BNCL24 },
72 { M32R2F_INSN_CMP, && case_sem_INSN_CMP },
73 { M32R2F_INSN_CMPI, && case_sem_INSN_CMPI },
74 { M32R2F_INSN_CMPU, && case_sem_INSN_CMPU },
75 { M32R2F_INSN_CMPUI, && case_sem_INSN_CMPUI },
76 { M32R2F_INSN_CMPEQ, && case_sem_INSN_CMPEQ },
77 { M32R2F_INSN_CMPZ, && case_sem_INSN_CMPZ },
78 { M32R2F_INSN_DIV, && case_sem_INSN_DIV },
79 { M32R2F_INSN_DIVU, && case_sem_INSN_DIVU },
80 { M32R2F_INSN_REM, && case_sem_INSN_REM },
81 { M32R2F_INSN_REMU, && case_sem_INSN_REMU },
82 { M32R2F_INSN_REMH, && case_sem_INSN_REMH },
83 { M32R2F_INSN_REMUH, && case_sem_INSN_REMUH },
84 { M32R2F_INSN_REMB, && case_sem_INSN_REMB },
85 { M32R2F_INSN_REMUB, && case_sem_INSN_REMUB },
86 { M32R2F_INSN_DIVUH, && case_sem_INSN_DIVUH },
87 { M32R2F_INSN_DIVB, && case_sem_INSN_DIVB },
88 { M32R2F_INSN_DIVUB, && case_sem_INSN_DIVUB },
89 { M32R2F_INSN_DIVH, && case_sem_INSN_DIVH },
90 { M32R2F_INSN_JC, && case_sem_INSN_JC },
91 { M32R2F_INSN_JNC, && case_sem_INSN_JNC },
92 { M32R2F_INSN_JL, && case_sem_INSN_JL },
93 { M32R2F_INSN_JMP, && case_sem_INSN_JMP },
94 { M32R2F_INSN_LD, && case_sem_INSN_LD },
95 { M32R2F_INSN_LD_D, && case_sem_INSN_LD_D },
96 { M32R2F_INSN_LDB, && case_sem_INSN_LDB },
97 { M32R2F_INSN_LDB_D, && case_sem_INSN_LDB_D },
98 { M32R2F_INSN_LDH, && case_sem_INSN_LDH },
99 { M32R2F_INSN_LDH_D, && case_sem_INSN_LDH_D },
100 { M32R2F_INSN_LDUB, && case_sem_INSN_LDUB },
101 { M32R2F_INSN_LDUB_D, && case_sem_INSN_LDUB_D },
102 { M32R2F_INSN_LDUH, && case_sem_INSN_LDUH },
103 { M32R2F_INSN_LDUH_D, && case_sem_INSN_LDUH_D },
104 { M32R2F_INSN_LD_PLUS, && case_sem_INSN_LD_PLUS },
105 { M32R2F_INSN_LD24, && case_sem_INSN_LD24 },
106 { M32R2F_INSN_LDI8, && case_sem_INSN_LDI8 },
107 { M32R2F_INSN_LDI16, && case_sem_INSN_LDI16 },
108 { M32R2F_INSN_LOCK, && case_sem_INSN_LOCK },
109 { M32R2F_INSN_MACHI_A, && case_sem_INSN_MACHI_A },
110 { M32R2F_INSN_MACLO_A, && case_sem_INSN_MACLO_A },
111 { M32R2F_INSN_MACWHI_A, && case_sem_INSN_MACWHI_A },
112 { M32R2F_INSN_MACWLO_A, && case_sem_INSN_MACWLO_A },
113 { M32R2F_INSN_MUL, && case_sem_INSN_MUL },
114 { M32R2F_INSN_MULHI_A, && case_sem_INSN_MULHI_A },
115 { M32R2F_INSN_MULLO_A, && case_sem_INSN_MULLO_A },
116 { M32R2F_INSN_MULWHI_A, && case_sem_INSN_MULWHI_A },
117 { M32R2F_INSN_MULWLO_A, && case_sem_INSN_MULWLO_A },
118 { M32R2F_INSN_MV, && case_sem_INSN_MV },
119 { M32R2F_INSN_MVFACHI_A, && case_sem_INSN_MVFACHI_A },
120 { M32R2F_INSN_MVFACLO_A, && case_sem_INSN_MVFACLO_A },
121 { M32R2F_INSN_MVFACMI_A, && case_sem_INSN_MVFACMI_A },
122 { M32R2F_INSN_MVFC, && case_sem_INSN_MVFC },
123 { M32R2F_INSN_MVTACHI_A, && case_sem_INSN_MVTACHI_A },
124 { M32R2F_INSN_MVTACLO_A, && case_sem_INSN_MVTACLO_A },
125 { M32R2F_INSN_MVTC, && case_sem_INSN_MVTC },
126 { M32R2F_INSN_NEG, && case_sem_INSN_NEG },
127 { M32R2F_INSN_NOP, && case_sem_INSN_NOP },
128 { M32R2F_INSN_NOT, && case_sem_INSN_NOT },
129 { M32R2F_INSN_RAC_DSI, && case_sem_INSN_RAC_DSI },
130 { M32R2F_INSN_RACH_DSI, && case_sem_INSN_RACH_DSI },
131 { M32R2F_INSN_RTE, && case_sem_INSN_RTE },
132 { M32R2F_INSN_SETH, && case_sem_INSN_SETH },
133 { M32R2F_INSN_SLL, && case_sem_INSN_SLL },
134 { M32R2F_INSN_SLL3, && case_sem_INSN_SLL3 },
135 { M32R2F_INSN_SLLI, && case_sem_INSN_SLLI },
136 { M32R2F_INSN_SRA, && case_sem_INSN_SRA },
137 { M32R2F_INSN_SRA3, && case_sem_INSN_SRA3 },
138 { M32R2F_INSN_SRAI, && case_sem_INSN_SRAI },
139 { M32R2F_INSN_SRL, && case_sem_INSN_SRL },
140 { M32R2F_INSN_SRL3, && case_sem_INSN_SRL3 },
141 { M32R2F_INSN_SRLI, && case_sem_INSN_SRLI },
142 { M32R2F_INSN_ST, && case_sem_INSN_ST },
143 { M32R2F_INSN_ST_D, && case_sem_INSN_ST_D },
144 { M32R2F_INSN_STB, && case_sem_INSN_STB },
145 { M32R2F_INSN_STB_D, && case_sem_INSN_STB_D },
146 { M32R2F_INSN_STH, && case_sem_INSN_STH },
147 { M32R2F_INSN_STH_D, && case_sem_INSN_STH_D },
148 { M32R2F_INSN_ST_PLUS, && case_sem_INSN_ST_PLUS },
149 { M32R2F_INSN_STH_PLUS, && case_sem_INSN_STH_PLUS },
150 { M32R2F_INSN_STB_PLUS, && case_sem_INSN_STB_PLUS },
151 { M32R2F_INSN_ST_MINUS, && case_sem_INSN_ST_MINUS },
152 { M32R2F_INSN_SUB, && case_sem_INSN_SUB },
153 { M32R2F_INSN_SUBV, && case_sem_INSN_SUBV },
154 { M32R2F_INSN_SUBX, && case_sem_INSN_SUBX },
155 { M32R2F_INSN_TRAP, && case_sem_INSN_TRAP },
156 { M32R2F_INSN_UNLOCK, && case_sem_INSN_UNLOCK },
157 { M32R2F_INSN_SATB, && case_sem_INSN_SATB },
158 { M32R2F_INSN_SATH, && case_sem_INSN_SATH },
159 { M32R2F_INSN_SAT, && case_sem_INSN_SAT },
160 { M32R2F_INSN_PCMPBZ, && case_sem_INSN_PCMPBZ },
161 { M32R2F_INSN_SADD, && case_sem_INSN_SADD },
162 { M32R2F_INSN_MACWU1, && case_sem_INSN_MACWU1 },
163 { M32R2F_INSN_MSBLO, && case_sem_INSN_MSBLO },
164 { M32R2F_INSN_MULWU1, && case_sem_INSN_MULWU1 },
165 { M32R2F_INSN_MACLH1, && case_sem_INSN_MACLH1 },
166 { M32R2F_INSN_SC, && case_sem_INSN_SC },
167 { M32R2F_INSN_SNC, && case_sem_INSN_SNC },
168 { M32R2F_INSN_CLRPSW, && case_sem_INSN_CLRPSW },
169 { M32R2F_INSN_SETPSW, && case_sem_INSN_SETPSW },
170 { M32R2F_INSN_BSET, && case_sem_INSN_BSET },
171 { M32R2F_INSN_BCLR, && case_sem_INSN_BCLR },
172 { M32R2F_INSN_BTST, && case_sem_INSN_BTST },
173 { M32R2F_INSN_PAR_ADD, && case_sem_INSN_PAR_ADD },
174 { M32R2F_INSN_WRITE_ADD, && case_sem_INSN_WRITE_ADD },
175 { M32R2F_INSN_PAR_AND, && case_sem_INSN_PAR_AND },
176 { M32R2F_INSN_WRITE_AND, && case_sem_INSN_WRITE_AND },
177 { M32R2F_INSN_PAR_OR, && case_sem_INSN_PAR_OR },
178 { M32R2F_INSN_WRITE_OR, && case_sem_INSN_WRITE_OR },
179 { M32R2F_INSN_PAR_XOR, && case_sem_INSN_PAR_XOR },
180 { M32R2F_INSN_WRITE_XOR, && case_sem_INSN_WRITE_XOR },
181 { M32R2F_INSN_PAR_ADDI, && case_sem_INSN_PAR_ADDI },
182 { M32R2F_INSN_WRITE_ADDI, && case_sem_INSN_WRITE_ADDI },
183 { M32R2F_INSN_PAR_ADDV, && case_sem_INSN_PAR_ADDV },
184 { M32R2F_INSN_WRITE_ADDV, && case_sem_INSN_WRITE_ADDV },
185 { M32R2F_INSN_PAR_ADDX, && case_sem_INSN_PAR_ADDX },
186 { M32R2F_INSN_WRITE_ADDX, && case_sem_INSN_WRITE_ADDX },
187 { M32R2F_INSN_PAR_BC8, && case_sem_INSN_PAR_BC8 },
188 { M32R2F_INSN_WRITE_BC8, && case_sem_INSN_WRITE_BC8 },
189 { M32R2F_INSN_PAR_BL8, && case_sem_INSN_PAR_BL8 },
190 { M32R2F_INSN_WRITE_BL8, && case_sem_INSN_WRITE_BL8 },
191 { M32R2F_INSN_PAR_BCL8, && case_sem_INSN_PAR_BCL8 },
192 { M32R2F_INSN_WRITE_BCL8, && case_sem_INSN_WRITE_BCL8 },
193 { M32R2F_INSN_PAR_BNC8, && case_sem_INSN_PAR_BNC8 },
194 { M32R2F_INSN_WRITE_BNC8, && case_sem_INSN_WRITE_BNC8 },
195 { M32R2F_INSN_PAR_BRA8, && case_sem_INSN_PAR_BRA8 },
196 { M32R2F_INSN_WRITE_BRA8, && case_sem_INSN_WRITE_BRA8 },
197 { M32R2F_INSN_PAR_BNCL8, && case_sem_INSN_PAR_BNCL8 },
198 { M32R2F_INSN_WRITE_BNCL8, && case_sem_INSN_WRITE_BNCL8 },
199 { M32R2F_INSN_PAR_CMP, && case_sem_INSN_PAR_CMP },
200 { M32R2F_INSN_WRITE_CMP, && case_sem_INSN_WRITE_CMP },
201 { M32R2F_INSN_PAR_CMPU, && case_sem_INSN_PAR_CMPU },
202 { M32R2F_INSN_WRITE_CMPU, && case_sem_INSN_WRITE_CMPU },
203 { M32R2F_INSN_PAR_CMPEQ, && case_sem_INSN_PAR_CMPEQ },
204 { M32R2F_INSN_WRITE_CMPEQ, && case_sem_INSN_WRITE_CMPEQ },
205 { M32R2F_INSN_PAR_CMPZ, && case_sem_INSN_PAR_CMPZ },
206 { M32R2F_INSN_WRITE_CMPZ, && case_sem_INSN_WRITE_CMPZ },
207 { M32R2F_INSN_PAR_JC, && case_sem_INSN_PAR_JC },
208 { M32R2F_INSN_WRITE_JC, && case_sem_INSN_WRITE_JC },
209 { M32R2F_INSN_PAR_JNC, && case_sem_INSN_PAR_JNC },
210 { M32R2F_INSN_WRITE_JNC, && case_sem_INSN_WRITE_JNC },
211 { M32R2F_INSN_PAR_JL, && case_sem_INSN_PAR_JL },
212 { M32R2F_INSN_WRITE_JL, && case_sem_INSN_WRITE_JL },
213 { M32R2F_INSN_PAR_JMP, && case_sem_INSN_PAR_JMP },
214 { M32R2F_INSN_WRITE_JMP, && case_sem_INSN_WRITE_JMP },
215 { M32R2F_INSN_PAR_LD, && case_sem_INSN_PAR_LD },
216 { M32R2F_INSN_WRITE_LD, && case_sem_INSN_WRITE_LD },
217 { M32R2F_INSN_PAR_LDB, && case_sem_INSN_PAR_LDB },
218 { M32R2F_INSN_WRITE_LDB, && case_sem_INSN_WRITE_LDB },
219 { M32R2F_INSN_PAR_LDH, && case_sem_INSN_PAR_LDH },
220 { M32R2F_INSN_WRITE_LDH, && case_sem_INSN_WRITE_LDH },
221 { M32R2F_INSN_PAR_LDUB, && case_sem_INSN_PAR_LDUB },
222 { M32R2F_INSN_WRITE_LDUB, && case_sem_INSN_WRITE_LDUB },
223 { M32R2F_INSN_PAR_LDUH, && case_sem_INSN_PAR_LDUH },
224 { M32R2F_INSN_WRITE_LDUH, && case_sem_INSN_WRITE_LDUH },
225 { M32R2F_INSN_PAR_LD_PLUS, && case_sem_INSN_PAR_LD_PLUS },
226 { M32R2F_INSN_WRITE_LD_PLUS, && case_sem_INSN_WRITE_LD_PLUS },
227 { M32R2F_INSN_PAR_LDI8, && case_sem_INSN_PAR_LDI8 },
228 { M32R2F_INSN_WRITE_LDI8, && case_sem_INSN_WRITE_LDI8 },
229 { M32R2F_INSN_PAR_LOCK, && case_sem_INSN_PAR_LOCK },
230 { M32R2F_INSN_WRITE_LOCK, && case_sem_INSN_WRITE_LOCK },
231 { M32R2F_INSN_PAR_MACHI_A, && case_sem_INSN_PAR_MACHI_A },
232 { M32R2F_INSN_WRITE_MACHI_A, && case_sem_INSN_WRITE_MACHI_A },
233 { M32R2F_INSN_PAR_MACLO_A, && case_sem_INSN_PAR_MACLO_A },
234 { M32R2F_INSN_WRITE_MACLO_A, && case_sem_INSN_WRITE_MACLO_A },
235 { M32R2F_INSN_PAR_MACWHI_A, && case_sem_INSN_PAR_MACWHI_A },
236 { M32R2F_INSN_WRITE_MACWHI_A, && case_sem_INSN_WRITE_MACWHI_A },
237 { M32R2F_INSN_PAR_MACWLO_A, && case_sem_INSN_PAR_MACWLO_A },
238 { M32R2F_INSN_WRITE_MACWLO_A, && case_sem_INSN_WRITE_MACWLO_A },
239 { M32R2F_INSN_PAR_MUL, && case_sem_INSN_PAR_MUL },
240 { M32R2F_INSN_WRITE_MUL, && case_sem_INSN_WRITE_MUL },
241 { M32R2F_INSN_PAR_MULHI_A, && case_sem_INSN_PAR_MULHI_A },
242 { M32R2F_INSN_WRITE_MULHI_A, && case_sem_INSN_WRITE_MULHI_A },
243 { M32R2F_INSN_PAR_MULLO_A, && case_sem_INSN_PAR_MULLO_A },
244 { M32R2F_INSN_WRITE_MULLO_A, && case_sem_INSN_WRITE_MULLO_A },
245 { M32R2F_INSN_PAR_MULWHI_A, && case_sem_INSN_PAR_MULWHI_A },
246 { M32R2F_INSN_WRITE_MULWHI_A, && case_sem_INSN_WRITE_MULWHI_A },
247 { M32R2F_INSN_PAR_MULWLO_A, && case_sem_INSN_PAR_MULWLO_A },
248 { M32R2F_INSN_WRITE_MULWLO_A, && case_sem_INSN_WRITE_MULWLO_A },
249 { M32R2F_INSN_PAR_MV, && case_sem_INSN_PAR_MV },
250 { M32R2F_INSN_WRITE_MV, && case_sem_INSN_WRITE_MV },
251 { M32R2F_INSN_PAR_MVFACHI_A, && case_sem_INSN_PAR_MVFACHI_A },
252 { M32R2F_INSN_WRITE_MVFACHI_A, && case_sem_INSN_WRITE_MVFACHI_A },
253 { M32R2F_INSN_PAR_MVFACLO_A, && case_sem_INSN_PAR_MVFACLO_A },
254 { M32R2F_INSN_WRITE_MVFACLO_A, && case_sem_INSN_WRITE_MVFACLO_A },
255 { M32R2F_INSN_PAR_MVFACMI_A, && case_sem_INSN_PAR_MVFACMI_A },
256 { M32R2F_INSN_WRITE_MVFACMI_A, && case_sem_INSN_WRITE_MVFACMI_A },
257 { M32R2F_INSN_PAR_MVFC, && case_sem_INSN_PAR_MVFC },
258 { M32R2F_INSN_WRITE_MVFC, && case_sem_INSN_WRITE_MVFC },
259 { M32R2F_INSN_PAR_MVTACHI_A, && case_sem_INSN_PAR_MVTACHI_A },
260 { M32R2F_INSN_WRITE_MVTACHI_A, && case_sem_INSN_WRITE_MVTACHI_A },
261 { M32R2F_INSN_PAR_MVTACLO_A, && case_sem_INSN_PAR_MVTACLO_A },
262 { M32R2F_INSN_WRITE_MVTACLO_A, && case_sem_INSN_WRITE_MVTACLO_A },
263 { M32R2F_INSN_PAR_MVTC, && case_sem_INSN_PAR_MVTC },
264 { M32R2F_INSN_WRITE_MVTC, && case_sem_INSN_WRITE_MVTC },
265 { M32R2F_INSN_PAR_NEG, && case_sem_INSN_PAR_NEG },
266 { M32R2F_INSN_WRITE_NEG, && case_sem_INSN_WRITE_NEG },
267 { M32R2F_INSN_PAR_NOP, && case_sem_INSN_PAR_NOP },
268 { M32R2F_INSN_WRITE_NOP, && case_sem_INSN_WRITE_NOP },
269 { M32R2F_INSN_PAR_NOT, && case_sem_INSN_PAR_NOT },
270 { M32R2F_INSN_WRITE_NOT, && case_sem_INSN_WRITE_NOT },
271 { M32R2F_INSN_PAR_RAC_DSI, && case_sem_INSN_PAR_RAC_DSI },
272 { M32R2F_INSN_WRITE_RAC_DSI, && case_sem_INSN_WRITE_RAC_DSI },
273 { M32R2F_INSN_PAR_RACH_DSI, && case_sem_INSN_PAR_RACH_DSI },
274 { M32R2F_INSN_WRITE_RACH_DSI, && case_sem_INSN_WRITE_RACH_DSI },
275 { M32R2F_INSN_PAR_RTE, && case_sem_INSN_PAR_RTE },
276 { M32R2F_INSN_WRITE_RTE, && case_sem_INSN_WRITE_RTE },
277 { M32R2F_INSN_PAR_SLL, && case_sem_INSN_PAR_SLL },
278 { M32R2F_INSN_WRITE_SLL, && case_sem_INSN_WRITE_SLL },
279 { M32R2F_INSN_PAR_SLLI, && case_sem_INSN_PAR_SLLI },
280 { M32R2F_INSN_WRITE_SLLI, && case_sem_INSN_WRITE_SLLI },
281 { M32R2F_INSN_PAR_SRA, && case_sem_INSN_PAR_SRA },
282 { M32R2F_INSN_WRITE_SRA, && case_sem_INSN_WRITE_SRA },
283 { M32R2F_INSN_PAR_SRAI, && case_sem_INSN_PAR_SRAI },
284 { M32R2F_INSN_WRITE_SRAI, && case_sem_INSN_WRITE_SRAI },
285 { M32R2F_INSN_PAR_SRL, && case_sem_INSN_PAR_SRL },
286 { M32R2F_INSN_WRITE_SRL, && case_sem_INSN_WRITE_SRL },
287 { M32R2F_INSN_PAR_SRLI, && case_sem_INSN_PAR_SRLI },
288 { M32R2F_INSN_WRITE_SRLI, && case_sem_INSN_WRITE_SRLI },
289 { M32R2F_INSN_PAR_ST, && case_sem_INSN_PAR_ST },
290 { M32R2F_INSN_WRITE_ST, && case_sem_INSN_WRITE_ST },
291 { M32R2F_INSN_PAR_STB, && case_sem_INSN_PAR_STB },
292 { M32R2F_INSN_WRITE_STB, && case_sem_INSN_WRITE_STB },
293 { M32R2F_INSN_PAR_STH, && case_sem_INSN_PAR_STH },
294 { M32R2F_INSN_WRITE_STH, && case_sem_INSN_WRITE_STH },
295 { M32R2F_INSN_PAR_ST_PLUS, && case_sem_INSN_PAR_ST_PLUS },
296 { M32R2F_INSN_WRITE_ST_PLUS, && case_sem_INSN_WRITE_ST_PLUS },
297 { M32R2F_INSN_PAR_STH_PLUS, && case_sem_INSN_PAR_STH_PLUS },
298 { M32R2F_INSN_WRITE_STH_PLUS, && case_sem_INSN_WRITE_STH_PLUS },
299 { M32R2F_INSN_PAR_STB_PLUS, && case_sem_INSN_PAR_STB_PLUS },
300 { M32R2F_INSN_WRITE_STB_PLUS, && case_sem_INSN_WRITE_STB_PLUS },
301 { M32R2F_INSN_PAR_ST_MINUS, && case_sem_INSN_PAR_ST_MINUS },
302 { M32R2F_INSN_WRITE_ST_MINUS, && case_sem_INSN_WRITE_ST_MINUS },
303 { M32R2F_INSN_PAR_SUB, && case_sem_INSN_PAR_SUB },
304 { M32R2F_INSN_WRITE_SUB, && case_sem_INSN_WRITE_SUB },
305 { M32R2F_INSN_PAR_SUBV, && case_sem_INSN_PAR_SUBV },
306 { M32R2F_INSN_WRITE_SUBV, && case_sem_INSN_WRITE_SUBV },
307 { M32R2F_INSN_PAR_SUBX, && case_sem_INSN_PAR_SUBX },
308 { M32R2F_INSN_WRITE_SUBX, && case_sem_INSN_WRITE_SUBX },
309 { M32R2F_INSN_PAR_TRAP, && case_sem_INSN_PAR_TRAP },
310 { M32R2F_INSN_WRITE_TRAP, && case_sem_INSN_WRITE_TRAP },
311 { M32R2F_INSN_PAR_UNLOCK, && case_sem_INSN_PAR_UNLOCK },
312 { M32R2F_INSN_WRITE_UNLOCK, && case_sem_INSN_WRITE_UNLOCK },
313 { M32R2F_INSN_PAR_PCMPBZ, && case_sem_INSN_PAR_PCMPBZ },
314 { M32R2F_INSN_WRITE_PCMPBZ, && case_sem_INSN_WRITE_PCMPBZ },
315 { M32R2F_INSN_PAR_SADD, && case_sem_INSN_PAR_SADD },
316 { M32R2F_INSN_WRITE_SADD, && case_sem_INSN_WRITE_SADD },
317 { M32R2F_INSN_PAR_MACWU1, && case_sem_INSN_PAR_MACWU1 },
318 { M32R2F_INSN_WRITE_MACWU1, && case_sem_INSN_WRITE_MACWU1 },
319 { M32R2F_INSN_PAR_MSBLO, && case_sem_INSN_PAR_MSBLO },
320 { M32R2F_INSN_WRITE_MSBLO, && case_sem_INSN_WRITE_MSBLO },
321 { M32R2F_INSN_PAR_MULWU1, && case_sem_INSN_PAR_MULWU1 },
322 { M32R2F_INSN_WRITE_MULWU1, && case_sem_INSN_WRITE_MULWU1 },
323 { M32R2F_INSN_PAR_MACLH1, && case_sem_INSN_PAR_MACLH1 },
324 { M32R2F_INSN_WRITE_MACLH1, && case_sem_INSN_WRITE_MACLH1 },
325 { M32R2F_INSN_PAR_SC, && case_sem_INSN_PAR_SC },
326 { M32R2F_INSN_WRITE_SC, && case_sem_INSN_WRITE_SC },
327 { M32R2F_INSN_PAR_SNC, && case_sem_INSN_PAR_SNC },
328 { M32R2F_INSN_WRITE_SNC, && case_sem_INSN_WRITE_SNC },
329 { M32R2F_INSN_PAR_CLRPSW, && case_sem_INSN_PAR_CLRPSW },
330 { M32R2F_INSN_WRITE_CLRPSW, && case_sem_INSN_WRITE_CLRPSW },
331 { M32R2F_INSN_PAR_SETPSW, && case_sem_INSN_PAR_SETPSW },
332 { M32R2F_INSN_WRITE_SETPSW, && case_sem_INSN_WRITE_SETPSW },
333 { M32R2F_INSN_PAR_BTST, && case_sem_INSN_PAR_BTST },
334 { M32R2F_INSN_WRITE_BTST, && case_sem_INSN_WRITE_BTST },
335 { 0, 0 }
337 int i;
339 for (i = 0; labels[i].label != 0; ++i)
341 #if FAST_P
342 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
343 #else
344 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
345 #endif
348 #undef DEFINE_LABELS
349 #endif /* DEFINE_LABELS */
351 #ifdef DEFINE_SWITCH
353 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
354 off frills like tracing and profiling. */
355 /* FIXME: A better way would be to have TRACE_RESULT check for something
356 that can cause it to be optimized out. Another way would be to emit
357 special handlers into the instruction "stream". */
359 #if FAST_P
360 #undef TRACE_RESULT
361 #define TRACE_RESULT(cpu, abuf, name, type, val)
362 #endif
364 #undef GET_ATTR
365 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
366 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
367 #else
368 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
369 #endif
373 #if WITH_SCACHE_PBB
375 /* Branch to next handler without going around main loop. */
376 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
377 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
379 #else /* ! WITH_SCACHE_PBB */
381 #define NEXT(vpc) BREAK (sem)
382 #ifdef __GNUC__
383 #if FAST_P
384 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
385 #else
386 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
387 #endif
388 #else
389 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
390 #endif
392 #endif /* ! WITH_SCACHE_PBB */
396 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
398 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
399 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
400 #define FLD(f) abuf->fields.fmt_empty.f
401 int UNUSED written = 0;
402 IADDR UNUSED pc = abuf->addr;
403 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
406 /* Update the recorded pc in the cpu state struct.
407 Only necessary for WITH_SCACHE case, but to avoid the
408 conditional compilation .... */
409 SET_H_PC (pc);
410 /* Virtual insns have zero size. Overwrite vpc with address of next insn
411 using the default-insn-bitsize spec. When executing insns in parallel
412 we may want to queue the fault and continue execution. */
413 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
414 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
417 #undef FLD
419 NEXT (vpc);
421 CASE (sem, INSN_X_AFTER) : /* --after-- */
423 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
424 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
425 #define FLD(f) abuf->fields.fmt_empty.f
426 int UNUSED written = 0;
427 IADDR UNUSED pc = abuf->addr;
428 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
431 #if WITH_SCACHE_PBB_M32R2F
432 m32r2f_pbb_after (current_cpu, sem_arg);
433 #endif
436 #undef FLD
438 NEXT (vpc);
440 CASE (sem, INSN_X_BEFORE) : /* --before-- */
442 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
443 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
444 #define FLD(f) abuf->fields.fmt_empty.f
445 int UNUSED written = 0;
446 IADDR UNUSED pc = abuf->addr;
447 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
450 #if WITH_SCACHE_PBB_M32R2F
451 m32r2f_pbb_before (current_cpu, sem_arg);
452 #endif
455 #undef FLD
457 NEXT (vpc);
459 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
461 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
462 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
463 #define FLD(f) abuf->fields.fmt_empty.f
464 int UNUSED written = 0;
465 IADDR UNUSED pc = abuf->addr;
466 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
469 #if WITH_SCACHE_PBB_M32R2F
470 #ifdef DEFINE_SWITCH
471 vpc = m32r2f_pbb_cti_chain (current_cpu, sem_arg,
472 pbb_br_type, pbb_br_npc);
473 BREAK (sem);
474 #else
475 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
476 vpc = m32r2f_pbb_cti_chain (current_cpu, sem_arg,
477 CPU_PBB_BR_TYPE (current_cpu),
478 CPU_PBB_BR_NPC (current_cpu));
479 #endif
480 #endif
483 #undef FLD
485 NEXT (vpc);
487 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
489 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
490 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
491 #define FLD(f) abuf->fields.fmt_empty.f
492 int UNUSED written = 0;
493 IADDR UNUSED pc = abuf->addr;
494 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
497 #if WITH_SCACHE_PBB_M32R2F
498 vpc = m32r2f_pbb_chain (current_cpu, sem_arg);
499 #ifdef DEFINE_SWITCH
500 BREAK (sem);
501 #endif
502 #endif
505 #undef FLD
507 NEXT (vpc);
509 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
513 #define FLD(f) abuf->fields.fmt_empty.f
514 int UNUSED written = 0;
515 IADDR UNUSED pc = abuf->addr;
516 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
519 #if WITH_SCACHE_PBB_M32R2F
520 #if defined DEFINE_SWITCH || defined FAST_P
521 /* In the switch case FAST_P is a constant, allowing several optimizations
522 in any called inline functions. */
523 vpc = m32r2f_pbb_begin (current_cpu, FAST_P);
524 #else
525 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
526 vpc = m32r2f_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
527 #else
528 vpc = m32r2f_pbb_begin (current_cpu, 0);
529 #endif
530 #endif
531 #endif
534 #undef FLD
536 NEXT (vpc);
538 CASE (sem, INSN_ADD) : /* add $dr,$sr */
540 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
541 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
542 #define FLD(f) abuf->fields.sfmt_add.f
543 int UNUSED written = 0;
544 IADDR UNUSED pc = abuf->addr;
545 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
548 SI opval = ADDSI (* FLD (i_dr), * FLD (i_sr));
549 * FLD (i_dr) = opval;
550 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
553 #undef FLD
555 NEXT (vpc);
557 CASE (sem, INSN_ADD3) : /* add3 $dr,$sr,$hash$slo16 */
559 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
560 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
561 #define FLD(f) abuf->fields.sfmt_add3.f
562 int UNUSED written = 0;
563 IADDR UNUSED pc = abuf->addr;
564 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
567 SI opval = ADDSI (* FLD (i_sr), FLD (f_simm16));
568 * FLD (i_dr) = opval;
569 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
572 #undef FLD
574 NEXT (vpc);
576 CASE (sem, INSN_AND) : /* and $dr,$sr */
578 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
579 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
580 #define FLD(f) abuf->fields.sfmt_add.f
581 int UNUSED written = 0;
582 IADDR UNUSED pc = abuf->addr;
583 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
586 SI opval = ANDSI (* FLD (i_dr), * FLD (i_sr));
587 * FLD (i_dr) = opval;
588 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
591 #undef FLD
593 NEXT (vpc);
595 CASE (sem, INSN_AND3) : /* and3 $dr,$sr,$uimm16 */
597 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
598 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
599 #define FLD(f) abuf->fields.sfmt_and3.f
600 int UNUSED written = 0;
601 IADDR UNUSED pc = abuf->addr;
602 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
605 SI opval = ANDSI (* FLD (i_sr), FLD (f_uimm16));
606 * FLD (i_dr) = opval;
607 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
610 #undef FLD
612 NEXT (vpc);
614 CASE (sem, INSN_OR) : /* or $dr,$sr */
616 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
617 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
618 #define FLD(f) abuf->fields.sfmt_add.f
619 int UNUSED written = 0;
620 IADDR UNUSED pc = abuf->addr;
621 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
624 SI opval = ORSI (* FLD (i_dr), * FLD (i_sr));
625 * FLD (i_dr) = opval;
626 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
629 #undef FLD
631 NEXT (vpc);
633 CASE (sem, INSN_OR3) : /* or3 $dr,$sr,$hash$ulo16 */
635 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
636 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
637 #define FLD(f) abuf->fields.sfmt_and3.f
638 int UNUSED written = 0;
639 IADDR UNUSED pc = abuf->addr;
640 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
643 SI opval = ORSI (* FLD (i_sr), FLD (f_uimm16));
644 * FLD (i_dr) = opval;
645 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
648 #undef FLD
650 NEXT (vpc);
652 CASE (sem, INSN_XOR) : /* xor $dr,$sr */
654 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
655 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
656 #define FLD(f) abuf->fields.sfmt_add.f
657 int UNUSED written = 0;
658 IADDR UNUSED pc = abuf->addr;
659 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
662 SI opval = XORSI (* FLD (i_dr), * FLD (i_sr));
663 * FLD (i_dr) = opval;
664 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
667 #undef FLD
669 NEXT (vpc);
671 CASE (sem, INSN_XOR3) : /* xor3 $dr,$sr,$uimm16 */
673 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
674 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
675 #define FLD(f) abuf->fields.sfmt_and3.f
676 int UNUSED written = 0;
677 IADDR UNUSED pc = abuf->addr;
678 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
681 SI opval = XORSI (* FLD (i_sr), FLD (f_uimm16));
682 * FLD (i_dr) = opval;
683 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
686 #undef FLD
688 NEXT (vpc);
690 CASE (sem, INSN_ADDI) : /* addi $dr,$simm8 */
692 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
693 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
694 #define FLD(f) abuf->fields.sfmt_addi.f
695 int UNUSED written = 0;
696 IADDR UNUSED pc = abuf->addr;
697 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
700 SI opval = ADDSI (* FLD (i_dr), FLD (f_simm8));
701 * FLD (i_dr) = opval;
702 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
705 #undef FLD
707 NEXT (vpc);
709 CASE (sem, INSN_ADDV) : /* addv $dr,$sr */
711 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
712 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
713 #define FLD(f) abuf->fields.sfmt_add.f
714 int UNUSED written = 0;
715 IADDR UNUSED pc = abuf->addr;
716 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
719 SI temp0;BI temp1;
720 temp0 = ADDSI (* FLD (i_dr), * FLD (i_sr));
721 temp1 = ADDOFSI (* FLD (i_dr), * FLD (i_sr), 0);
723 SI opval = temp0;
724 * FLD (i_dr) = opval;
725 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
728 BI opval = temp1;
729 CPU (h_cond) = opval;
730 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
734 #undef FLD
736 NEXT (vpc);
738 CASE (sem, INSN_ADDV3) : /* addv3 $dr,$sr,$simm16 */
740 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
741 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
742 #define FLD(f) abuf->fields.sfmt_add3.f
743 int UNUSED written = 0;
744 IADDR UNUSED pc = abuf->addr;
745 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
748 SI temp0;BI temp1;
749 temp0 = ADDSI (* FLD (i_sr), FLD (f_simm16));
750 temp1 = ADDOFSI (* FLD (i_sr), FLD (f_simm16), 0);
752 SI opval = temp0;
753 * FLD (i_dr) = opval;
754 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
757 BI opval = temp1;
758 CPU (h_cond) = opval;
759 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
763 #undef FLD
765 NEXT (vpc);
767 CASE (sem, INSN_ADDX) : /* addx $dr,$sr */
769 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
770 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
771 #define FLD(f) abuf->fields.sfmt_add.f
772 int UNUSED written = 0;
773 IADDR UNUSED pc = abuf->addr;
774 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
777 SI temp0;BI temp1;
778 temp0 = ADDCSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
779 temp1 = ADDCFSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
781 SI opval = temp0;
782 * FLD (i_dr) = opval;
783 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
786 BI opval = temp1;
787 CPU (h_cond) = opval;
788 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
792 #undef FLD
794 NEXT (vpc);
796 CASE (sem, INSN_BC8) : /* bc.s $disp8 */
798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
799 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
800 #define FLD(f) abuf->fields.sfmt_bl8.f
801 int UNUSED written = 0;
802 IADDR UNUSED pc = abuf->addr;
803 SEM_BRANCH_INIT
804 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
806 if (CPU (h_cond)) {
808 USI opval = FLD (i_disp8);
809 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
810 written |= (1 << 2);
811 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
815 abuf->written = written;
816 SEM_BRANCH_FINI (vpc);
817 #undef FLD
819 NEXT (vpc);
821 CASE (sem, INSN_BC24) : /* bc.l $disp24 */
823 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
824 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
825 #define FLD(f) abuf->fields.sfmt_bl24.f
826 int UNUSED written = 0;
827 IADDR UNUSED pc = abuf->addr;
828 SEM_BRANCH_INIT
829 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
831 if (CPU (h_cond)) {
833 USI opval = FLD (i_disp24);
834 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
835 written |= (1 << 2);
836 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
840 abuf->written = written;
841 SEM_BRANCH_FINI (vpc);
842 #undef FLD
844 NEXT (vpc);
846 CASE (sem, INSN_BEQ) : /* beq $src1,$src2,$disp16 */
848 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
849 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
850 #define FLD(f) abuf->fields.sfmt_beq.f
851 int UNUSED written = 0;
852 IADDR UNUSED pc = abuf->addr;
853 SEM_BRANCH_INIT
854 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
856 if (EQSI (* FLD (i_src1), * FLD (i_src2))) {
858 USI opval = FLD (i_disp16);
859 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
860 written |= (1 << 3);
861 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
865 abuf->written = written;
866 SEM_BRANCH_FINI (vpc);
867 #undef FLD
869 NEXT (vpc);
871 CASE (sem, INSN_BEQZ) : /* beqz $src2,$disp16 */
873 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
874 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
875 #define FLD(f) abuf->fields.sfmt_beq.f
876 int UNUSED written = 0;
877 IADDR UNUSED pc = abuf->addr;
878 SEM_BRANCH_INIT
879 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
881 if (EQSI (* FLD (i_src2), 0)) {
883 USI opval = FLD (i_disp16);
884 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
885 written |= (1 << 2);
886 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
890 abuf->written = written;
891 SEM_BRANCH_FINI (vpc);
892 #undef FLD
894 NEXT (vpc);
896 CASE (sem, INSN_BGEZ) : /* bgez $src2,$disp16 */
898 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
899 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
900 #define FLD(f) abuf->fields.sfmt_beq.f
901 int UNUSED written = 0;
902 IADDR UNUSED pc = abuf->addr;
903 SEM_BRANCH_INIT
904 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
906 if (GESI (* FLD (i_src2), 0)) {
908 USI opval = FLD (i_disp16);
909 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
910 written |= (1 << 2);
911 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
915 abuf->written = written;
916 SEM_BRANCH_FINI (vpc);
917 #undef FLD
919 NEXT (vpc);
921 CASE (sem, INSN_BGTZ) : /* bgtz $src2,$disp16 */
923 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
924 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
925 #define FLD(f) abuf->fields.sfmt_beq.f
926 int UNUSED written = 0;
927 IADDR UNUSED pc = abuf->addr;
928 SEM_BRANCH_INIT
929 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
931 if (GTSI (* FLD (i_src2), 0)) {
933 USI opval = FLD (i_disp16);
934 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
935 written |= (1 << 2);
936 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
940 abuf->written = written;
941 SEM_BRANCH_FINI (vpc);
942 #undef FLD
944 NEXT (vpc);
946 CASE (sem, INSN_BLEZ) : /* blez $src2,$disp16 */
948 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
949 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
950 #define FLD(f) abuf->fields.sfmt_beq.f
951 int UNUSED written = 0;
952 IADDR UNUSED pc = abuf->addr;
953 SEM_BRANCH_INIT
954 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
956 if (LESI (* FLD (i_src2), 0)) {
958 USI opval = FLD (i_disp16);
959 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
960 written |= (1 << 2);
961 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
965 abuf->written = written;
966 SEM_BRANCH_FINI (vpc);
967 #undef FLD
969 NEXT (vpc);
971 CASE (sem, INSN_BLTZ) : /* bltz $src2,$disp16 */
973 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
974 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
975 #define FLD(f) abuf->fields.sfmt_beq.f
976 int UNUSED written = 0;
977 IADDR UNUSED pc = abuf->addr;
978 SEM_BRANCH_INIT
979 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
981 if (LTSI (* FLD (i_src2), 0)) {
983 USI opval = FLD (i_disp16);
984 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
985 written |= (1 << 2);
986 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
990 abuf->written = written;
991 SEM_BRANCH_FINI (vpc);
992 #undef FLD
994 NEXT (vpc);
996 CASE (sem, INSN_BNEZ) : /* bnez $src2,$disp16 */
998 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
999 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1000 #define FLD(f) abuf->fields.sfmt_beq.f
1001 int UNUSED written = 0;
1002 IADDR UNUSED pc = abuf->addr;
1003 SEM_BRANCH_INIT
1004 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1006 if (NESI (* FLD (i_src2), 0)) {
1008 USI opval = FLD (i_disp16);
1009 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1010 written |= (1 << 2);
1011 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1015 abuf->written = written;
1016 SEM_BRANCH_FINI (vpc);
1017 #undef FLD
1019 NEXT (vpc);
1021 CASE (sem, INSN_BL8) : /* bl.s $disp8 */
1023 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1024 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1025 #define FLD(f) abuf->fields.sfmt_bl8.f
1026 int UNUSED written = 0;
1027 IADDR UNUSED pc = abuf->addr;
1028 SEM_BRANCH_INIT
1029 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1033 SI opval = ADDSI (ANDSI (pc, -4), 4);
1034 CPU (h_gr[((UINT) 14)]) = opval;
1035 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1038 USI opval = FLD (i_disp8);
1039 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1040 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1044 SEM_BRANCH_FINI (vpc);
1045 #undef FLD
1047 NEXT (vpc);
1049 CASE (sem, INSN_BL24) : /* bl.l $disp24 */
1051 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1052 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1053 #define FLD(f) abuf->fields.sfmt_bl24.f
1054 int UNUSED written = 0;
1055 IADDR UNUSED pc = abuf->addr;
1056 SEM_BRANCH_INIT
1057 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1061 SI opval = ADDSI (pc, 4);
1062 CPU (h_gr[((UINT) 14)]) = opval;
1063 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1066 USI opval = FLD (i_disp24);
1067 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1068 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1072 SEM_BRANCH_FINI (vpc);
1073 #undef FLD
1075 NEXT (vpc);
1077 CASE (sem, INSN_BCL8) : /* bcl.s $disp8 */
1079 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1080 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1081 #define FLD(f) abuf->fields.sfmt_bl8.f
1082 int UNUSED written = 0;
1083 IADDR UNUSED pc = abuf->addr;
1084 SEM_BRANCH_INIT
1085 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1087 if (CPU (h_cond)) {
1090 SI opval = ADDSI (ANDSI (pc, -4), 4);
1091 CPU (h_gr[((UINT) 14)]) = opval;
1092 written |= (1 << 3);
1093 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1096 USI opval = FLD (i_disp8);
1097 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1098 written |= (1 << 4);
1099 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1104 abuf->written = written;
1105 SEM_BRANCH_FINI (vpc);
1106 #undef FLD
1108 NEXT (vpc);
1110 CASE (sem, INSN_BCL24) : /* bcl.l $disp24 */
1112 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1113 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1114 #define FLD(f) abuf->fields.sfmt_bl24.f
1115 int UNUSED written = 0;
1116 IADDR UNUSED pc = abuf->addr;
1117 SEM_BRANCH_INIT
1118 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1120 if (CPU (h_cond)) {
1123 SI opval = ADDSI (pc, 4);
1124 CPU (h_gr[((UINT) 14)]) = opval;
1125 written |= (1 << 3);
1126 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1129 USI opval = FLD (i_disp24);
1130 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1131 written |= (1 << 4);
1132 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1137 abuf->written = written;
1138 SEM_BRANCH_FINI (vpc);
1139 #undef FLD
1141 NEXT (vpc);
1143 CASE (sem, INSN_BNC8) : /* bnc.s $disp8 */
1145 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1146 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1147 #define FLD(f) abuf->fields.sfmt_bl8.f
1148 int UNUSED written = 0;
1149 IADDR UNUSED pc = abuf->addr;
1150 SEM_BRANCH_INIT
1151 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1153 if (NOTBI (CPU (h_cond))) {
1155 USI opval = FLD (i_disp8);
1156 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1157 written |= (1 << 2);
1158 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1162 abuf->written = written;
1163 SEM_BRANCH_FINI (vpc);
1164 #undef FLD
1166 NEXT (vpc);
1168 CASE (sem, INSN_BNC24) : /* bnc.l $disp24 */
1170 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1171 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1172 #define FLD(f) abuf->fields.sfmt_bl24.f
1173 int UNUSED written = 0;
1174 IADDR UNUSED pc = abuf->addr;
1175 SEM_BRANCH_INIT
1176 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1178 if (NOTBI (CPU (h_cond))) {
1180 USI opval = FLD (i_disp24);
1181 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1182 written |= (1 << 2);
1183 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1187 abuf->written = written;
1188 SEM_BRANCH_FINI (vpc);
1189 #undef FLD
1191 NEXT (vpc);
1193 CASE (sem, INSN_BNE) : /* bne $src1,$src2,$disp16 */
1195 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1196 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1197 #define FLD(f) abuf->fields.sfmt_beq.f
1198 int UNUSED written = 0;
1199 IADDR UNUSED pc = abuf->addr;
1200 SEM_BRANCH_INIT
1201 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1203 if (NESI (* FLD (i_src1), * FLD (i_src2))) {
1205 USI opval = FLD (i_disp16);
1206 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1207 written |= (1 << 3);
1208 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1212 abuf->written = written;
1213 SEM_BRANCH_FINI (vpc);
1214 #undef FLD
1216 NEXT (vpc);
1218 CASE (sem, INSN_BRA8) : /* bra.s $disp8 */
1220 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1221 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1222 #define FLD(f) abuf->fields.sfmt_bl8.f
1223 int UNUSED written = 0;
1224 IADDR UNUSED pc = abuf->addr;
1225 SEM_BRANCH_INIT
1226 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1229 USI opval = FLD (i_disp8);
1230 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1231 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1234 SEM_BRANCH_FINI (vpc);
1235 #undef FLD
1237 NEXT (vpc);
1239 CASE (sem, INSN_BRA24) : /* bra.l $disp24 */
1241 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1242 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1243 #define FLD(f) abuf->fields.sfmt_bl24.f
1244 int UNUSED written = 0;
1245 IADDR UNUSED pc = abuf->addr;
1246 SEM_BRANCH_INIT
1247 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1250 USI opval = FLD (i_disp24);
1251 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1252 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1255 SEM_BRANCH_FINI (vpc);
1256 #undef FLD
1258 NEXT (vpc);
1260 CASE (sem, INSN_BNCL8) : /* bncl.s $disp8 */
1262 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1263 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1264 #define FLD(f) abuf->fields.sfmt_bl8.f
1265 int UNUSED written = 0;
1266 IADDR UNUSED pc = abuf->addr;
1267 SEM_BRANCH_INIT
1268 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1270 if (NOTBI (CPU (h_cond))) {
1273 SI opval = ADDSI (ANDSI (pc, -4), 4);
1274 CPU (h_gr[((UINT) 14)]) = opval;
1275 written |= (1 << 3);
1276 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1279 USI opval = FLD (i_disp8);
1280 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1281 written |= (1 << 4);
1282 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1287 abuf->written = written;
1288 SEM_BRANCH_FINI (vpc);
1289 #undef FLD
1291 NEXT (vpc);
1293 CASE (sem, INSN_BNCL24) : /* bncl.l $disp24 */
1295 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1296 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1297 #define FLD(f) abuf->fields.sfmt_bl24.f
1298 int UNUSED written = 0;
1299 IADDR UNUSED pc = abuf->addr;
1300 SEM_BRANCH_INIT
1301 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1303 if (NOTBI (CPU (h_cond))) {
1306 SI opval = ADDSI (pc, 4);
1307 CPU (h_gr[((UINT) 14)]) = opval;
1308 written |= (1 << 3);
1309 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1312 USI opval = FLD (i_disp24);
1313 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1314 written |= (1 << 4);
1315 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1320 abuf->written = written;
1321 SEM_BRANCH_FINI (vpc);
1322 #undef FLD
1324 NEXT (vpc);
1326 CASE (sem, INSN_CMP) : /* cmp $src1,$src2 */
1328 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1329 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1330 #define FLD(f) abuf->fields.sfmt_st_plus.f
1331 int UNUSED written = 0;
1332 IADDR UNUSED pc = abuf->addr;
1333 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1336 BI opval = LTSI (* FLD (i_src1), * FLD (i_src2));
1337 CPU (h_cond) = opval;
1338 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1341 #undef FLD
1343 NEXT (vpc);
1345 CASE (sem, INSN_CMPI) : /* cmpi $src2,$simm16 */
1347 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1348 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1349 #define FLD(f) abuf->fields.sfmt_st_d.f
1350 int UNUSED written = 0;
1351 IADDR UNUSED pc = abuf->addr;
1352 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1355 BI opval = LTSI (* FLD (i_src2), FLD (f_simm16));
1356 CPU (h_cond) = opval;
1357 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1360 #undef FLD
1362 NEXT (vpc);
1364 CASE (sem, INSN_CMPU) : /* cmpu $src1,$src2 */
1366 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1367 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1368 #define FLD(f) abuf->fields.sfmt_st_plus.f
1369 int UNUSED written = 0;
1370 IADDR UNUSED pc = abuf->addr;
1371 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1374 BI opval = LTUSI (* FLD (i_src1), * FLD (i_src2));
1375 CPU (h_cond) = opval;
1376 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1379 #undef FLD
1381 NEXT (vpc);
1383 CASE (sem, INSN_CMPUI) : /* cmpui $src2,$simm16 */
1385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1387 #define FLD(f) abuf->fields.sfmt_st_d.f
1388 int UNUSED written = 0;
1389 IADDR UNUSED pc = abuf->addr;
1390 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1393 BI opval = LTUSI (* FLD (i_src2), FLD (f_simm16));
1394 CPU (h_cond) = opval;
1395 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1398 #undef FLD
1400 NEXT (vpc);
1402 CASE (sem, INSN_CMPEQ) : /* cmpeq $src1,$src2 */
1404 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1405 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1406 #define FLD(f) abuf->fields.sfmt_st_plus.f
1407 int UNUSED written = 0;
1408 IADDR UNUSED pc = abuf->addr;
1409 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1412 BI opval = EQSI (* FLD (i_src1), * FLD (i_src2));
1413 CPU (h_cond) = opval;
1414 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1417 #undef FLD
1419 NEXT (vpc);
1421 CASE (sem, INSN_CMPZ) : /* cmpz $src2 */
1423 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1424 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1425 #define FLD(f) abuf->fields.sfmt_st_plus.f
1426 int UNUSED written = 0;
1427 IADDR UNUSED pc = abuf->addr;
1428 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1431 BI opval = EQSI (* FLD (i_src2), 0);
1432 CPU (h_cond) = opval;
1433 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1436 #undef FLD
1438 NEXT (vpc);
1440 CASE (sem, INSN_DIV) : /* div $dr,$sr */
1442 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1443 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1444 #define FLD(f) abuf->fields.sfmt_add.f
1445 int UNUSED written = 0;
1446 IADDR UNUSED pc = abuf->addr;
1447 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1449 if (NESI (* FLD (i_sr), 0)) {
1451 SI opval = DIVSI (* FLD (i_dr), * FLD (i_sr));
1452 * FLD (i_dr) = opval;
1453 written |= (1 << 2);
1454 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1458 abuf->written = written;
1459 #undef FLD
1461 NEXT (vpc);
1463 CASE (sem, INSN_DIVU) : /* divu $dr,$sr */
1465 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1466 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1467 #define FLD(f) abuf->fields.sfmt_add.f
1468 int UNUSED written = 0;
1469 IADDR UNUSED pc = abuf->addr;
1470 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1472 if (NESI (* FLD (i_sr), 0)) {
1474 SI opval = UDIVSI (* FLD (i_dr), * FLD (i_sr));
1475 * FLD (i_dr) = opval;
1476 written |= (1 << 2);
1477 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1481 abuf->written = written;
1482 #undef FLD
1484 NEXT (vpc);
1486 CASE (sem, INSN_REM) : /* rem $dr,$sr */
1488 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1489 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1490 #define FLD(f) abuf->fields.sfmt_add.f
1491 int UNUSED written = 0;
1492 IADDR UNUSED pc = abuf->addr;
1493 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1495 if (NESI (* FLD (i_sr), 0)) {
1497 SI opval = MODSI (* FLD (i_dr), * FLD (i_sr));
1498 * FLD (i_dr) = opval;
1499 written |= (1 << 2);
1500 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1504 abuf->written = written;
1505 #undef FLD
1507 NEXT (vpc);
1509 CASE (sem, INSN_REMU) : /* remu $dr,$sr */
1511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1513 #define FLD(f) abuf->fields.sfmt_add.f
1514 int UNUSED written = 0;
1515 IADDR UNUSED pc = abuf->addr;
1516 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1518 if (NESI (* FLD (i_sr), 0)) {
1520 SI opval = UMODSI (* FLD (i_dr), * FLD (i_sr));
1521 * FLD (i_dr) = opval;
1522 written |= (1 << 2);
1523 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1527 abuf->written = written;
1528 #undef FLD
1530 NEXT (vpc);
1532 CASE (sem, INSN_REMH) : /* remh $dr,$sr */
1534 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1535 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1536 #define FLD(f) abuf->fields.sfmt_add.f
1537 int UNUSED written = 0;
1538 IADDR UNUSED pc = abuf->addr;
1539 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1541 if (NESI (* FLD (i_sr), 0)) {
1543 SI opval = MODSI (EXTHISI (TRUNCSIHI (* FLD (i_dr))), * FLD (i_sr));
1544 * FLD (i_dr) = opval;
1545 written |= (1 << 2);
1546 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1550 abuf->written = written;
1551 #undef FLD
1553 NEXT (vpc);
1555 CASE (sem, INSN_REMUH) : /* remuh $dr,$sr */
1557 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1558 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1559 #define FLD(f) abuf->fields.sfmt_add.f
1560 int UNUSED written = 0;
1561 IADDR UNUSED pc = abuf->addr;
1562 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1564 if (NESI (* FLD (i_sr), 0)) {
1566 SI opval = UMODSI (* FLD (i_dr), * FLD (i_sr));
1567 * FLD (i_dr) = opval;
1568 written |= (1 << 2);
1569 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1573 abuf->written = written;
1574 #undef FLD
1576 NEXT (vpc);
1578 CASE (sem, INSN_REMB) : /* remb $dr,$sr */
1580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1581 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1582 #define FLD(f) abuf->fields.sfmt_add.f
1583 int UNUSED written = 0;
1584 IADDR UNUSED pc = abuf->addr;
1585 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1587 if (NESI (* FLD (i_sr), 0)) {
1589 SI opval = MODSI (EXTBISI (TRUNCSIBI (* FLD (i_dr))), * FLD (i_sr));
1590 * FLD (i_dr) = opval;
1591 written |= (1 << 2);
1592 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1596 abuf->written = written;
1597 #undef FLD
1599 NEXT (vpc);
1601 CASE (sem, INSN_REMUB) : /* remub $dr,$sr */
1603 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1604 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1605 #define FLD(f) abuf->fields.sfmt_add.f
1606 int UNUSED written = 0;
1607 IADDR UNUSED pc = abuf->addr;
1608 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1610 if (NESI (* FLD (i_sr), 0)) {
1612 SI opval = UMODSI (* FLD (i_dr), * FLD (i_sr));
1613 * FLD (i_dr) = opval;
1614 written |= (1 << 2);
1615 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1619 abuf->written = written;
1620 #undef FLD
1622 NEXT (vpc);
1624 CASE (sem, INSN_DIVUH) : /* divuh $dr,$sr */
1626 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1627 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1628 #define FLD(f) abuf->fields.sfmt_add.f
1629 int UNUSED written = 0;
1630 IADDR UNUSED pc = abuf->addr;
1631 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1633 if (NESI (* FLD (i_sr), 0)) {
1635 SI opval = UDIVSI (* FLD (i_dr), * FLD (i_sr));
1636 * FLD (i_dr) = opval;
1637 written |= (1 << 2);
1638 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1642 abuf->written = written;
1643 #undef FLD
1645 NEXT (vpc);
1647 CASE (sem, INSN_DIVB) : /* divb $dr,$sr */
1649 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1650 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1651 #define FLD(f) abuf->fields.sfmt_add.f
1652 int UNUSED written = 0;
1653 IADDR UNUSED pc = abuf->addr;
1654 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1656 if (NESI (* FLD (i_sr), 0)) {
1658 SI opval = DIVSI (EXTBISI (TRUNCSIBI (* FLD (i_dr))), * FLD (i_sr));
1659 * FLD (i_dr) = opval;
1660 written |= (1 << 2);
1661 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1665 abuf->written = written;
1666 #undef FLD
1668 NEXT (vpc);
1670 CASE (sem, INSN_DIVUB) : /* divub $dr,$sr */
1672 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1673 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1674 #define FLD(f) abuf->fields.sfmt_add.f
1675 int UNUSED written = 0;
1676 IADDR UNUSED pc = abuf->addr;
1677 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1679 if (NESI (* FLD (i_sr), 0)) {
1681 SI opval = UDIVSI (* FLD (i_dr), * FLD (i_sr));
1682 * FLD (i_dr) = opval;
1683 written |= (1 << 2);
1684 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1688 abuf->written = written;
1689 #undef FLD
1691 NEXT (vpc);
1693 CASE (sem, INSN_DIVH) : /* divh $dr,$sr */
1695 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1696 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1697 #define FLD(f) abuf->fields.sfmt_add.f
1698 int UNUSED written = 0;
1699 IADDR UNUSED pc = abuf->addr;
1700 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1702 if (NESI (* FLD (i_sr), 0)) {
1704 SI opval = DIVSI (EXTHISI (TRUNCSIHI (* FLD (i_dr))), * FLD (i_sr));
1705 * FLD (i_dr) = opval;
1706 written |= (1 << 2);
1707 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1711 abuf->written = written;
1712 #undef FLD
1714 NEXT (vpc);
1716 CASE (sem, INSN_JC) : /* jc $sr */
1718 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1719 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1720 #define FLD(f) abuf->fields.sfmt_jl.f
1721 int UNUSED written = 0;
1722 IADDR UNUSED pc = abuf->addr;
1723 SEM_BRANCH_INIT
1724 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1726 if (CPU (h_cond)) {
1728 USI opval = ANDSI (* FLD (i_sr), -4);
1729 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1730 written |= (1 << 2);
1731 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1735 abuf->written = written;
1736 SEM_BRANCH_FINI (vpc);
1737 #undef FLD
1739 NEXT (vpc);
1741 CASE (sem, INSN_JNC) : /* jnc $sr */
1743 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1744 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1745 #define FLD(f) abuf->fields.sfmt_jl.f
1746 int UNUSED written = 0;
1747 IADDR UNUSED pc = abuf->addr;
1748 SEM_BRANCH_INIT
1749 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1751 if (NOTBI (CPU (h_cond))) {
1753 USI opval = ANDSI (* FLD (i_sr), -4);
1754 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1755 written |= (1 << 2);
1756 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1760 abuf->written = written;
1761 SEM_BRANCH_FINI (vpc);
1762 #undef FLD
1764 NEXT (vpc);
1766 CASE (sem, INSN_JL) : /* jl $sr */
1768 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1769 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1770 #define FLD(f) abuf->fields.sfmt_jl.f
1771 int UNUSED written = 0;
1772 IADDR UNUSED pc = abuf->addr;
1773 SEM_BRANCH_INIT
1774 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1777 SI temp0;USI temp1;
1778 temp0 = ADDSI (ANDSI (pc, -4), 4);
1779 temp1 = ANDSI (* FLD (i_sr), -4);
1781 SI opval = temp0;
1782 CPU (h_gr[((UINT) 14)]) = opval;
1783 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1786 USI opval = temp1;
1787 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1788 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1792 SEM_BRANCH_FINI (vpc);
1793 #undef FLD
1795 NEXT (vpc);
1797 CASE (sem, INSN_JMP) : /* jmp $sr */
1799 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1800 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1801 #define FLD(f) abuf->fields.sfmt_jl.f
1802 int UNUSED written = 0;
1803 IADDR UNUSED pc = abuf->addr;
1804 SEM_BRANCH_INIT
1805 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1808 USI opval = ANDSI (* FLD (i_sr), -4);
1809 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1810 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1813 SEM_BRANCH_FINI (vpc);
1814 #undef FLD
1816 NEXT (vpc);
1818 CASE (sem, INSN_LD) : /* ld $dr,@$sr */
1820 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1821 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1822 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1823 int UNUSED written = 0;
1824 IADDR UNUSED pc = abuf->addr;
1825 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1828 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_sr));
1829 * FLD (i_dr) = opval;
1830 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1833 #undef FLD
1835 NEXT (vpc);
1837 CASE (sem, INSN_LD_D) : /* ld $dr,@($slo16,$sr) */
1839 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1840 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1841 #define FLD(f) abuf->fields.sfmt_add3.f
1842 int UNUSED written = 0;
1843 IADDR UNUSED pc = abuf->addr;
1844 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1847 SI opval = GETMEMSI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)));
1848 * FLD (i_dr) = opval;
1849 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1852 #undef FLD
1854 NEXT (vpc);
1856 CASE (sem, INSN_LDB) : /* ldb $dr,@$sr */
1858 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1859 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1860 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1861 int UNUSED written = 0;
1862 IADDR UNUSED pc = abuf->addr;
1863 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1866 SI opval = EXTQISI (GETMEMQI (current_cpu, pc, * FLD (i_sr)));
1867 * FLD (i_dr) = opval;
1868 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1871 #undef FLD
1873 NEXT (vpc);
1875 CASE (sem, INSN_LDB_D) : /* ldb $dr,@($slo16,$sr) */
1877 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1878 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1879 #define FLD(f) abuf->fields.sfmt_add3.f
1880 int UNUSED written = 0;
1881 IADDR UNUSED pc = abuf->addr;
1882 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1885 SI opval = EXTQISI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1886 * FLD (i_dr) = opval;
1887 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1890 #undef FLD
1892 NEXT (vpc);
1894 CASE (sem, INSN_LDH) : /* ldh $dr,@$sr */
1896 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1897 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1898 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1899 int UNUSED written = 0;
1900 IADDR UNUSED pc = abuf->addr;
1901 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1904 SI opval = EXTHISI (GETMEMHI (current_cpu, pc, * FLD (i_sr)));
1905 * FLD (i_dr) = opval;
1906 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1909 #undef FLD
1911 NEXT (vpc);
1913 CASE (sem, INSN_LDH_D) : /* ldh $dr,@($slo16,$sr) */
1915 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1916 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1917 #define FLD(f) abuf->fields.sfmt_add3.f
1918 int UNUSED written = 0;
1919 IADDR UNUSED pc = abuf->addr;
1920 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1923 SI opval = EXTHISI (GETMEMHI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1924 * FLD (i_dr) = opval;
1925 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1928 #undef FLD
1930 NEXT (vpc);
1932 CASE (sem, INSN_LDUB) : /* ldub $dr,@$sr */
1934 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1935 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1936 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1937 int UNUSED written = 0;
1938 IADDR UNUSED pc = abuf->addr;
1939 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1942 SI opval = ZEXTQISI (GETMEMQI (current_cpu, pc, * FLD (i_sr)));
1943 * FLD (i_dr) = opval;
1944 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1947 #undef FLD
1949 NEXT (vpc);
1951 CASE (sem, INSN_LDUB_D) : /* ldub $dr,@($slo16,$sr) */
1953 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1954 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1955 #define FLD(f) abuf->fields.sfmt_add3.f
1956 int UNUSED written = 0;
1957 IADDR UNUSED pc = abuf->addr;
1958 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1961 SI opval = ZEXTQISI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1962 * FLD (i_dr) = opval;
1963 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1966 #undef FLD
1968 NEXT (vpc);
1970 CASE (sem, INSN_LDUH) : /* lduh $dr,@$sr */
1972 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1973 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1974 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1975 int UNUSED written = 0;
1976 IADDR UNUSED pc = abuf->addr;
1977 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1980 SI opval = ZEXTHISI (GETMEMHI (current_cpu, pc, * FLD (i_sr)));
1981 * FLD (i_dr) = opval;
1982 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1985 #undef FLD
1987 NEXT (vpc);
1989 CASE (sem, INSN_LDUH_D) : /* lduh $dr,@($slo16,$sr) */
1991 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1992 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1993 #define FLD(f) abuf->fields.sfmt_add3.f
1994 int UNUSED written = 0;
1995 IADDR UNUSED pc = abuf->addr;
1996 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1999 SI opval = ZEXTHISI (GETMEMHI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
2000 * FLD (i_dr) = opval;
2001 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2004 #undef FLD
2006 NEXT (vpc);
2008 CASE (sem, INSN_LD_PLUS) : /* ld $dr,@$sr+ */
2010 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2011 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2012 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2013 int UNUSED written = 0;
2014 IADDR UNUSED pc = abuf->addr;
2015 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2018 SI temp0;SI temp1;
2019 temp0 = GETMEMSI (current_cpu, pc, * FLD (i_sr));
2020 temp1 = ADDSI (* FLD (i_sr), 4);
2022 SI opval = temp0;
2023 * FLD (i_dr) = opval;
2024 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2027 SI opval = temp1;
2028 * FLD (i_sr) = opval;
2029 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2033 #undef FLD
2035 NEXT (vpc);
2037 CASE (sem, INSN_LD24) : /* ld24 $dr,$uimm24 */
2039 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2040 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2041 #define FLD(f) abuf->fields.sfmt_ld24.f
2042 int UNUSED written = 0;
2043 IADDR UNUSED pc = abuf->addr;
2044 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2047 SI opval = FLD (i_uimm24);
2048 * FLD (i_dr) = opval;
2049 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2052 #undef FLD
2054 NEXT (vpc);
2056 CASE (sem, INSN_LDI8) : /* ldi8 $dr,$simm8 */
2058 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2059 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2060 #define FLD(f) abuf->fields.sfmt_addi.f
2061 int UNUSED written = 0;
2062 IADDR UNUSED pc = abuf->addr;
2063 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2066 SI opval = FLD (f_simm8);
2067 * FLD (i_dr) = opval;
2068 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2071 #undef FLD
2073 NEXT (vpc);
2075 CASE (sem, INSN_LDI16) : /* ldi16 $dr,$hash$slo16 */
2077 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2078 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2079 #define FLD(f) abuf->fields.sfmt_add3.f
2080 int UNUSED written = 0;
2081 IADDR UNUSED pc = abuf->addr;
2082 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2085 SI opval = FLD (f_simm16);
2086 * FLD (i_dr) = opval;
2087 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2090 #undef FLD
2092 NEXT (vpc);
2094 CASE (sem, INSN_LOCK) : /* lock $dr,@$sr */
2096 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2097 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2098 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2099 int UNUSED written = 0;
2100 IADDR UNUSED pc = abuf->addr;
2101 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2105 BI opval = 1;
2106 CPU (h_lock) = opval;
2107 TRACE_RESULT (current_cpu, abuf, "lock", 'x', opval);
2110 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_sr));
2111 * FLD (i_dr) = opval;
2112 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2116 #undef FLD
2118 NEXT (vpc);
2120 CASE (sem, INSN_MACHI_A) : /* machi $src1,$src2,$acc */
2122 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2123 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2124 #define FLD(f) abuf->fields.sfmt_machi_a.f
2125 int UNUSED written = 0;
2126 IADDR UNUSED pc = abuf->addr;
2127 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2130 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (ANDSI (* FLD (i_src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16))))), 8), 8);
2131 SET_H_ACCUMS (FLD (f_acc), opval);
2132 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2135 #undef FLD
2137 NEXT (vpc);
2139 CASE (sem, INSN_MACLO_A) : /* maclo $src1,$src2,$acc */
2141 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2142 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2143 #define FLD(f) abuf->fields.sfmt_machi_a.f
2144 int UNUSED written = 0;
2145 IADDR UNUSED pc = abuf->addr;
2146 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2149 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (SLLSI (* FLD (i_src1), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2))))), 8), 8);
2150 SET_H_ACCUMS (FLD (f_acc), opval);
2151 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2154 #undef FLD
2156 NEXT (vpc);
2158 CASE (sem, INSN_MACWHI_A) : /* macwhi $src1,$src2,$acc */
2160 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2161 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2162 #define FLD(f) abuf->fields.sfmt_machi_a.f
2163 int UNUSED written = 0;
2164 IADDR UNUSED pc = abuf->addr;
2165 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2168 DI opval = ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16)))));
2169 SET_H_ACCUMS (FLD (f_acc), opval);
2170 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2173 #undef FLD
2175 NEXT (vpc);
2177 CASE (sem, INSN_MACWLO_A) : /* macwlo $src1,$src2,$acc */
2179 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2180 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2181 #define FLD(f) abuf->fields.sfmt_machi_a.f
2182 int UNUSED written = 0;
2183 IADDR UNUSED pc = abuf->addr;
2184 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2187 DI opval = ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))));
2188 SET_H_ACCUMS (FLD (f_acc), opval);
2189 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2192 #undef FLD
2194 NEXT (vpc);
2196 CASE (sem, INSN_MUL) : /* mul $dr,$sr */
2198 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2199 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2200 #define FLD(f) abuf->fields.sfmt_add.f
2201 int UNUSED written = 0;
2202 IADDR UNUSED pc = abuf->addr;
2203 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2206 SI opval = MULSI (* FLD (i_dr), * FLD (i_sr));
2207 * FLD (i_dr) = opval;
2208 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2211 #undef FLD
2213 NEXT (vpc);
2215 CASE (sem, INSN_MULHI_A) : /* mulhi $src1,$src2,$acc */
2217 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2218 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2219 #define FLD(f) abuf->fields.sfmt_machi_a.f
2220 int UNUSED written = 0;
2221 IADDR UNUSED pc = abuf->addr;
2222 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2225 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16)))), 16), 16);
2226 SET_H_ACCUMS (FLD (f_acc), opval);
2227 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2230 #undef FLD
2232 NEXT (vpc);
2234 CASE (sem, INSN_MULLO_A) : /* mullo $src1,$src2,$acc */
2236 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2237 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2238 #define FLD(f) abuf->fields.sfmt_machi_a.f
2239 int UNUSED written = 0;
2240 IADDR UNUSED pc = abuf->addr;
2241 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2244 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))), 16), 16);
2245 SET_H_ACCUMS (FLD (f_acc), opval);
2246 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2249 #undef FLD
2251 NEXT (vpc);
2253 CASE (sem, INSN_MULWHI_A) : /* mulwhi $src1,$src2,$acc */
2255 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2256 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2257 #define FLD(f) abuf->fields.sfmt_machi_a.f
2258 int UNUSED written = 0;
2259 IADDR UNUSED pc = abuf->addr;
2260 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2263 DI opval = MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16))));
2264 SET_H_ACCUMS (FLD (f_acc), opval);
2265 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2268 #undef FLD
2270 NEXT (vpc);
2272 CASE (sem, INSN_MULWLO_A) : /* mulwlo $src1,$src2,$acc */
2274 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2275 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2276 #define FLD(f) abuf->fields.sfmt_machi_a.f
2277 int UNUSED written = 0;
2278 IADDR UNUSED pc = abuf->addr;
2279 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2282 DI opval = MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (* FLD (i_src2))));
2283 SET_H_ACCUMS (FLD (f_acc), opval);
2284 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2287 #undef FLD
2289 NEXT (vpc);
2291 CASE (sem, INSN_MV) : /* mv $dr,$sr */
2293 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2294 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2295 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2296 int UNUSED written = 0;
2297 IADDR UNUSED pc = abuf->addr;
2298 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2301 SI opval = * FLD (i_sr);
2302 * FLD (i_dr) = opval;
2303 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2306 #undef FLD
2308 NEXT (vpc);
2310 CASE (sem, INSN_MVFACHI_A) : /* mvfachi $dr,$accs */
2312 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2313 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2314 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2315 int UNUSED written = 0;
2316 IADDR UNUSED pc = abuf->addr;
2317 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2320 SI opval = TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs)), 32));
2321 * FLD (i_dr) = opval;
2322 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2325 #undef FLD
2327 NEXT (vpc);
2329 CASE (sem, INSN_MVFACLO_A) : /* mvfaclo $dr,$accs */
2331 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2332 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2333 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2334 int UNUSED written = 0;
2335 IADDR UNUSED pc = abuf->addr;
2336 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2339 SI opval = TRUNCDISI (GET_H_ACCUMS (FLD (f_accs)));
2340 * FLD (i_dr) = opval;
2341 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2344 #undef FLD
2346 NEXT (vpc);
2348 CASE (sem, INSN_MVFACMI_A) : /* mvfacmi $dr,$accs */
2350 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2351 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2352 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2353 int UNUSED written = 0;
2354 IADDR UNUSED pc = abuf->addr;
2355 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2358 SI opval = TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs)), 16));
2359 * FLD (i_dr) = opval;
2360 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2363 #undef FLD
2365 NEXT (vpc);
2367 CASE (sem, INSN_MVFC) : /* mvfc $dr,$scr */
2369 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2370 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2371 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2372 int UNUSED written = 0;
2373 IADDR UNUSED pc = abuf->addr;
2374 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2377 SI opval = GET_H_CR (FLD (f_r2));
2378 * FLD (i_dr) = opval;
2379 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2382 #undef FLD
2384 NEXT (vpc);
2386 CASE (sem, INSN_MVTACHI_A) : /* mvtachi $src1,$accs */
2388 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2389 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2390 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
2391 int UNUSED written = 0;
2392 IADDR UNUSED pc = abuf->addr;
2393 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2396 DI opval = ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs)), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1)), 32));
2397 SET_H_ACCUMS (FLD (f_accs), opval);
2398 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2401 #undef FLD
2403 NEXT (vpc);
2405 CASE (sem, INSN_MVTACLO_A) : /* mvtaclo $src1,$accs */
2407 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2408 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2409 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
2410 int UNUSED written = 0;
2411 IADDR UNUSED pc = abuf->addr;
2412 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2415 DI opval = ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs)), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1)));
2416 SET_H_ACCUMS (FLD (f_accs), opval);
2417 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2420 #undef FLD
2422 NEXT (vpc);
2424 CASE (sem, INSN_MVTC) : /* mvtc $sr,$dcr */
2426 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2427 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2428 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2429 int UNUSED written = 0;
2430 IADDR UNUSED pc = abuf->addr;
2431 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2434 USI opval = * FLD (i_sr);
2435 SET_H_CR (FLD (f_r1), opval);
2436 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
2439 #undef FLD
2441 NEXT (vpc);
2443 CASE (sem, INSN_NEG) : /* neg $dr,$sr */
2445 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2446 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2447 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2448 int UNUSED written = 0;
2449 IADDR UNUSED pc = abuf->addr;
2450 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2453 SI opval = NEGSI (* FLD (i_sr));
2454 * FLD (i_dr) = opval;
2455 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2458 #undef FLD
2460 NEXT (vpc);
2462 CASE (sem, INSN_NOP) : /* nop */
2464 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2465 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2466 #define FLD(f) abuf->fields.fmt_empty.f
2467 int UNUSED written = 0;
2468 IADDR UNUSED pc = abuf->addr;
2469 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2471 PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr);
2473 #undef FLD
2475 NEXT (vpc);
2477 CASE (sem, INSN_NOT) : /* not $dr,$sr */
2479 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2480 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2481 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2482 int UNUSED written = 0;
2483 IADDR UNUSED pc = abuf->addr;
2484 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2487 SI opval = INVSI (* FLD (i_sr));
2488 * FLD (i_dr) = opval;
2489 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2492 #undef FLD
2494 NEXT (vpc);
2496 CASE (sem, INSN_RAC_DSI) : /* rac $accd,$accs,$imm1 */
2498 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2499 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2500 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2501 int UNUSED written = 0;
2502 IADDR UNUSED pc = abuf->addr;
2503 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2506 DI tmp_tmp1;
2507 tmp_tmp1 = SLLDI (GET_H_ACCUMS (FLD (f_accs)), FLD (f_imm1));
2508 tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 32768));
2510 DI opval = (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0xffff0000)));
2511 SET_H_ACCUMS (FLD (f_accd), opval);
2512 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2516 #undef FLD
2518 NEXT (vpc);
2520 CASE (sem, INSN_RACH_DSI) : /* rach $accd,$accs,$imm1 */
2522 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2523 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2524 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2525 int UNUSED written = 0;
2526 IADDR UNUSED pc = abuf->addr;
2527 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2530 DI tmp_tmp1;
2531 tmp_tmp1 = SLLDI (GET_H_ACCUMS (FLD (f_accs)), FLD (f_imm1));
2532 tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 0x80000000));
2534 DI opval = (GTDI (tmp_tmp1, MAKEDI (32767, 0))) ? (MAKEDI (32767, 0)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0)));
2535 SET_H_ACCUMS (FLD (f_accd), opval);
2536 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
2540 #undef FLD
2542 NEXT (vpc);
2544 CASE (sem, INSN_RTE) : /* rte */
2546 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2547 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2548 #define FLD(f) abuf->fields.fmt_empty.f
2549 int UNUSED written = 0;
2550 IADDR UNUSED pc = abuf->addr;
2551 SEM_BRANCH_INIT
2552 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2556 USI opval = ANDSI (GET_H_CR (((UINT) 6)), -4);
2557 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
2558 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
2561 USI opval = GET_H_CR (((UINT) 14));
2562 SET_H_CR (((UINT) 6), opval);
2563 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
2566 UQI opval = CPU (h_bpsw);
2567 SET_H_PSW (opval);
2568 TRACE_RESULT (current_cpu, abuf, "psw", 'x', opval);
2571 UQI opval = CPU (h_bbpsw);
2572 CPU (h_bpsw) = opval;
2573 TRACE_RESULT (current_cpu, abuf, "bpsw", 'x', opval);
2577 SEM_BRANCH_FINI (vpc);
2578 #undef FLD
2580 NEXT (vpc);
2582 CASE (sem, INSN_SETH) : /* seth $dr,$hash$hi16 */
2584 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2585 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2586 #define FLD(f) abuf->fields.sfmt_seth.f
2587 int UNUSED written = 0;
2588 IADDR UNUSED pc = abuf->addr;
2589 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2592 SI opval = SLLSI (FLD (f_hi16), 16);
2593 * FLD (i_dr) = opval;
2594 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2597 #undef FLD
2599 NEXT (vpc);
2601 CASE (sem, INSN_SLL) : /* sll $dr,$sr */
2603 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2604 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2605 #define FLD(f) abuf->fields.sfmt_add.f
2606 int UNUSED written = 0;
2607 IADDR UNUSED pc = abuf->addr;
2608 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2611 SI opval = SLLSI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
2612 * FLD (i_dr) = opval;
2613 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2616 #undef FLD
2618 NEXT (vpc);
2620 CASE (sem, INSN_SLL3) : /* sll3 $dr,$sr,$simm16 */
2622 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2623 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2624 #define FLD(f) abuf->fields.sfmt_add3.f
2625 int UNUSED written = 0;
2626 IADDR UNUSED pc = abuf->addr;
2627 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2630 SI opval = SLLSI (* FLD (i_sr), ANDSI (FLD (f_simm16), 31));
2631 * FLD (i_dr) = opval;
2632 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2635 #undef FLD
2637 NEXT (vpc);
2639 CASE (sem, INSN_SLLI) : /* slli $dr,$uimm5 */
2641 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2642 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2643 #define FLD(f) abuf->fields.sfmt_slli.f
2644 int UNUSED written = 0;
2645 IADDR UNUSED pc = abuf->addr;
2646 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2649 SI opval = SLLSI (* FLD (i_dr), FLD (f_uimm5));
2650 * FLD (i_dr) = opval;
2651 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2654 #undef FLD
2656 NEXT (vpc);
2658 CASE (sem, INSN_SRA) : /* sra $dr,$sr */
2660 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2661 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2662 #define FLD(f) abuf->fields.sfmt_add.f
2663 int UNUSED written = 0;
2664 IADDR UNUSED pc = abuf->addr;
2665 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2668 SI opval = SRASI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
2669 * FLD (i_dr) = opval;
2670 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2673 #undef FLD
2675 NEXT (vpc);
2677 CASE (sem, INSN_SRA3) : /* sra3 $dr,$sr,$simm16 */
2679 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2680 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2681 #define FLD(f) abuf->fields.sfmt_add3.f
2682 int UNUSED written = 0;
2683 IADDR UNUSED pc = abuf->addr;
2684 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2687 SI opval = SRASI (* FLD (i_sr), ANDSI (FLD (f_simm16), 31));
2688 * FLD (i_dr) = opval;
2689 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2692 #undef FLD
2694 NEXT (vpc);
2696 CASE (sem, INSN_SRAI) : /* srai $dr,$uimm5 */
2698 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2699 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2700 #define FLD(f) abuf->fields.sfmt_slli.f
2701 int UNUSED written = 0;
2702 IADDR UNUSED pc = abuf->addr;
2703 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2706 SI opval = SRASI (* FLD (i_dr), FLD (f_uimm5));
2707 * FLD (i_dr) = opval;
2708 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2711 #undef FLD
2713 NEXT (vpc);
2715 CASE (sem, INSN_SRL) : /* srl $dr,$sr */
2717 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2718 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2719 #define FLD(f) abuf->fields.sfmt_add.f
2720 int UNUSED written = 0;
2721 IADDR UNUSED pc = abuf->addr;
2722 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2725 SI opval = SRLSI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
2726 * FLD (i_dr) = opval;
2727 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2730 #undef FLD
2732 NEXT (vpc);
2734 CASE (sem, INSN_SRL3) : /* srl3 $dr,$sr,$simm16 */
2736 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2737 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2738 #define FLD(f) abuf->fields.sfmt_add3.f
2739 int UNUSED written = 0;
2740 IADDR UNUSED pc = abuf->addr;
2741 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2744 SI opval = SRLSI (* FLD (i_sr), ANDSI (FLD (f_simm16), 31));
2745 * FLD (i_dr) = opval;
2746 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2749 #undef FLD
2751 NEXT (vpc);
2753 CASE (sem, INSN_SRLI) : /* srli $dr,$uimm5 */
2755 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2756 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2757 #define FLD(f) abuf->fields.sfmt_slli.f
2758 int UNUSED written = 0;
2759 IADDR UNUSED pc = abuf->addr;
2760 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2763 SI opval = SRLSI (* FLD (i_dr), FLD (f_uimm5));
2764 * FLD (i_dr) = opval;
2765 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2768 #undef FLD
2770 NEXT (vpc);
2772 CASE (sem, INSN_ST) : /* st $src1,@$src2 */
2774 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2775 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2776 #define FLD(f) abuf->fields.sfmt_st_plus.f
2777 int UNUSED written = 0;
2778 IADDR UNUSED pc = abuf->addr;
2779 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2782 SI opval = * FLD (i_src1);
2783 SETMEMSI (current_cpu, pc, * FLD (i_src2), opval);
2784 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2787 #undef FLD
2789 NEXT (vpc);
2791 CASE (sem, INSN_ST_D) : /* st $src1,@($slo16,$src2) */
2793 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2794 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2795 #define FLD(f) abuf->fields.sfmt_st_d.f
2796 int UNUSED written = 0;
2797 IADDR UNUSED pc = abuf->addr;
2798 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2801 SI opval = * FLD (i_src1);
2802 SETMEMSI (current_cpu, pc, ADDSI (* FLD (i_src2), FLD (f_simm16)), opval);
2803 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2806 #undef FLD
2808 NEXT (vpc);
2810 CASE (sem, INSN_STB) : /* stb $src1,@$src2 */
2812 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2813 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2814 #define FLD(f) abuf->fields.sfmt_st_plus.f
2815 int UNUSED written = 0;
2816 IADDR UNUSED pc = abuf->addr;
2817 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2820 QI opval = * FLD (i_src1);
2821 SETMEMQI (current_cpu, pc, * FLD (i_src2), opval);
2822 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2825 #undef FLD
2827 NEXT (vpc);
2829 CASE (sem, INSN_STB_D) : /* stb $src1,@($slo16,$src2) */
2831 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2832 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2833 #define FLD(f) abuf->fields.sfmt_st_d.f
2834 int UNUSED written = 0;
2835 IADDR UNUSED pc = abuf->addr;
2836 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2839 QI opval = * FLD (i_src1);
2840 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_src2), FLD (f_simm16)), opval);
2841 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2844 #undef FLD
2846 NEXT (vpc);
2848 CASE (sem, INSN_STH) : /* sth $src1,@$src2 */
2850 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2851 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2852 #define FLD(f) abuf->fields.sfmt_st_plus.f
2853 int UNUSED written = 0;
2854 IADDR UNUSED pc = abuf->addr;
2855 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2858 HI opval = * FLD (i_src1);
2859 SETMEMHI (current_cpu, pc, * FLD (i_src2), opval);
2860 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2863 #undef FLD
2865 NEXT (vpc);
2867 CASE (sem, INSN_STH_D) : /* sth $src1,@($slo16,$src2) */
2869 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2870 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2871 #define FLD(f) abuf->fields.sfmt_st_d.f
2872 int UNUSED written = 0;
2873 IADDR UNUSED pc = abuf->addr;
2874 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2877 HI opval = * FLD (i_src1);
2878 SETMEMHI (current_cpu, pc, ADDSI (* FLD (i_src2), FLD (f_simm16)), opval);
2879 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2882 #undef FLD
2884 NEXT (vpc);
2886 CASE (sem, INSN_ST_PLUS) : /* st $src1,@+$src2 */
2888 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2890 #define FLD(f) abuf->fields.sfmt_st_plus.f
2891 int UNUSED written = 0;
2892 IADDR UNUSED pc = abuf->addr;
2893 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2896 SI tmp_new_src2;
2897 tmp_new_src2 = ADDSI (* FLD (i_src2), 4);
2899 SI opval = * FLD (i_src1);
2900 SETMEMSI (current_cpu, pc, tmp_new_src2, opval);
2901 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2904 SI opval = tmp_new_src2;
2905 * FLD (i_src2) = opval;
2906 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2910 #undef FLD
2912 NEXT (vpc);
2914 CASE (sem, INSN_STH_PLUS) : /* sth $src1,@$src2+ */
2916 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2917 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2918 #define FLD(f) abuf->fields.sfmt_st_plus.f
2919 int UNUSED written = 0;
2920 IADDR UNUSED pc = abuf->addr;
2921 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2924 HI tmp_new_src2;
2926 HI opval = * FLD (i_src1);
2927 SETMEMHI (current_cpu, pc, tmp_new_src2, opval);
2928 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2930 tmp_new_src2 = ADDSI (* FLD (i_src2), 2);
2932 SI opval = tmp_new_src2;
2933 * FLD (i_src2) = opval;
2934 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2938 #undef FLD
2940 NEXT (vpc);
2942 CASE (sem, INSN_STB_PLUS) : /* stb $src1,@$src2+ */
2944 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2945 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2946 #define FLD(f) abuf->fields.sfmt_st_plus.f
2947 int UNUSED written = 0;
2948 IADDR UNUSED pc = abuf->addr;
2949 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2952 QI tmp_new_src2;
2954 QI opval = * FLD (i_src1);
2955 SETMEMQI (current_cpu, pc, tmp_new_src2, opval);
2956 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2958 tmp_new_src2 = ADDSI (* FLD (i_src2), 1);
2960 SI opval = tmp_new_src2;
2961 * FLD (i_src2) = opval;
2962 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2966 #undef FLD
2968 NEXT (vpc);
2970 CASE (sem, INSN_ST_MINUS) : /* st $src1,@-$src2 */
2972 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2973 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2974 #define FLD(f) abuf->fields.sfmt_st_plus.f
2975 int UNUSED written = 0;
2976 IADDR UNUSED pc = abuf->addr;
2977 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2980 SI tmp_new_src2;
2981 tmp_new_src2 = SUBSI (* FLD (i_src2), 4);
2983 SI opval = * FLD (i_src1);
2984 SETMEMSI (current_cpu, pc, tmp_new_src2, opval);
2985 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2988 SI opval = tmp_new_src2;
2989 * FLD (i_src2) = opval;
2990 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2994 #undef FLD
2996 NEXT (vpc);
2998 CASE (sem, INSN_SUB) : /* sub $dr,$sr */
3000 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3001 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3002 #define FLD(f) abuf->fields.sfmt_add.f
3003 int UNUSED written = 0;
3004 IADDR UNUSED pc = abuf->addr;
3005 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3008 SI opval = SUBSI (* FLD (i_dr), * FLD (i_sr));
3009 * FLD (i_dr) = opval;
3010 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3013 #undef FLD
3015 NEXT (vpc);
3017 CASE (sem, INSN_SUBV) : /* subv $dr,$sr */
3019 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3020 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3021 #define FLD(f) abuf->fields.sfmt_add.f
3022 int UNUSED written = 0;
3023 IADDR UNUSED pc = abuf->addr;
3024 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3027 SI temp0;BI temp1;
3028 temp0 = SUBSI (* FLD (i_dr), * FLD (i_sr));
3029 temp1 = SUBOFSI (* FLD (i_dr), * FLD (i_sr), 0);
3031 SI opval = temp0;
3032 * FLD (i_dr) = opval;
3033 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3036 BI opval = temp1;
3037 CPU (h_cond) = opval;
3038 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
3042 #undef FLD
3044 NEXT (vpc);
3046 CASE (sem, INSN_SUBX) : /* subx $dr,$sr */
3048 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3049 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3050 #define FLD(f) abuf->fields.sfmt_add.f
3051 int UNUSED written = 0;
3052 IADDR UNUSED pc = abuf->addr;
3053 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3056 SI temp0;BI temp1;
3057 temp0 = SUBCSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
3058 temp1 = SUBCFSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
3060 SI opval = temp0;
3061 * FLD (i_dr) = opval;
3062 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3065 BI opval = temp1;
3066 CPU (h_cond) = opval;
3067 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
3071 #undef FLD
3073 NEXT (vpc);
3075 CASE (sem, INSN_TRAP) : /* trap $uimm4 */
3077 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3078 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3079 #define FLD(f) abuf->fields.sfmt_trap.f
3080 int UNUSED written = 0;
3081 IADDR UNUSED pc = abuf->addr;
3082 SEM_BRANCH_INIT
3083 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3087 USI opval = GET_H_CR (((UINT) 6));
3088 SET_H_CR (((UINT) 14), opval);
3089 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
3092 USI opval = ADDSI (pc, 4);
3093 SET_H_CR (((UINT) 6), opval);
3094 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
3097 UQI opval = CPU (h_bpsw);
3098 CPU (h_bbpsw) = opval;
3099 TRACE_RESULT (current_cpu, abuf, "bbpsw", 'x', opval);
3102 UQI opval = GET_H_PSW ();
3103 CPU (h_bpsw) = opval;
3104 TRACE_RESULT (current_cpu, abuf, "bpsw", 'x', opval);
3107 UQI opval = ANDQI (GET_H_PSW (), 128);
3108 SET_H_PSW (opval);
3109 TRACE_RESULT (current_cpu, abuf, "psw", 'x', opval);
3112 SI opval = m32r_trap (current_cpu, pc, FLD (f_uimm4));
3113 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3114 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3118 SEM_BRANCH_FINI (vpc);
3119 #undef FLD
3121 NEXT (vpc);
3123 CASE (sem, INSN_UNLOCK) : /* unlock $src1,@$src2 */
3125 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3126 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3127 #define FLD(f) abuf->fields.sfmt_st_plus.f
3128 int UNUSED written = 0;
3129 IADDR UNUSED pc = abuf->addr;
3130 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3133 if (CPU (h_lock)) {
3135 SI opval = * FLD (i_src1);
3136 SETMEMSI (current_cpu, pc, * FLD (i_src2), opval);
3137 written |= (1 << 4);
3138 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3142 BI opval = 0;
3143 CPU (h_lock) = opval;
3144 TRACE_RESULT (current_cpu, abuf, "lock", 'x', opval);
3148 abuf->written = written;
3149 #undef FLD
3151 NEXT (vpc);
3153 CASE (sem, INSN_SATB) : /* satb $dr,$sr */
3155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3157 #define FLD(f) abuf->fields.sfmt_ld_plus.f
3158 int UNUSED written = 0;
3159 IADDR UNUSED pc = abuf->addr;
3160 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3163 SI opval = (GESI (* FLD (i_sr), 127)) ? (127) : (LESI (* FLD (i_sr), -128)) ? (-128) : (* FLD (i_sr));
3164 * FLD (i_dr) = opval;
3165 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3168 #undef FLD
3170 NEXT (vpc);
3172 CASE (sem, INSN_SATH) : /* sath $dr,$sr */
3174 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3175 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3176 #define FLD(f) abuf->fields.sfmt_ld_plus.f
3177 int UNUSED written = 0;
3178 IADDR UNUSED pc = abuf->addr;
3179 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3182 SI opval = (GESI (* FLD (i_sr), 32767)) ? (32767) : (LESI (* FLD (i_sr), -32768)) ? (-32768) : (* FLD (i_sr));
3183 * FLD (i_dr) = opval;
3184 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3187 #undef FLD
3189 NEXT (vpc);
3191 CASE (sem, INSN_SAT) : /* sat $dr,$sr */
3193 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3194 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3195 #define FLD(f) abuf->fields.sfmt_ld_plus.f
3196 int UNUSED written = 0;
3197 IADDR UNUSED pc = abuf->addr;
3198 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3201 SI opval = ((CPU (h_cond)) ? (((LTSI (* FLD (i_sr), 0)) ? (2147483647) : (0x80000000))) : (* FLD (i_sr)));
3202 * FLD (i_dr) = opval;
3203 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3206 #undef FLD
3208 NEXT (vpc);
3210 CASE (sem, INSN_PCMPBZ) : /* pcmpbz $src2 */
3212 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3213 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3214 #define FLD(f) abuf->fields.sfmt_st_plus.f
3215 int UNUSED written = 0;
3216 IADDR UNUSED pc = abuf->addr;
3217 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3220 BI opval = (EQSI (ANDSI (* FLD (i_src2), 255), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2), 65280), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2), 16711680), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2), 0xff000000), 0)) ? (1) : (0);
3221 CPU (h_cond) = opval;
3222 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
3225 #undef FLD
3227 NEXT (vpc);
3229 CASE (sem, INSN_SADD) : /* sadd */
3231 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3232 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3233 #define FLD(f) abuf->fields.fmt_empty.f
3234 int UNUSED written = 0;
3235 IADDR UNUSED pc = abuf->addr;
3236 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3239 DI opval = ADDDI (SRADI (GET_H_ACCUMS (((UINT) 1)), 16), GET_H_ACCUMS (((UINT) 0)));
3240 SET_H_ACCUMS (((UINT) 0), opval);
3241 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
3244 #undef FLD
3246 NEXT (vpc);
3248 CASE (sem, INSN_MACWU1) : /* macwu1 $src1,$src2 */
3250 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3251 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3252 #define FLD(f) abuf->fields.sfmt_st_plus.f
3253 int UNUSED written = 0;
3254 IADDR UNUSED pc = abuf->addr;
3255 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3258 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT) 1)), MULDI (EXTSIDI (* FLD (i_src1)), EXTSIDI (ANDSI (* FLD (i_src2), 65535)))), 8), 8);
3259 SET_H_ACCUMS (((UINT) 1), opval);
3260 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
3263 #undef FLD
3265 NEXT (vpc);
3267 CASE (sem, INSN_MSBLO) : /* msblo $src1,$src2 */
3269 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3270 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3271 #define FLD(f) abuf->fields.sfmt_st_plus.f
3272 int UNUSED written = 0;
3273 IADDR UNUSED pc = abuf->addr;
3274 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3277 DI opval = SRADI (SLLDI (SUBDI (GET_H_ACCUM (), SRADI (SLLDI (MULDI (EXTHIDI (TRUNCSIHI (* FLD (i_src1))), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))), 32), 16)), 8), 8);
3278 SET_H_ACCUM (opval);
3279 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
3282 #undef FLD
3284 NEXT (vpc);
3286 CASE (sem, INSN_MULWU1) : /* mulwu1 $src1,$src2 */
3288 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3289 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3290 #define FLD(f) abuf->fields.sfmt_st_plus.f
3291 int UNUSED written = 0;
3292 IADDR UNUSED pc = abuf->addr;
3293 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3296 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1)), EXTSIDI (ANDSI (* FLD (i_src2), 65535))), 16), 16);
3297 SET_H_ACCUMS (((UINT) 1), opval);
3298 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
3301 #undef FLD
3303 NEXT (vpc);
3305 CASE (sem, INSN_MACLH1) : /* maclh1 $src1,$src2 */
3307 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3308 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3309 #define FLD(f) abuf->fields.sfmt_st_plus.f
3310 int UNUSED written = 0;
3311 IADDR UNUSED pc = abuf->addr;
3312 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3315 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT) 1)), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (* FLD (i_src1))), SRASI (* FLD (i_src2), 16))), 16)), 8), 8);
3316 SET_H_ACCUMS (((UINT) 1), opval);
3317 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
3320 #undef FLD
3322 NEXT (vpc);
3324 CASE (sem, INSN_SC) : /* sc */
3326 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3327 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3328 #define FLD(f) abuf->fields.fmt_empty.f
3329 int UNUSED written = 0;
3330 IADDR UNUSED pc = abuf->addr;
3331 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3333 if (ZEXTBISI (CPU (h_cond)))
3334 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
3336 #undef FLD
3338 NEXT (vpc);
3340 CASE (sem, INSN_SNC) : /* snc */
3342 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3343 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3344 #define FLD(f) abuf->fields.fmt_empty.f
3345 int UNUSED written = 0;
3346 IADDR UNUSED pc = abuf->addr;
3347 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3349 if (ZEXTBISI (NOTBI (CPU (h_cond))))
3350 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
3352 #undef FLD
3354 NEXT (vpc);
3356 CASE (sem, INSN_CLRPSW) : /* clrpsw $uimm8 */
3358 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3359 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3360 #define FLD(f) abuf->fields.sfmt_clrpsw.f
3361 int UNUSED written = 0;
3362 IADDR UNUSED pc = abuf->addr;
3363 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3366 SI opval = ANDSI (GET_H_CR (((UINT) 0)), ORSI (INVBI (FLD (f_uimm8)), 65280));
3367 SET_H_CR (((UINT) 0), opval);
3368 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
3371 #undef FLD
3373 NEXT (vpc);
3375 CASE (sem, INSN_SETPSW) : /* setpsw $uimm8 */
3377 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3378 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3379 #define FLD(f) abuf->fields.sfmt_clrpsw.f
3380 int UNUSED written = 0;
3381 IADDR UNUSED pc = abuf->addr;
3382 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3385 SI opval = FLD (f_uimm8);
3386 SET_H_CR (((UINT) 0), opval);
3387 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
3390 #undef FLD
3392 NEXT (vpc);
3394 CASE (sem, INSN_BSET) : /* bset $uimm3,@($slo16,$sr) */
3396 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3397 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3398 #define FLD(f) abuf->fields.sfmt_bset.f
3399 int UNUSED written = 0;
3400 IADDR UNUSED pc = abuf->addr;
3401 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3404 QI opval = ORQI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))), SLLSI (1, SUBSI (7, FLD (f_uimm3))));
3405 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)), opval);
3406 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3409 #undef FLD
3411 NEXT (vpc);
3413 CASE (sem, INSN_BCLR) : /* bclr $uimm3,@($slo16,$sr) */
3415 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3416 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3417 #define FLD(f) abuf->fields.sfmt_bset.f
3418 int UNUSED written = 0;
3419 IADDR UNUSED pc = abuf->addr;
3420 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3423 QI opval = ANDQI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))), INVQI (SLLSI (1, SUBSI (7, FLD (f_uimm3)))));
3424 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)), opval);
3425 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3428 #undef FLD
3430 NEXT (vpc);
3432 CASE (sem, INSN_BTST) : /* btst $uimm3,$sr */
3434 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3435 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3436 #define FLD(f) abuf->fields.sfmt_bset.f
3437 int UNUSED written = 0;
3438 IADDR UNUSED pc = abuf->addr;
3439 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3442 BI opval = ANDQI (SRLSI (* FLD (i_sr), SUBSI (7, FLD (f_uimm3))), 1);
3443 CPU (h_cond) = opval;
3444 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
3447 #undef FLD
3449 NEXT (vpc);
3451 CASE (sem, INSN_PAR_ADD) : /* add $dr,$sr */
3453 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3454 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3455 #define FLD(f) abuf->fields.sfmt_add.f
3456 #define OPRND(f) par_exec->operands.sfmt_add.f
3457 int UNUSED written = 0;
3458 IADDR UNUSED pc = abuf->addr;
3459 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3462 SI opval = ADDSI (* FLD (i_dr), * FLD (i_sr));
3463 OPRND (dr) = opval;
3464 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3467 #undef OPRND
3468 #undef FLD
3470 NEXT (vpc);
3472 CASE (sem, INSN_WRITE_ADD) : /* add $dr,$sr */
3474 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3475 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3476 #define FLD(f) abuf->fields.sfmt_add.f
3477 #define OPRND(f) par_exec->operands.sfmt_add.f
3478 int UNUSED written = abuf->written;
3479 IADDR UNUSED pc = abuf->addr;
3480 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3482 * FLD (i_dr) = OPRND (dr);
3484 #undef OPRND
3485 #undef FLD
3487 NEXT (vpc);
3489 CASE (sem, INSN_PAR_AND) : /* and $dr,$sr */
3491 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3492 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3493 #define FLD(f) abuf->fields.sfmt_add.f
3494 #define OPRND(f) par_exec->operands.sfmt_add.f
3495 int UNUSED written = 0;
3496 IADDR UNUSED pc = abuf->addr;
3497 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3500 SI opval = ANDSI (* FLD (i_dr), * FLD (i_sr));
3501 OPRND (dr) = opval;
3502 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3505 #undef OPRND
3506 #undef FLD
3508 NEXT (vpc);
3510 CASE (sem, INSN_WRITE_AND) : /* and $dr,$sr */
3512 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3513 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3514 #define FLD(f) abuf->fields.sfmt_add.f
3515 #define OPRND(f) par_exec->operands.sfmt_add.f
3516 int UNUSED written = abuf->written;
3517 IADDR UNUSED pc = abuf->addr;
3518 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3520 * FLD (i_dr) = OPRND (dr);
3522 #undef OPRND
3523 #undef FLD
3525 NEXT (vpc);
3527 CASE (sem, INSN_PAR_OR) : /* or $dr,$sr */
3529 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3530 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3531 #define FLD(f) abuf->fields.sfmt_add.f
3532 #define OPRND(f) par_exec->operands.sfmt_add.f
3533 int UNUSED written = 0;
3534 IADDR UNUSED pc = abuf->addr;
3535 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3538 SI opval = ORSI (* FLD (i_dr), * FLD (i_sr));
3539 OPRND (dr) = opval;
3540 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3543 #undef OPRND
3544 #undef FLD
3546 NEXT (vpc);
3548 CASE (sem, INSN_WRITE_OR) : /* or $dr,$sr */
3550 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3551 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3552 #define FLD(f) abuf->fields.sfmt_add.f
3553 #define OPRND(f) par_exec->operands.sfmt_add.f
3554 int UNUSED written = abuf->written;
3555 IADDR UNUSED pc = abuf->addr;
3556 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3558 * FLD (i_dr) = OPRND (dr);
3560 #undef OPRND
3561 #undef FLD
3563 NEXT (vpc);
3565 CASE (sem, INSN_PAR_XOR) : /* xor $dr,$sr */
3567 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3568 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3569 #define FLD(f) abuf->fields.sfmt_add.f
3570 #define OPRND(f) par_exec->operands.sfmt_add.f
3571 int UNUSED written = 0;
3572 IADDR UNUSED pc = abuf->addr;
3573 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3576 SI opval = XORSI (* FLD (i_dr), * FLD (i_sr));
3577 OPRND (dr) = opval;
3578 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3581 #undef OPRND
3582 #undef FLD
3584 NEXT (vpc);
3586 CASE (sem, INSN_WRITE_XOR) : /* xor $dr,$sr */
3588 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3589 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3590 #define FLD(f) abuf->fields.sfmt_add.f
3591 #define OPRND(f) par_exec->operands.sfmt_add.f
3592 int UNUSED written = abuf->written;
3593 IADDR UNUSED pc = abuf->addr;
3594 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3596 * FLD (i_dr) = OPRND (dr);
3598 #undef OPRND
3599 #undef FLD
3601 NEXT (vpc);
3603 CASE (sem, INSN_PAR_ADDI) : /* addi $dr,$simm8 */
3605 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3606 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3607 #define FLD(f) abuf->fields.sfmt_addi.f
3608 #define OPRND(f) par_exec->operands.sfmt_addi.f
3609 int UNUSED written = 0;
3610 IADDR UNUSED pc = abuf->addr;
3611 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3614 SI opval = ADDSI (* FLD (i_dr), FLD (f_simm8));
3615 OPRND (dr) = opval;
3616 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3619 #undef OPRND
3620 #undef FLD
3622 NEXT (vpc);
3624 CASE (sem, INSN_WRITE_ADDI) : /* addi $dr,$simm8 */
3626 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3627 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3628 #define FLD(f) abuf->fields.sfmt_addi.f
3629 #define OPRND(f) par_exec->operands.sfmt_addi.f
3630 int UNUSED written = abuf->written;
3631 IADDR UNUSED pc = abuf->addr;
3632 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3634 * FLD (i_dr) = OPRND (dr);
3636 #undef OPRND
3637 #undef FLD
3639 NEXT (vpc);
3641 CASE (sem, INSN_PAR_ADDV) : /* addv $dr,$sr */
3643 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3644 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3645 #define FLD(f) abuf->fields.sfmt_add.f
3646 #define OPRND(f) par_exec->operands.sfmt_addv.f
3647 int UNUSED written = 0;
3648 IADDR UNUSED pc = abuf->addr;
3649 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3652 SI temp0;BI temp1;
3653 temp0 = ADDSI (* FLD (i_dr), * FLD (i_sr));
3654 temp1 = ADDOFSI (* FLD (i_dr), * FLD (i_sr), 0);
3656 SI opval = temp0;
3657 OPRND (dr) = opval;
3658 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3661 BI opval = temp1;
3662 OPRND (condbit) = opval;
3663 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
3667 #undef OPRND
3668 #undef FLD
3670 NEXT (vpc);
3672 CASE (sem, INSN_WRITE_ADDV) : /* addv $dr,$sr */
3674 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3675 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3676 #define FLD(f) abuf->fields.sfmt_add.f
3677 #define OPRND(f) par_exec->operands.sfmt_addv.f
3678 int UNUSED written = abuf->written;
3679 IADDR UNUSED pc = abuf->addr;
3680 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3682 CPU (h_cond) = OPRND (condbit);
3683 * FLD (i_dr) = OPRND (dr);
3685 #undef OPRND
3686 #undef FLD
3688 NEXT (vpc);
3690 CASE (sem, INSN_PAR_ADDX) : /* addx $dr,$sr */
3692 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3693 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3694 #define FLD(f) abuf->fields.sfmt_add.f
3695 #define OPRND(f) par_exec->operands.sfmt_addx.f
3696 int UNUSED written = 0;
3697 IADDR UNUSED pc = abuf->addr;
3698 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3701 SI temp0;BI temp1;
3702 temp0 = ADDCSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
3703 temp1 = ADDCFSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
3705 SI opval = temp0;
3706 OPRND (dr) = opval;
3707 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3710 BI opval = temp1;
3711 OPRND (condbit) = opval;
3712 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
3716 #undef OPRND
3717 #undef FLD
3719 NEXT (vpc);
3721 CASE (sem, INSN_WRITE_ADDX) : /* addx $dr,$sr */
3723 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3724 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3725 #define FLD(f) abuf->fields.sfmt_add.f
3726 #define OPRND(f) par_exec->operands.sfmt_addx.f
3727 int UNUSED written = abuf->written;
3728 IADDR UNUSED pc = abuf->addr;
3729 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3731 CPU (h_cond) = OPRND (condbit);
3732 * FLD (i_dr) = OPRND (dr);
3734 #undef OPRND
3735 #undef FLD
3737 NEXT (vpc);
3739 CASE (sem, INSN_PAR_BC8) : /* bc.s $disp8 */
3741 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3742 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3743 #define FLD(f) abuf->fields.sfmt_bl8.f
3744 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3745 int UNUSED written = 0;
3746 IADDR UNUSED pc = abuf->addr;
3747 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3749 if (CPU (h_cond)) {
3751 USI opval = FLD (i_disp8);
3752 OPRND (pc) = opval;
3753 written |= (1 << 2);
3754 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3758 abuf->written = written;
3759 #undef OPRND
3760 #undef FLD
3762 NEXT (vpc);
3764 CASE (sem, INSN_WRITE_BC8) : /* bc.s $disp8 */
3766 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3767 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3768 #define FLD(f) abuf->fields.sfmt_bl8.f
3769 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3770 int UNUSED written = abuf->written;
3771 IADDR UNUSED pc = abuf->addr;
3772 SEM_BRANCH_INIT
3773 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3775 if (written & (1 << 2))
3777 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
3780 SEM_BRANCH_FINI (vpc);
3781 #undef OPRND
3782 #undef FLD
3784 NEXT (vpc);
3786 CASE (sem, INSN_PAR_BL8) : /* bl.s $disp8 */
3788 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3789 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3790 #define FLD(f) abuf->fields.sfmt_bl8.f
3791 #define OPRND(f) par_exec->operands.sfmt_bl8.f
3792 int UNUSED written = 0;
3793 IADDR UNUSED pc = abuf->addr;
3794 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3798 SI opval = ADDSI (ANDSI (pc, -4), 4);
3799 OPRND (h_gr_SI_14) = opval;
3800 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3803 USI opval = FLD (i_disp8);
3804 OPRND (pc) = opval;
3805 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3809 #undef OPRND
3810 #undef FLD
3812 NEXT (vpc);
3814 CASE (sem, INSN_WRITE_BL8) : /* bl.s $disp8 */
3816 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3817 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3818 #define FLD(f) abuf->fields.sfmt_bl8.f
3819 #define OPRND(f) par_exec->operands.sfmt_bl8.f
3820 int UNUSED written = abuf->written;
3821 IADDR UNUSED pc = abuf->addr;
3822 SEM_BRANCH_INIT
3823 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3825 CPU (h_gr[((UINT) 14)]) = OPRND (h_gr_SI_14);
3826 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
3828 SEM_BRANCH_FINI (vpc);
3829 #undef OPRND
3830 #undef FLD
3832 NEXT (vpc);
3834 CASE (sem, INSN_PAR_BCL8) : /* bcl.s $disp8 */
3836 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3837 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3838 #define FLD(f) abuf->fields.sfmt_bl8.f
3839 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3840 int UNUSED written = 0;
3841 IADDR UNUSED pc = abuf->addr;
3842 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3844 if (CPU (h_cond)) {
3847 SI opval = ADDSI (ANDSI (pc, -4), 4);
3848 OPRND (h_gr_SI_14) = opval;
3849 written |= (1 << 3);
3850 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3853 USI opval = FLD (i_disp8);
3854 OPRND (pc) = opval;
3855 written |= (1 << 4);
3856 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3861 abuf->written = written;
3862 #undef OPRND
3863 #undef FLD
3865 NEXT (vpc);
3867 CASE (sem, INSN_WRITE_BCL8) : /* bcl.s $disp8 */
3869 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3870 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3871 #define FLD(f) abuf->fields.sfmt_bl8.f
3872 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3873 int UNUSED written = abuf->written;
3874 IADDR UNUSED pc = abuf->addr;
3875 SEM_BRANCH_INIT
3876 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3878 if (written & (1 << 3))
3880 CPU (h_gr[((UINT) 14)]) = OPRND (h_gr_SI_14);
3882 if (written & (1 << 4))
3884 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
3887 SEM_BRANCH_FINI (vpc);
3888 #undef OPRND
3889 #undef FLD
3891 NEXT (vpc);
3893 CASE (sem, INSN_PAR_BNC8) : /* bnc.s $disp8 */
3895 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3896 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3897 #define FLD(f) abuf->fields.sfmt_bl8.f
3898 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3899 int UNUSED written = 0;
3900 IADDR UNUSED pc = abuf->addr;
3901 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3903 if (NOTBI (CPU (h_cond))) {
3905 USI opval = FLD (i_disp8);
3906 OPRND (pc) = opval;
3907 written |= (1 << 2);
3908 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3912 abuf->written = written;
3913 #undef OPRND
3914 #undef FLD
3916 NEXT (vpc);
3918 CASE (sem, INSN_WRITE_BNC8) : /* bnc.s $disp8 */
3920 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3921 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3922 #define FLD(f) abuf->fields.sfmt_bl8.f
3923 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3924 int UNUSED written = abuf->written;
3925 IADDR UNUSED pc = abuf->addr;
3926 SEM_BRANCH_INIT
3927 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3929 if (written & (1 << 2))
3931 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
3934 SEM_BRANCH_FINI (vpc);
3935 #undef OPRND
3936 #undef FLD
3938 NEXT (vpc);
3940 CASE (sem, INSN_PAR_BRA8) : /* bra.s $disp8 */
3942 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3943 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3944 #define FLD(f) abuf->fields.sfmt_bl8.f
3945 #define OPRND(f) par_exec->operands.sfmt_bra8.f
3946 int UNUSED written = 0;
3947 IADDR UNUSED pc = abuf->addr;
3948 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3951 USI opval = FLD (i_disp8);
3952 OPRND (pc) = opval;
3953 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3956 #undef OPRND
3957 #undef FLD
3959 NEXT (vpc);
3961 CASE (sem, INSN_WRITE_BRA8) : /* bra.s $disp8 */
3963 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3964 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
3965 #define FLD(f) abuf->fields.sfmt_bl8.f
3966 #define OPRND(f) par_exec->operands.sfmt_bra8.f
3967 int UNUSED written = abuf->written;
3968 IADDR UNUSED pc = abuf->addr;
3969 SEM_BRANCH_INIT
3970 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
3972 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
3974 SEM_BRANCH_FINI (vpc);
3975 #undef OPRND
3976 #undef FLD
3978 NEXT (vpc);
3980 CASE (sem, INSN_PAR_BNCL8) : /* bncl.s $disp8 */
3982 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3983 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3984 #define FLD(f) abuf->fields.sfmt_bl8.f
3985 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3986 int UNUSED written = 0;
3987 IADDR UNUSED pc = abuf->addr;
3988 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3990 if (NOTBI (CPU (h_cond))) {
3993 SI opval = ADDSI (ANDSI (pc, -4), 4);
3994 OPRND (h_gr_SI_14) = opval;
3995 written |= (1 << 3);
3996 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3999 USI opval = FLD (i_disp8);
4000 OPRND (pc) = opval;
4001 written |= (1 << 4);
4002 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4007 abuf->written = written;
4008 #undef OPRND
4009 #undef FLD
4011 NEXT (vpc);
4013 CASE (sem, INSN_WRITE_BNCL8) : /* bncl.s $disp8 */
4015 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4016 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4017 #define FLD(f) abuf->fields.sfmt_bl8.f
4018 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
4019 int UNUSED written = abuf->written;
4020 IADDR UNUSED pc = abuf->addr;
4021 SEM_BRANCH_INIT
4022 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4024 if (written & (1 << 3))
4026 CPU (h_gr[((UINT) 14)]) = OPRND (h_gr_SI_14);
4028 if (written & (1 << 4))
4030 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
4033 SEM_BRANCH_FINI (vpc);
4034 #undef OPRND
4035 #undef FLD
4037 NEXT (vpc);
4039 CASE (sem, INSN_PAR_CMP) : /* cmp $src1,$src2 */
4041 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4042 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4043 #define FLD(f) abuf->fields.sfmt_st_plus.f
4044 #define OPRND(f) par_exec->operands.sfmt_cmp.f
4045 int UNUSED written = 0;
4046 IADDR UNUSED pc = abuf->addr;
4047 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4050 BI opval = LTSI (* FLD (i_src1), * FLD (i_src2));
4051 OPRND (condbit) = opval;
4052 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
4055 #undef OPRND
4056 #undef FLD
4058 NEXT (vpc);
4060 CASE (sem, INSN_WRITE_CMP) : /* cmp $src1,$src2 */
4062 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4063 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4064 #define FLD(f) abuf->fields.sfmt_st_plus.f
4065 #define OPRND(f) par_exec->operands.sfmt_cmp.f
4066 int UNUSED written = abuf->written;
4067 IADDR UNUSED pc = abuf->addr;
4068 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4070 CPU (h_cond) = OPRND (condbit);
4072 #undef OPRND
4073 #undef FLD
4075 NEXT (vpc);
4077 CASE (sem, INSN_PAR_CMPU) : /* cmpu $src1,$src2 */
4079 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4080 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4081 #define FLD(f) abuf->fields.sfmt_st_plus.f
4082 #define OPRND(f) par_exec->operands.sfmt_cmp.f
4083 int UNUSED written = 0;
4084 IADDR UNUSED pc = abuf->addr;
4085 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4088 BI opval = LTUSI (* FLD (i_src1), * FLD (i_src2));
4089 OPRND (condbit) = opval;
4090 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
4093 #undef OPRND
4094 #undef FLD
4096 NEXT (vpc);
4098 CASE (sem, INSN_WRITE_CMPU) : /* cmpu $src1,$src2 */
4100 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4101 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4102 #define FLD(f) abuf->fields.sfmt_st_plus.f
4103 #define OPRND(f) par_exec->operands.sfmt_cmp.f
4104 int UNUSED written = abuf->written;
4105 IADDR UNUSED pc = abuf->addr;
4106 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4108 CPU (h_cond) = OPRND (condbit);
4110 #undef OPRND
4111 #undef FLD
4113 NEXT (vpc);
4115 CASE (sem, INSN_PAR_CMPEQ) : /* cmpeq $src1,$src2 */
4117 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4118 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4119 #define FLD(f) abuf->fields.sfmt_st_plus.f
4120 #define OPRND(f) par_exec->operands.sfmt_cmp.f
4121 int UNUSED written = 0;
4122 IADDR UNUSED pc = abuf->addr;
4123 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4126 BI opval = EQSI (* FLD (i_src1), * FLD (i_src2));
4127 OPRND (condbit) = opval;
4128 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
4131 #undef OPRND
4132 #undef FLD
4134 NEXT (vpc);
4136 CASE (sem, INSN_WRITE_CMPEQ) : /* cmpeq $src1,$src2 */
4138 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4139 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4140 #define FLD(f) abuf->fields.sfmt_st_plus.f
4141 #define OPRND(f) par_exec->operands.sfmt_cmp.f
4142 int UNUSED written = abuf->written;
4143 IADDR UNUSED pc = abuf->addr;
4144 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4146 CPU (h_cond) = OPRND (condbit);
4148 #undef OPRND
4149 #undef FLD
4151 NEXT (vpc);
4153 CASE (sem, INSN_PAR_CMPZ) : /* cmpz $src2 */
4155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4157 #define FLD(f) abuf->fields.sfmt_st_plus.f
4158 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
4159 int UNUSED written = 0;
4160 IADDR UNUSED pc = abuf->addr;
4161 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4164 BI opval = EQSI (* FLD (i_src2), 0);
4165 OPRND (condbit) = opval;
4166 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
4169 #undef OPRND
4170 #undef FLD
4172 NEXT (vpc);
4174 CASE (sem, INSN_WRITE_CMPZ) : /* cmpz $src2 */
4176 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4177 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4178 #define FLD(f) abuf->fields.sfmt_st_plus.f
4179 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
4180 int UNUSED written = abuf->written;
4181 IADDR UNUSED pc = abuf->addr;
4182 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4184 CPU (h_cond) = OPRND (condbit);
4186 #undef OPRND
4187 #undef FLD
4189 NEXT (vpc);
4191 CASE (sem, INSN_PAR_JC) : /* jc $sr */
4193 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4194 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4195 #define FLD(f) abuf->fields.sfmt_jl.f
4196 #define OPRND(f) par_exec->operands.sfmt_jc.f
4197 int UNUSED written = 0;
4198 IADDR UNUSED pc = abuf->addr;
4199 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4201 if (CPU (h_cond)) {
4203 USI opval = ANDSI (* FLD (i_sr), -4);
4204 OPRND (pc) = opval;
4205 written |= (1 << 2);
4206 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4210 abuf->written = written;
4211 #undef OPRND
4212 #undef FLD
4214 NEXT (vpc);
4216 CASE (sem, INSN_WRITE_JC) : /* jc $sr */
4218 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4219 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4220 #define FLD(f) abuf->fields.sfmt_jl.f
4221 #define OPRND(f) par_exec->operands.sfmt_jc.f
4222 int UNUSED written = abuf->written;
4223 IADDR UNUSED pc = abuf->addr;
4224 SEM_BRANCH_INIT
4225 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4227 if (written & (1 << 2))
4229 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
4232 SEM_BRANCH_FINI (vpc);
4233 #undef OPRND
4234 #undef FLD
4236 NEXT (vpc);
4238 CASE (sem, INSN_PAR_JNC) : /* jnc $sr */
4240 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4241 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4242 #define FLD(f) abuf->fields.sfmt_jl.f
4243 #define OPRND(f) par_exec->operands.sfmt_jc.f
4244 int UNUSED written = 0;
4245 IADDR UNUSED pc = abuf->addr;
4246 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4248 if (NOTBI (CPU (h_cond))) {
4250 USI opval = ANDSI (* FLD (i_sr), -4);
4251 OPRND (pc) = opval;
4252 written |= (1 << 2);
4253 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4257 abuf->written = written;
4258 #undef OPRND
4259 #undef FLD
4261 NEXT (vpc);
4263 CASE (sem, INSN_WRITE_JNC) : /* jnc $sr */
4265 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4266 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4267 #define FLD(f) abuf->fields.sfmt_jl.f
4268 #define OPRND(f) par_exec->operands.sfmt_jc.f
4269 int UNUSED written = abuf->written;
4270 IADDR UNUSED pc = abuf->addr;
4271 SEM_BRANCH_INIT
4272 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4274 if (written & (1 << 2))
4276 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
4279 SEM_BRANCH_FINI (vpc);
4280 #undef OPRND
4281 #undef FLD
4283 NEXT (vpc);
4285 CASE (sem, INSN_PAR_JL) : /* jl $sr */
4287 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4288 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4289 #define FLD(f) abuf->fields.sfmt_jl.f
4290 #define OPRND(f) par_exec->operands.sfmt_jl.f
4291 int UNUSED written = 0;
4292 IADDR UNUSED pc = abuf->addr;
4293 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4296 SI temp0;USI temp1;
4297 temp0 = ADDSI (ANDSI (pc, -4), 4);
4298 temp1 = ANDSI (* FLD (i_sr), -4);
4300 SI opval = temp0;
4301 OPRND (h_gr_SI_14) = opval;
4302 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4305 USI opval = temp1;
4306 OPRND (pc) = opval;
4307 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4311 #undef OPRND
4312 #undef FLD
4314 NEXT (vpc);
4316 CASE (sem, INSN_WRITE_JL) : /* jl $sr */
4318 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4319 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4320 #define FLD(f) abuf->fields.sfmt_jl.f
4321 #define OPRND(f) par_exec->operands.sfmt_jl.f
4322 int UNUSED written = abuf->written;
4323 IADDR UNUSED pc = abuf->addr;
4324 SEM_BRANCH_INIT
4325 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4327 CPU (h_gr[((UINT) 14)]) = OPRND (h_gr_SI_14);
4328 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
4330 SEM_BRANCH_FINI (vpc);
4331 #undef OPRND
4332 #undef FLD
4334 NEXT (vpc);
4336 CASE (sem, INSN_PAR_JMP) : /* jmp $sr */
4338 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4339 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4340 #define FLD(f) abuf->fields.sfmt_jl.f
4341 #define OPRND(f) par_exec->operands.sfmt_jmp.f
4342 int UNUSED written = 0;
4343 IADDR UNUSED pc = abuf->addr;
4344 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4347 USI opval = ANDSI (* FLD (i_sr), -4);
4348 OPRND (pc) = opval;
4349 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4352 #undef OPRND
4353 #undef FLD
4355 NEXT (vpc);
4357 CASE (sem, INSN_WRITE_JMP) : /* jmp $sr */
4359 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4360 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4361 #define FLD(f) abuf->fields.sfmt_jl.f
4362 #define OPRND(f) par_exec->operands.sfmt_jmp.f
4363 int UNUSED written = abuf->written;
4364 IADDR UNUSED pc = abuf->addr;
4365 SEM_BRANCH_INIT
4366 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4368 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
4370 SEM_BRANCH_FINI (vpc);
4371 #undef OPRND
4372 #undef FLD
4374 NEXT (vpc);
4376 CASE (sem, INSN_PAR_LD) : /* ld $dr,@$sr */
4378 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4379 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4380 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4381 #define OPRND(f) par_exec->operands.sfmt_ld.f
4382 int UNUSED written = 0;
4383 IADDR UNUSED pc = abuf->addr;
4384 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4387 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_sr));
4388 OPRND (dr) = opval;
4389 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4392 #undef OPRND
4393 #undef FLD
4395 NEXT (vpc);
4397 CASE (sem, INSN_WRITE_LD) : /* ld $dr,@$sr */
4399 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4400 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4401 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4402 #define OPRND(f) par_exec->operands.sfmt_ld.f
4403 int UNUSED written = abuf->written;
4404 IADDR UNUSED pc = abuf->addr;
4405 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4407 * FLD (i_dr) = OPRND (dr);
4409 #undef OPRND
4410 #undef FLD
4412 NEXT (vpc);
4414 CASE (sem, INSN_PAR_LDB) : /* ldb $dr,@$sr */
4416 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4417 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4418 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4419 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4420 int UNUSED written = 0;
4421 IADDR UNUSED pc = abuf->addr;
4422 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4425 SI opval = EXTQISI (GETMEMQI (current_cpu, pc, * FLD (i_sr)));
4426 OPRND (dr) = opval;
4427 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4430 #undef OPRND
4431 #undef FLD
4433 NEXT (vpc);
4435 CASE (sem, INSN_WRITE_LDB) : /* ldb $dr,@$sr */
4437 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4438 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4439 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4440 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4441 int UNUSED written = abuf->written;
4442 IADDR UNUSED pc = abuf->addr;
4443 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4445 * FLD (i_dr) = OPRND (dr);
4447 #undef OPRND
4448 #undef FLD
4450 NEXT (vpc);
4452 CASE (sem, INSN_PAR_LDH) : /* ldh $dr,@$sr */
4454 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4455 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4456 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4457 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4458 int UNUSED written = 0;
4459 IADDR UNUSED pc = abuf->addr;
4460 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4463 SI opval = EXTHISI (GETMEMHI (current_cpu, pc, * FLD (i_sr)));
4464 OPRND (dr) = opval;
4465 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4468 #undef OPRND
4469 #undef FLD
4471 NEXT (vpc);
4473 CASE (sem, INSN_WRITE_LDH) : /* ldh $dr,@$sr */
4475 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4476 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4477 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4478 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4479 int UNUSED written = abuf->written;
4480 IADDR UNUSED pc = abuf->addr;
4481 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4483 * FLD (i_dr) = OPRND (dr);
4485 #undef OPRND
4486 #undef FLD
4488 NEXT (vpc);
4490 CASE (sem, INSN_PAR_LDUB) : /* ldub $dr,@$sr */
4492 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4493 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4494 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4495 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4496 int UNUSED written = 0;
4497 IADDR UNUSED pc = abuf->addr;
4498 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4501 SI opval = ZEXTQISI (GETMEMQI (current_cpu, pc, * FLD (i_sr)));
4502 OPRND (dr) = opval;
4503 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4506 #undef OPRND
4507 #undef FLD
4509 NEXT (vpc);
4511 CASE (sem, INSN_WRITE_LDUB) : /* ldub $dr,@$sr */
4513 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4514 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4515 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4516 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4517 int UNUSED written = abuf->written;
4518 IADDR UNUSED pc = abuf->addr;
4519 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4521 * FLD (i_dr) = OPRND (dr);
4523 #undef OPRND
4524 #undef FLD
4526 NEXT (vpc);
4528 CASE (sem, INSN_PAR_LDUH) : /* lduh $dr,@$sr */
4530 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4531 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4532 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4533 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4534 int UNUSED written = 0;
4535 IADDR UNUSED pc = abuf->addr;
4536 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4539 SI opval = ZEXTHISI (GETMEMHI (current_cpu, pc, * FLD (i_sr)));
4540 OPRND (dr) = opval;
4541 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4544 #undef OPRND
4545 #undef FLD
4547 NEXT (vpc);
4549 CASE (sem, INSN_WRITE_LDUH) : /* lduh $dr,@$sr */
4551 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4552 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4553 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4554 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4555 int UNUSED written = abuf->written;
4556 IADDR UNUSED pc = abuf->addr;
4557 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4559 * FLD (i_dr) = OPRND (dr);
4561 #undef OPRND
4562 #undef FLD
4564 NEXT (vpc);
4566 CASE (sem, INSN_PAR_LD_PLUS) : /* ld $dr,@$sr+ */
4568 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4569 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4570 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4571 #define OPRND(f) par_exec->operands.sfmt_ld_plus.f
4572 int UNUSED written = 0;
4573 IADDR UNUSED pc = abuf->addr;
4574 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4577 SI temp0;SI temp1;
4578 temp0 = GETMEMSI (current_cpu, pc, * FLD (i_sr));
4579 temp1 = ADDSI (* FLD (i_sr), 4);
4581 SI opval = temp0;
4582 OPRND (dr) = opval;
4583 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4586 SI opval = temp1;
4587 OPRND (sr) = opval;
4588 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4592 #undef OPRND
4593 #undef FLD
4595 NEXT (vpc);
4597 CASE (sem, INSN_WRITE_LD_PLUS) : /* ld $dr,@$sr+ */
4599 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4600 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4601 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4602 #define OPRND(f) par_exec->operands.sfmt_ld_plus.f
4603 int UNUSED written = abuf->written;
4604 IADDR UNUSED pc = abuf->addr;
4605 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4607 * FLD (i_dr) = OPRND (dr);
4608 * FLD (i_sr) = OPRND (sr);
4610 #undef OPRND
4611 #undef FLD
4613 NEXT (vpc);
4615 CASE (sem, INSN_PAR_LDI8) : /* ldi8 $dr,$simm8 */
4617 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4618 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4619 #define FLD(f) abuf->fields.sfmt_addi.f
4620 #define OPRND(f) par_exec->operands.sfmt_ldi8.f
4621 int UNUSED written = 0;
4622 IADDR UNUSED pc = abuf->addr;
4623 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4626 SI opval = FLD (f_simm8);
4627 OPRND (dr) = opval;
4628 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4631 #undef OPRND
4632 #undef FLD
4634 NEXT (vpc);
4636 CASE (sem, INSN_WRITE_LDI8) : /* ldi8 $dr,$simm8 */
4638 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4639 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4640 #define FLD(f) abuf->fields.sfmt_addi.f
4641 #define OPRND(f) par_exec->operands.sfmt_ldi8.f
4642 int UNUSED written = abuf->written;
4643 IADDR UNUSED pc = abuf->addr;
4644 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4646 * FLD (i_dr) = OPRND (dr);
4648 #undef OPRND
4649 #undef FLD
4651 NEXT (vpc);
4653 CASE (sem, INSN_PAR_LOCK) : /* lock $dr,@$sr */
4655 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4656 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4657 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4658 #define OPRND(f) par_exec->operands.sfmt_lock.f
4659 int UNUSED written = 0;
4660 IADDR UNUSED pc = abuf->addr;
4661 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4665 BI opval = 1;
4666 OPRND (h_lock_BI) = opval;
4667 TRACE_RESULT (current_cpu, abuf, "lock", 'x', opval);
4670 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_sr));
4671 OPRND (dr) = opval;
4672 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4676 #undef OPRND
4677 #undef FLD
4679 NEXT (vpc);
4681 CASE (sem, INSN_WRITE_LOCK) : /* lock $dr,@$sr */
4683 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4684 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4685 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4686 #define OPRND(f) par_exec->operands.sfmt_lock.f
4687 int UNUSED written = abuf->written;
4688 IADDR UNUSED pc = abuf->addr;
4689 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4691 * FLD (i_dr) = OPRND (dr);
4692 CPU (h_lock) = OPRND (h_lock_BI);
4694 #undef OPRND
4695 #undef FLD
4697 NEXT (vpc);
4699 CASE (sem, INSN_PAR_MACHI_A) : /* machi $src1,$src2,$acc */
4701 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4702 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4703 #define FLD(f) abuf->fields.sfmt_machi_a.f
4704 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4705 int UNUSED written = 0;
4706 IADDR UNUSED pc = abuf->addr;
4707 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4710 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (ANDSI (* FLD (i_src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16))))), 8), 8);
4711 OPRND (acc) = opval;
4712 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4715 #undef OPRND
4716 #undef FLD
4718 NEXT (vpc);
4720 CASE (sem, INSN_WRITE_MACHI_A) : /* machi $src1,$src2,$acc */
4722 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4723 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4724 #define FLD(f) abuf->fields.sfmt_machi_a.f
4725 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4726 int UNUSED written = abuf->written;
4727 IADDR UNUSED pc = abuf->addr;
4728 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4730 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4732 #undef OPRND
4733 #undef FLD
4735 NEXT (vpc);
4737 CASE (sem, INSN_PAR_MACLO_A) : /* maclo $src1,$src2,$acc */
4739 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4740 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4741 #define FLD(f) abuf->fields.sfmt_machi_a.f
4742 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4743 int UNUSED written = 0;
4744 IADDR UNUSED pc = abuf->addr;
4745 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4748 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (SLLSI (* FLD (i_src1), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2))))), 8), 8);
4749 OPRND (acc) = opval;
4750 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4753 #undef OPRND
4754 #undef FLD
4756 NEXT (vpc);
4758 CASE (sem, INSN_WRITE_MACLO_A) : /* maclo $src1,$src2,$acc */
4760 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4761 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4762 #define FLD(f) abuf->fields.sfmt_machi_a.f
4763 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4764 int UNUSED written = abuf->written;
4765 IADDR UNUSED pc = abuf->addr;
4766 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4768 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4770 #undef OPRND
4771 #undef FLD
4773 NEXT (vpc);
4775 CASE (sem, INSN_PAR_MACWHI_A) : /* macwhi $src1,$src2,$acc */
4777 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4778 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4779 #define FLD(f) abuf->fields.sfmt_machi_a.f
4780 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4781 int UNUSED written = 0;
4782 IADDR UNUSED pc = abuf->addr;
4783 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4786 DI opval = ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16)))));
4787 OPRND (acc) = opval;
4788 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4791 #undef OPRND
4792 #undef FLD
4794 NEXT (vpc);
4796 CASE (sem, INSN_WRITE_MACWHI_A) : /* macwhi $src1,$src2,$acc */
4798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4799 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4800 #define FLD(f) abuf->fields.sfmt_machi_a.f
4801 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4802 int UNUSED written = abuf->written;
4803 IADDR UNUSED pc = abuf->addr;
4804 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4806 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4808 #undef OPRND
4809 #undef FLD
4811 NEXT (vpc);
4813 CASE (sem, INSN_PAR_MACWLO_A) : /* macwlo $src1,$src2,$acc */
4815 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4816 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4817 #define FLD(f) abuf->fields.sfmt_machi_a.f
4818 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4819 int UNUSED written = 0;
4820 IADDR UNUSED pc = abuf->addr;
4821 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4824 DI opval = ADDDI (GET_H_ACCUMS (FLD (f_acc)), MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))));
4825 OPRND (acc) = opval;
4826 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4829 #undef OPRND
4830 #undef FLD
4832 NEXT (vpc);
4834 CASE (sem, INSN_WRITE_MACWLO_A) : /* macwlo $src1,$src2,$acc */
4836 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4837 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4838 #define FLD(f) abuf->fields.sfmt_machi_a.f
4839 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4840 int UNUSED written = abuf->written;
4841 IADDR UNUSED pc = abuf->addr;
4842 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4844 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4846 #undef OPRND
4847 #undef FLD
4849 NEXT (vpc);
4851 CASE (sem, INSN_PAR_MUL) : /* mul $dr,$sr */
4853 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4854 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4855 #define FLD(f) abuf->fields.sfmt_add.f
4856 #define OPRND(f) par_exec->operands.sfmt_add.f
4857 int UNUSED written = 0;
4858 IADDR UNUSED pc = abuf->addr;
4859 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4862 SI opval = MULSI (* FLD (i_dr), * FLD (i_sr));
4863 OPRND (dr) = opval;
4864 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
4867 #undef OPRND
4868 #undef FLD
4870 NEXT (vpc);
4872 CASE (sem, INSN_WRITE_MUL) : /* mul $dr,$sr */
4874 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4875 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4876 #define FLD(f) abuf->fields.sfmt_add.f
4877 #define OPRND(f) par_exec->operands.sfmt_add.f
4878 int UNUSED written = abuf->written;
4879 IADDR UNUSED pc = abuf->addr;
4880 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4882 * FLD (i_dr) = OPRND (dr);
4884 #undef OPRND
4885 #undef FLD
4887 NEXT (vpc);
4889 CASE (sem, INSN_PAR_MULHI_A) : /* mulhi $src1,$src2,$acc */
4891 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4892 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4893 #define FLD(f) abuf->fields.sfmt_machi_a.f
4894 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4895 int UNUSED written = 0;
4896 IADDR UNUSED pc = abuf->addr;
4897 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4900 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16)))), 16), 16);
4901 OPRND (acc) = opval;
4902 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4905 #undef OPRND
4906 #undef FLD
4908 NEXT (vpc);
4910 CASE (sem, INSN_WRITE_MULHI_A) : /* mulhi $src1,$src2,$acc */
4912 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4913 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4914 #define FLD(f) abuf->fields.sfmt_machi_a.f
4915 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4916 int UNUSED written = abuf->written;
4917 IADDR UNUSED pc = abuf->addr;
4918 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4920 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4922 #undef OPRND
4923 #undef FLD
4925 NEXT (vpc);
4927 CASE (sem, INSN_PAR_MULLO_A) : /* mullo $src1,$src2,$acc */
4929 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4930 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4931 #define FLD(f) abuf->fields.sfmt_machi_a.f
4932 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4933 int UNUSED written = 0;
4934 IADDR UNUSED pc = abuf->addr;
4935 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4938 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))), 16), 16);
4939 OPRND (acc) = opval;
4940 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4943 #undef OPRND
4944 #undef FLD
4946 NEXT (vpc);
4948 CASE (sem, INSN_WRITE_MULLO_A) : /* mullo $src1,$src2,$acc */
4950 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4951 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4952 #define FLD(f) abuf->fields.sfmt_machi_a.f
4953 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4954 int UNUSED written = abuf->written;
4955 IADDR UNUSED pc = abuf->addr;
4956 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4958 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4960 #undef OPRND
4961 #undef FLD
4963 NEXT (vpc);
4965 CASE (sem, INSN_PAR_MULWHI_A) : /* mulwhi $src1,$src2,$acc */
4967 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4968 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4969 #define FLD(f) abuf->fields.sfmt_machi_a.f
4970 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4971 int UNUSED written = 0;
4972 IADDR UNUSED pc = abuf->addr;
4973 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4976 DI opval = MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16))));
4977 OPRND (acc) = opval;
4978 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
4981 #undef OPRND
4982 #undef FLD
4984 NEXT (vpc);
4986 CASE (sem, INSN_WRITE_MULWHI_A) : /* mulwhi $src1,$src2,$acc */
4988 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4989 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
4990 #define FLD(f) abuf->fields.sfmt_machi_a.f
4991 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4992 int UNUSED written = abuf->written;
4993 IADDR UNUSED pc = abuf->addr;
4994 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
4996 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
4998 #undef OPRND
4999 #undef FLD
5001 NEXT (vpc);
5003 CASE (sem, INSN_PAR_MULWLO_A) : /* mulwlo $src1,$src2,$acc */
5005 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5006 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5007 #define FLD(f) abuf->fields.sfmt_machi_a.f
5008 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
5009 int UNUSED written = 0;
5010 IADDR UNUSED pc = abuf->addr;
5011 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5014 DI opval = MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (* FLD (i_src2))));
5015 OPRND (acc) = opval;
5016 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
5019 #undef OPRND
5020 #undef FLD
5022 NEXT (vpc);
5024 CASE (sem, INSN_WRITE_MULWLO_A) : /* mulwlo $src1,$src2,$acc */
5026 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5027 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5028 #define FLD(f) abuf->fields.sfmt_machi_a.f
5029 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
5030 int UNUSED written = abuf->written;
5031 IADDR UNUSED pc = abuf->addr;
5032 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5034 SET_H_ACCUMS (FLD (f_acc), OPRND (acc));
5036 #undef OPRND
5037 #undef FLD
5039 NEXT (vpc);
5041 CASE (sem, INSN_PAR_MV) : /* mv $dr,$sr */
5043 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5044 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5045 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5046 #define OPRND(f) par_exec->operands.sfmt_mv.f
5047 int UNUSED written = 0;
5048 IADDR UNUSED pc = abuf->addr;
5049 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5052 SI opval = * FLD (i_sr);
5053 OPRND (dr) = opval;
5054 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5057 #undef OPRND
5058 #undef FLD
5060 NEXT (vpc);
5062 CASE (sem, INSN_WRITE_MV) : /* mv $dr,$sr */
5064 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5065 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5066 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5067 #define OPRND(f) par_exec->operands.sfmt_mv.f
5068 int UNUSED written = abuf->written;
5069 IADDR UNUSED pc = abuf->addr;
5070 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5072 * FLD (i_dr) = OPRND (dr);
5074 #undef OPRND
5075 #undef FLD
5077 NEXT (vpc);
5079 CASE (sem, INSN_PAR_MVFACHI_A) : /* mvfachi $dr,$accs */
5081 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5082 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5083 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5084 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5085 int UNUSED written = 0;
5086 IADDR UNUSED pc = abuf->addr;
5087 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5090 SI opval = TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs)), 32));
5091 OPRND (dr) = opval;
5092 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5095 #undef OPRND
5096 #undef FLD
5098 NEXT (vpc);
5100 CASE (sem, INSN_WRITE_MVFACHI_A) : /* mvfachi $dr,$accs */
5102 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5103 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5104 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5105 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5106 int UNUSED written = abuf->written;
5107 IADDR UNUSED pc = abuf->addr;
5108 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5110 * FLD (i_dr) = OPRND (dr);
5112 #undef OPRND
5113 #undef FLD
5115 NEXT (vpc);
5117 CASE (sem, INSN_PAR_MVFACLO_A) : /* mvfaclo $dr,$accs */
5119 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5120 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5121 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5122 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5123 int UNUSED written = 0;
5124 IADDR UNUSED pc = abuf->addr;
5125 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5128 SI opval = TRUNCDISI (GET_H_ACCUMS (FLD (f_accs)));
5129 OPRND (dr) = opval;
5130 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5133 #undef OPRND
5134 #undef FLD
5136 NEXT (vpc);
5138 CASE (sem, INSN_WRITE_MVFACLO_A) : /* mvfaclo $dr,$accs */
5140 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5141 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5142 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5143 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5144 int UNUSED written = abuf->written;
5145 IADDR UNUSED pc = abuf->addr;
5146 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5148 * FLD (i_dr) = OPRND (dr);
5150 #undef OPRND
5151 #undef FLD
5153 NEXT (vpc);
5155 CASE (sem, INSN_PAR_MVFACMI_A) : /* mvfacmi $dr,$accs */
5157 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5158 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5159 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5160 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5161 int UNUSED written = 0;
5162 IADDR UNUSED pc = abuf->addr;
5163 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5166 SI opval = TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs)), 16));
5167 OPRND (dr) = opval;
5168 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5171 #undef OPRND
5172 #undef FLD
5174 NEXT (vpc);
5176 CASE (sem, INSN_WRITE_MVFACMI_A) : /* mvfacmi $dr,$accs */
5178 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5179 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5180 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5181 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5182 int UNUSED written = abuf->written;
5183 IADDR UNUSED pc = abuf->addr;
5184 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5186 * FLD (i_dr) = OPRND (dr);
5188 #undef OPRND
5189 #undef FLD
5191 NEXT (vpc);
5193 CASE (sem, INSN_PAR_MVFC) : /* mvfc $dr,$scr */
5195 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5196 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5197 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5198 #define OPRND(f) par_exec->operands.sfmt_mvfc.f
5199 int UNUSED written = 0;
5200 IADDR UNUSED pc = abuf->addr;
5201 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5204 SI opval = GET_H_CR (FLD (f_r2));
5205 OPRND (dr) = opval;
5206 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5209 #undef OPRND
5210 #undef FLD
5212 NEXT (vpc);
5214 CASE (sem, INSN_WRITE_MVFC) : /* mvfc $dr,$scr */
5216 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5217 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5218 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5219 #define OPRND(f) par_exec->operands.sfmt_mvfc.f
5220 int UNUSED written = abuf->written;
5221 IADDR UNUSED pc = abuf->addr;
5222 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5224 * FLD (i_dr) = OPRND (dr);
5226 #undef OPRND
5227 #undef FLD
5229 NEXT (vpc);
5231 CASE (sem, INSN_PAR_MVTACHI_A) : /* mvtachi $src1,$accs */
5233 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5234 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5235 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5236 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5237 int UNUSED written = 0;
5238 IADDR UNUSED pc = abuf->addr;
5239 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5242 DI opval = ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs)), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1)), 32));
5243 OPRND (accs) = opval;
5244 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
5247 #undef OPRND
5248 #undef FLD
5250 NEXT (vpc);
5252 CASE (sem, INSN_WRITE_MVTACHI_A) : /* mvtachi $src1,$accs */
5254 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5255 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5256 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5257 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5258 int UNUSED written = abuf->written;
5259 IADDR UNUSED pc = abuf->addr;
5260 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5262 SET_H_ACCUMS (FLD (f_accs), OPRND (accs));
5264 #undef OPRND
5265 #undef FLD
5267 NEXT (vpc);
5269 CASE (sem, INSN_PAR_MVTACLO_A) : /* mvtaclo $src1,$accs */
5271 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5272 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5273 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5274 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5275 int UNUSED written = 0;
5276 IADDR UNUSED pc = abuf->addr;
5277 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5280 DI opval = ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs)), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1)));
5281 OPRND (accs) = opval;
5282 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
5285 #undef OPRND
5286 #undef FLD
5288 NEXT (vpc);
5290 CASE (sem, INSN_WRITE_MVTACLO_A) : /* mvtaclo $src1,$accs */
5292 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5293 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5294 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5295 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5296 int UNUSED written = abuf->written;
5297 IADDR UNUSED pc = abuf->addr;
5298 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5300 SET_H_ACCUMS (FLD (f_accs), OPRND (accs));
5302 #undef OPRND
5303 #undef FLD
5305 NEXT (vpc);
5307 CASE (sem, INSN_PAR_MVTC) : /* mvtc $sr,$dcr */
5309 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5310 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5311 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5312 #define OPRND(f) par_exec->operands.sfmt_mvtc.f
5313 int UNUSED written = 0;
5314 IADDR UNUSED pc = abuf->addr;
5315 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5318 USI opval = * FLD (i_sr);
5319 OPRND (dcr) = opval;
5320 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
5323 #undef OPRND
5324 #undef FLD
5326 NEXT (vpc);
5328 CASE (sem, INSN_WRITE_MVTC) : /* mvtc $sr,$dcr */
5330 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5331 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5332 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5333 #define OPRND(f) par_exec->operands.sfmt_mvtc.f
5334 int UNUSED written = abuf->written;
5335 IADDR UNUSED pc = abuf->addr;
5336 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5338 SET_H_CR (FLD (f_r1), OPRND (dcr));
5340 #undef OPRND
5341 #undef FLD
5343 NEXT (vpc);
5345 CASE (sem, INSN_PAR_NEG) : /* neg $dr,$sr */
5347 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5348 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5349 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5350 #define OPRND(f) par_exec->operands.sfmt_mv.f
5351 int UNUSED written = 0;
5352 IADDR UNUSED pc = abuf->addr;
5353 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5356 SI opval = NEGSI (* FLD (i_sr));
5357 OPRND (dr) = opval;
5358 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5361 #undef OPRND
5362 #undef FLD
5364 NEXT (vpc);
5366 CASE (sem, INSN_WRITE_NEG) : /* neg $dr,$sr */
5368 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5369 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5370 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5371 #define OPRND(f) par_exec->operands.sfmt_mv.f
5372 int UNUSED written = abuf->written;
5373 IADDR UNUSED pc = abuf->addr;
5374 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5376 * FLD (i_dr) = OPRND (dr);
5378 #undef OPRND
5379 #undef FLD
5381 NEXT (vpc);
5383 CASE (sem, INSN_PAR_NOP) : /* nop */
5385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5387 #define FLD(f) abuf->fields.fmt_empty.f
5388 #define OPRND(f) par_exec->operands.sfmt_nop.f
5389 int UNUSED written = 0;
5390 IADDR UNUSED pc = abuf->addr;
5391 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5393 PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr);
5395 #undef OPRND
5396 #undef FLD
5398 NEXT (vpc);
5400 CASE (sem, INSN_WRITE_NOP) : /* nop */
5402 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5403 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5404 #define FLD(f) abuf->fields.fmt_empty.f
5405 #define OPRND(f) par_exec->operands.sfmt_nop.f
5406 int UNUSED written = abuf->written;
5407 IADDR UNUSED pc = abuf->addr;
5408 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5411 #undef OPRND
5412 #undef FLD
5414 NEXT (vpc);
5416 CASE (sem, INSN_PAR_NOT) : /* not $dr,$sr */
5418 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5419 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5420 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5421 #define OPRND(f) par_exec->operands.sfmt_mv.f
5422 int UNUSED written = 0;
5423 IADDR UNUSED pc = abuf->addr;
5424 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5427 SI opval = INVSI (* FLD (i_sr));
5428 OPRND (dr) = opval;
5429 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5432 #undef OPRND
5433 #undef FLD
5435 NEXT (vpc);
5437 CASE (sem, INSN_WRITE_NOT) : /* not $dr,$sr */
5439 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5440 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5441 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5442 #define OPRND(f) par_exec->operands.sfmt_mv.f
5443 int UNUSED written = abuf->written;
5444 IADDR UNUSED pc = abuf->addr;
5445 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5447 * FLD (i_dr) = OPRND (dr);
5449 #undef OPRND
5450 #undef FLD
5452 NEXT (vpc);
5454 CASE (sem, INSN_PAR_RAC_DSI) : /* rac $accd,$accs,$imm1 */
5456 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5457 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5458 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5459 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5460 int UNUSED written = 0;
5461 IADDR UNUSED pc = abuf->addr;
5462 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5465 DI tmp_tmp1;
5466 tmp_tmp1 = SLLDI (GET_H_ACCUMS (FLD (f_accs)), FLD (f_imm1));
5467 tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 32768));
5469 DI opval = (GTDI (tmp_tmp1, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0xffff0000)));
5470 OPRND (accd) = opval;
5471 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
5475 #undef OPRND
5476 #undef FLD
5478 NEXT (vpc);
5480 CASE (sem, INSN_WRITE_RAC_DSI) : /* rac $accd,$accs,$imm1 */
5482 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5483 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5484 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5485 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5486 int UNUSED written = abuf->written;
5487 IADDR UNUSED pc = abuf->addr;
5488 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5490 SET_H_ACCUMS (FLD (f_accd), OPRND (accd));
5492 #undef OPRND
5493 #undef FLD
5495 NEXT (vpc);
5497 CASE (sem, INSN_PAR_RACH_DSI) : /* rach $accd,$accs,$imm1 */
5499 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5500 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5501 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5502 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5503 int UNUSED written = 0;
5504 IADDR UNUSED pc = abuf->addr;
5505 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5508 DI tmp_tmp1;
5509 tmp_tmp1 = SLLDI (GET_H_ACCUMS (FLD (f_accs)), FLD (f_imm1));
5510 tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 0x80000000));
5512 DI opval = (GTDI (tmp_tmp1, MAKEDI (32767, 0))) ? (MAKEDI (32767, 0)) : (LTDI (tmp_tmp1, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1, MAKEDI (0xffffffff, 0)));
5513 OPRND (accd) = opval;
5514 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
5518 #undef OPRND
5519 #undef FLD
5521 NEXT (vpc);
5523 CASE (sem, INSN_WRITE_RACH_DSI) : /* rach $accd,$accs,$imm1 */
5525 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5526 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5527 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5528 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5529 int UNUSED written = abuf->written;
5530 IADDR UNUSED pc = abuf->addr;
5531 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5533 SET_H_ACCUMS (FLD (f_accd), OPRND (accd));
5535 #undef OPRND
5536 #undef FLD
5538 NEXT (vpc);
5540 CASE (sem, INSN_PAR_RTE) : /* rte */
5542 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5543 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5544 #define FLD(f) abuf->fields.fmt_empty.f
5545 #define OPRND(f) par_exec->operands.sfmt_rte.f
5546 int UNUSED written = 0;
5547 IADDR UNUSED pc = abuf->addr;
5548 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5552 USI opval = ANDSI (GET_H_CR (((UINT) 6)), -4);
5553 OPRND (pc) = opval;
5554 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
5557 USI opval = GET_H_CR (((UINT) 14));
5558 OPRND (h_cr_USI_6) = opval;
5559 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
5562 UQI opval = CPU (h_bpsw);
5563 OPRND (h_psw_UQI) = opval;
5564 TRACE_RESULT (current_cpu, abuf, "psw", 'x', opval);
5567 UQI opval = CPU (h_bbpsw);
5568 OPRND (h_bpsw_UQI) = opval;
5569 TRACE_RESULT (current_cpu, abuf, "bpsw", 'x', opval);
5573 #undef OPRND
5574 #undef FLD
5576 NEXT (vpc);
5578 CASE (sem, INSN_WRITE_RTE) : /* rte */
5580 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5581 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5582 #define FLD(f) abuf->fields.fmt_empty.f
5583 #define OPRND(f) par_exec->operands.sfmt_rte.f
5584 int UNUSED written = abuf->written;
5585 IADDR UNUSED pc = abuf->addr;
5586 SEM_BRANCH_INIT
5587 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5589 CPU (h_bpsw) = OPRND (h_bpsw_UQI);
5590 SET_H_CR (((UINT) 6), OPRND (h_cr_USI_6));
5591 SET_H_PSW (OPRND (h_psw_UQI));
5592 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
5594 SEM_BRANCH_FINI (vpc);
5595 #undef OPRND
5596 #undef FLD
5598 NEXT (vpc);
5600 CASE (sem, INSN_PAR_SLL) : /* sll $dr,$sr */
5602 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5603 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5604 #define FLD(f) abuf->fields.sfmt_add.f
5605 #define OPRND(f) par_exec->operands.sfmt_add.f
5606 int UNUSED written = 0;
5607 IADDR UNUSED pc = abuf->addr;
5608 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5611 SI opval = SLLSI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
5612 OPRND (dr) = opval;
5613 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5616 #undef OPRND
5617 #undef FLD
5619 NEXT (vpc);
5621 CASE (sem, INSN_WRITE_SLL) : /* sll $dr,$sr */
5623 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5624 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5625 #define FLD(f) abuf->fields.sfmt_add.f
5626 #define OPRND(f) par_exec->operands.sfmt_add.f
5627 int UNUSED written = abuf->written;
5628 IADDR UNUSED pc = abuf->addr;
5629 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5631 * FLD (i_dr) = OPRND (dr);
5633 #undef OPRND
5634 #undef FLD
5636 NEXT (vpc);
5638 CASE (sem, INSN_PAR_SLLI) : /* slli $dr,$uimm5 */
5640 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5641 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5642 #define FLD(f) abuf->fields.sfmt_slli.f
5643 #define OPRND(f) par_exec->operands.sfmt_slli.f
5644 int UNUSED written = 0;
5645 IADDR UNUSED pc = abuf->addr;
5646 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5649 SI opval = SLLSI (* FLD (i_dr), FLD (f_uimm5));
5650 OPRND (dr) = opval;
5651 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5654 #undef OPRND
5655 #undef FLD
5657 NEXT (vpc);
5659 CASE (sem, INSN_WRITE_SLLI) : /* slli $dr,$uimm5 */
5661 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5662 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5663 #define FLD(f) abuf->fields.sfmt_slli.f
5664 #define OPRND(f) par_exec->operands.sfmt_slli.f
5665 int UNUSED written = abuf->written;
5666 IADDR UNUSED pc = abuf->addr;
5667 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5669 * FLD (i_dr) = OPRND (dr);
5671 #undef OPRND
5672 #undef FLD
5674 NEXT (vpc);
5676 CASE (sem, INSN_PAR_SRA) : /* sra $dr,$sr */
5678 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5679 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5680 #define FLD(f) abuf->fields.sfmt_add.f
5681 #define OPRND(f) par_exec->operands.sfmt_add.f
5682 int UNUSED written = 0;
5683 IADDR UNUSED pc = abuf->addr;
5684 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5687 SI opval = SRASI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
5688 OPRND (dr) = opval;
5689 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5692 #undef OPRND
5693 #undef FLD
5695 NEXT (vpc);
5697 CASE (sem, INSN_WRITE_SRA) : /* sra $dr,$sr */
5699 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5700 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5701 #define FLD(f) abuf->fields.sfmt_add.f
5702 #define OPRND(f) par_exec->operands.sfmt_add.f
5703 int UNUSED written = abuf->written;
5704 IADDR UNUSED pc = abuf->addr;
5705 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5707 * FLD (i_dr) = OPRND (dr);
5709 #undef OPRND
5710 #undef FLD
5712 NEXT (vpc);
5714 CASE (sem, INSN_PAR_SRAI) : /* srai $dr,$uimm5 */
5716 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5717 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5718 #define FLD(f) abuf->fields.sfmt_slli.f
5719 #define OPRND(f) par_exec->operands.sfmt_slli.f
5720 int UNUSED written = 0;
5721 IADDR UNUSED pc = abuf->addr;
5722 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5725 SI opval = SRASI (* FLD (i_dr), FLD (f_uimm5));
5726 OPRND (dr) = opval;
5727 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5730 #undef OPRND
5731 #undef FLD
5733 NEXT (vpc);
5735 CASE (sem, INSN_WRITE_SRAI) : /* srai $dr,$uimm5 */
5737 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5738 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5739 #define FLD(f) abuf->fields.sfmt_slli.f
5740 #define OPRND(f) par_exec->operands.sfmt_slli.f
5741 int UNUSED written = abuf->written;
5742 IADDR UNUSED pc = abuf->addr;
5743 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5745 * FLD (i_dr) = OPRND (dr);
5747 #undef OPRND
5748 #undef FLD
5750 NEXT (vpc);
5752 CASE (sem, INSN_PAR_SRL) : /* srl $dr,$sr */
5754 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5755 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5756 #define FLD(f) abuf->fields.sfmt_add.f
5757 #define OPRND(f) par_exec->operands.sfmt_add.f
5758 int UNUSED written = 0;
5759 IADDR UNUSED pc = abuf->addr;
5760 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5763 SI opval = SRLSI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
5764 OPRND (dr) = opval;
5765 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5768 #undef OPRND
5769 #undef FLD
5771 NEXT (vpc);
5773 CASE (sem, INSN_WRITE_SRL) : /* srl $dr,$sr */
5775 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5776 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5777 #define FLD(f) abuf->fields.sfmt_add.f
5778 #define OPRND(f) par_exec->operands.sfmt_add.f
5779 int UNUSED written = abuf->written;
5780 IADDR UNUSED pc = abuf->addr;
5781 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5783 * FLD (i_dr) = OPRND (dr);
5785 #undef OPRND
5786 #undef FLD
5788 NEXT (vpc);
5790 CASE (sem, INSN_PAR_SRLI) : /* srli $dr,$uimm5 */
5792 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5793 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5794 #define FLD(f) abuf->fields.sfmt_slli.f
5795 #define OPRND(f) par_exec->operands.sfmt_slli.f
5796 int UNUSED written = 0;
5797 IADDR UNUSED pc = abuf->addr;
5798 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5801 SI opval = SRLSI (* FLD (i_dr), FLD (f_uimm5));
5802 OPRND (dr) = opval;
5803 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5806 #undef OPRND
5807 #undef FLD
5809 NEXT (vpc);
5811 CASE (sem, INSN_WRITE_SRLI) : /* srli $dr,$uimm5 */
5813 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5814 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5815 #define FLD(f) abuf->fields.sfmt_slli.f
5816 #define OPRND(f) par_exec->operands.sfmt_slli.f
5817 int UNUSED written = abuf->written;
5818 IADDR UNUSED pc = abuf->addr;
5819 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5821 * FLD (i_dr) = OPRND (dr);
5823 #undef OPRND
5824 #undef FLD
5826 NEXT (vpc);
5828 CASE (sem, INSN_PAR_ST) : /* st $src1,@$src2 */
5830 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5831 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5832 #define FLD(f) abuf->fields.sfmt_st_plus.f
5833 #define OPRND(f) par_exec->operands.sfmt_st.f
5834 int UNUSED written = 0;
5835 IADDR UNUSED pc = abuf->addr;
5836 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5839 SI opval = * FLD (i_src1);
5840 OPRND (h_memory_SI_src2_idx) = * FLD (i_src2);
5841 OPRND (h_memory_SI_src2) = opval;
5842 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5845 #undef OPRND
5846 #undef FLD
5848 NEXT (vpc);
5850 CASE (sem, INSN_WRITE_ST) : /* st $src1,@$src2 */
5852 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5853 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5854 #define FLD(f) abuf->fields.sfmt_st_plus.f
5855 #define OPRND(f) par_exec->operands.sfmt_st.f
5856 int UNUSED written = abuf->written;
5857 IADDR UNUSED pc = abuf->addr;
5858 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5860 SETMEMSI (current_cpu, pc, OPRND (h_memory_SI_src2_idx), OPRND (h_memory_SI_src2));
5862 #undef OPRND
5863 #undef FLD
5865 NEXT (vpc);
5867 CASE (sem, INSN_PAR_STB) : /* stb $src1,@$src2 */
5869 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5870 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5871 #define FLD(f) abuf->fields.sfmt_st_plus.f
5872 #define OPRND(f) par_exec->operands.sfmt_stb.f
5873 int UNUSED written = 0;
5874 IADDR UNUSED pc = abuf->addr;
5875 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5878 QI opval = * FLD (i_src1);
5879 OPRND (h_memory_QI_src2_idx) = * FLD (i_src2);
5880 OPRND (h_memory_QI_src2) = opval;
5881 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5884 #undef OPRND
5885 #undef FLD
5887 NEXT (vpc);
5889 CASE (sem, INSN_WRITE_STB) : /* stb $src1,@$src2 */
5891 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5892 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5893 #define FLD(f) abuf->fields.sfmt_st_plus.f
5894 #define OPRND(f) par_exec->operands.sfmt_stb.f
5895 int UNUSED written = abuf->written;
5896 IADDR UNUSED pc = abuf->addr;
5897 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5899 SETMEMQI (current_cpu, pc, OPRND (h_memory_QI_src2_idx), OPRND (h_memory_QI_src2));
5901 #undef OPRND
5902 #undef FLD
5904 NEXT (vpc);
5906 CASE (sem, INSN_PAR_STH) : /* sth $src1,@$src2 */
5908 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5909 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5910 #define FLD(f) abuf->fields.sfmt_st_plus.f
5911 #define OPRND(f) par_exec->operands.sfmt_sth.f
5912 int UNUSED written = 0;
5913 IADDR UNUSED pc = abuf->addr;
5914 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5917 HI opval = * FLD (i_src1);
5918 OPRND (h_memory_HI_src2_idx) = * FLD (i_src2);
5919 OPRND (h_memory_HI_src2) = opval;
5920 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5923 #undef OPRND
5924 #undef FLD
5926 NEXT (vpc);
5928 CASE (sem, INSN_WRITE_STH) : /* sth $src1,@$src2 */
5930 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5931 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5932 #define FLD(f) abuf->fields.sfmt_st_plus.f
5933 #define OPRND(f) par_exec->operands.sfmt_sth.f
5934 int UNUSED written = abuf->written;
5935 IADDR UNUSED pc = abuf->addr;
5936 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5938 SETMEMHI (current_cpu, pc, OPRND (h_memory_HI_src2_idx), OPRND (h_memory_HI_src2));
5940 #undef OPRND
5941 #undef FLD
5943 NEXT (vpc);
5945 CASE (sem, INSN_PAR_ST_PLUS) : /* st $src1,@+$src2 */
5947 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5948 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5949 #define FLD(f) abuf->fields.sfmt_st_plus.f
5950 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5951 int UNUSED written = 0;
5952 IADDR UNUSED pc = abuf->addr;
5953 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5956 SI tmp_new_src2;
5957 tmp_new_src2 = ADDSI (* FLD (i_src2), 4);
5959 SI opval = * FLD (i_src1);
5960 OPRND (h_memory_SI_new_src2_idx) = tmp_new_src2;
5961 OPRND (h_memory_SI_new_src2) = opval;
5962 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5965 SI opval = tmp_new_src2;
5966 OPRND (src2) = opval;
5967 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
5971 #undef OPRND
5972 #undef FLD
5974 NEXT (vpc);
5976 CASE (sem, INSN_WRITE_ST_PLUS) : /* st $src1,@+$src2 */
5978 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5979 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
5980 #define FLD(f) abuf->fields.sfmt_st_plus.f
5981 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5982 int UNUSED written = abuf->written;
5983 IADDR UNUSED pc = abuf->addr;
5984 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
5986 SETMEMSI (current_cpu, pc, OPRND (h_memory_SI_new_src2_idx), OPRND (h_memory_SI_new_src2));
5987 * FLD (i_src2) = OPRND (src2);
5989 #undef OPRND
5990 #undef FLD
5992 NEXT (vpc);
5994 CASE (sem, INSN_PAR_STH_PLUS) : /* sth $src1,@$src2+ */
5996 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5997 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5998 #define FLD(f) abuf->fields.sfmt_st_plus.f
5999 #define OPRND(f) par_exec->operands.sfmt_sth_plus.f
6000 int UNUSED written = 0;
6001 IADDR UNUSED pc = abuf->addr;
6002 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6005 HI tmp_new_src2;
6007 HI opval = * FLD (i_src1);
6008 OPRND (h_memory_HI_new_src2_idx) = tmp_new_src2;
6009 OPRND (h_memory_HI_new_src2) = opval;
6010 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
6012 tmp_new_src2 = ADDSI (* FLD (i_src2), 2);
6014 SI opval = tmp_new_src2;
6015 OPRND (src2) = opval;
6016 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6020 #undef OPRND
6021 #undef FLD
6023 NEXT (vpc);
6025 CASE (sem, INSN_WRITE_STH_PLUS) : /* sth $src1,@$src2+ */
6027 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6028 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6029 #define FLD(f) abuf->fields.sfmt_st_plus.f
6030 #define OPRND(f) par_exec->operands.sfmt_sth_plus.f
6031 int UNUSED written = abuf->written;
6032 IADDR UNUSED pc = abuf->addr;
6033 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6035 SETMEMHI (current_cpu, pc, OPRND (h_memory_HI_new_src2_idx), OPRND (h_memory_HI_new_src2));
6036 * FLD (i_src2) = OPRND (src2);
6038 #undef OPRND
6039 #undef FLD
6041 NEXT (vpc);
6043 CASE (sem, INSN_PAR_STB_PLUS) : /* stb $src1,@$src2+ */
6045 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6046 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6047 #define FLD(f) abuf->fields.sfmt_st_plus.f
6048 #define OPRND(f) par_exec->operands.sfmt_stb_plus.f
6049 int UNUSED written = 0;
6050 IADDR UNUSED pc = abuf->addr;
6051 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6054 QI tmp_new_src2;
6056 QI opval = * FLD (i_src1);
6057 OPRND (h_memory_QI_new_src2_idx) = tmp_new_src2;
6058 OPRND (h_memory_QI_new_src2) = opval;
6059 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
6061 tmp_new_src2 = ADDSI (* FLD (i_src2), 1);
6063 SI opval = tmp_new_src2;
6064 OPRND (src2) = opval;
6065 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6069 #undef OPRND
6070 #undef FLD
6072 NEXT (vpc);
6074 CASE (sem, INSN_WRITE_STB_PLUS) : /* stb $src1,@$src2+ */
6076 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6077 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6078 #define FLD(f) abuf->fields.sfmt_st_plus.f
6079 #define OPRND(f) par_exec->operands.sfmt_stb_plus.f
6080 int UNUSED written = abuf->written;
6081 IADDR UNUSED pc = abuf->addr;
6082 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6084 SETMEMQI (current_cpu, pc, OPRND (h_memory_QI_new_src2_idx), OPRND (h_memory_QI_new_src2));
6085 * FLD (i_src2) = OPRND (src2);
6087 #undef OPRND
6088 #undef FLD
6090 NEXT (vpc);
6092 CASE (sem, INSN_PAR_ST_MINUS) : /* st $src1,@-$src2 */
6094 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6095 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6096 #define FLD(f) abuf->fields.sfmt_st_plus.f
6097 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
6098 int UNUSED written = 0;
6099 IADDR UNUSED pc = abuf->addr;
6100 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6103 SI tmp_new_src2;
6104 tmp_new_src2 = SUBSI (* FLD (i_src2), 4);
6106 SI opval = * FLD (i_src1);
6107 OPRND (h_memory_SI_new_src2_idx) = tmp_new_src2;
6108 OPRND (h_memory_SI_new_src2) = opval;
6109 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
6112 SI opval = tmp_new_src2;
6113 OPRND (src2) = opval;
6114 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6118 #undef OPRND
6119 #undef FLD
6121 NEXT (vpc);
6123 CASE (sem, INSN_WRITE_ST_MINUS) : /* st $src1,@-$src2 */
6125 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6126 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6127 #define FLD(f) abuf->fields.sfmt_st_plus.f
6128 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
6129 int UNUSED written = abuf->written;
6130 IADDR UNUSED pc = abuf->addr;
6131 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6133 SETMEMSI (current_cpu, pc, OPRND (h_memory_SI_new_src2_idx), OPRND (h_memory_SI_new_src2));
6134 * FLD (i_src2) = OPRND (src2);
6136 #undef OPRND
6137 #undef FLD
6139 NEXT (vpc);
6141 CASE (sem, INSN_PAR_SUB) : /* sub $dr,$sr */
6143 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6144 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6145 #define FLD(f) abuf->fields.sfmt_add.f
6146 #define OPRND(f) par_exec->operands.sfmt_add.f
6147 int UNUSED written = 0;
6148 IADDR UNUSED pc = abuf->addr;
6149 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6152 SI opval = SUBSI (* FLD (i_dr), * FLD (i_sr));
6153 OPRND (dr) = opval;
6154 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6157 #undef OPRND
6158 #undef FLD
6160 NEXT (vpc);
6162 CASE (sem, INSN_WRITE_SUB) : /* sub $dr,$sr */
6164 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6165 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6166 #define FLD(f) abuf->fields.sfmt_add.f
6167 #define OPRND(f) par_exec->operands.sfmt_add.f
6168 int UNUSED written = abuf->written;
6169 IADDR UNUSED pc = abuf->addr;
6170 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6172 * FLD (i_dr) = OPRND (dr);
6174 #undef OPRND
6175 #undef FLD
6177 NEXT (vpc);
6179 CASE (sem, INSN_PAR_SUBV) : /* subv $dr,$sr */
6181 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6182 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6183 #define FLD(f) abuf->fields.sfmt_add.f
6184 #define OPRND(f) par_exec->operands.sfmt_addv.f
6185 int UNUSED written = 0;
6186 IADDR UNUSED pc = abuf->addr;
6187 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6190 SI temp0;BI temp1;
6191 temp0 = SUBSI (* FLD (i_dr), * FLD (i_sr));
6192 temp1 = SUBOFSI (* FLD (i_dr), * FLD (i_sr), 0);
6194 SI opval = temp0;
6195 OPRND (dr) = opval;
6196 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6199 BI opval = temp1;
6200 OPRND (condbit) = opval;
6201 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
6205 #undef OPRND
6206 #undef FLD
6208 NEXT (vpc);
6210 CASE (sem, INSN_WRITE_SUBV) : /* subv $dr,$sr */
6212 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6213 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6214 #define FLD(f) abuf->fields.sfmt_add.f
6215 #define OPRND(f) par_exec->operands.sfmt_addv.f
6216 int UNUSED written = abuf->written;
6217 IADDR UNUSED pc = abuf->addr;
6218 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6220 CPU (h_cond) = OPRND (condbit);
6221 * FLD (i_dr) = OPRND (dr);
6223 #undef OPRND
6224 #undef FLD
6226 NEXT (vpc);
6228 CASE (sem, INSN_PAR_SUBX) : /* subx $dr,$sr */
6230 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6231 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6232 #define FLD(f) abuf->fields.sfmt_add.f
6233 #define OPRND(f) par_exec->operands.sfmt_addx.f
6234 int UNUSED written = 0;
6235 IADDR UNUSED pc = abuf->addr;
6236 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6239 SI temp0;BI temp1;
6240 temp0 = SUBCSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
6241 temp1 = SUBCFSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
6243 SI opval = temp0;
6244 OPRND (dr) = opval;
6245 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
6248 BI opval = temp1;
6249 OPRND (condbit) = opval;
6250 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
6254 #undef OPRND
6255 #undef FLD
6257 NEXT (vpc);
6259 CASE (sem, INSN_WRITE_SUBX) : /* subx $dr,$sr */
6261 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6262 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6263 #define FLD(f) abuf->fields.sfmt_add.f
6264 #define OPRND(f) par_exec->operands.sfmt_addx.f
6265 int UNUSED written = abuf->written;
6266 IADDR UNUSED pc = abuf->addr;
6267 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6269 CPU (h_cond) = OPRND (condbit);
6270 * FLD (i_dr) = OPRND (dr);
6272 #undef OPRND
6273 #undef FLD
6275 NEXT (vpc);
6277 CASE (sem, INSN_PAR_TRAP) : /* trap $uimm4 */
6279 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6280 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6281 #define FLD(f) abuf->fields.sfmt_trap.f
6282 #define OPRND(f) par_exec->operands.sfmt_trap.f
6283 int UNUSED written = 0;
6284 IADDR UNUSED pc = abuf->addr;
6285 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6289 USI opval = GET_H_CR (((UINT) 6));
6290 OPRND (h_cr_USI_14) = opval;
6291 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
6294 USI opval = ADDSI (pc, 4);
6295 OPRND (h_cr_USI_6) = opval;
6296 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
6299 UQI opval = CPU (h_bpsw);
6300 OPRND (h_bbpsw_UQI) = opval;
6301 TRACE_RESULT (current_cpu, abuf, "bbpsw", 'x', opval);
6304 UQI opval = GET_H_PSW ();
6305 OPRND (h_bpsw_UQI) = opval;
6306 TRACE_RESULT (current_cpu, abuf, "bpsw", 'x', opval);
6309 UQI opval = ANDQI (GET_H_PSW (), 128);
6310 OPRND (h_psw_UQI) = opval;
6311 TRACE_RESULT (current_cpu, abuf, "psw", 'x', opval);
6314 SI opval = m32r_trap (current_cpu, pc, FLD (f_uimm4));
6315 OPRND (pc) = opval;
6316 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
6320 #undef OPRND
6321 #undef FLD
6323 NEXT (vpc);
6325 CASE (sem, INSN_WRITE_TRAP) : /* trap $uimm4 */
6327 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6328 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6329 #define FLD(f) abuf->fields.sfmt_trap.f
6330 #define OPRND(f) par_exec->operands.sfmt_trap.f
6331 int UNUSED written = abuf->written;
6332 IADDR UNUSED pc = abuf->addr;
6333 SEM_BRANCH_INIT
6334 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6336 CPU (h_bbpsw) = OPRND (h_bbpsw_UQI);
6337 CPU (h_bpsw) = OPRND (h_bpsw_UQI);
6338 SET_H_CR (((UINT) 14), OPRND (h_cr_USI_14));
6339 SET_H_CR (((UINT) 6), OPRND (h_cr_USI_6));
6340 SET_H_PSW (OPRND (h_psw_UQI));
6341 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, OPRND (pc), vpc);
6343 SEM_BRANCH_FINI (vpc);
6344 #undef OPRND
6345 #undef FLD
6347 NEXT (vpc);
6349 CASE (sem, INSN_PAR_UNLOCK) : /* unlock $src1,@$src2 */
6351 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6352 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6353 #define FLD(f) abuf->fields.sfmt_st_plus.f
6354 #define OPRND(f) par_exec->operands.sfmt_unlock.f
6355 int UNUSED written = 0;
6356 IADDR UNUSED pc = abuf->addr;
6357 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6360 if (CPU (h_lock)) {
6362 SI opval = * FLD (i_src1);
6363 OPRND (h_memory_SI_src2_idx) = * FLD (i_src2);
6364 OPRND (h_memory_SI_src2) = opval;
6365 written |= (1 << 4);
6366 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
6370 BI opval = 0;
6371 OPRND (h_lock_BI) = opval;
6372 TRACE_RESULT (current_cpu, abuf, "lock", 'x', opval);
6376 abuf->written = written;
6377 #undef OPRND
6378 #undef FLD
6380 NEXT (vpc);
6382 CASE (sem, INSN_WRITE_UNLOCK) : /* unlock $src1,@$src2 */
6384 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6385 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6386 #define FLD(f) abuf->fields.sfmt_st_plus.f
6387 #define OPRND(f) par_exec->operands.sfmt_unlock.f
6388 int UNUSED written = abuf->written;
6389 IADDR UNUSED pc = abuf->addr;
6390 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6392 CPU (h_lock) = OPRND (h_lock_BI);
6393 if (written & (1 << 4))
6395 SETMEMSI (current_cpu, pc, OPRND (h_memory_SI_src2_idx), OPRND (h_memory_SI_src2));
6398 #undef OPRND
6399 #undef FLD
6401 NEXT (vpc);
6403 CASE (sem, INSN_PAR_PCMPBZ) : /* pcmpbz $src2 */
6405 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6406 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6407 #define FLD(f) abuf->fields.sfmt_st_plus.f
6408 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
6409 int UNUSED written = 0;
6410 IADDR UNUSED pc = abuf->addr;
6411 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6414 BI opval = (EQSI (ANDSI (* FLD (i_src2), 255), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2), 65280), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2), 16711680), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2), 0xff000000), 0)) ? (1) : (0);
6415 OPRND (condbit) = opval;
6416 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
6419 #undef OPRND
6420 #undef FLD
6422 NEXT (vpc);
6424 CASE (sem, INSN_WRITE_PCMPBZ) : /* pcmpbz $src2 */
6426 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6427 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6428 #define FLD(f) abuf->fields.sfmt_st_plus.f
6429 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
6430 int UNUSED written = abuf->written;
6431 IADDR UNUSED pc = abuf->addr;
6432 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6434 CPU (h_cond) = OPRND (condbit);
6436 #undef OPRND
6437 #undef FLD
6439 NEXT (vpc);
6441 CASE (sem, INSN_PAR_SADD) : /* sadd */
6443 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6444 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6445 #define FLD(f) abuf->fields.fmt_empty.f
6446 #define OPRND(f) par_exec->operands.sfmt_sadd.f
6447 int UNUSED written = 0;
6448 IADDR UNUSED pc = abuf->addr;
6449 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6452 DI opval = ADDDI (SRADI (GET_H_ACCUMS (((UINT) 1)), 16), GET_H_ACCUMS (((UINT) 0)));
6453 OPRND (h_accums_DI_0) = opval;
6454 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
6457 #undef OPRND
6458 #undef FLD
6460 NEXT (vpc);
6462 CASE (sem, INSN_WRITE_SADD) : /* sadd */
6464 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6465 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6466 #define FLD(f) abuf->fields.fmt_empty.f
6467 #define OPRND(f) par_exec->operands.sfmt_sadd.f
6468 int UNUSED written = abuf->written;
6469 IADDR UNUSED pc = abuf->addr;
6470 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6472 SET_H_ACCUMS (((UINT) 0), OPRND (h_accums_DI_0));
6474 #undef OPRND
6475 #undef FLD
6477 NEXT (vpc);
6479 CASE (sem, INSN_PAR_MACWU1) : /* macwu1 $src1,$src2 */
6481 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6482 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6483 #define FLD(f) abuf->fields.sfmt_st_plus.f
6484 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6485 int UNUSED written = 0;
6486 IADDR UNUSED pc = abuf->addr;
6487 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6490 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT) 1)), MULDI (EXTSIDI (* FLD (i_src1)), EXTSIDI (ANDSI (* FLD (i_src2), 65535)))), 8), 8);
6491 OPRND (h_accums_DI_1) = opval;
6492 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
6495 #undef OPRND
6496 #undef FLD
6498 NEXT (vpc);
6500 CASE (sem, INSN_WRITE_MACWU1) : /* macwu1 $src1,$src2 */
6502 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6503 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6504 #define FLD(f) abuf->fields.sfmt_st_plus.f
6505 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6506 int UNUSED written = abuf->written;
6507 IADDR UNUSED pc = abuf->addr;
6508 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6510 SET_H_ACCUMS (((UINT) 1), OPRND (h_accums_DI_1));
6512 #undef OPRND
6513 #undef FLD
6515 NEXT (vpc);
6517 CASE (sem, INSN_PAR_MSBLO) : /* msblo $src1,$src2 */
6519 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6520 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6521 #define FLD(f) abuf->fields.sfmt_st_plus.f
6522 #define OPRND(f) par_exec->operands.sfmt_msblo.f
6523 int UNUSED written = 0;
6524 IADDR UNUSED pc = abuf->addr;
6525 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6528 DI opval = SRADI (SLLDI (SUBDI (GET_H_ACCUM (), SRADI (SLLDI (MULDI (EXTHIDI (TRUNCSIHI (* FLD (i_src1))), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))), 32), 16)), 8), 8);
6529 OPRND (accum) = opval;
6530 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
6533 #undef OPRND
6534 #undef FLD
6536 NEXT (vpc);
6538 CASE (sem, INSN_WRITE_MSBLO) : /* msblo $src1,$src2 */
6540 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6541 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6542 #define FLD(f) abuf->fields.sfmt_st_plus.f
6543 #define OPRND(f) par_exec->operands.sfmt_msblo.f
6544 int UNUSED written = abuf->written;
6545 IADDR UNUSED pc = abuf->addr;
6546 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6548 SET_H_ACCUM (OPRND (accum));
6550 #undef OPRND
6551 #undef FLD
6553 NEXT (vpc);
6555 CASE (sem, INSN_PAR_MULWU1) : /* mulwu1 $src1,$src2 */
6557 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6558 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6559 #define FLD(f) abuf->fields.sfmt_st_plus.f
6560 #define OPRND(f) par_exec->operands.sfmt_mulwu1.f
6561 int UNUSED written = 0;
6562 IADDR UNUSED pc = abuf->addr;
6563 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6566 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1)), EXTSIDI (ANDSI (* FLD (i_src2), 65535))), 16), 16);
6567 OPRND (h_accums_DI_1) = opval;
6568 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
6571 #undef OPRND
6572 #undef FLD
6574 NEXT (vpc);
6576 CASE (sem, INSN_WRITE_MULWU1) : /* mulwu1 $src1,$src2 */
6578 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6579 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6580 #define FLD(f) abuf->fields.sfmt_st_plus.f
6581 #define OPRND(f) par_exec->operands.sfmt_mulwu1.f
6582 int UNUSED written = abuf->written;
6583 IADDR UNUSED pc = abuf->addr;
6584 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6586 SET_H_ACCUMS (((UINT) 1), OPRND (h_accums_DI_1));
6588 #undef OPRND
6589 #undef FLD
6591 NEXT (vpc);
6593 CASE (sem, INSN_PAR_MACLH1) : /* maclh1 $src1,$src2 */
6595 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6596 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6597 #define FLD(f) abuf->fields.sfmt_st_plus.f
6598 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6599 int UNUSED written = 0;
6600 IADDR UNUSED pc = abuf->addr;
6601 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6604 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT) 1)), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (* FLD (i_src1))), SRASI (* FLD (i_src2), 16))), 16)), 8), 8);
6605 OPRND (h_accums_DI_1) = opval;
6606 TRACE_RESULT (current_cpu, abuf, "accums", 'D', opval);
6609 #undef OPRND
6610 #undef FLD
6612 NEXT (vpc);
6614 CASE (sem, INSN_WRITE_MACLH1) : /* maclh1 $src1,$src2 */
6616 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6617 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6618 #define FLD(f) abuf->fields.sfmt_st_plus.f
6619 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6620 int UNUSED written = abuf->written;
6621 IADDR UNUSED pc = abuf->addr;
6622 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6624 SET_H_ACCUMS (((UINT) 1), OPRND (h_accums_DI_1));
6626 #undef OPRND
6627 #undef FLD
6629 NEXT (vpc);
6631 CASE (sem, INSN_PAR_SC) : /* sc */
6633 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6634 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6635 #define FLD(f) abuf->fields.fmt_empty.f
6636 #define OPRND(f) par_exec->operands.sfmt_sc.f
6637 int UNUSED written = 0;
6638 IADDR UNUSED pc = abuf->addr;
6639 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6641 if (ZEXTBISI (CPU (h_cond)))
6642 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
6644 #undef OPRND
6645 #undef FLD
6647 NEXT (vpc);
6649 CASE (sem, INSN_WRITE_SC) : /* sc */
6651 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6652 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6653 #define FLD(f) abuf->fields.fmt_empty.f
6654 #define OPRND(f) par_exec->operands.sfmt_sc.f
6655 int UNUSED written = abuf->written;
6656 IADDR UNUSED pc = abuf->addr;
6657 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6660 #undef OPRND
6661 #undef FLD
6663 NEXT (vpc);
6665 CASE (sem, INSN_PAR_SNC) : /* snc */
6667 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6668 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6669 #define FLD(f) abuf->fields.fmt_empty.f
6670 #define OPRND(f) par_exec->operands.sfmt_sc.f
6671 int UNUSED written = 0;
6672 IADDR UNUSED pc = abuf->addr;
6673 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6675 if (ZEXTBISI (NOTBI (CPU (h_cond))))
6676 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
6678 #undef OPRND
6679 #undef FLD
6681 NEXT (vpc);
6683 CASE (sem, INSN_WRITE_SNC) : /* snc */
6685 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6686 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6687 #define FLD(f) abuf->fields.fmt_empty.f
6688 #define OPRND(f) par_exec->operands.sfmt_sc.f
6689 int UNUSED written = abuf->written;
6690 IADDR UNUSED pc = abuf->addr;
6691 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6694 #undef OPRND
6695 #undef FLD
6697 NEXT (vpc);
6699 CASE (sem, INSN_PAR_CLRPSW) : /* clrpsw $uimm8 */
6701 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6702 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6703 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6704 #define OPRND(f) par_exec->operands.sfmt_clrpsw.f
6705 int UNUSED written = 0;
6706 IADDR UNUSED pc = abuf->addr;
6707 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6710 SI opval = ANDSI (GET_H_CR (((UINT) 0)), ORSI (INVBI (FLD (f_uimm8)), 65280));
6711 OPRND (h_cr_USI_0) = opval;
6712 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
6715 #undef OPRND
6716 #undef FLD
6718 NEXT (vpc);
6720 CASE (sem, INSN_WRITE_CLRPSW) : /* clrpsw $uimm8 */
6722 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6723 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6724 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6725 #define OPRND(f) par_exec->operands.sfmt_clrpsw.f
6726 int UNUSED written = abuf->written;
6727 IADDR UNUSED pc = abuf->addr;
6728 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6730 SET_H_CR (((UINT) 0), OPRND (h_cr_USI_0));
6732 #undef OPRND
6733 #undef FLD
6735 NEXT (vpc);
6737 CASE (sem, INSN_PAR_SETPSW) : /* setpsw $uimm8 */
6739 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6740 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6741 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6742 #define OPRND(f) par_exec->operands.sfmt_setpsw.f
6743 int UNUSED written = 0;
6744 IADDR UNUSED pc = abuf->addr;
6745 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6748 SI opval = FLD (f_uimm8);
6749 OPRND (h_cr_USI_0) = opval;
6750 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
6753 #undef OPRND
6754 #undef FLD
6756 NEXT (vpc);
6758 CASE (sem, INSN_WRITE_SETPSW) : /* setpsw $uimm8 */
6760 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6761 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6762 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6763 #define OPRND(f) par_exec->operands.sfmt_setpsw.f
6764 int UNUSED written = abuf->written;
6765 IADDR UNUSED pc = abuf->addr;
6766 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6768 SET_H_CR (((UINT) 0), OPRND (h_cr_USI_0));
6770 #undef OPRND
6771 #undef FLD
6773 NEXT (vpc);
6775 CASE (sem, INSN_PAR_BTST) : /* btst $uimm3,$sr */
6777 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6778 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6779 #define FLD(f) abuf->fields.sfmt_bset.f
6780 #define OPRND(f) par_exec->operands.sfmt_btst.f
6781 int UNUSED written = 0;
6782 IADDR UNUSED pc = abuf->addr;
6783 vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
6786 BI opval = ANDQI (SRLSI (* FLD (i_sr), SUBSI (7, FLD (f_uimm3))), 1);
6787 OPRND (condbit) = opval;
6788 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
6791 #undef OPRND
6792 #undef FLD
6794 NEXT (vpc);
6796 CASE (sem, INSN_WRITE_BTST) : /* btst $uimm3,$sr */
6798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
6799 const ARGBUF *abuf = SEM_ARGBUF (sem_arg)->fields.write.abuf;
6800 #define FLD(f) abuf->fields.sfmt_bset.f
6801 #define OPRND(f) par_exec->operands.sfmt_btst.f
6802 int UNUSED written = abuf->written;
6803 IADDR UNUSED pc = abuf->addr;
6804 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
6806 CPU (h_cond) = OPRND (condbit);
6808 #undef OPRND
6809 #undef FLD
6811 NEXT (vpc);
6815 ENDSWITCH (sem) /* End of semantic switch. */
6817 /* At this point `vpc' contains the next insn to execute. */
6820 #undef DEFINE_SWITCH
6821 #endif /* DEFINE_SWITCH */