1 /* Simulator instruction semantics for sh64.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2009 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { SH64_MEDIA_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
36 { SH64_MEDIA_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
37 { SH64_MEDIA_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
38 { SH64_MEDIA_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
39 { SH64_MEDIA_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
40 { SH64_MEDIA_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
41 { SH64_MEDIA_INSN_ADD, && case_sem_INSN_ADD },
42 { SH64_MEDIA_INSN_ADDL, && case_sem_INSN_ADDL },
43 { SH64_MEDIA_INSN_ADDI, && case_sem_INSN_ADDI },
44 { SH64_MEDIA_INSN_ADDIL, && case_sem_INSN_ADDIL },
45 { SH64_MEDIA_INSN_ADDZL, && case_sem_INSN_ADDZL },
46 { SH64_MEDIA_INSN_ALLOCO, && case_sem_INSN_ALLOCO },
47 { SH64_MEDIA_INSN_AND, && case_sem_INSN_AND },
48 { SH64_MEDIA_INSN_ANDC, && case_sem_INSN_ANDC },
49 { SH64_MEDIA_INSN_ANDI, && case_sem_INSN_ANDI },
50 { SH64_MEDIA_INSN_BEQ, && case_sem_INSN_BEQ },
51 { SH64_MEDIA_INSN_BEQI, && case_sem_INSN_BEQI },
52 { SH64_MEDIA_INSN_BGE, && case_sem_INSN_BGE },
53 { SH64_MEDIA_INSN_BGEU, && case_sem_INSN_BGEU },
54 { SH64_MEDIA_INSN_BGT, && case_sem_INSN_BGT },
55 { SH64_MEDIA_INSN_BGTU, && case_sem_INSN_BGTU },
56 { SH64_MEDIA_INSN_BLINK, && case_sem_INSN_BLINK },
57 { SH64_MEDIA_INSN_BNE, && case_sem_INSN_BNE },
58 { SH64_MEDIA_INSN_BNEI, && case_sem_INSN_BNEI },
59 { SH64_MEDIA_INSN_BRK, && case_sem_INSN_BRK },
60 { SH64_MEDIA_INSN_BYTEREV, && case_sem_INSN_BYTEREV },
61 { SH64_MEDIA_INSN_CMPEQ, && case_sem_INSN_CMPEQ },
62 { SH64_MEDIA_INSN_CMPGT, && case_sem_INSN_CMPGT },
63 { SH64_MEDIA_INSN_CMPGTU, && case_sem_INSN_CMPGTU },
64 { SH64_MEDIA_INSN_CMVEQ, && case_sem_INSN_CMVEQ },
65 { SH64_MEDIA_INSN_CMVNE, && case_sem_INSN_CMVNE },
66 { SH64_MEDIA_INSN_FABSD, && case_sem_INSN_FABSD },
67 { SH64_MEDIA_INSN_FABSS, && case_sem_INSN_FABSS },
68 { SH64_MEDIA_INSN_FADDD, && case_sem_INSN_FADDD },
69 { SH64_MEDIA_INSN_FADDS, && case_sem_INSN_FADDS },
70 { SH64_MEDIA_INSN_FCMPEQD, && case_sem_INSN_FCMPEQD },
71 { SH64_MEDIA_INSN_FCMPEQS, && case_sem_INSN_FCMPEQS },
72 { SH64_MEDIA_INSN_FCMPGED, && case_sem_INSN_FCMPGED },
73 { SH64_MEDIA_INSN_FCMPGES, && case_sem_INSN_FCMPGES },
74 { SH64_MEDIA_INSN_FCMPGTD, && case_sem_INSN_FCMPGTD },
75 { SH64_MEDIA_INSN_FCMPGTS, && case_sem_INSN_FCMPGTS },
76 { SH64_MEDIA_INSN_FCMPUND, && case_sem_INSN_FCMPUND },
77 { SH64_MEDIA_INSN_FCMPUNS, && case_sem_INSN_FCMPUNS },
78 { SH64_MEDIA_INSN_FCNVDS, && case_sem_INSN_FCNVDS },
79 { SH64_MEDIA_INSN_FCNVSD, && case_sem_INSN_FCNVSD },
80 { SH64_MEDIA_INSN_FDIVD, && case_sem_INSN_FDIVD },
81 { SH64_MEDIA_INSN_FDIVS, && case_sem_INSN_FDIVS },
82 { SH64_MEDIA_INSN_FGETSCR, && case_sem_INSN_FGETSCR },
83 { SH64_MEDIA_INSN_FIPRS, && case_sem_INSN_FIPRS },
84 { SH64_MEDIA_INSN_FLDD, && case_sem_INSN_FLDD },
85 { SH64_MEDIA_INSN_FLDP, && case_sem_INSN_FLDP },
86 { SH64_MEDIA_INSN_FLDS, && case_sem_INSN_FLDS },
87 { SH64_MEDIA_INSN_FLDXD, && case_sem_INSN_FLDXD },
88 { SH64_MEDIA_INSN_FLDXP, && case_sem_INSN_FLDXP },
89 { SH64_MEDIA_INSN_FLDXS, && case_sem_INSN_FLDXS },
90 { SH64_MEDIA_INSN_FLOATLD, && case_sem_INSN_FLOATLD },
91 { SH64_MEDIA_INSN_FLOATLS, && case_sem_INSN_FLOATLS },
92 { SH64_MEDIA_INSN_FLOATQD, && case_sem_INSN_FLOATQD },
93 { SH64_MEDIA_INSN_FLOATQS, && case_sem_INSN_FLOATQS },
94 { SH64_MEDIA_INSN_FMACS, && case_sem_INSN_FMACS },
95 { SH64_MEDIA_INSN_FMOVD, && case_sem_INSN_FMOVD },
96 { SH64_MEDIA_INSN_FMOVDQ, && case_sem_INSN_FMOVDQ },
97 { SH64_MEDIA_INSN_FMOVLS, && case_sem_INSN_FMOVLS },
98 { SH64_MEDIA_INSN_FMOVQD, && case_sem_INSN_FMOVQD },
99 { SH64_MEDIA_INSN_FMOVS, && case_sem_INSN_FMOVS },
100 { SH64_MEDIA_INSN_FMOVSL, && case_sem_INSN_FMOVSL },
101 { SH64_MEDIA_INSN_FMULD, && case_sem_INSN_FMULD },
102 { SH64_MEDIA_INSN_FMULS, && case_sem_INSN_FMULS },
103 { SH64_MEDIA_INSN_FNEGD, && case_sem_INSN_FNEGD },
104 { SH64_MEDIA_INSN_FNEGS, && case_sem_INSN_FNEGS },
105 { SH64_MEDIA_INSN_FPUTSCR, && case_sem_INSN_FPUTSCR },
106 { SH64_MEDIA_INSN_FSQRTD, && case_sem_INSN_FSQRTD },
107 { SH64_MEDIA_INSN_FSQRTS, && case_sem_INSN_FSQRTS },
108 { SH64_MEDIA_INSN_FSTD, && case_sem_INSN_FSTD },
109 { SH64_MEDIA_INSN_FSTP, && case_sem_INSN_FSTP },
110 { SH64_MEDIA_INSN_FSTS, && case_sem_INSN_FSTS },
111 { SH64_MEDIA_INSN_FSTXD, && case_sem_INSN_FSTXD },
112 { SH64_MEDIA_INSN_FSTXP, && case_sem_INSN_FSTXP },
113 { SH64_MEDIA_INSN_FSTXS, && case_sem_INSN_FSTXS },
114 { SH64_MEDIA_INSN_FSUBD, && case_sem_INSN_FSUBD },
115 { SH64_MEDIA_INSN_FSUBS, && case_sem_INSN_FSUBS },
116 { SH64_MEDIA_INSN_FTRCDL, && case_sem_INSN_FTRCDL },
117 { SH64_MEDIA_INSN_FTRCSL, && case_sem_INSN_FTRCSL },
118 { SH64_MEDIA_INSN_FTRCDQ, && case_sem_INSN_FTRCDQ },
119 { SH64_MEDIA_INSN_FTRCSQ, && case_sem_INSN_FTRCSQ },
120 { SH64_MEDIA_INSN_FTRVS, && case_sem_INSN_FTRVS },
121 { SH64_MEDIA_INSN_GETCFG, && case_sem_INSN_GETCFG },
122 { SH64_MEDIA_INSN_GETCON, && case_sem_INSN_GETCON },
123 { SH64_MEDIA_INSN_GETTR, && case_sem_INSN_GETTR },
124 { SH64_MEDIA_INSN_ICBI, && case_sem_INSN_ICBI },
125 { SH64_MEDIA_INSN_LDB, && case_sem_INSN_LDB },
126 { SH64_MEDIA_INSN_LDL, && case_sem_INSN_LDL },
127 { SH64_MEDIA_INSN_LDQ, && case_sem_INSN_LDQ },
128 { SH64_MEDIA_INSN_LDUB, && case_sem_INSN_LDUB },
129 { SH64_MEDIA_INSN_LDUW, && case_sem_INSN_LDUW },
130 { SH64_MEDIA_INSN_LDW, && case_sem_INSN_LDW },
131 { SH64_MEDIA_INSN_LDHIL, && case_sem_INSN_LDHIL },
132 { SH64_MEDIA_INSN_LDHIQ, && case_sem_INSN_LDHIQ },
133 { SH64_MEDIA_INSN_LDLOL, && case_sem_INSN_LDLOL },
134 { SH64_MEDIA_INSN_LDLOQ, && case_sem_INSN_LDLOQ },
135 { SH64_MEDIA_INSN_LDXB, && case_sem_INSN_LDXB },
136 { SH64_MEDIA_INSN_LDXL, && case_sem_INSN_LDXL },
137 { SH64_MEDIA_INSN_LDXQ, && case_sem_INSN_LDXQ },
138 { SH64_MEDIA_INSN_LDXUB, && case_sem_INSN_LDXUB },
139 { SH64_MEDIA_INSN_LDXUW, && case_sem_INSN_LDXUW },
140 { SH64_MEDIA_INSN_LDXW, && case_sem_INSN_LDXW },
141 { SH64_MEDIA_INSN_MABSL, && case_sem_INSN_MABSL },
142 { SH64_MEDIA_INSN_MABSW, && case_sem_INSN_MABSW },
143 { SH64_MEDIA_INSN_MADDL, && case_sem_INSN_MADDL },
144 { SH64_MEDIA_INSN_MADDW, && case_sem_INSN_MADDW },
145 { SH64_MEDIA_INSN_MADDSL, && case_sem_INSN_MADDSL },
146 { SH64_MEDIA_INSN_MADDSUB, && case_sem_INSN_MADDSUB },
147 { SH64_MEDIA_INSN_MADDSW, && case_sem_INSN_MADDSW },
148 { SH64_MEDIA_INSN_MCMPEQB, && case_sem_INSN_MCMPEQB },
149 { SH64_MEDIA_INSN_MCMPEQL, && case_sem_INSN_MCMPEQL },
150 { SH64_MEDIA_INSN_MCMPEQW, && case_sem_INSN_MCMPEQW },
151 { SH64_MEDIA_INSN_MCMPGTL, && case_sem_INSN_MCMPGTL },
152 { SH64_MEDIA_INSN_MCMPGTUB, && case_sem_INSN_MCMPGTUB },
153 { SH64_MEDIA_INSN_MCMPGTW, && case_sem_INSN_MCMPGTW },
154 { SH64_MEDIA_INSN_MCMV, && case_sem_INSN_MCMV },
155 { SH64_MEDIA_INSN_MCNVSLW, && case_sem_INSN_MCNVSLW },
156 { SH64_MEDIA_INSN_MCNVSWB, && case_sem_INSN_MCNVSWB },
157 { SH64_MEDIA_INSN_MCNVSWUB, && case_sem_INSN_MCNVSWUB },
158 { SH64_MEDIA_INSN_MEXTR1, && case_sem_INSN_MEXTR1 },
159 { SH64_MEDIA_INSN_MEXTR2, && case_sem_INSN_MEXTR2 },
160 { SH64_MEDIA_INSN_MEXTR3, && case_sem_INSN_MEXTR3 },
161 { SH64_MEDIA_INSN_MEXTR4, && case_sem_INSN_MEXTR4 },
162 { SH64_MEDIA_INSN_MEXTR5, && case_sem_INSN_MEXTR5 },
163 { SH64_MEDIA_INSN_MEXTR6, && case_sem_INSN_MEXTR6 },
164 { SH64_MEDIA_INSN_MEXTR7, && case_sem_INSN_MEXTR7 },
165 { SH64_MEDIA_INSN_MMACFXWL, && case_sem_INSN_MMACFXWL },
166 { SH64_MEDIA_INSN_MMACNFX_WL, && case_sem_INSN_MMACNFX_WL },
167 { SH64_MEDIA_INSN_MMULL, && case_sem_INSN_MMULL },
168 { SH64_MEDIA_INSN_MMULW, && case_sem_INSN_MMULW },
169 { SH64_MEDIA_INSN_MMULFXL, && case_sem_INSN_MMULFXL },
170 { SH64_MEDIA_INSN_MMULFXW, && case_sem_INSN_MMULFXW },
171 { SH64_MEDIA_INSN_MMULFXRPW, && case_sem_INSN_MMULFXRPW },
172 { SH64_MEDIA_INSN_MMULHIWL, && case_sem_INSN_MMULHIWL },
173 { SH64_MEDIA_INSN_MMULLOWL, && case_sem_INSN_MMULLOWL },
174 { SH64_MEDIA_INSN_MMULSUMWQ, && case_sem_INSN_MMULSUMWQ },
175 { SH64_MEDIA_INSN_MOVI, && case_sem_INSN_MOVI },
176 { SH64_MEDIA_INSN_MPERMW, && case_sem_INSN_MPERMW },
177 { SH64_MEDIA_INSN_MSADUBQ, && case_sem_INSN_MSADUBQ },
178 { SH64_MEDIA_INSN_MSHALDSL, && case_sem_INSN_MSHALDSL },
179 { SH64_MEDIA_INSN_MSHALDSW, && case_sem_INSN_MSHALDSW },
180 { SH64_MEDIA_INSN_MSHARDL, && case_sem_INSN_MSHARDL },
181 { SH64_MEDIA_INSN_MSHARDW, && case_sem_INSN_MSHARDW },
182 { SH64_MEDIA_INSN_MSHARDSQ, && case_sem_INSN_MSHARDSQ },
183 { SH64_MEDIA_INSN_MSHFHIB, && case_sem_INSN_MSHFHIB },
184 { SH64_MEDIA_INSN_MSHFHIL, && case_sem_INSN_MSHFHIL },
185 { SH64_MEDIA_INSN_MSHFHIW, && case_sem_INSN_MSHFHIW },
186 { SH64_MEDIA_INSN_MSHFLOB, && case_sem_INSN_MSHFLOB },
187 { SH64_MEDIA_INSN_MSHFLOL, && case_sem_INSN_MSHFLOL },
188 { SH64_MEDIA_INSN_MSHFLOW, && case_sem_INSN_MSHFLOW },
189 { SH64_MEDIA_INSN_MSHLLDL, && case_sem_INSN_MSHLLDL },
190 { SH64_MEDIA_INSN_MSHLLDW, && case_sem_INSN_MSHLLDW },
191 { SH64_MEDIA_INSN_MSHLRDL, && case_sem_INSN_MSHLRDL },
192 { SH64_MEDIA_INSN_MSHLRDW, && case_sem_INSN_MSHLRDW },
193 { SH64_MEDIA_INSN_MSUBL, && case_sem_INSN_MSUBL },
194 { SH64_MEDIA_INSN_MSUBW, && case_sem_INSN_MSUBW },
195 { SH64_MEDIA_INSN_MSUBSL, && case_sem_INSN_MSUBSL },
196 { SH64_MEDIA_INSN_MSUBSUB, && case_sem_INSN_MSUBSUB },
197 { SH64_MEDIA_INSN_MSUBSW, && case_sem_INSN_MSUBSW },
198 { SH64_MEDIA_INSN_MULSL, && case_sem_INSN_MULSL },
199 { SH64_MEDIA_INSN_MULUL, && case_sem_INSN_MULUL },
200 { SH64_MEDIA_INSN_NOP, && case_sem_INSN_NOP },
201 { SH64_MEDIA_INSN_NSB, && case_sem_INSN_NSB },
202 { SH64_MEDIA_INSN_OCBI, && case_sem_INSN_OCBI },
203 { SH64_MEDIA_INSN_OCBP, && case_sem_INSN_OCBP },
204 { SH64_MEDIA_INSN_OCBWB, && case_sem_INSN_OCBWB },
205 { SH64_MEDIA_INSN_OR, && case_sem_INSN_OR },
206 { SH64_MEDIA_INSN_ORI, && case_sem_INSN_ORI },
207 { SH64_MEDIA_INSN_PREFI, && case_sem_INSN_PREFI },
208 { SH64_MEDIA_INSN_PTA, && case_sem_INSN_PTA },
209 { SH64_MEDIA_INSN_PTABS, && case_sem_INSN_PTABS },
210 { SH64_MEDIA_INSN_PTB, && case_sem_INSN_PTB },
211 { SH64_MEDIA_INSN_PTREL, && case_sem_INSN_PTREL },
212 { SH64_MEDIA_INSN_PUTCFG, && case_sem_INSN_PUTCFG },
213 { SH64_MEDIA_INSN_PUTCON, && case_sem_INSN_PUTCON },
214 { SH64_MEDIA_INSN_RTE, && case_sem_INSN_RTE },
215 { SH64_MEDIA_INSN_SHARD, && case_sem_INSN_SHARD },
216 { SH64_MEDIA_INSN_SHARDL, && case_sem_INSN_SHARDL },
217 { SH64_MEDIA_INSN_SHARI, && case_sem_INSN_SHARI },
218 { SH64_MEDIA_INSN_SHARIL, && case_sem_INSN_SHARIL },
219 { SH64_MEDIA_INSN_SHLLD, && case_sem_INSN_SHLLD },
220 { SH64_MEDIA_INSN_SHLLDL, && case_sem_INSN_SHLLDL },
221 { SH64_MEDIA_INSN_SHLLI, && case_sem_INSN_SHLLI },
222 { SH64_MEDIA_INSN_SHLLIL, && case_sem_INSN_SHLLIL },
223 { SH64_MEDIA_INSN_SHLRD, && case_sem_INSN_SHLRD },
224 { SH64_MEDIA_INSN_SHLRDL, && case_sem_INSN_SHLRDL },
225 { SH64_MEDIA_INSN_SHLRI, && case_sem_INSN_SHLRI },
226 { SH64_MEDIA_INSN_SHLRIL, && case_sem_INSN_SHLRIL },
227 { SH64_MEDIA_INSN_SHORI, && case_sem_INSN_SHORI },
228 { SH64_MEDIA_INSN_SLEEP, && case_sem_INSN_SLEEP },
229 { SH64_MEDIA_INSN_STB, && case_sem_INSN_STB },
230 { SH64_MEDIA_INSN_STL, && case_sem_INSN_STL },
231 { SH64_MEDIA_INSN_STQ, && case_sem_INSN_STQ },
232 { SH64_MEDIA_INSN_STW, && case_sem_INSN_STW },
233 { SH64_MEDIA_INSN_STHIL, && case_sem_INSN_STHIL },
234 { SH64_MEDIA_INSN_STHIQ, && case_sem_INSN_STHIQ },
235 { SH64_MEDIA_INSN_STLOL, && case_sem_INSN_STLOL },
236 { SH64_MEDIA_INSN_STLOQ, && case_sem_INSN_STLOQ },
237 { SH64_MEDIA_INSN_STXB, && case_sem_INSN_STXB },
238 { SH64_MEDIA_INSN_STXL, && case_sem_INSN_STXL },
239 { SH64_MEDIA_INSN_STXQ, && case_sem_INSN_STXQ },
240 { SH64_MEDIA_INSN_STXW, && case_sem_INSN_STXW },
241 { SH64_MEDIA_INSN_SUB, && case_sem_INSN_SUB },
242 { SH64_MEDIA_INSN_SUBL, && case_sem_INSN_SUBL },
243 { SH64_MEDIA_INSN_SWAPQ, && case_sem_INSN_SWAPQ },
244 { SH64_MEDIA_INSN_SYNCI, && case_sem_INSN_SYNCI },
245 { SH64_MEDIA_INSN_SYNCO, && case_sem_INSN_SYNCO },
246 { SH64_MEDIA_INSN_TRAPA, && case_sem_INSN_TRAPA },
247 { SH64_MEDIA_INSN_XOR, && case_sem_INSN_XOR },
248 { SH64_MEDIA_INSN_XORI, && case_sem_INSN_XORI },
253 for (i = 0; labels[i].label != 0; ++i)
256 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
258 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
263 #endif /* DEFINE_LABELS */
267 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
268 off frills like tracing and profiling. */
269 /* FIXME: A better way would be to have TRACE_RESULT check for something
270 that can cause it to be optimized out. Another way would be to emit
271 special handlers into the instruction "stream". */
275 #define TRACE_RESULT(cpu, abuf, name, type, val)
279 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
280 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
282 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
289 /* Branch to next handler without going around main loop. */
290 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
291 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
293 #else /* ! WITH_SCACHE_PBB */
295 #define NEXT(vpc) BREAK (sem)
298 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
300 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
303 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
306 #endif /* ! WITH_SCACHE_PBB */
310 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
312 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
313 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
314 #define FLD(f) abuf->fields.fmt_empty.f
315 int UNUSED written = 0;
316 IADDR UNUSED pc = abuf->addr;
317 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
320 /* Update the recorded pc in the cpu state struct.
321 Only necessary for WITH_SCACHE case, but to avoid the
322 conditional compilation .... */
324 /* Virtual insns have zero size. Overwrite vpc with address of next insn
325 using the default-insn-bitsize spec. When executing insns in parallel
326 we may want to queue the fault and continue execution. */
327 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
328 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
335 CASE (sem, INSN_X_AFTER) : /* --after-- */
337 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
338 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
339 #define FLD(f) abuf->fields.fmt_empty.f
340 int UNUSED written = 0;
341 IADDR UNUSED pc = abuf->addr;
342 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
345 #if WITH_SCACHE_PBB_SH64_MEDIA
346 sh64_media_pbb_after (current_cpu, sem_arg);
354 CASE (sem, INSN_X_BEFORE) : /* --before-- */
356 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
357 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
358 #define FLD(f) abuf->fields.fmt_empty.f
359 int UNUSED written = 0;
360 IADDR UNUSED pc = abuf->addr;
361 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
364 #if WITH_SCACHE_PBB_SH64_MEDIA
365 sh64_media_pbb_before (current_cpu, sem_arg);
373 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
375 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
376 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
377 #define FLD(f) abuf->fields.fmt_empty.f
378 int UNUSED written = 0;
379 IADDR UNUSED pc = abuf->addr;
380 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
383 #if WITH_SCACHE_PBB_SH64_MEDIA
385 vpc = sh64_media_pbb_cti_chain (current_cpu, sem_arg,
386 pbb_br_type, pbb_br_npc);
389 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
390 vpc = sh64_media_pbb_cti_chain (current_cpu, sem_arg,
391 CPU_PBB_BR_TYPE (current_cpu),
392 CPU_PBB_BR_NPC (current_cpu));
401 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
403 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
404 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
405 #define FLD(f) abuf->fields.fmt_empty.f
406 int UNUSED written = 0;
407 IADDR UNUSED pc = abuf->addr;
408 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
411 #if WITH_SCACHE_PBB_SH64_MEDIA
412 vpc = sh64_media_pbb_chain (current_cpu, sem_arg);
423 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
425 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
426 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
427 #define FLD(f) abuf->fields.fmt_empty.f
428 int UNUSED written = 0;
429 IADDR UNUSED pc = abuf->addr;
430 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
433 #if WITH_SCACHE_PBB_SH64_MEDIA
434 #if defined DEFINE_SWITCH || defined FAST_P
435 /* In the switch case FAST_P is a constant, allowing several optimizations
436 in any called inline functions. */
437 vpc = sh64_media_pbb_begin (current_cpu, FAST_P);
439 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
440 vpc = sh64_media_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
442 vpc = sh64_media_pbb_begin (current_cpu, 0);
452 CASE (sem, INSN_ADD) : /* add $rm, $rn, $rd */
454 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
455 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
456 #define FLD(f) abuf->fields.sfmt_add.f
457 int UNUSED written = 0;
458 IADDR UNUSED pc = abuf->addr;
459 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
462 DI opval = ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
463 SET_H_GR (FLD (f_dest), opval);
464 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
471 CASE (sem, INSN_ADDL) : /* add.l $rm, $rn, $rd */
473 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
474 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
475 #define FLD(f) abuf->fields.sfmt_add.f
476 int UNUSED written = 0;
477 IADDR UNUSED pc = abuf->addr;
478 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
481 DI opval = ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
482 SET_H_GR (FLD (f_dest), opval);
483 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
490 CASE (sem, INSN_ADDI) : /* addi $rm, $disp10, $rd */
492 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
493 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
494 #define FLD(f) abuf->fields.sfmt_addi.f
495 int UNUSED written = 0;
496 IADDR UNUSED pc = abuf->addr;
497 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
500 DI opval = ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)));
501 SET_H_GR (FLD (f_dest), opval);
502 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
509 CASE (sem, INSN_ADDIL) : /* addi.l $rm, $disp10, $rd */
511 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
513 #define FLD(f) abuf->fields.sfmt_addi.f
514 int UNUSED written = 0;
515 IADDR UNUSED pc = abuf->addr;
516 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
519 DI opval = EXTSIDI (ADDSI (EXTSISI (FLD (f_disp10)), SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)));
520 SET_H_GR (FLD (f_dest), opval);
521 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
528 CASE (sem, INSN_ADDZL) : /* addz.l $rm, $rn, $rd */
530 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
531 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
532 #define FLD(f) abuf->fields.sfmt_add.f
533 int UNUSED written = 0;
534 IADDR UNUSED pc = abuf->addr;
535 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
538 DI opval = ZEXTSIDI (ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
539 SET_H_GR (FLD (f_dest), opval);
540 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
547 CASE (sem, INSN_ALLOCO) : /* alloco $rm, $disp6x32 */
549 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
550 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
551 #define FLD(f) abuf->fields.sfmt_xori.f
552 int UNUSED written = 0;
553 IADDR UNUSED pc = abuf->addr;
554 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
558 DI opval = GET_H_GR (FLD (f_left));
559 SET_H_GR (FLD (f_left), opval);
560 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
569 CASE (sem, INSN_AND) : /* and $rm, $rn, $rd */
571 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
572 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
573 #define FLD(f) abuf->fields.sfmt_add.f
574 int UNUSED written = 0;
575 IADDR UNUSED pc = abuf->addr;
576 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
579 DI opval = ANDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
580 SET_H_GR (FLD (f_dest), opval);
581 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
588 CASE (sem, INSN_ANDC) : /* andc $rm, $rn, $rd */
590 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
591 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
592 #define FLD(f) abuf->fields.sfmt_add.f
593 int UNUSED written = 0;
594 IADDR UNUSED pc = abuf->addr;
595 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
598 DI opval = ANDDI (GET_H_GR (FLD (f_left)), INVDI (GET_H_GR (FLD (f_right))));
599 SET_H_GR (FLD (f_dest), opval);
600 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
607 CASE (sem, INSN_ANDI) : /* andi $rm, $disp10, $rd */
609 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
610 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
611 #define FLD(f) abuf->fields.sfmt_addi.f
612 int UNUSED written = 0;
613 IADDR UNUSED pc = abuf->addr;
614 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
617 DI opval = ANDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)));
618 SET_H_GR (FLD (f_dest), opval);
619 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
626 CASE (sem, INSN_BEQ) : /* beq$likely $rm, $rn, $tra */
628 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
629 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
630 #define FLD(f) abuf->fields.sfmt_beq.f
631 int UNUSED written = 0;
632 IADDR UNUSED pc = abuf->addr;
634 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
638 if (EQDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
640 UDI opval = CPU (h_tr[FLD (f_tra)]);
641 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
643 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
648 abuf->written = written;
649 SEM_BRANCH_FINI (vpc);
654 CASE (sem, INSN_BEQI) : /* beqi$likely $rm, $imm6, $tra */
656 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
657 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
658 #define FLD(f) abuf->fields.sfmt_beqi.f
659 int UNUSED written = 0;
660 IADDR UNUSED pc = abuf->addr;
662 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
666 if (EQDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)))) {
668 UDI opval = CPU (h_tr[FLD (f_tra)]);
669 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
671 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
676 abuf->written = written;
677 SEM_BRANCH_FINI (vpc);
682 CASE (sem, INSN_BGE) : /* bge$likely $rm, $rn, $tra */
684 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
685 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
686 #define FLD(f) abuf->fields.sfmt_beq.f
687 int UNUSED written = 0;
688 IADDR UNUSED pc = abuf->addr;
690 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
694 if (GEDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
696 UDI opval = CPU (h_tr[FLD (f_tra)]);
697 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
699 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
704 abuf->written = written;
705 SEM_BRANCH_FINI (vpc);
710 CASE (sem, INSN_BGEU) : /* bgeu$likely $rm, $rn, $tra */
712 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
713 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
714 #define FLD(f) abuf->fields.sfmt_beq.f
715 int UNUSED written = 0;
716 IADDR UNUSED pc = abuf->addr;
718 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
722 if (GEUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
724 UDI opval = CPU (h_tr[FLD (f_tra)]);
725 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
727 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
732 abuf->written = written;
733 SEM_BRANCH_FINI (vpc);
738 CASE (sem, INSN_BGT) : /* bgt$likely $rm, $rn, $tra */
740 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
741 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
742 #define FLD(f) abuf->fields.sfmt_beq.f
743 int UNUSED written = 0;
744 IADDR UNUSED pc = abuf->addr;
746 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
750 if (GTDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
752 UDI opval = CPU (h_tr[FLD (f_tra)]);
753 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
755 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
760 abuf->written = written;
761 SEM_BRANCH_FINI (vpc);
766 CASE (sem, INSN_BGTU) : /* bgtu$likely $rm, $rn, $tra */
768 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
769 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
770 #define FLD(f) abuf->fields.sfmt_beq.f
771 int UNUSED written = 0;
772 IADDR UNUSED pc = abuf->addr;
774 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
778 if (GTUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
780 UDI opval = CPU (h_tr[FLD (f_tra)]);
781 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
783 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
788 abuf->written = written;
789 SEM_BRANCH_FINI (vpc);
794 CASE (sem, INSN_BLINK) : /* blink $trb, $rd */
796 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
797 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
798 #define FLD(f) abuf->fields.sfmt_blink.f
799 int UNUSED written = 0;
800 IADDR UNUSED pc = abuf->addr;
802 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
806 DI opval = ORDI (ADDDI (pc, 4), 1);
807 SET_H_GR (FLD (f_dest), opval);
808 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
811 UDI opval = CPU (h_tr[FLD (f_trb)]);
812 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
813 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
815 if (EQSI (FLD (f_dest), 63)) {
822 SEM_BRANCH_FINI (vpc);
827 CASE (sem, INSN_BNE) : /* bne$likely $rm, $rn, $tra */
829 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
830 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
831 #define FLD(f) abuf->fields.sfmt_beq.f
832 int UNUSED written = 0;
833 IADDR UNUSED pc = abuf->addr;
835 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
839 if (NEDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
841 UDI opval = CPU (h_tr[FLD (f_tra)]);
842 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
844 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
849 abuf->written = written;
850 SEM_BRANCH_FINI (vpc);
855 CASE (sem, INSN_BNEI) : /* bnei$likely $rm, $imm6, $tra */
857 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
858 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
859 #define FLD(f) abuf->fields.sfmt_beqi.f
860 int UNUSED written = 0;
861 IADDR UNUSED pc = abuf->addr;
863 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
867 if (NEDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)))) {
869 UDI opval = CPU (h_tr[FLD (f_tra)]);
870 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
872 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
877 abuf->written = written;
878 SEM_BRANCH_FINI (vpc);
883 CASE (sem, INSN_BRK) : /* brk */
885 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
886 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
887 #define FLD(f) abuf->fields.fmt_empty.f
888 int UNUSED written = 0;
889 IADDR UNUSED pc = abuf->addr;
890 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
892 sh64_break (current_cpu, pc);
898 CASE (sem, INSN_BYTEREV) : /* byterev $rm, $rd */
900 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
901 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
902 #define FLD(f) abuf->fields.sfmt_xori.f
903 int UNUSED written = 0;
904 IADDR UNUSED pc = abuf->addr;
905 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
910 tmp_source = GET_H_GR (FLD (f_left));
913 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
914 tmp_source = SRLDI (tmp_source, 8);
917 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
918 tmp_source = SRLDI (tmp_source, 8);
921 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
922 tmp_source = SRLDI (tmp_source, 8);
925 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
926 tmp_source = SRLDI (tmp_source, 8);
929 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
930 tmp_source = SRLDI (tmp_source, 8);
933 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
934 tmp_source = SRLDI (tmp_source, 8);
937 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
938 tmp_source = SRLDI (tmp_source, 8);
941 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
942 tmp_source = SRLDI (tmp_source, 8);
945 DI opval = tmp_result;
946 SET_H_GR (FLD (f_dest), opval);
947 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
955 CASE (sem, INSN_CMPEQ) : /* cmpeq $rm, $rn, $rd */
957 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
958 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
959 #define FLD(f) abuf->fields.sfmt_add.f
960 int UNUSED written = 0;
961 IADDR UNUSED pc = abuf->addr;
962 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
965 DI opval = ((EQDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) ? (1) : (0));
966 SET_H_GR (FLD (f_dest), opval);
967 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
974 CASE (sem, INSN_CMPGT) : /* cmpgt $rm, $rn, $rd */
976 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
977 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
978 #define FLD(f) abuf->fields.sfmt_add.f
979 int UNUSED written = 0;
980 IADDR UNUSED pc = abuf->addr;
981 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
984 DI opval = ((GTDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) ? (1) : (0));
985 SET_H_GR (FLD (f_dest), opval);
986 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
993 CASE (sem, INSN_CMPGTU) : /* cmpgtu $rm,$rn, $rd */
995 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
996 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
997 #define FLD(f) abuf->fields.sfmt_add.f
998 int UNUSED written = 0;
999 IADDR UNUSED pc = abuf->addr;
1000 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1003 DI opval = ((GTUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) ? (1) : (0));
1004 SET_H_GR (FLD (f_dest), opval);
1005 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1012 CASE (sem, INSN_CMVEQ) : /* cmveq $rm, $rn, $rd */
1014 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1015 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1016 #define FLD(f) abuf->fields.sfmt_add.f
1017 int UNUSED written = 0;
1018 IADDR UNUSED pc = abuf->addr;
1019 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1021 if (EQDI (GET_H_GR (FLD (f_left)), 0)) {
1023 DI opval = GET_H_GR (FLD (f_right));
1024 SET_H_GR (FLD (f_dest), opval);
1025 written |= (1 << 2);
1026 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1030 abuf->written = written;
1035 CASE (sem, INSN_CMVNE) : /* cmvne $rm, $rn, $rd */
1037 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1038 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1039 #define FLD(f) abuf->fields.sfmt_add.f
1040 int UNUSED written = 0;
1041 IADDR UNUSED pc = abuf->addr;
1042 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1044 if (NEDI (GET_H_GR (FLD (f_left)), 0)) {
1046 DI opval = GET_H_GR (FLD (f_right));
1047 SET_H_GR (FLD (f_dest), opval);
1048 written |= (1 << 2);
1049 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1053 abuf->written = written;
1058 CASE (sem, INSN_FABSD) : /* fabs.d $drgh, $drf */
1060 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1061 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1062 #define FLD(f) abuf->fields.sfmt_fabsd.f
1063 int UNUSED written = 0;
1064 IADDR UNUSED pc = abuf->addr;
1065 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1068 DF opval = sh64_fabsd (current_cpu, GET_H_DR (FLD (f_left_right)));
1069 SET_H_DR (FLD (f_dest), opval);
1070 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1077 CASE (sem, INSN_FABSS) : /* fabs.s $frgh, $frf */
1079 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1080 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1081 #define FLD(f) abuf->fields.sfmt_fabsd.f
1082 int UNUSED written = 0;
1083 IADDR UNUSED pc = abuf->addr;
1084 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1087 SF opval = sh64_fabss (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1088 CPU (h_fr[FLD (f_dest)]) = opval;
1089 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1096 CASE (sem, INSN_FADDD) : /* fadd.d $drg, $drh, $drf */
1098 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1099 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1100 #define FLD(f) abuf->fields.sfmt_add.f
1101 int UNUSED written = 0;
1102 IADDR UNUSED pc = abuf->addr;
1103 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1106 DF opval = sh64_faddd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
1107 SET_H_DR (FLD (f_dest), opval);
1108 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1115 CASE (sem, INSN_FADDS) : /* fadd.s $frg, $frh, $frf */
1117 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1118 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1119 #define FLD(f) abuf->fields.sfmt_add.f
1120 int UNUSED written = 0;
1121 IADDR UNUSED pc = abuf->addr;
1122 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1125 SF opval = sh64_fadds (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
1126 CPU (h_fr[FLD (f_dest)]) = opval;
1127 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1134 CASE (sem, INSN_FCMPEQD) : /* fcmpeq.d $drg, $drh, $rd */
1136 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1137 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1138 #define FLD(f) abuf->fields.sfmt_add.f
1139 int UNUSED written = 0;
1140 IADDR UNUSED pc = abuf->addr;
1141 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1144 DI opval = ZEXTBIDI (sh64_fcmpeqd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1145 SET_H_GR (FLD (f_dest), opval);
1146 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1153 CASE (sem, INSN_FCMPEQS) : /* fcmpeq.s $frg, $frh, $rd */
1155 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1156 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1157 #define FLD(f) abuf->fields.sfmt_add.f
1158 int UNUSED written = 0;
1159 IADDR UNUSED pc = abuf->addr;
1160 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1163 DI opval = ZEXTBIDI (sh64_fcmpeqs (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1164 SET_H_GR (FLD (f_dest), opval);
1165 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1172 CASE (sem, INSN_FCMPGED) : /* fcmpge.d $drg, $drh, $rd */
1174 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1175 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1176 #define FLD(f) abuf->fields.sfmt_add.f
1177 int UNUSED written = 0;
1178 IADDR UNUSED pc = abuf->addr;
1179 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1182 DI opval = ZEXTBIDI (sh64_fcmpged (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1183 SET_H_GR (FLD (f_dest), opval);
1184 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1191 CASE (sem, INSN_FCMPGES) : /* fcmpge.s $frg, $frh, $rd */
1193 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1194 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1195 #define FLD(f) abuf->fields.sfmt_add.f
1196 int UNUSED written = 0;
1197 IADDR UNUSED pc = abuf->addr;
1198 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1201 DI opval = ZEXTBIDI (sh64_fcmpges (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1202 SET_H_GR (FLD (f_dest), opval);
1203 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1210 CASE (sem, INSN_FCMPGTD) : /* fcmpgt.d $drg, $drh, $rd */
1212 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1213 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1214 #define FLD(f) abuf->fields.sfmt_add.f
1215 int UNUSED written = 0;
1216 IADDR UNUSED pc = abuf->addr;
1217 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1220 DI opval = ZEXTBIDI (sh64_fcmpgtd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1221 SET_H_GR (FLD (f_dest), opval);
1222 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1229 CASE (sem, INSN_FCMPGTS) : /* fcmpgt.s $frg, $frh, $rd */
1231 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1232 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1233 #define FLD(f) abuf->fields.sfmt_add.f
1234 int UNUSED written = 0;
1235 IADDR UNUSED pc = abuf->addr;
1236 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1239 DI opval = ZEXTBIDI (sh64_fcmpgts (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1240 SET_H_GR (FLD (f_dest), opval);
1241 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1248 CASE (sem, INSN_FCMPUND) : /* fcmpun.d $drg, $drh, $rd */
1250 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1251 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1252 #define FLD(f) abuf->fields.sfmt_add.f
1253 int UNUSED written = 0;
1254 IADDR UNUSED pc = abuf->addr;
1255 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1258 DI opval = ZEXTBIDI (sh64_fcmpund (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1259 SET_H_GR (FLD (f_dest), opval);
1260 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1267 CASE (sem, INSN_FCMPUNS) : /* fcmpun.s $frg, $frh, $rd */
1269 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1270 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1271 #define FLD(f) abuf->fields.sfmt_add.f
1272 int UNUSED written = 0;
1273 IADDR UNUSED pc = abuf->addr;
1274 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1277 DI opval = ZEXTBIDI (sh64_fcmpuns (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1278 SET_H_GR (FLD (f_dest), opval);
1279 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1286 CASE (sem, INSN_FCNVDS) : /* fcnv.ds $drgh, $frf */
1288 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1289 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1290 #define FLD(f) abuf->fields.sfmt_fabsd.f
1291 int UNUSED written = 0;
1292 IADDR UNUSED pc = abuf->addr;
1293 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1296 SF opval = sh64_fcnvds (current_cpu, GET_H_DR (FLD (f_left_right)));
1297 CPU (h_fr[FLD (f_dest)]) = opval;
1298 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1305 CASE (sem, INSN_FCNVSD) : /* fcnv.sd $frgh, $drf */
1307 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1308 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1309 #define FLD(f) abuf->fields.sfmt_fabsd.f
1310 int UNUSED written = 0;
1311 IADDR UNUSED pc = abuf->addr;
1312 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1315 DF opval = sh64_fcnvsd (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1316 SET_H_DR (FLD (f_dest), opval);
1317 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1324 CASE (sem, INSN_FDIVD) : /* fdiv.d $drg, $drh, $drf */
1326 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1327 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1328 #define FLD(f) abuf->fields.sfmt_add.f
1329 int UNUSED written = 0;
1330 IADDR UNUSED pc = abuf->addr;
1331 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1334 DF opval = sh64_fdivd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
1335 SET_H_DR (FLD (f_dest), opval);
1336 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1343 CASE (sem, INSN_FDIVS) : /* fdiv.s $frg, $frh, $frf */
1345 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1346 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1347 #define FLD(f) abuf->fields.sfmt_add.f
1348 int UNUSED written = 0;
1349 IADDR UNUSED pc = abuf->addr;
1350 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1353 SF opval = sh64_fdivs (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
1354 CPU (h_fr[FLD (f_dest)]) = opval;
1355 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1362 CASE (sem, INSN_FGETSCR) : /* fgetscr $frf */
1364 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1365 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1366 #define FLD(f) abuf->fields.sfmt_shori.f
1367 int UNUSED written = 0;
1368 IADDR UNUSED pc = abuf->addr;
1369 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1372 SF opval = SUBWORDSISF (CPU (h_fpscr));
1373 CPU (h_fr[FLD (f_dest)]) = opval;
1374 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1381 CASE (sem, INSN_FIPRS) : /* fipr.s $fvg, $fvh, $frf */
1383 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1384 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1385 #define FLD(f) abuf->fields.sfmt_add.f
1386 int UNUSED written = 0;
1387 IADDR UNUSED pc = abuf->addr;
1388 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1392 SF opval = GET_H_FV (FLD (f_left));
1393 SET_H_FV (FLD (f_left), opval);
1394 TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
1397 SF opval = GET_H_FV (FLD (f_right));
1398 SET_H_FV (FLD (f_right), opval);
1399 TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
1402 SF opval = sh64_fiprs (current_cpu, FLD (f_left), FLD (f_right));
1403 CPU (h_fr[FLD (f_dest)]) = opval;
1404 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1412 CASE (sem, INSN_FLDD) : /* fld.d $rm, $disp10x8, $drf */
1414 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1415 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1416 #define FLD(f) abuf->fields.sfmt_fldd.f
1417 int UNUSED written = 0;
1418 IADDR UNUSED pc = abuf->addr;
1419 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1422 DF opval = GETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x8)));
1423 SET_H_DR (FLD (f_dest), opval);
1424 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1431 CASE (sem, INSN_FLDP) : /* fld.p $rm, $disp10x8, $fpf */
1433 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1434 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1435 #define FLD(f) abuf->fields.sfmt_fldd.f
1436 int UNUSED written = 0;
1437 IADDR UNUSED pc = abuf->addr;
1438 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1442 SF opval = GET_H_FP (FLD (f_dest));
1443 SET_H_FP (FLD (f_dest), opval);
1444 TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1446 sh64_fldp (current_cpu, pc, GET_H_GR (FLD (f_left)), FLD (f_disp10x8), FLD (f_dest));
1453 CASE (sem, INSN_FLDS) : /* fld.s $rm, $disp10x4, $frf */
1455 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1456 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1457 #define FLD(f) abuf->fields.sfmt_flds.f
1458 int UNUSED written = 0;
1459 IADDR UNUSED pc = abuf->addr;
1460 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1463 SF opval = GETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x4)));
1464 CPU (h_fr[FLD (f_dest)]) = opval;
1465 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1472 CASE (sem, INSN_FLDXD) : /* fldx.d $rm, $rn, $drf */
1474 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1475 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1476 #define FLD(f) abuf->fields.sfmt_add.f
1477 int UNUSED written = 0;
1478 IADDR UNUSED pc = abuf->addr;
1479 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1482 DF opval = GETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))));
1483 SET_H_DR (FLD (f_dest), opval);
1484 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1491 CASE (sem, INSN_FLDXP) : /* fldx.p $rm, $rn, $fpf */
1493 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1494 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1495 #define FLD(f) abuf->fields.sfmt_add.f
1496 int UNUSED written = 0;
1497 IADDR UNUSED pc = abuf->addr;
1498 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1502 SF opval = GET_H_FP (FLD (f_dest));
1503 SET_H_FP (FLD (f_dest), opval);
1504 TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1506 sh64_fldp (current_cpu, pc, GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)), FLD (f_dest));
1513 CASE (sem, INSN_FLDXS) : /* fldx.s $rm, $rn, $frf */
1515 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1516 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1517 #define FLD(f) abuf->fields.sfmt_add.f
1518 int UNUSED written = 0;
1519 IADDR UNUSED pc = abuf->addr;
1520 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1523 SF opval = GETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))));
1524 CPU (h_fr[FLD (f_dest)]) = opval;
1525 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1532 CASE (sem, INSN_FLOATLD) : /* float.ld $frgh, $drf */
1534 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1535 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1536 #define FLD(f) abuf->fields.sfmt_fabsd.f
1537 int UNUSED written = 0;
1538 IADDR UNUSED pc = abuf->addr;
1539 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1542 DF opval = sh64_floatld (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1543 SET_H_DR (FLD (f_dest), opval);
1544 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1551 CASE (sem, INSN_FLOATLS) : /* float.ls $frgh, $frf */
1553 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1554 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1555 #define FLD(f) abuf->fields.sfmt_fabsd.f
1556 int UNUSED written = 0;
1557 IADDR UNUSED pc = abuf->addr;
1558 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1561 SF opval = sh64_floatls (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1562 CPU (h_fr[FLD (f_dest)]) = opval;
1563 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1570 CASE (sem, INSN_FLOATQD) : /* float.qd $drgh, $drf */
1572 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1573 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1574 #define FLD(f) abuf->fields.sfmt_fabsd.f
1575 int UNUSED written = 0;
1576 IADDR UNUSED pc = abuf->addr;
1577 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1580 DF opval = sh64_floatqd (current_cpu, GET_H_DR (FLD (f_left_right)));
1581 SET_H_DR (FLD (f_dest), opval);
1582 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1589 CASE (sem, INSN_FLOATQS) : /* float.qs $drgh, $frf */
1591 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1592 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1593 #define FLD(f) abuf->fields.sfmt_fabsd.f
1594 int UNUSED written = 0;
1595 IADDR UNUSED pc = abuf->addr;
1596 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1599 SF opval = sh64_floatqs (current_cpu, GET_H_DR (FLD (f_left_right)));
1600 CPU (h_fr[FLD (f_dest)]) = opval;
1601 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1608 CASE (sem, INSN_FMACS) : /* fmac.s $frg, $frh, $frf */
1610 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1611 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1612 #define FLD(f) abuf->fields.sfmt_add.f
1613 int UNUSED written = 0;
1614 IADDR UNUSED pc = abuf->addr;
1615 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1618 SF opval = sh64_fadds (current_cpu, CPU (h_fr[FLD (f_dest)]), sh64_fmuls (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1619 CPU (h_fr[FLD (f_dest)]) = opval;
1620 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1627 CASE (sem, INSN_FMOVD) : /* fmov.d $drgh, $drf */
1629 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1630 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1631 #define FLD(f) abuf->fields.sfmt_fabsd.f
1632 int UNUSED written = 0;
1633 IADDR UNUSED pc = abuf->addr;
1634 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1637 DF opval = GET_H_DR (FLD (f_left_right));
1638 SET_H_DR (FLD (f_dest), opval);
1639 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1646 CASE (sem, INSN_FMOVDQ) : /* fmov.dq $drgh, $rd */
1648 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1649 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1650 #define FLD(f) abuf->fields.sfmt_fabsd.f
1651 int UNUSED written = 0;
1652 IADDR UNUSED pc = abuf->addr;
1653 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1656 DI opval = SUBWORDDFDI (GET_H_DR (FLD (f_left_right)));
1657 SET_H_GR (FLD (f_dest), opval);
1658 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1665 CASE (sem, INSN_FMOVLS) : /* fmov.ls $rm, $frf */
1667 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1668 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1669 #define FLD(f) abuf->fields.sfmt_xori.f
1670 int UNUSED written = 0;
1671 IADDR UNUSED pc = abuf->addr;
1672 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1675 SF opval = SUBWORDSISF (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1));
1676 CPU (h_fr[FLD (f_dest)]) = opval;
1677 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1684 CASE (sem, INSN_FMOVQD) : /* fmov.qd $rm, $drf */
1686 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1687 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1688 #define FLD(f) abuf->fields.sfmt_xori.f
1689 int UNUSED written = 0;
1690 IADDR UNUSED pc = abuf->addr;
1691 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1694 DF opval = SUBWORDDIDF (GET_H_GR (FLD (f_left)));
1695 SET_H_DR (FLD (f_dest), opval);
1696 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1703 CASE (sem, INSN_FMOVS) : /* fmov.s $frgh, $frf */
1705 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1706 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1707 #define FLD(f) abuf->fields.sfmt_fabsd.f
1708 int UNUSED written = 0;
1709 IADDR UNUSED pc = abuf->addr;
1710 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1713 SF opval = CPU (h_fr[FLD (f_left_right)]);
1714 CPU (h_fr[FLD (f_dest)]) = opval;
1715 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1722 CASE (sem, INSN_FMOVSL) : /* fmov.sl $frgh, $rd */
1724 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1725 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1726 #define FLD(f) abuf->fields.sfmt_fabsd.f
1727 int UNUSED written = 0;
1728 IADDR UNUSED pc = abuf->addr;
1729 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1732 DI opval = EXTSIDI (SUBWORDSFSI (CPU (h_fr[FLD (f_left_right)])));
1733 SET_H_GR (FLD (f_dest), opval);
1734 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1741 CASE (sem, INSN_FMULD) : /* fmul.d $drg, $drh, $drf */
1743 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1744 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1745 #define FLD(f) abuf->fields.sfmt_add.f
1746 int UNUSED written = 0;
1747 IADDR UNUSED pc = abuf->addr;
1748 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1751 DF opval = sh64_fmuld (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
1752 SET_H_DR (FLD (f_dest), opval);
1753 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1760 CASE (sem, INSN_FMULS) : /* fmul.s $frg, $frh, $frf */
1762 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1763 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1764 #define FLD(f) abuf->fields.sfmt_add.f
1765 int UNUSED written = 0;
1766 IADDR UNUSED pc = abuf->addr;
1767 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1770 SF opval = sh64_fmuls (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
1771 CPU (h_fr[FLD (f_dest)]) = opval;
1772 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1779 CASE (sem, INSN_FNEGD) : /* fneg.d $drgh, $drf */
1781 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1782 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1783 #define FLD(f) abuf->fields.sfmt_fabsd.f
1784 int UNUSED written = 0;
1785 IADDR UNUSED pc = abuf->addr;
1786 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1789 DF opval = sh64_fnegd (current_cpu, GET_H_DR (FLD (f_left_right)));
1790 SET_H_DR (FLD (f_dest), opval);
1791 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1798 CASE (sem, INSN_FNEGS) : /* fneg.s $frgh, $frf */
1800 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1801 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1802 #define FLD(f) abuf->fields.sfmt_fabsd.f
1803 int UNUSED written = 0;
1804 IADDR UNUSED pc = abuf->addr;
1805 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1808 SF opval = sh64_fnegs (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1809 CPU (h_fr[FLD (f_dest)]) = opval;
1810 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1817 CASE (sem, INSN_FPUTSCR) : /* fputscr $frgh */
1819 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1820 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1821 #define FLD(f) abuf->fields.sfmt_fabsd.f
1822 int UNUSED written = 0;
1823 IADDR UNUSED pc = abuf->addr;
1824 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1827 SI opval = SUBWORDSFSI (CPU (h_fr[FLD (f_left_right)]));
1828 CPU (h_fpscr) = opval;
1829 TRACE_RESULT (current_cpu, abuf, "fpscr", 'x', opval);
1836 CASE (sem, INSN_FSQRTD) : /* fsqrt.d $drgh, $drf */
1838 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1839 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1840 #define FLD(f) abuf->fields.sfmt_fabsd.f
1841 int UNUSED written = 0;
1842 IADDR UNUSED pc = abuf->addr;
1843 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1846 DF opval = sh64_fsqrtd (current_cpu, GET_H_DR (FLD (f_left_right)));
1847 SET_H_DR (FLD (f_dest), opval);
1848 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1855 CASE (sem, INSN_FSQRTS) : /* fsqrt.s $frgh, $frf */
1857 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1858 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1859 #define FLD(f) abuf->fields.sfmt_fabsd.f
1860 int UNUSED written = 0;
1861 IADDR UNUSED pc = abuf->addr;
1862 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1865 SF opval = sh64_fsqrts (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1866 CPU (h_fr[FLD (f_dest)]) = opval;
1867 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1874 CASE (sem, INSN_FSTD) : /* fst.d $rm, $disp10x8, $drf */
1876 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1877 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1878 #define FLD(f) abuf->fields.sfmt_fldd.f
1879 int UNUSED written = 0;
1880 IADDR UNUSED pc = abuf->addr;
1881 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1884 DF opval = GET_H_DR (FLD (f_dest));
1885 SETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x8)), opval);
1886 TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1893 CASE (sem, INSN_FSTP) : /* fst.p $rm, $disp10x8, $fpf */
1895 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1896 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1897 #define FLD(f) abuf->fields.sfmt_fldd.f
1898 int UNUSED written = 0;
1899 IADDR UNUSED pc = abuf->addr;
1900 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1904 SF opval = GET_H_FP (FLD (f_dest));
1905 SET_H_FP (FLD (f_dest), opval);
1906 TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1908 sh64_fstp (current_cpu, pc, GET_H_GR (FLD (f_left)), FLD (f_disp10x8), FLD (f_dest));
1915 CASE (sem, INSN_FSTS) : /* fst.s $rm, $disp10x4, $frf */
1917 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1918 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1919 #define FLD(f) abuf->fields.sfmt_flds.f
1920 int UNUSED written = 0;
1921 IADDR UNUSED pc = abuf->addr;
1922 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1925 SF opval = CPU (h_fr[FLD (f_dest)]);
1926 SETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x4)), opval);
1927 TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1934 CASE (sem, INSN_FSTXD) : /* fstx.d $rm, $rn, $drf */
1936 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1937 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1938 #define FLD(f) abuf->fields.sfmt_add.f
1939 int UNUSED written = 0;
1940 IADDR UNUSED pc = abuf->addr;
1941 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1944 DF opval = GET_H_DR (FLD (f_dest));
1945 SETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
1946 TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1953 CASE (sem, INSN_FSTXP) : /* fstx.p $rm, $rn, $fpf */
1955 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1956 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1957 #define FLD(f) abuf->fields.sfmt_add.f
1958 int UNUSED written = 0;
1959 IADDR UNUSED pc = abuf->addr;
1960 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1964 SF opval = GET_H_FP (FLD (f_dest));
1965 SET_H_FP (FLD (f_dest), opval);
1966 TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1968 sh64_fstp (current_cpu, pc, GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)), FLD (f_dest));
1975 CASE (sem, INSN_FSTXS) : /* fstx.s $rm, $rn, $frf */
1977 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1978 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1979 #define FLD(f) abuf->fields.sfmt_add.f
1980 int UNUSED written = 0;
1981 IADDR UNUSED pc = abuf->addr;
1982 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1985 SF opval = CPU (h_fr[FLD (f_dest)]);
1986 SETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
1987 TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1994 CASE (sem, INSN_FSUBD) : /* fsub.d $drg, $drh, $drf */
1996 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1997 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1998 #define FLD(f) abuf->fields.sfmt_add.f
1999 int UNUSED written = 0;
2000 IADDR UNUSED pc = abuf->addr;
2001 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2004 DF opval = sh64_fsubd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
2005 SET_H_DR (FLD (f_dest), opval);
2006 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
2013 CASE (sem, INSN_FSUBS) : /* fsub.s $frg, $frh, $frf */
2015 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2016 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2017 #define FLD(f) abuf->fields.sfmt_add.f
2018 int UNUSED written = 0;
2019 IADDR UNUSED pc = abuf->addr;
2020 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2023 SF opval = sh64_fsubs (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
2024 CPU (h_fr[FLD (f_dest)]) = opval;
2025 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
2032 CASE (sem, INSN_FTRCDL) : /* ftrc.dl $drgh, $frf */
2034 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2035 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2036 #define FLD(f) abuf->fields.sfmt_fabsd.f
2037 int UNUSED written = 0;
2038 IADDR UNUSED pc = abuf->addr;
2039 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2042 SF opval = sh64_ftrcdl (current_cpu, GET_H_DR (FLD (f_left_right)));
2043 CPU (h_fr[FLD (f_dest)]) = opval;
2044 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
2051 CASE (sem, INSN_FTRCSL) : /* ftrc.sl $frgh, $frf */
2053 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2054 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2055 #define FLD(f) abuf->fields.sfmt_fabsd.f
2056 int UNUSED written = 0;
2057 IADDR UNUSED pc = abuf->addr;
2058 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2061 SF opval = sh64_ftrcsl (current_cpu, CPU (h_fr[FLD (f_left_right)]));
2062 CPU (h_fr[FLD (f_dest)]) = opval;
2063 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
2070 CASE (sem, INSN_FTRCDQ) : /* ftrc.dq $drgh, $drf */
2072 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2073 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2074 #define FLD(f) abuf->fields.sfmt_fabsd.f
2075 int UNUSED written = 0;
2076 IADDR UNUSED pc = abuf->addr;
2077 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2080 DF opval = sh64_ftrcdq (current_cpu, GET_H_DR (FLD (f_left_right)));
2081 SET_H_DR (FLD (f_dest), opval);
2082 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
2089 CASE (sem, INSN_FTRCSQ) : /* ftrc.sq $frgh, $drf */
2091 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2092 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2093 #define FLD(f) abuf->fields.sfmt_fabsd.f
2094 int UNUSED written = 0;
2095 IADDR UNUSED pc = abuf->addr;
2096 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2099 DF opval = sh64_ftrcsq (current_cpu, CPU (h_fr[FLD (f_left_right)]));
2100 SET_H_DR (FLD (f_dest), opval);
2101 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
2108 CASE (sem, INSN_FTRVS) : /* ftrv.s $mtrxg, $fvh, $fvf */
2110 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2111 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2112 #define FLD(f) abuf->fields.sfmt_add.f
2113 int UNUSED written = 0;
2114 IADDR UNUSED pc = abuf->addr;
2115 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2119 SF opval = GET_H_FMTX (FLD (f_left));
2120 SET_H_FMTX (FLD (f_left), opval);
2121 TRACE_RESULT (current_cpu, abuf, "fmtx", 'f', opval);
2124 SF opval = GET_H_FV (FLD (f_right));
2125 SET_H_FV (FLD (f_right), opval);
2126 TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
2129 SF opval = GET_H_FV (FLD (f_dest));
2130 SET_H_FV (FLD (f_dest), opval);
2131 TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
2133 sh64_ftrvs (current_cpu, FLD (f_left), FLD (f_right), FLD (f_dest));
2140 CASE (sem, INSN_GETCFG) : /* getcfg $rm, $disp6, $rd */
2142 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2143 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2144 #define FLD(f) abuf->fields.sfmt_getcfg.f
2145 int UNUSED written = 0;
2146 IADDR UNUSED pc = abuf->addr;
2147 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2151 tmp_address = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2154 DI opval = GETMEMSI (current_cpu, pc, tmp_address);
2155 SET_H_GR (FLD (f_dest), opval);
2156 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2164 CASE (sem, INSN_GETCON) : /* getcon $crk, $rd */
2166 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2167 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2168 #define FLD(f) abuf->fields.sfmt_xori.f
2169 int UNUSED written = 0;
2170 IADDR UNUSED pc = abuf->addr;
2171 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2174 DI opval = GET_H_CR (FLD (f_left));
2175 SET_H_GR (FLD (f_dest), opval);
2176 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2183 CASE (sem, INSN_GETTR) : /* gettr $trb, $rd */
2185 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2186 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2187 #define FLD(f) abuf->fields.sfmt_blink.f
2188 int UNUSED written = 0;
2189 IADDR UNUSED pc = abuf->addr;
2190 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2193 DI opval = CPU (h_tr[FLD (f_trb)]);
2194 SET_H_GR (FLD (f_dest), opval);
2195 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2202 CASE (sem, INSN_ICBI) : /* icbi $rm, $disp6x32 */
2204 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2205 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2206 #define FLD(f) abuf->fields.sfmt_xori.f
2207 int UNUSED written = 0;
2208 IADDR UNUSED pc = abuf->addr;
2209 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2213 DI opval = GET_H_GR (FLD (f_left));
2214 SET_H_GR (FLD (f_left), opval);
2215 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2224 CASE (sem, INSN_LDB) : /* ld.b $rm, $disp10, $rd */
2226 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2227 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2228 #define FLD(f) abuf->fields.sfmt_addi.f
2229 int UNUSED written = 0;
2230 IADDR UNUSED pc = abuf->addr;
2231 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2234 DI opval = EXTQIDI (GETMEMQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)))));
2235 SET_H_GR (FLD (f_dest), opval);
2236 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2243 CASE (sem, INSN_LDL) : /* ld.l $rm, $disp10x4, $rd */
2245 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2246 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2247 #define FLD(f) abuf->fields.sfmt_flds.f
2248 int UNUSED written = 0;
2249 IADDR UNUSED pc = abuf->addr;
2250 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2253 DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x4)))));
2254 SET_H_GR (FLD (f_dest), opval);
2255 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2262 CASE (sem, INSN_LDQ) : /* ld.q $rm, $disp10x8, $rd */
2264 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2265 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2266 #define FLD(f) abuf->fields.sfmt_fldd.f
2267 int UNUSED written = 0;
2268 IADDR UNUSED pc = abuf->addr;
2269 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2272 DI opval = GETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x8))));
2273 SET_H_GR (FLD (f_dest), opval);
2274 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2281 CASE (sem, INSN_LDUB) : /* ld.ub $rm, $disp10, $rd */
2283 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2284 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2285 #define FLD(f) abuf->fields.sfmt_addi.f
2286 int UNUSED written = 0;
2287 IADDR UNUSED pc = abuf->addr;
2288 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2291 DI opval = ZEXTQIDI (GETMEMQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)))));
2292 SET_H_GR (FLD (f_dest), opval);
2293 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2300 CASE (sem, INSN_LDUW) : /* ld.uw $rm, $disp10x2, $rd */
2302 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2303 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2304 #define FLD(f) abuf->fields.sfmt_lduw.f
2305 int UNUSED written = 0;
2306 IADDR UNUSED pc = abuf->addr;
2307 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2310 DI opval = ZEXTHIDI (GETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x2)))));
2311 SET_H_GR (FLD (f_dest), opval);
2312 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2319 CASE (sem, INSN_LDW) : /* ld.w $rm, $disp10x2, $rd */
2321 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2322 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2323 #define FLD(f) abuf->fields.sfmt_lduw.f
2324 int UNUSED written = 0;
2325 IADDR UNUSED pc = abuf->addr;
2326 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2329 DI opval = EXTHIDI (GETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x2)))));
2330 SET_H_GR (FLD (f_dest), opval);
2331 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2338 CASE (sem, INSN_LDHIL) : /* ldhi.l $rm, $disp6, $rd */
2340 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2341 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2342 #define FLD(f) abuf->fields.sfmt_getcfg.f
2343 int UNUSED written = 0;
2344 IADDR UNUSED pc = abuf->addr;
2345 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2351 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2352 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 3), 1);
2354 if (ANDQI (tmp_bytecount, 4)) {
2356 DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -4)));
2357 SET_H_GR (FLD (f_dest), opval);
2358 written |= (1 << 6);
2359 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2362 if (GET_H_ENDIAN ()) {
2364 if (ANDQI (tmp_bytecount, 2)) {
2365 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2367 if (ANDQI (tmp_bytecount, 1)) {
2368 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2371 DI opval = EXTSIDI (tmp_val);
2372 SET_H_GR (FLD (f_dest), opval);
2373 written |= (1 << 6);
2374 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2379 if (ANDQI (tmp_bytecount, 1)) {
2380 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2382 if (ANDQI (tmp_bytecount, 2)) {
2383 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2386 DI opval = EXTSIDI (SLLSI (tmp_val, SUBSI (32, MULSI (8, tmp_bytecount))));
2387 SET_H_GR (FLD (f_dest), opval);
2388 written |= (1 << 6);
2389 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2396 abuf->written = written;
2401 CASE (sem, INSN_LDHIQ) : /* ldhi.q $rm, $disp6, $rd */
2403 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2404 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2405 #define FLD(f) abuf->fields.sfmt_getcfg.f
2406 int UNUSED written = 0;
2407 IADDR UNUSED pc = abuf->addr;
2408 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2414 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2415 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 7), 1);
2417 if (ANDQI (tmp_bytecount, 8)) {
2419 DI opval = GETMEMDI (current_cpu, pc, ANDDI (tmp_addr, -8));
2420 SET_H_GR (FLD (f_dest), opval);
2421 written |= (1 << 7);
2422 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2425 if (GET_H_ENDIAN ()) {
2427 if (ANDQI (tmp_bytecount, 4)) {
2428 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8))));
2430 if (ANDQI (tmp_bytecount, 2)) {
2431 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2433 if (ANDQI (tmp_bytecount, 1)) {
2434 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2438 SET_H_GR (FLD (f_dest), opval);
2439 written |= (1 << 7);
2440 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2445 if (ANDQI (tmp_bytecount, 1)) {
2446 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2448 if (ANDQI (tmp_bytecount, 2)) {
2449 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2451 if (ANDQI (tmp_bytecount, 4)) {
2452 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8))));
2455 DI opval = SLLDI (tmp_val, SUBSI (64, MULSI (8, tmp_bytecount)));
2456 SET_H_GR (FLD (f_dest), opval);
2457 written |= (1 << 7);
2458 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2465 abuf->written = written;
2470 CASE (sem, INSN_LDLOL) : /* ldlo.l $rm, $disp6, $rd */
2472 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2473 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2474 #define FLD(f) abuf->fields.sfmt_getcfg.f
2475 int UNUSED written = 0;
2476 IADDR UNUSED pc = abuf->addr;
2477 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2483 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2484 tmp_bytecount = SUBSI (4, ANDDI (tmp_addr, 3));
2486 if (ANDQI (tmp_bytecount, 4)) {
2488 DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, tmp_addr));
2489 SET_H_GR (FLD (f_dest), opval);
2490 written |= (1 << 6);
2491 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2494 if (GET_H_ENDIAN ()) {
2496 if (ANDQI (tmp_bytecount, 1)) {
2497 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2499 if (ANDQI (tmp_bytecount, 2)) {
2500 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2503 DI opval = EXTSIDI (SLLSI (tmp_val, SUBSI (32, MULSI (8, tmp_bytecount))));
2504 SET_H_GR (FLD (f_dest), opval);
2505 written |= (1 << 6);
2506 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2511 if (ANDQI (tmp_bytecount, 2)) {
2512 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2514 if (ANDQI (tmp_bytecount, 1)) {
2515 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2518 DI opval = EXTSIDI (tmp_val);
2519 SET_H_GR (FLD (f_dest), opval);
2520 written |= (1 << 6);
2521 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2528 abuf->written = written;
2533 CASE (sem, INSN_LDLOQ) : /* ldlo.q $rm, $disp6, $rd */
2535 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2536 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2537 #define FLD(f) abuf->fields.sfmt_getcfg.f
2538 int UNUSED written = 0;
2539 IADDR UNUSED pc = abuf->addr;
2540 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2546 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2547 tmp_bytecount = SUBSI (8, ANDDI (tmp_addr, 7));
2549 if (ANDQI (tmp_bytecount, 8)) {
2551 DI opval = GETMEMDI (current_cpu, pc, tmp_addr);
2552 SET_H_GR (FLD (f_dest), opval);
2553 written |= (1 << 7);
2554 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2557 if (GET_H_ENDIAN ()) {
2559 if (ANDQI (tmp_bytecount, 1)) {
2560 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2562 if (ANDQI (tmp_bytecount, 2)) {
2563 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2565 if (ANDQI (tmp_bytecount, 4)) {
2566 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4))));
2569 DI opval = SLLDI (tmp_val, SUBSI (64, MULSI (8, tmp_bytecount)));
2570 SET_H_GR (FLD (f_dest), opval);
2571 written |= (1 << 7);
2572 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2577 if (ANDQI (tmp_bytecount, 4)) {
2578 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4))));
2580 if (ANDQI (tmp_bytecount, 2)) {
2581 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2583 if (ANDQI (tmp_bytecount, 1)) {
2584 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2588 SET_H_GR (FLD (f_dest), opval);
2589 written |= (1 << 7);
2590 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2597 abuf->written = written;
2602 CASE (sem, INSN_LDXB) : /* ldx.b $rm, $rn, $rd */
2604 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2605 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2606 #define FLD(f) abuf->fields.sfmt_add.f
2607 int UNUSED written = 0;
2608 IADDR UNUSED pc = abuf->addr;
2609 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2612 DI opval = EXTQIDI (GETMEMQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2613 SET_H_GR (FLD (f_dest), opval);
2614 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2621 CASE (sem, INSN_LDXL) : /* ldx.l $rm, $rn, $rd */
2623 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2624 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2625 #define FLD(f) abuf->fields.sfmt_add.f
2626 int UNUSED written = 0;
2627 IADDR UNUSED pc = abuf->addr;
2628 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2631 DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2632 SET_H_GR (FLD (f_dest), opval);
2633 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2640 CASE (sem, INSN_LDXQ) : /* ldx.q $rm, $rn, $rd */
2642 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2643 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2644 #define FLD(f) abuf->fields.sfmt_add.f
2645 int UNUSED written = 0;
2646 IADDR UNUSED pc = abuf->addr;
2647 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2650 DI opval = GETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))));
2651 SET_H_GR (FLD (f_dest), opval);
2652 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2659 CASE (sem, INSN_LDXUB) : /* ldx.ub $rm, $rn, $rd */
2661 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2662 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2663 #define FLD(f) abuf->fields.sfmt_add.f
2664 int UNUSED written = 0;
2665 IADDR UNUSED pc = abuf->addr;
2666 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2669 DI opval = ZEXTQIDI (GETMEMUQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2670 SET_H_GR (FLD (f_dest), opval);
2671 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2678 CASE (sem, INSN_LDXUW) : /* ldx.uw $rm, $rn, $rd */
2680 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2681 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2682 #define FLD(f) abuf->fields.sfmt_add.f
2683 int UNUSED written = 0;
2684 IADDR UNUSED pc = abuf->addr;
2685 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2688 DI opval = ZEXTHIDI (GETMEMUHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2689 SET_H_GR (FLD (f_dest), opval);
2690 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2697 CASE (sem, INSN_LDXW) : /* ldx.w $rm, $rn, $rd */
2699 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2700 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2701 #define FLD(f) abuf->fields.sfmt_add.f
2702 int UNUSED written = 0;
2703 IADDR UNUSED pc = abuf->addr;
2704 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2707 DI opval = EXTHIDI (GETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2708 SET_H_GR (FLD (f_dest), opval);
2709 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2716 CASE (sem, INSN_MABSL) : /* mabs.l $rm, $rd */
2718 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2719 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2720 #define FLD(f) abuf->fields.sfmt_xori.f
2721 int UNUSED written = 0;
2722 IADDR UNUSED pc = abuf->addr;
2723 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2728 tmp_result0 = ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1));
2729 tmp_result1 = ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0));
2731 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2732 SET_H_GR (FLD (f_dest), opval);
2733 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2741 CASE (sem, INSN_MABSW) : /* mabs.w $rm, $rd */
2743 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2744 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2745 #define FLD(f) abuf->fields.sfmt_xori.f
2746 int UNUSED written = 0;
2747 IADDR UNUSED pc = abuf->addr;
2748 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2755 tmp_result0 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3));
2756 tmp_result1 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2));
2757 tmp_result2 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1));
2758 tmp_result3 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0));
2760 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2761 SET_H_GR (FLD (f_dest), opval);
2762 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2770 CASE (sem, INSN_MADDL) : /* madd.l $rm, $rn, $rd */
2772 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2773 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2774 #define FLD(f) abuf->fields.sfmt_add.f
2775 int UNUSED written = 0;
2776 IADDR UNUSED pc = abuf->addr;
2777 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2782 tmp_result0 = ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
2783 tmp_result1 = ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0));
2785 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2786 SET_H_GR (FLD (f_dest), opval);
2787 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2795 CASE (sem, INSN_MADDW) : /* madd.w $rm, $rn, $rd */
2797 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2798 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2799 #define FLD(f) abuf->fields.sfmt_add.f
2800 int UNUSED written = 0;
2801 IADDR UNUSED pc = abuf->addr;
2802 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2809 tmp_result0 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3));
2810 tmp_result1 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2));
2811 tmp_result2 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1));
2812 tmp_result3 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0));
2814 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2815 SET_H_GR (FLD (f_dest), opval);
2816 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2824 CASE (sem, INSN_MADDSL) : /* madds.l $rm, $rn, $rd */
2826 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2827 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2828 #define FLD(f) abuf->fields.sfmt_add.f
2829 int UNUSED written = 0;
2830 IADDR UNUSED pc = abuf->addr;
2831 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2836 tmp_result0 = ((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
2837 tmp_result1 = ((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
2839 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2840 SET_H_GR (FLD (f_dest), opval);
2841 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2849 CASE (sem, INSN_MADDSUB) : /* madds.ub $rm, $rn, $rd */
2851 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2852 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2853 #define FLD(f) abuf->fields.sfmt_add.f
2854 int UNUSED written = 0;
2855 IADDR UNUSED pc = abuf->addr;
2856 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2867 tmp_result0 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7)))) : (SUBQI (SLLQI (1, 8), 1)))));
2868 tmp_result1 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6)))) : (SUBQI (SLLQI (1, 8), 1)))));
2869 tmp_result2 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5)))) : (SUBQI (SLLQI (1, 8), 1)))));
2870 tmp_result3 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4)))) : (SUBQI (SLLQI (1, 8), 1)))));
2871 tmp_result4 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3)))) : (SUBQI (SLLQI (1, 8), 1)))));
2872 tmp_result5 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2)))) : (SUBQI (SLLQI (1, 8), 1)))));
2873 tmp_result6 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1)))) : (SUBQI (SLLQI (1, 8), 1)))));
2874 tmp_result7 = ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0)))) : (SUBQI (SLLQI (1, 8), 1)))));
2876 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
2877 SET_H_GR (FLD (f_dest), opval);
2878 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2886 CASE (sem, INSN_MADDSW) : /* madds.w $rm, $rn, $rd */
2888 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2890 #define FLD(f) abuf->fields.sfmt_add.f
2891 int UNUSED written = 0;
2892 IADDR UNUSED pc = abuf->addr;
2893 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2900 tmp_result0 = ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2901 tmp_result1 = ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2902 tmp_result2 = ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2903 tmp_result3 = ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2905 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2906 SET_H_GR (FLD (f_dest), opval);
2907 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2915 CASE (sem, INSN_MCMPEQB) : /* mcmpeq.b $rm, $rn, $rd */
2917 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2918 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2919 #define FLD(f) abuf->fields.sfmt_add.f
2920 int UNUSED written = 0;
2921 IADDR UNUSED pc = abuf->addr;
2922 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2933 tmp_result0 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))) ? (INVQI (0)) : (0));
2934 tmp_result1 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))) ? (INVQI (0)) : (0));
2935 tmp_result2 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))) ? (INVQI (0)) : (0));
2936 tmp_result3 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))) ? (INVQI (0)) : (0));
2937 tmp_result4 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))) ? (INVQI (0)) : (0));
2938 tmp_result5 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))) ? (INVQI (0)) : (0));
2939 tmp_result6 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))) ? (INVQI (0)) : (0));
2940 tmp_result7 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))) ? (INVQI (0)) : (0));
2942 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
2943 SET_H_GR (FLD (f_dest), opval);
2944 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2952 CASE (sem, INSN_MCMPEQL) : /* mcmpeq.l $rm, $rn, $rd */
2954 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2955 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2956 #define FLD(f) abuf->fields.sfmt_add.f
2957 int UNUSED written = 0;
2958 IADDR UNUSED pc = abuf->addr;
2959 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2964 tmp_result0 = ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))) ? (INVSI (0)) : (0));
2965 tmp_result1 = ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))) ? (INVSI (0)) : (0));
2967 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2968 SET_H_GR (FLD (f_dest), opval);
2969 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2977 CASE (sem, INSN_MCMPEQW) : /* mcmpeq.w $rm, $rn, $rd */
2979 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2980 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2981 #define FLD(f) abuf->fields.sfmt_add.f
2982 int UNUSED written = 0;
2983 IADDR UNUSED pc = abuf->addr;
2984 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2991 tmp_result0 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))) ? (INVHI (0)) : (0));
2992 tmp_result1 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))) ? (INVHI (0)) : (0));
2993 tmp_result2 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))) ? (INVHI (0)) : (0));
2994 tmp_result3 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0))) ? (INVHI (0)) : (0));
2996 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2997 SET_H_GR (FLD (f_dest), opval);
2998 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3006 CASE (sem, INSN_MCMPGTL) : /* mcmpgt.l $rm, $rn, $rd */
3008 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3009 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3010 #define FLD(f) abuf->fields.sfmt_add.f
3011 int UNUSED written = 0;
3012 IADDR UNUSED pc = abuf->addr;
3013 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3018 tmp_result0 = ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))) ? (INVSI (0)) : (0));
3019 tmp_result1 = ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))) ? (INVSI (0)) : (0));
3021 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3022 SET_H_GR (FLD (f_dest), opval);
3023 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3031 CASE (sem, INSN_MCMPGTUB) : /* mcmpgt.ub $rm, $rn, $rd */
3033 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3034 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3035 #define FLD(f) abuf->fields.sfmt_add.f
3036 int UNUSED written = 0;
3037 IADDR UNUSED pc = abuf->addr;
3038 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3049 tmp_result0 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))) ? (INVQI (0)) : (0));
3050 tmp_result1 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))) ? (INVQI (0)) : (0));
3051 tmp_result2 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))) ? (INVQI (0)) : (0));
3052 tmp_result3 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))) ? (INVQI (0)) : (0));
3053 tmp_result4 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))) ? (INVQI (0)) : (0));
3054 tmp_result5 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))) ? (INVQI (0)) : (0));
3055 tmp_result6 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))) ? (INVQI (0)) : (0));
3056 tmp_result7 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))) ? (INVQI (0)) : (0));
3058 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
3059 SET_H_GR (FLD (f_dest), opval);
3060 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3068 CASE (sem, INSN_MCMPGTW) : /* mcmpgt.w $rm, $rn, $rd */
3070 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3071 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3072 #define FLD(f) abuf->fields.sfmt_add.f
3073 int UNUSED written = 0;
3074 IADDR UNUSED pc = abuf->addr;
3075 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3082 tmp_result0 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))) ? (INVHI (0)) : (0));
3083 tmp_result1 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))) ? (INVHI (0)) : (0));
3084 tmp_result2 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))) ? (INVHI (0)) : (0));
3085 tmp_result3 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0))) ? (INVHI (0)) : (0));
3087 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3088 SET_H_GR (FLD (f_dest), opval);
3089 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3097 CASE (sem, INSN_MCMV) : /* mcmv $rm, $rn, $rd */
3099 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3100 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3101 #define FLD(f) abuf->fields.sfmt_add.f
3102 int UNUSED written = 0;
3103 IADDR UNUSED pc = abuf->addr;
3104 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3107 DI opval = ORDI (ANDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), ANDDI (GET_H_GR (FLD (f_dest)), INVDI (GET_H_GR (FLD (f_right)))));
3108 SET_H_GR (FLD (f_dest), opval);
3109 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3116 CASE (sem, INSN_MCNVSLW) : /* mcnvs.lw $rm, $rn, $rd */
3118 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3119 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3120 #define FLD(f) abuf->fields.sfmt_add.f
3121 int UNUSED written = 0;
3122 IADDR UNUSED pc = abuf->addr;
3123 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3130 tmp_result0 = ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3131 tmp_result1 = ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3132 tmp_result2 = ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3133 tmp_result3 = ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3135 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3136 SET_H_GR (FLD (f_dest), opval);
3137 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3145 CASE (sem, INSN_MCNVSWB) : /* mcnvs.wb $rm, $rn, $rd */
3147 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3148 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3149 #define FLD(f) abuf->fields.sfmt_add.f
3150 int UNUSED written = 0;
3151 IADDR UNUSED pc = abuf->addr;
3152 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3163 tmp_result0 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3164 tmp_result1 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3165 tmp_result2 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3166 tmp_result3 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3167 tmp_result4 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3168 tmp_result5 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3169 tmp_result6 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3170 tmp_result7 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3172 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
3173 SET_H_GR (FLD (f_dest), opval);
3174 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3182 CASE (sem, INSN_MCNVSWUB) : /* mcnvs.wub $rm, $rn, $rd */
3184 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3185 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3186 #define FLD(f) abuf->fields.sfmt_add.f
3187 int UNUSED written = 0;
3188 IADDR UNUSED pc = abuf->addr;
3189 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3200 tmp_result0 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)) : (SUBQI (SLLQI (1, 8), 1)))));
3201 tmp_result1 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)) : (SUBQI (SLLQI (1, 8), 1)))));
3202 tmp_result2 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)) : (SUBQI (SLLQI (1, 8), 1)))));
3203 tmp_result3 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)) : (SUBQI (SLLQI (1, 8), 1)))));
3204 tmp_result4 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)) : (SUBQI (SLLQI (1, 8), 1)))));
3205 tmp_result5 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)) : (SUBQI (SLLQI (1, 8), 1)))));
3206 tmp_result6 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)) : (SUBQI (SLLQI (1, 8), 1)))));
3207 tmp_result7 = ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)) : (SUBQI (SLLQI (1, 8), 1)))));
3209 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
3210 SET_H_GR (FLD (f_dest), opval);
3211 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3219 CASE (sem, INSN_MEXTR1) : /* mextr1 $rm, $rn, $rd */
3221 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3222 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3223 #define FLD(f) abuf->fields.sfmt_add.f
3224 int UNUSED written = 0;
3225 IADDR UNUSED pc = abuf->addr;
3226 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3232 tmp_count = MULQI (8, 1);
3233 tmp_mask = SLLDI (INVSI (0), tmp_count);
3234 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3235 tmp_count = MULQI (8, SUBQI (8, 1));
3236 tmp_mask = SRLDI (INVSI (0), tmp_count);
3238 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3239 SET_H_GR (FLD (f_dest), opval);
3240 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3248 CASE (sem, INSN_MEXTR2) : /* mextr2 $rm, $rn, $rd */
3250 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3251 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3252 #define FLD(f) abuf->fields.sfmt_add.f
3253 int UNUSED written = 0;
3254 IADDR UNUSED pc = abuf->addr;
3255 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3261 tmp_count = MULQI (8, 2);
3262 tmp_mask = SLLDI (INVSI (0), tmp_count);
3263 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3264 tmp_count = MULQI (8, SUBQI (8, 2));
3265 tmp_mask = SRLDI (INVSI (0), tmp_count);
3267 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3268 SET_H_GR (FLD (f_dest), opval);
3269 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3277 CASE (sem, INSN_MEXTR3) : /* mextr3 $rm, $rn, $rd */
3279 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3280 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3281 #define FLD(f) abuf->fields.sfmt_add.f
3282 int UNUSED written = 0;
3283 IADDR UNUSED pc = abuf->addr;
3284 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3290 tmp_count = MULQI (8, 3);
3291 tmp_mask = SLLDI (INVSI (0), tmp_count);
3292 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3293 tmp_count = MULQI (8, SUBQI (8, 3));
3294 tmp_mask = SRLDI (INVSI (0), tmp_count);
3296 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3297 SET_H_GR (FLD (f_dest), opval);
3298 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3306 CASE (sem, INSN_MEXTR4) : /* mextr4 $rm, $rn, $rd */
3308 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3309 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3310 #define FLD(f) abuf->fields.sfmt_add.f
3311 int UNUSED written = 0;
3312 IADDR UNUSED pc = abuf->addr;
3313 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3319 tmp_count = MULQI (8, 4);
3320 tmp_mask = SLLDI (INVSI (0), tmp_count);
3321 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3322 tmp_count = MULQI (8, SUBQI (8, 4));
3323 tmp_mask = SRLDI (INVSI (0), tmp_count);
3325 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3326 SET_H_GR (FLD (f_dest), opval);
3327 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3335 CASE (sem, INSN_MEXTR5) : /* mextr5 $rm, $rn, $rd */
3337 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3338 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3339 #define FLD(f) abuf->fields.sfmt_add.f
3340 int UNUSED written = 0;
3341 IADDR UNUSED pc = abuf->addr;
3342 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3348 tmp_count = MULQI (8, 5);
3349 tmp_mask = SLLDI (INVSI (0), tmp_count);
3350 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3351 tmp_count = MULQI (8, SUBQI (8, 5));
3352 tmp_mask = SRLDI (INVSI (0), tmp_count);
3354 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3355 SET_H_GR (FLD (f_dest), opval);
3356 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3364 CASE (sem, INSN_MEXTR6) : /* mextr6 $rm, $rn, $rd */
3366 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3367 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3368 #define FLD(f) abuf->fields.sfmt_add.f
3369 int UNUSED written = 0;
3370 IADDR UNUSED pc = abuf->addr;
3371 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3377 tmp_count = MULQI (8, 6);
3378 tmp_mask = SLLDI (INVSI (0), tmp_count);
3379 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3380 tmp_count = MULQI (8, SUBQI (8, 6));
3381 tmp_mask = SRLDI (INVSI (0), tmp_count);
3383 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3384 SET_H_GR (FLD (f_dest), opval);
3385 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3393 CASE (sem, INSN_MEXTR7) : /* mextr7 $rm, $rn, $rd */
3395 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3396 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3397 #define FLD(f) abuf->fields.sfmt_add.f
3398 int UNUSED written = 0;
3399 IADDR UNUSED pc = abuf->addr;
3400 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3406 tmp_count = MULQI (8, 7);
3407 tmp_mask = SLLDI (INVSI (0), tmp_count);
3408 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3409 tmp_count = MULQI (8, SUBQI (8, 7));
3410 tmp_mask = SRLDI (INVSI (0), tmp_count);
3412 DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3413 SET_H_GR (FLD (f_dest), opval);
3414 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3422 CASE (sem, INSN_MMACFXWL) : /* mmacfx.wl $rm, $rn, $rd */
3424 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3425 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3426 #define FLD(f) abuf->fields.sfmt_add.f
3427 int UNUSED written = 0;
3428 IADDR UNUSED pc = abuf->addr;
3429 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3435 tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 1);
3436 tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 0);
3437 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3438 tmp_temp = ((LTDI (SLLDI (tmp_temp, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3439 tmp_result0 = ((LTDI (ADDDI (EXTSIDI (tmp_result0), EXTSIDI (tmp_temp)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (tmp_result0), EXTSIDI (tmp_temp)), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (tmp_result0), EXTSIDI (tmp_temp))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3440 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3441 tmp_temp = ((LTDI (SLLDI (tmp_temp, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3442 tmp_result1 = ((LTDI (ADDDI (EXTSIDI (tmp_result1), EXTSIDI (tmp_temp)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (tmp_result1), EXTSIDI (tmp_temp)), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (tmp_result1), EXTSIDI (tmp_temp))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3444 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3445 SET_H_GR (FLD (f_dest), opval);
3446 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3454 CASE (sem, INSN_MMACNFX_WL) : /* mmacnfx.wl $rm, $rn, $rd */
3456 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3457 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3458 #define FLD(f) abuf->fields.sfmt_add.f
3459 int UNUSED written = 0;
3460 IADDR UNUSED pc = abuf->addr;
3461 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3467 tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 1);
3468 tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 0);
3469 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3470 tmp_temp = ((LTDI (SLLDI (tmp_temp, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3471 tmp_result0 = ((LTDI (SUBDI (EXTSIDI (tmp_result0), EXTSIDI (tmp_temp)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (tmp_result0), EXTSIDI (tmp_temp)), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (tmp_result0), EXTSIDI (tmp_temp))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3472 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3473 tmp_temp = ((LTDI (SLLDI (tmp_temp, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3474 tmp_result1 = ((LTDI (SUBDI (EXTSIDI (tmp_result1), EXTSIDI (tmp_temp)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (tmp_result1), EXTSIDI (tmp_temp)), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (tmp_result1), EXTSIDI (tmp_temp))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3476 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3477 SET_H_GR (FLD (f_dest), opval);
3478 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3486 CASE (sem, INSN_MMULL) : /* mmul.l $rm, $rn, $rd */
3488 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3489 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3490 #define FLD(f) abuf->fields.sfmt_add.f
3491 int UNUSED written = 0;
3492 IADDR UNUSED pc = abuf->addr;
3493 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3498 tmp_result0 = MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
3499 tmp_result1 = MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0));
3501 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3502 SET_H_GR (FLD (f_dest), opval);
3503 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3511 CASE (sem, INSN_MMULW) : /* mmul.w $rm, $rn, $rd */
3513 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3514 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3515 #define FLD(f) abuf->fields.sfmt_add.f
3516 int UNUSED written = 0;
3517 IADDR UNUSED pc = abuf->addr;
3518 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3525 tmp_result0 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3));
3526 tmp_result1 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2));
3527 tmp_result2 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1));
3528 tmp_result3 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0));
3530 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3531 SET_H_GR (FLD (f_dest), opval);
3532 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3540 CASE (sem, INSN_MMULFXL) : /* mmulfx.l $rm, $rn, $rd */
3542 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3543 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3544 #define FLD(f) abuf->fields.sfmt_add.f
3545 int UNUSED written = 0;
3546 IADDR UNUSED pc = abuf->addr;
3547 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3553 tmp_temp = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
3554 tmp_result0 = ((LTDI (SRADI (tmp_temp, 31), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SRADI (tmp_temp, 31), SLLDI (1, SUBSI (32, 1)))) ? (SRADI (tmp_temp, 31)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3555 tmp_temp = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0)));
3556 tmp_result1 = ((LTDI (SRADI (tmp_temp, 31), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SRADI (tmp_temp, 31), SLLDI (1, SUBSI (32, 1)))) ? (SRADI (tmp_temp, 31)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3558 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3559 SET_H_GR (FLD (f_dest), opval);
3560 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3568 CASE (sem, INSN_MMULFXW) : /* mmulfx.w $rm, $rn, $rd */
3570 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3571 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3572 #define FLD(f) abuf->fields.sfmt_add.f
3573 int UNUSED written = 0;
3574 IADDR UNUSED pc = abuf->addr;
3575 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3583 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3584 tmp_result0 = ((LTSI (SRASI (tmp_temp, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3585 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3586 tmp_result1 = ((LTSI (SRASI (tmp_temp, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3587 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)));
3588 tmp_result2 = ((LTSI (SRASI (tmp_temp, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3589 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3590 tmp_result3 = ((LTSI (SRASI (tmp_temp, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3592 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3593 SET_H_GR (FLD (f_dest), opval);
3594 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3602 CASE (sem, INSN_MMULFXRPW) : /* mmulfxrp.w $rm, $rn, $rd */
3604 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3605 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3606 #define FLD(f) abuf->fields.sfmt_add.f
3607 int UNUSED written = 0;
3608 IADDR UNUSED pc = abuf->addr;
3609 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3618 tmp_c = SLLSI (1, 14);
3619 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3620 tmp_result0 = ((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp, tmp_c), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3621 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3622 tmp_result1 = ((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp, tmp_c), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3623 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)));
3624 tmp_result2 = ((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp, tmp_c), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3625 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3626 tmp_result3 = ((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp, tmp_c), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp, tmp_c), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3628 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3629 SET_H_GR (FLD (f_dest), opval);
3630 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3638 CASE (sem, INSN_MMULHIWL) : /* mmulhi.wl $rm, $rn, $rd */
3640 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3641 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3642 #define FLD(f) abuf->fields.sfmt_add.f
3643 int UNUSED written = 0;
3644 IADDR UNUSED pc = abuf->addr;
3645 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3650 tmp_result0 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)));
3651 tmp_result1 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3653 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3654 SET_H_GR (FLD (f_dest), opval);
3655 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3663 CASE (sem, INSN_MMULLOWL) : /* mmullo.wl $rm, $rn, $rd */
3665 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3666 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3667 #define FLD(f) abuf->fields.sfmt_add.f
3668 int UNUSED written = 0;
3669 IADDR UNUSED pc = abuf->addr;
3670 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3675 tmp_result0 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3676 tmp_result1 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3678 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3679 SET_H_GR (FLD (f_dest), opval);
3680 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3688 CASE (sem, INSN_MMULSUMWQ) : /* mmulsum.wq $rm, $rn, $rd */
3690 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3691 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3692 #define FLD(f) abuf->fields.sfmt_add.f
3693 int UNUSED written = 0;
3694 IADDR UNUSED pc = abuf->addr;
3695 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3699 tmp_acc = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3700 tmp_acc = ADDDI (tmp_acc, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))));
3701 tmp_acc = ADDDI (tmp_acc, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))));
3702 tmp_acc = ADDDI (tmp_acc, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))));
3704 DI opval = ADDDI (GET_H_GR (FLD (f_dest)), tmp_acc);
3705 SET_H_GR (FLD (f_dest), opval);
3706 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3714 CASE (sem, INSN_MOVI) : /* movi $imm16, $rd */
3716 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3717 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3718 #define FLD(f) abuf->fields.sfmt_movi.f
3719 int UNUSED written = 0;
3720 IADDR UNUSED pc = abuf->addr;
3721 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3724 DI opval = EXTSIDI (FLD (f_imm16));
3725 SET_H_GR (FLD (f_dest), opval);
3726 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3733 CASE (sem, INSN_MPERMW) : /* mperm.w $rm, $rn, $rd */
3735 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3736 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3737 #define FLD(f) abuf->fields.sfmt_add.f
3738 int UNUSED written = 0;
3739 IADDR UNUSED pc = abuf->addr;
3740 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3748 tmp_control = ANDQI (GET_H_GR (FLD (f_right)), 255);
3749 tmp_result0 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (tmp_control, 3)));
3750 tmp_result1 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (SRLQI (tmp_control, 2), 3)));
3751 tmp_result2 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (SRLQI (tmp_control, 4), 3)));
3752 tmp_result3 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (SRLQI (tmp_control, 6), 3)));
3754 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3755 SET_H_GR (FLD (f_dest), opval);
3756 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3764 CASE (sem, INSN_MSADUBQ) : /* msad.ubq $rm, $rn, $rd */
3766 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3767 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3768 #define FLD(f) abuf->fields.sfmt_add.f
3769 int UNUSED written = 0;
3770 IADDR UNUSED pc = abuf->addr;
3771 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3775 tmp_acc = ABSDI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0)));
3776 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))));
3777 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))));
3778 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))));
3779 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))));
3780 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))));
3781 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))));
3782 tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))));
3784 DI opval = ADDDI (GET_H_GR (FLD (f_dest)), tmp_acc);
3785 SET_H_GR (FLD (f_dest), opval);
3786 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3794 CASE (sem, INSN_MSHALDSL) : /* mshalds.l $rm, $rn, $rd */
3796 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3797 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3798 #define FLD(f) abuf->fields.sfmt_add.f
3799 int UNUSED written = 0;
3800 IADDR UNUSED pc = abuf->addr;
3801 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3806 tmp_result0 = ((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31)), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3807 tmp_result1 = ((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31)), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3809 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3810 SET_H_GR (FLD (f_dest), opval);
3811 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3819 CASE (sem, INSN_MSHALDSW) : /* mshalds.w $rm, $rn, $rd */
3821 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3822 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3823 #define FLD(f) abuf->fields.sfmt_add.f
3824 int UNUSED written = 0;
3825 IADDR UNUSED pc = abuf->addr;
3826 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3833 tmp_result0 = ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3834 tmp_result1 = ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3835 tmp_result2 = ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3836 tmp_result3 = ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3838 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3839 SET_H_GR (FLD (f_dest), opval);
3840 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3848 CASE (sem, INSN_MSHARDL) : /* mshard.l $rm, $rn, $rd */
3850 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3851 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3852 #define FLD(f) abuf->fields.sfmt_add.f
3853 int UNUSED written = 0;
3854 IADDR UNUSED pc = abuf->addr;
3855 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3860 tmp_result0 = SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31));
3861 tmp_result1 = SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31));
3863 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3864 SET_H_GR (FLD (f_dest), opval);
3865 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3873 CASE (sem, INSN_MSHARDW) : /* mshard.w $rm, $rn, $rd */
3875 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3876 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3877 #define FLD(f) abuf->fields.sfmt_add.f
3878 int UNUSED written = 0;
3879 IADDR UNUSED pc = abuf->addr;
3880 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3887 tmp_result0 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15));
3888 tmp_result1 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15));
3889 tmp_result2 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15));
3890 tmp_result3 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15));
3892 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3893 SET_H_GR (FLD (f_dest), opval);
3894 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3902 CASE (sem, INSN_MSHARDSQ) : /* mshards.q $rm, $rn, $rd */
3904 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3905 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3906 #define FLD(f) abuf->fields.sfmt_add.f
3907 int UNUSED written = 0;
3908 IADDR UNUSED pc = abuf->addr;
3909 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3912 DI opval = ((LTDI (SRADI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGDI (SLLDI (1, SUBSI (16, 1)))) : (((LTDI (SRADI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63)), SLLDI (1, SUBSI (16, 1)))) ? (SRADI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63))) : (SUBDI (SLLDI (1, SUBSI (16, 1)), 1)))));
3913 SET_H_GR (FLD (f_dest), opval);
3914 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3921 CASE (sem, INSN_MSHFHIB) : /* mshfhi.b $rm, $rn, $rd */
3923 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3924 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3925 #define FLD(f) abuf->fields.sfmt_add.f
3926 int UNUSED written = 0;
3927 IADDR UNUSED pc = abuf->addr;
3928 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3939 tmp_result0 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3);
3940 tmp_result1 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3);
3941 tmp_result2 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2);
3942 tmp_result3 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2);
3943 tmp_result4 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1);
3944 tmp_result5 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1);
3945 tmp_result6 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0);
3946 tmp_result7 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0);
3948 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
3949 SET_H_GR (FLD (f_dest), opval);
3950 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3958 CASE (sem, INSN_MSHFHIL) : /* mshfhi.l $rm, $rn, $rd */
3960 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3961 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3962 #define FLD(f) abuf->fields.sfmt_add.f
3963 int UNUSED written = 0;
3964 IADDR UNUSED pc = abuf->addr;
3965 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3970 tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_left)), 0);
3971 tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_right)), 0);
3973 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3974 SET_H_GR (FLD (f_dest), opval);
3975 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3983 CASE (sem, INSN_MSHFHIW) : /* mshfhi.w $rm, $rn, $rd */
3985 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3986 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3987 #define FLD(f) abuf->fields.sfmt_add.f
3988 int UNUSED written = 0;
3989 IADDR UNUSED pc = abuf->addr;
3990 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3997 tmp_result0 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1);
3998 tmp_result1 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1);
3999 tmp_result2 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0);
4000 tmp_result3 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0);
4002 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4003 SET_H_GR (FLD (f_dest), opval);
4004 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4012 CASE (sem, INSN_MSHFLOB) : /* mshflo.b $rm, $rn, $rd */
4014 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4015 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4016 #define FLD(f) abuf->fields.sfmt_add.f
4017 int UNUSED written = 0;
4018 IADDR UNUSED pc = abuf->addr;
4019 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4030 tmp_result0 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7);
4031 tmp_result1 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7);
4032 tmp_result2 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6);
4033 tmp_result3 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6);
4034 tmp_result4 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5);
4035 tmp_result5 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5);
4036 tmp_result6 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4);
4037 tmp_result7 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4);
4039 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
4040 SET_H_GR (FLD (f_dest), opval);
4041 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4049 CASE (sem, INSN_MSHFLOL) : /* mshflo.l $rm, $rn, $rd */
4051 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4052 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4053 #define FLD(f) abuf->fields.sfmt_add.f
4054 int UNUSED written = 0;
4055 IADDR UNUSED pc = abuf->addr;
4056 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4061 tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_left)), 1);
4062 tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_right)), 1);
4064 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4065 SET_H_GR (FLD (f_dest), opval);
4066 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4074 CASE (sem, INSN_MSHFLOW) : /* mshflo.w $rm, $rn, $rd */
4076 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4077 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4078 #define FLD(f) abuf->fields.sfmt_add.f
4079 int UNUSED written = 0;
4080 IADDR UNUSED pc = abuf->addr;
4081 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4088 tmp_result0 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3);
4089 tmp_result1 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3);
4090 tmp_result2 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2);
4091 tmp_result3 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2);
4093 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4094 SET_H_GR (FLD (f_dest), opval);
4095 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4103 CASE (sem, INSN_MSHLLDL) : /* mshlld.l $rm, $rn, $rd */
4105 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4106 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4107 #define FLD(f) abuf->fields.sfmt_add.f
4108 int UNUSED written = 0;
4109 IADDR UNUSED pc = abuf->addr;
4110 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4115 tmp_result0 = SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31));
4116 tmp_result1 = SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31));
4118 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4119 SET_H_GR (FLD (f_dest), opval);
4120 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4128 CASE (sem, INSN_MSHLLDW) : /* mshlld.w $rm, $rn, $rd */
4130 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4131 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4132 #define FLD(f) abuf->fields.sfmt_add.f
4133 int UNUSED written = 0;
4134 IADDR UNUSED pc = abuf->addr;
4135 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4142 tmp_result0 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15));
4143 tmp_result1 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15));
4144 tmp_result2 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15));
4145 tmp_result3 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15));
4147 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4148 SET_H_GR (FLD (f_dest), opval);
4149 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4157 CASE (sem, INSN_MSHLRDL) : /* mshlrd.l $rm, $rn, $rd */
4159 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4160 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4161 #define FLD(f) abuf->fields.sfmt_add.f
4162 int UNUSED written = 0;
4163 IADDR UNUSED pc = abuf->addr;
4164 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4169 tmp_result0 = SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31));
4170 tmp_result1 = SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31));
4172 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4173 SET_H_GR (FLD (f_dest), opval);
4174 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4182 CASE (sem, INSN_MSHLRDW) : /* mshlrd.w $rm, $rn, $rd */
4184 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4185 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4186 #define FLD(f) abuf->fields.sfmt_add.f
4187 int UNUSED written = 0;
4188 IADDR UNUSED pc = abuf->addr;
4189 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4196 tmp_result0 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15));
4197 tmp_result1 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15));
4198 tmp_result2 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15));
4199 tmp_result3 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15));
4201 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4202 SET_H_GR (FLD (f_dest), opval);
4203 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4211 CASE (sem, INSN_MSUBL) : /* msub.l $rm, $rn, $rd */
4213 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4214 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4215 #define FLD(f) abuf->fields.sfmt_add.f
4216 int UNUSED written = 0;
4217 IADDR UNUSED pc = abuf->addr;
4218 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4223 tmp_result0 = SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
4224 tmp_result1 = SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0));
4226 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4227 SET_H_GR (FLD (f_dest), opval);
4228 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4236 CASE (sem, INSN_MSUBW) : /* msub.w $rm, $rn, $rd */
4238 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4239 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4240 #define FLD(f) abuf->fields.sfmt_add.f
4241 int UNUSED written = 0;
4242 IADDR UNUSED pc = abuf->addr;
4243 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4250 tmp_result0 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3));
4251 tmp_result1 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2));
4252 tmp_result2 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1));
4253 tmp_result3 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0));
4255 DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4256 SET_H_GR (FLD (f_dest), opval);
4257 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4265 CASE (sem, INSN_MSUBSL) : /* msubs.l $rm, $rn, $rd */
4267 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4268 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4269 #define FLD(f) abuf->fields.sfmt_add.f
4270 int UNUSED written = 0;
4271 IADDR UNUSED pc = abuf->addr;
4272 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4277 tmp_result0 = ((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
4278 tmp_result1 = ((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
4280 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4281 SET_H_GR (FLD (f_dest), opval);
4282 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4290 CASE (sem, INSN_MSUBSUB) : /* msubs.ub $rm, $rn, $rd */
4292 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4293 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4294 #define FLD(f) abuf->fields.sfmt_add.f
4295 int UNUSED written = 0;
4296 IADDR UNUSED pc = abuf->addr;
4297 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4308 tmp_result0 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7)))) : (SUBQI (SLLQI (1, 8), 1)))));
4309 tmp_result1 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6)))) : (SUBQI (SLLQI (1, 8), 1)))));
4310 tmp_result2 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5)))) : (SUBQI (SLLQI (1, 8), 1)))));
4311 tmp_result3 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4)))) : (SUBQI (SLLQI (1, 8), 1)))));
4312 tmp_result4 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3)))) : (SUBQI (SLLQI (1, 8), 1)))));
4313 tmp_result5 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2)))) : (SUBQI (SLLQI (1, 8), 1)))));
4314 tmp_result6 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1)))) : (SUBQI (SLLQI (1, 8), 1)))));
4315 tmp_result7 = ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0)))) : (SUBQI (SLLQI (1, 8), 1)))));
4317 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
4318 SET_H_GR (FLD (f_dest), opval);
4319 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4327 CASE (sem, INSN_MSUBSW) : /* msubs.w $rm, $rn, $rd */
4329 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4330 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4331 #define FLD(f) abuf->fields.sfmt_add.f
4332 int UNUSED written = 0;
4333 IADDR UNUSED pc = abuf->addr;
4334 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4345 tmp_result0 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4346 tmp_result1 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4347 tmp_result2 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4348 tmp_result3 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4349 tmp_result4 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4350 tmp_result5 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4351 tmp_result6 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4352 tmp_result7 = ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4354 DI opval = ORDI (SLLDI (ZEXTQIDI (tmp_result7), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1), 8), ZEXTQIDI (tmp_result0))))))));
4355 SET_H_GR (FLD (f_dest), opval);
4356 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4364 CASE (sem, INSN_MULSL) : /* muls.l $rm, $rn, $rd */
4366 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4367 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4368 #define FLD(f) abuf->fields.sfmt_add.f
4369 int UNUSED written = 0;
4370 IADDR UNUSED pc = abuf->addr;
4371 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4374 DI opval = MULDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
4375 SET_H_GR (FLD (f_dest), opval);
4376 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4383 CASE (sem, INSN_MULUL) : /* mulu.l $rm, $rn, $rd */
4385 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4386 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4387 #define FLD(f) abuf->fields.sfmt_add.f
4388 int UNUSED written = 0;
4389 IADDR UNUSED pc = abuf->addr;
4390 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4393 DI opval = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
4394 SET_H_GR (FLD (f_dest), opval);
4395 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4402 CASE (sem, INSN_NOP) : /* nop */
4404 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4405 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4406 #define FLD(f) abuf->fields.fmt_empty.f
4407 int UNUSED written = 0;
4408 IADDR UNUSED pc = abuf->addr;
4409 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4417 CASE (sem, INSN_NSB) : /* nsb $rm, $rd */
4419 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4420 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4421 #define FLD(f) abuf->fields.sfmt_xori.f
4422 int UNUSED written = 0;
4423 IADDR UNUSED pc = abuf->addr;
4424 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4427 DI opval = sh64_nsb (current_cpu, GET_H_GR (FLD (f_left)));
4428 SET_H_GR (FLD (f_dest), opval);
4429 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4436 CASE (sem, INSN_OCBI) : /* ocbi $rm, $disp6x32 */
4438 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4439 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4440 #define FLD(f) abuf->fields.sfmt_xori.f
4441 int UNUSED written = 0;
4442 IADDR UNUSED pc = abuf->addr;
4443 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4447 DI opval = GET_H_GR (FLD (f_left));
4448 SET_H_GR (FLD (f_left), opval);
4449 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4458 CASE (sem, INSN_OCBP) : /* ocbp $rm, $disp6x32 */
4460 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4461 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4462 #define FLD(f) abuf->fields.sfmt_xori.f
4463 int UNUSED written = 0;
4464 IADDR UNUSED pc = abuf->addr;
4465 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4469 DI opval = GET_H_GR (FLD (f_left));
4470 SET_H_GR (FLD (f_left), opval);
4471 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4480 CASE (sem, INSN_OCBWB) : /* ocbwb $rm, $disp6x32 */
4482 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4483 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4484 #define FLD(f) abuf->fields.sfmt_xori.f
4485 int UNUSED written = 0;
4486 IADDR UNUSED pc = abuf->addr;
4487 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4491 DI opval = GET_H_GR (FLD (f_left));
4492 SET_H_GR (FLD (f_left), opval);
4493 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4502 CASE (sem, INSN_OR) : /* or $rm, $rn, $rd */
4504 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4505 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4506 #define FLD(f) abuf->fields.sfmt_add.f
4507 int UNUSED written = 0;
4508 IADDR UNUSED pc = abuf->addr;
4509 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4512 DI opval = ORDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
4513 SET_H_GR (FLD (f_dest), opval);
4514 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4521 CASE (sem, INSN_ORI) : /* ori $rm, $imm10, $rd */
4523 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4524 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4525 #define FLD(f) abuf->fields.sfmt_ori.f
4526 int UNUSED written = 0;
4527 IADDR UNUSED pc = abuf->addr;
4528 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4531 DI opval = ORDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm10)));
4532 SET_H_GR (FLD (f_dest), opval);
4533 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4540 CASE (sem, INSN_PREFI) : /* prefi $rm, $disp6x32 */
4542 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4543 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4544 #define FLD(f) abuf->fields.sfmt_xori.f
4545 int UNUSED written = 0;
4546 IADDR UNUSED pc = abuf->addr;
4547 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4551 DI opval = GET_H_GR (FLD (f_left));
4552 SET_H_GR (FLD (f_left), opval);
4553 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4562 CASE (sem, INSN_PTA) : /* pta$likely $disp16, $tra */
4564 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4565 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4566 #define FLD(f) abuf->fields.sfmt_pta.f
4567 int UNUSED written = 0;
4568 IADDR UNUSED pc = abuf->addr;
4569 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4574 DI opval = ADDSI (FLD (f_disp16), 1);
4575 CPU (h_tr[FLD (f_tra)]) = opval;
4576 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4584 CASE (sem, INSN_PTABS) : /* ptabs$likely $rn, $tra */
4586 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4587 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4588 #define FLD(f) abuf->fields.sfmt_beq.f
4589 int UNUSED written = 0;
4590 IADDR UNUSED pc = abuf->addr;
4591 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4596 DI opval = GET_H_GR (FLD (f_right));
4597 CPU (h_tr[FLD (f_tra)]) = opval;
4598 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4606 CASE (sem, INSN_PTB) : /* ptb$likely $disp16, $tra */
4608 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4609 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4610 #define FLD(f) abuf->fields.sfmt_pta.f
4611 int UNUSED written = 0;
4612 IADDR UNUSED pc = abuf->addr;
4613 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4618 DI opval = FLD (f_disp16);
4619 CPU (h_tr[FLD (f_tra)]) = opval;
4620 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4628 CASE (sem, INSN_PTREL) : /* ptrel$likely $rn, $tra */
4630 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4632 #define FLD(f) abuf->fields.sfmt_beq.f
4633 int UNUSED written = 0;
4634 IADDR UNUSED pc = abuf->addr;
4635 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4640 DI opval = ADDDI (pc, GET_H_GR (FLD (f_right)));
4641 CPU (h_tr[FLD (f_tra)]) = opval;
4642 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4650 CASE (sem, INSN_PUTCFG) : /* putcfg $rm, $disp6, $rd */
4652 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4653 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4654 #define FLD(f) abuf->fields.sfmt_getcfg.f
4655 int UNUSED written = 0;
4656 IADDR UNUSED pc = abuf->addr;
4657 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4661 tmp_address = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
4664 SI opval = GET_H_GR (FLD (f_dest));
4665 SETMEMSI (current_cpu, pc, tmp_address, opval);
4666 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4674 CASE (sem, INSN_PUTCON) : /* putcon $rm, $crj */
4676 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4677 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4678 #define FLD(f) abuf->fields.sfmt_xori.f
4679 int UNUSED written = 0;
4680 IADDR UNUSED pc = abuf->addr;
4681 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4684 DI opval = GET_H_GR (FLD (f_left));
4685 SET_H_CR (FLD (f_dest), opval);
4686 TRACE_RESULT (current_cpu, abuf, "cr", 'D', opval);
4693 CASE (sem, INSN_RTE) : /* rte */
4695 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4696 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4697 #define FLD(f) abuf->fields.fmt_empty.f
4698 int UNUSED written = 0;
4699 IADDR UNUSED pc = abuf->addr;
4700 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4708 CASE (sem, INSN_SHARD) : /* shard $rm, $rn, $rd */
4710 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4711 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4712 #define FLD(f) abuf->fields.sfmt_add.f
4713 int UNUSED written = 0;
4714 IADDR UNUSED pc = abuf->addr;
4715 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4718 DI opval = SRADI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63));
4719 SET_H_GR (FLD (f_dest), opval);
4720 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4727 CASE (sem, INSN_SHARDL) : /* shard.l $rm, $rn, $rd */
4729 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4730 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4731 #define FLD(f) abuf->fields.sfmt_add.f
4732 int UNUSED written = 0;
4733 IADDR UNUSED pc = abuf->addr;
4734 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4737 DI opval = EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 63)));
4738 SET_H_GR (FLD (f_dest), opval);
4739 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4746 CASE (sem, INSN_SHARI) : /* shari $rm, $uimm6, $rd */
4748 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4749 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4750 #define FLD(f) abuf->fields.sfmt_shari.f
4751 int UNUSED written = 0;
4752 IADDR UNUSED pc = abuf->addr;
4753 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4756 DI opval = SRADI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4757 SET_H_GR (FLD (f_dest), opval);
4758 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4765 CASE (sem, INSN_SHARIL) : /* shari.l $rm, $uimm6, $rd */
4767 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4768 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4769 #define FLD(f) abuf->fields.sfmt_shari.f
4770 int UNUSED written = 0;
4771 IADDR UNUSED pc = abuf->addr;
4772 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4775 DI opval = EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDSI (FLD (f_uimm6), 63)));
4776 SET_H_GR (FLD (f_dest), opval);
4777 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4784 CASE (sem, INSN_SHLLD) : /* shlld $rm, $rn, $rd */
4786 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4787 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4788 #define FLD(f) abuf->fields.sfmt_add.f
4789 int UNUSED written = 0;
4790 IADDR UNUSED pc = abuf->addr;
4791 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4794 DI opval = SLLDI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63));
4795 SET_H_GR (FLD (f_dest), opval);
4796 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4803 CASE (sem, INSN_SHLLDL) : /* shlld.l $rm, $rn, $rd */
4805 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4806 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4807 #define FLD(f) abuf->fields.sfmt_add.f
4808 int UNUSED written = 0;
4809 IADDR UNUSED pc = abuf->addr;
4810 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4813 DI opval = EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 63)));
4814 SET_H_GR (FLD (f_dest), opval);
4815 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4822 CASE (sem, INSN_SHLLI) : /* shlli $rm, $uimm6, $rd */
4824 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4825 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4826 #define FLD(f) abuf->fields.sfmt_shari.f
4827 int UNUSED written = 0;
4828 IADDR UNUSED pc = abuf->addr;
4829 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4832 DI opval = SLLDI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4833 SET_H_GR (FLD (f_dest), opval);
4834 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4841 CASE (sem, INSN_SHLLIL) : /* shlli.l $rm, $uimm6, $rd */
4843 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4844 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4845 #define FLD(f) abuf->fields.sfmt_shari.f
4846 int UNUSED written = 0;
4847 IADDR UNUSED pc = abuf->addr;
4848 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4851 DI opval = EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDSI (FLD (f_uimm6), 63)));
4852 SET_H_GR (FLD (f_dest), opval);
4853 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4860 CASE (sem, INSN_SHLRD) : /* shlrd $rm, $rn, $rd */
4862 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4863 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4864 #define FLD(f) abuf->fields.sfmt_add.f
4865 int UNUSED written = 0;
4866 IADDR UNUSED pc = abuf->addr;
4867 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4870 DI opval = SRLDI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63));
4871 SET_H_GR (FLD (f_dest), opval);
4872 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4879 CASE (sem, INSN_SHLRDL) : /* shlrd.l $rm, $rn, $rd */
4881 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4882 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4883 #define FLD(f) abuf->fields.sfmt_add.f
4884 int UNUSED written = 0;
4885 IADDR UNUSED pc = abuf->addr;
4886 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4889 DI opval = EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 63)));
4890 SET_H_GR (FLD (f_dest), opval);
4891 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4898 CASE (sem, INSN_SHLRI) : /* shlri $rm, $uimm6, $rd */
4900 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4901 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4902 #define FLD(f) abuf->fields.sfmt_shari.f
4903 int UNUSED written = 0;
4904 IADDR UNUSED pc = abuf->addr;
4905 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4908 DI opval = SRLDI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4909 SET_H_GR (FLD (f_dest), opval);
4910 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4917 CASE (sem, INSN_SHLRIL) : /* shlri.l $rm, $uimm6, $rd */
4919 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4920 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4921 #define FLD(f) abuf->fields.sfmt_shari.f
4922 int UNUSED written = 0;
4923 IADDR UNUSED pc = abuf->addr;
4924 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4927 DI opval = EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDSI (FLD (f_uimm6), 63)));
4928 SET_H_GR (FLD (f_dest), opval);
4929 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4936 CASE (sem, INSN_SHORI) : /* shori $uimm16, $rd */
4938 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4939 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4940 #define FLD(f) abuf->fields.sfmt_shori.f
4941 int UNUSED written = 0;
4942 IADDR UNUSED pc = abuf->addr;
4943 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4946 DI opval = ORDI (SLLDI (GET_H_GR (FLD (f_dest)), 16), ZEXTSIDI (FLD (f_uimm16)));
4947 SET_H_GR (FLD (f_dest), opval);
4948 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4955 CASE (sem, INSN_SLEEP) : /* sleep */
4957 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4958 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4959 #define FLD(f) abuf->fields.fmt_empty.f
4960 int UNUSED written = 0;
4961 IADDR UNUSED pc = abuf->addr;
4962 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4970 CASE (sem, INSN_STB) : /* st.b $rm, $disp10, $rd */
4972 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4973 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4974 #define FLD(f) abuf->fields.sfmt_addi.f
4975 int UNUSED written = 0;
4976 IADDR UNUSED pc = abuf->addr;
4977 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4980 UQI opval = ANDQI (GET_H_GR (FLD (f_dest)), 255);
4981 SETMEMUQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10))), opval);
4982 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4989 CASE (sem, INSN_STL) : /* st.l $rm, $disp10x4, $rd */
4991 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4992 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4993 #define FLD(f) abuf->fields.sfmt_flds.f
4994 int UNUSED written = 0;
4995 IADDR UNUSED pc = abuf->addr;
4996 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4999 SI opval = ANDSI (GET_H_GR (FLD (f_dest)), 0xffffffff);
5000 SETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x4))), opval);
5001 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5008 CASE (sem, INSN_STQ) : /* st.q $rm, $disp10x8, $rd */
5010 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5011 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5012 #define FLD(f) abuf->fields.sfmt_fldd.f
5013 int UNUSED written = 0;
5014 IADDR UNUSED pc = abuf->addr;
5015 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5018 DI opval = GET_H_GR (FLD (f_dest));
5019 SETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x8))), opval);
5020 TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5027 CASE (sem, INSN_STW) : /* st.w $rm, $disp10x2, $rd */
5029 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5030 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5031 #define FLD(f) abuf->fields.sfmt_lduw.f
5032 int UNUSED written = 0;
5033 IADDR UNUSED pc = abuf->addr;
5034 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5037 HI opval = ANDHI (GET_H_GR (FLD (f_dest)), 65535);
5038 SETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x2))), opval);
5039 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5046 CASE (sem, INSN_STHIL) : /* sthi.l $rm, $disp6, $rd */
5048 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5049 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5050 #define FLD(f) abuf->fields.sfmt_getcfg.f
5051 int UNUSED written = 0;
5052 IADDR UNUSED pc = abuf->addr;
5053 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5059 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5060 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 3), 1);
5061 if (ANDQI (tmp_bytecount, 4)) {
5063 SI opval = GET_H_GR (FLD (f_dest));
5064 SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5065 written |= (1 << 5);
5066 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5069 if (GET_H_ENDIAN ()) {
5071 tmp_val = GET_H_GR (FLD (f_dest));
5072 if (ANDQI (tmp_bytecount, 1)) {
5075 UQI opval = ANDQI (tmp_val, 255);
5076 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5077 written |= (1 << 6);
5078 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5080 tmp_val = SRLDI (tmp_val, 8);
5083 if (ANDQI (tmp_bytecount, 2)) {
5086 HI opval = ANDHI (tmp_val, 65535);
5087 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5088 written |= (1 << 4);
5089 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5091 tmp_val = SRLDI (tmp_val, 16);
5097 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (32, MULSI (8, tmp_bytecount)));
5098 if (ANDQI (tmp_bytecount, 2)) {
5101 HI opval = ANDHI (tmp_val, 65535);
5102 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5103 written |= (1 << 4);
5104 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5106 tmp_val = SRLDI (tmp_val, 16);
5109 if (ANDQI (tmp_bytecount, 1)) {
5112 UQI opval = ANDQI (tmp_val, 255);
5113 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5114 written |= (1 << 6);
5115 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5117 tmp_val = SRLDI (tmp_val, 8);
5125 abuf->written = written;
5130 CASE (sem, INSN_STHIQ) : /* sthi.q $rm, $disp6, $rd */
5132 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5133 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5134 #define FLD(f) abuf->fields.sfmt_getcfg.f
5135 int UNUSED written = 0;
5136 IADDR UNUSED pc = abuf->addr;
5137 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5143 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5144 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 7), 1);
5145 if (ANDQI (tmp_bytecount, 8)) {
5147 DI opval = GET_H_GR (FLD (f_dest));
5148 SETMEMDI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5149 written |= (1 << 4);
5150 TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5153 if (GET_H_ENDIAN ()) {
5155 tmp_val = GET_H_GR (FLD (f_dest));
5156 if (ANDQI (tmp_bytecount, 1)) {
5159 UQI opval = ANDQI (tmp_val, 255);
5160 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5161 written |= (1 << 7);
5162 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5164 tmp_val = SRLDI (tmp_val, 8);
5167 if (ANDQI (tmp_bytecount, 2)) {
5170 HI opval = ANDHI (tmp_val, 65535);
5171 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5172 written |= (1 << 5);
5173 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5175 tmp_val = SRLDI (tmp_val, 16);
5178 if (ANDQI (tmp_bytecount, 4)) {
5181 SI opval = ANDSI (tmp_val, 0xffffffff);
5182 SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5183 written |= (1 << 6);
5184 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5186 tmp_val = SRLDI (tmp_val, 32);
5192 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (64, MULSI (8, tmp_bytecount)));
5193 if (ANDQI (tmp_bytecount, 4)) {
5196 SI opval = ANDSI (tmp_val, 0xffffffff);
5197 SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5198 written |= (1 << 6);
5199 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5201 tmp_val = SRLDI (tmp_val, 32);
5204 if (ANDQI (tmp_bytecount, 2)) {
5207 HI opval = ANDHI (tmp_val, 65535);
5208 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5209 written |= (1 << 5);
5210 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5212 tmp_val = SRLDI (tmp_val, 16);
5215 if (ANDQI (tmp_bytecount, 1)) {
5218 UQI opval = ANDQI (tmp_val, 255);
5219 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5220 written |= (1 << 7);
5221 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5223 tmp_val = SRLDI (tmp_val, 8);
5231 abuf->written = written;
5236 CASE (sem, INSN_STLOL) : /* stlo.l $rm, $disp6, $rd */
5238 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5239 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5240 #define FLD(f) abuf->fields.sfmt_getcfg.f
5241 int UNUSED written = 0;
5242 IADDR UNUSED pc = abuf->addr;
5243 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5249 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5250 tmp_bytecount = SUBSI (4, ANDDI (tmp_addr, 3));
5251 if (ANDQI (tmp_bytecount, 4)) {
5253 USI opval = GET_H_GR (FLD (f_dest));
5254 SETMEMUSI (current_cpu, pc, tmp_addr, opval);
5255 written |= (1 << 6);
5256 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5259 if (GET_H_ENDIAN ()) {
5261 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (32, MULSI (8, tmp_bytecount)));
5262 if (ANDQI (tmp_bytecount, 2)) {
5265 UHI opval = ANDHI (tmp_val, 65535);
5266 SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5267 written |= (1 << 4);
5268 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5270 tmp_val = SRLDI (tmp_val, 16);
5273 if (ANDQI (tmp_bytecount, 1)) {
5276 UQI opval = ANDQI (tmp_val, 255);
5277 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5278 written |= (1 << 5);
5279 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5281 tmp_val = SRLDI (tmp_val, 8);
5287 tmp_val = GET_H_GR (FLD (f_dest));
5288 if (ANDQI (tmp_bytecount, 1)) {
5291 UQI opval = ANDQI (tmp_val, 255);
5292 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5293 written |= (1 << 5);
5294 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5296 tmp_val = SRLDI (tmp_val, 8);
5299 if (ANDQI (tmp_bytecount, 2)) {
5302 UHI opval = ANDHI (tmp_val, 65535);
5303 SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5304 written |= (1 << 4);
5305 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5307 tmp_val = SRLDI (tmp_val, 16);
5315 abuf->written = written;
5320 CASE (sem, INSN_STLOQ) : /* stlo.q $rm, $disp6, $rd */
5322 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5323 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5324 #define FLD(f) abuf->fields.sfmt_getcfg.f
5325 int UNUSED written = 0;
5326 IADDR UNUSED pc = abuf->addr;
5327 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5333 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5334 tmp_bytecount = SUBSI (8, ANDDI (tmp_addr, 7));
5335 if (ANDQI (tmp_bytecount, 8)) {
5337 UDI opval = GET_H_GR (FLD (f_dest));
5338 SETMEMUDI (current_cpu, pc, tmp_addr, opval);
5339 written |= (1 << 4);
5340 TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5343 if (GET_H_ENDIAN ()) {
5345 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (64, MULSI (8, tmp_bytecount)));
5346 if (ANDQI (tmp_bytecount, 4)) {
5349 USI opval = ANDSI (tmp_val, 0xffffffff);
5350 SETMEMUSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4), opval);
5351 written |= (1 << 7);
5352 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5354 tmp_val = SRLDI (tmp_val, 32);
5357 if (ANDQI (tmp_bytecount, 2)) {
5360 UHI opval = ANDHI (tmp_val, 65535);
5361 SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5362 written |= (1 << 5);
5363 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5365 tmp_val = SRLDI (tmp_val, 16);
5368 if (ANDQI (tmp_bytecount, 1)) {
5371 UQI opval = ANDQI (tmp_val, 255);
5372 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5373 written |= (1 << 6);
5374 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5376 tmp_val = SRLDI (tmp_val, 8);
5382 tmp_val = GET_H_GR (FLD (f_dest));
5383 if (ANDQI (tmp_bytecount, 1)) {
5386 UQI opval = ANDQI (tmp_val, 255);
5387 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5388 written |= (1 << 6);
5389 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5391 tmp_val = SRLDI (tmp_val, 8);
5394 if (ANDQI (tmp_bytecount, 2)) {
5397 UHI opval = ANDHI (tmp_val, 65535);
5398 SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5399 written |= (1 << 5);
5400 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5402 tmp_val = SRLDI (tmp_val, 16);
5405 if (ANDQI (tmp_bytecount, 4)) {
5408 USI opval = ANDSI (tmp_val, 0xffffffff);
5409 SETMEMUSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4), opval);
5410 written |= (1 << 7);
5411 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5413 tmp_val = SRLDI (tmp_val, 32);
5421 abuf->written = written;
5426 CASE (sem, INSN_STXB) : /* stx.b $rm, $rn, $rd */
5428 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5429 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5430 #define FLD(f) abuf->fields.sfmt_add.f
5431 int UNUSED written = 0;
5432 IADDR UNUSED pc = abuf->addr;
5433 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5436 UQI opval = SUBWORDDIQI (GET_H_GR (FLD (f_dest)), 7);
5437 SETMEMUQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5438 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5445 CASE (sem, INSN_STXL) : /* stx.l $rm, $rn, $rd */
5447 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5448 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5449 #define FLD(f) abuf->fields.sfmt_add.f
5450 int UNUSED written = 0;
5451 IADDR UNUSED pc = abuf->addr;
5452 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5455 SI opval = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 1);
5456 SETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5457 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5464 CASE (sem, INSN_STXQ) : /* stx.q $rm, $rn, $rd */
5466 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5467 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5468 #define FLD(f) abuf->fields.sfmt_add.f
5469 int UNUSED written = 0;
5470 IADDR UNUSED pc = abuf->addr;
5471 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5474 DI opval = GET_H_GR (FLD (f_dest));
5475 SETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5476 TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5483 CASE (sem, INSN_STXW) : /* stx.w $rm, $rn, $rd */
5485 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5486 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5487 #define FLD(f) abuf->fields.sfmt_add.f
5488 int UNUSED written = 0;
5489 IADDR UNUSED pc = abuf->addr;
5490 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5493 HI opval = SUBWORDDIHI (GET_H_GR (FLD (f_dest)), 3);
5494 SETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5495 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5502 CASE (sem, INSN_SUB) : /* sub $rm, $rn, $rd */
5504 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5505 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5506 #define FLD(f) abuf->fields.sfmt_add.f
5507 int UNUSED written = 0;
5508 IADDR UNUSED pc = abuf->addr;
5509 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5512 DI opval = SUBDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5513 SET_H_GR (FLD (f_dest), opval);
5514 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5521 CASE (sem, INSN_SUBL) : /* sub.l $rm, $rn, $rd */
5523 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5524 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5525 #define FLD(f) abuf->fields.sfmt_add.f
5526 int UNUSED written = 0;
5527 IADDR UNUSED pc = abuf->addr;
5528 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5531 DI opval = EXTSIDI (SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
5532 SET_H_GR (FLD (f_dest), opval);
5533 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5540 CASE (sem, INSN_SWAPQ) : /* swap.q $rm, $rn, $rd */
5542 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5543 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5544 #define FLD(f) abuf->fields.sfmt_add.f
5545 int UNUSED written = 0;
5546 IADDR UNUSED pc = abuf->addr;
5547 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5552 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5553 tmp_temp = GETMEMDI (current_cpu, pc, tmp_addr);
5555 DI opval = GET_H_GR (FLD (f_dest));
5556 SETMEMDI (current_cpu, pc, tmp_addr, opval);
5557 TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5560 DI opval = tmp_temp;
5561 SET_H_GR (FLD (f_dest), opval);
5562 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5570 CASE (sem, INSN_SYNCI) : /* synci */
5572 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5573 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5574 #define FLD(f) abuf->fields.fmt_empty.f
5575 int UNUSED written = 0;
5576 IADDR UNUSED pc = abuf->addr;
5577 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5585 CASE (sem, INSN_SYNCO) : /* synco */
5587 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5588 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5589 #define FLD(f) abuf->fields.fmt_empty.f
5590 int UNUSED written = 0;
5591 IADDR UNUSED pc = abuf->addr;
5592 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5600 CASE (sem, INSN_TRAPA) : /* trapa $rm */
5602 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5603 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5604 #define FLD(f) abuf->fields.sfmt_xori.f
5605 int UNUSED written = 0;
5606 IADDR UNUSED pc = abuf->addr;
5607 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5609 sh64_trapa (current_cpu, GET_H_GR (FLD (f_left)), pc);
5615 CASE (sem, INSN_XOR) : /* xor $rm, $rn, $rd */
5617 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5618 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5619 #define FLD(f) abuf->fields.sfmt_add.f
5620 int UNUSED written = 0;
5621 IADDR UNUSED pc = abuf->addr;
5622 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5625 DI opval = XORDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5626 SET_H_GR (FLD (f_dest), opval);
5627 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5634 CASE (sem, INSN_XORI) : /* xori $rm, $imm6, $rd */
5636 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5637 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5638 #define FLD(f) abuf->fields.sfmt_xori.f
5639 int UNUSED written = 0;
5640 IADDR UNUSED pc = abuf->addr;
5641 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5644 DI opval = XORDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)));
5645 SET_H_GR (FLD (f_dest), opval);
5646 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5655 ENDSWITCH (sem) /* End of semantic switch. */
5657 /* At this point `vpc' contains the next insn to execute. */
5660 #undef DEFINE_SWITCH
5661 #endif /* DEFINE_SWITCH */