* cgen-asm.in: Update copyright year.
[deliverable/binutils-gdb.git] / sim / sh64 / sem-media-switch.c
CommitLineData
cbb38b47
BE
1/* Simulator instruction semantics for sh64.
2
3THIS FILE IS MACHINE GENERATED WITH CGEN.
4
fda1c30b 5Copyright 1996-2009 Free Software Foundation, Inc.
cbb38b47 6
1bbd6057 7This file is part of the GNU simulators.
cbb38b47 8
fda1c30b
DE
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)
12 any later version.
cbb38b47 13
fda1c30b
DE
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.
cbb38b47 18
fda1c30b
DE
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.
cbb38b47
BE
22
23*/
24
25#ifdef DEFINE_LABELS
26
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. */
30
31 static struct {
32 int index;
33 void *label;
34 } labels[] = {
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 },
249 { 0, 0 }
250 };
251 int i;
252
253 for (i = 0; labels[i].label != 0; ++i)
254 {
255#if FAST_P
256 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
257#else
258 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
259#endif
260 }
261
262#undef DEFINE_LABELS
263#endif /* DEFINE_LABELS */
264
265#ifdef DEFINE_SWITCH
266
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". */
272
273#if FAST_P
274#undef TRACE_RESULT
275#define TRACE_RESULT(cpu, abuf, name, type, val)
276#endif
277
278#undef GET_ATTR
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)
281#else
282#define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
283#endif
284
285{
286
287#if WITH_SCACHE_PBB
288
289/* Branch to next handler without going around main loop. */
290#define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
291SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
292
293#else /* ! WITH_SCACHE_PBB */
294
295#define NEXT(vpc) BREAK (sem)
296#ifdef __GNUC__
297#if FAST_P
298 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
299#else
300 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
301#endif
302#else
303 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
304#endif
305
306#endif /* ! WITH_SCACHE_PBB */
307
308 {
309
310 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
311{
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);
318
319 {
320 /* Update the recorded pc in the cpu state struct.
321 Only necessary for WITH_SCACHE case, but to avoid the
322 conditional compilation .... */
323 SET_H_PC (pc);
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);
329 }
330
331#undef FLD
332}
333 NEXT (vpc);
334
335 CASE (sem, INSN_X_AFTER) : /* --after-- */
336{
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);
343
344 {
345#if WITH_SCACHE_PBB_SH64_MEDIA
346 sh64_media_pbb_after (current_cpu, sem_arg);
347#endif
348 }
349
350#undef FLD
351}
352 NEXT (vpc);
353
354 CASE (sem, INSN_X_BEFORE) : /* --before-- */
355{
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);
362
363 {
364#if WITH_SCACHE_PBB_SH64_MEDIA
365 sh64_media_pbb_before (current_cpu, sem_arg);
366#endif
367 }
368
369#undef FLD
370}
371 NEXT (vpc);
372
373 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
374{
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);
381
382 {
383#if WITH_SCACHE_PBB_SH64_MEDIA
384#ifdef DEFINE_SWITCH
385 vpc = sh64_media_pbb_cti_chain (current_cpu, sem_arg,
386 pbb_br_type, pbb_br_npc);
387 BREAK (sem);
388#else
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));
393#endif
394#endif
395 }
396
397#undef FLD
398}
399 NEXT (vpc);
400
401 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
402{
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);
409
410 {
411#if WITH_SCACHE_PBB_SH64_MEDIA
412 vpc = sh64_media_pbb_chain (current_cpu, sem_arg);
413#ifdef DEFINE_SWITCH
414 BREAK (sem);
415#endif
416#endif
417 }
418
419#undef FLD
420}
421 NEXT (vpc);
422
423 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
424{
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);
431
432 {
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);
438#else
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)));
441#else
442 vpc = sh64_media_pbb_begin (current_cpu, 0);
443#endif
444#endif
445#endif
446 }
447
448#undef FLD
449}
450 NEXT (vpc);
451
452 CASE (sem, INSN_ADD) : /* add $rm, $rn, $rd */
453{
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);
460
461 {
462 DI opval = ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
463 SET_H_GR (FLD (f_dest), opval);
1bbd6057 464 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
465 }
466
467#undef FLD
468}
469 NEXT (vpc);
470
471 CASE (sem, INSN_ADDL) : /* add.l $rm, $rn, $rd */
472{
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);
479
480 {
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);
1bbd6057 483 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
484 }
485
486#undef FLD
487}
488 NEXT (vpc);
489
490 CASE (sem, INSN_ADDI) : /* addi $rm, $disp10, $rd */
491{
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);
498
499 {
500 DI opval = ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)));
501 SET_H_GR (FLD (f_dest), opval);
1bbd6057 502 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
503 }
504
505#undef FLD
506}
507 NEXT (vpc);
508
509 CASE (sem, INSN_ADDIL) : /* addi.l $rm, $disp10, $rd */
510{
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);
517
518 {
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);
1bbd6057 521 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
522 }
523
524#undef FLD
525}
526 NEXT (vpc);
527
528 CASE (sem, INSN_ADDZL) : /* addz.l $rm, $rn, $rd */
529{
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);
536
537 {
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);
1bbd6057 540 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
541 }
542
543#undef FLD
544}
545 NEXT (vpc);
546
547 CASE (sem, INSN_ALLOCO) : /* alloco $rm, $disp6x32 */
548{
549 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
550 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 551#define FLD(f) abuf->fields.sfmt_xori.f
cbb38b47
BE
552 int UNUSED written = 0;
553 IADDR UNUSED pc = abuf->addr;
554 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
555
c7e628df
DB
556{
557 {
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);
561 }
cbb38b47 562((void) 0); /*nop*/
c7e628df 563}
cbb38b47
BE
564
565#undef FLD
566}
567 NEXT (vpc);
568
569 CASE (sem, INSN_AND) : /* and $rm, $rn, $rd */
570{
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);
577
578 {
579 DI opval = ANDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
580 SET_H_GR (FLD (f_dest), opval);
1bbd6057 581 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
582 }
583
584#undef FLD
585}
586 NEXT (vpc);
587
588 CASE (sem, INSN_ANDC) : /* andc $rm, $rn, $rd */
589{
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);
596
597 {
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);
1bbd6057 600 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
601 }
602
603#undef FLD
604}
605 NEXT (vpc);
606
607 CASE (sem, INSN_ANDI) : /* andi $rm, $disp10, $rd */
608{
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);
615
616 {
617 DI opval = ANDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)));
618 SET_H_GR (FLD (f_dest), opval);
1bbd6057 619 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
620 }
621
622#undef FLD
623}
624 NEXT (vpc);
625
626 CASE (sem, INSN_BEQ) : /* beq$likely $rm, $rn, $tra */
627{
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;
633 SEM_BRANCH_INIT
634 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
635
c7e628df
DB
636{
637((void) 0); /*nop*/
cbb38b47
BE
638if (EQDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
639 {
640 UDI opval = CPU (h_tr[FLD (f_tra)]);
641 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
642 written |= (1 << 3);
643 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
644 }
c7e628df 645}
cbb38b47
BE
646}
647
648 abuf->written = written;
649 SEM_BRANCH_FINI (vpc);
650#undef FLD
651}
652 NEXT (vpc);
653
654 CASE (sem, INSN_BEQI) : /* beqi$likely $rm, $imm6, $tra */
655{
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;
661 SEM_BRANCH_INIT
662 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
663
c7e628df
DB
664{
665((void) 0); /*nop*/
cbb38b47
BE
666if (EQDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)))) {
667 {
668 UDI opval = CPU (h_tr[FLD (f_tra)]);
669 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
670 written |= (1 << 3);
671 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
672 }
c7e628df 673}
cbb38b47
BE
674}
675
676 abuf->written = written;
677 SEM_BRANCH_FINI (vpc);
678#undef FLD
679}
680 NEXT (vpc);
681
682 CASE (sem, INSN_BGE) : /* bge$likely $rm, $rn, $tra */
683{
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;
689 SEM_BRANCH_INIT
690 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
691
c7e628df
DB
692{
693((void) 0); /*nop*/
cbb38b47
BE
694if (GEDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
695 {
696 UDI opval = CPU (h_tr[FLD (f_tra)]);
697 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
698 written |= (1 << 3);
699 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
700 }
c7e628df 701}
cbb38b47
BE
702}
703
704 abuf->written = written;
705 SEM_BRANCH_FINI (vpc);
706#undef FLD
707}
708 NEXT (vpc);
709
710 CASE (sem, INSN_BGEU) : /* bgeu$likely $rm, $rn, $tra */
711{
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;
717 SEM_BRANCH_INIT
718 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
719
c7e628df
DB
720{
721((void) 0); /*nop*/
cbb38b47
BE
722if (GEUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
723 {
724 UDI opval = CPU (h_tr[FLD (f_tra)]);
725 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
726 written |= (1 << 3);
727 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
728 }
c7e628df 729}
cbb38b47
BE
730}
731
732 abuf->written = written;
733 SEM_BRANCH_FINI (vpc);
734#undef FLD
735}
736 NEXT (vpc);
737
738 CASE (sem, INSN_BGT) : /* bgt$likely $rm, $rn, $tra */
739{
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;
745 SEM_BRANCH_INIT
746 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
747
c7e628df
DB
748{
749((void) 0); /*nop*/
cbb38b47
BE
750if (GTDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
751 {
752 UDI opval = CPU (h_tr[FLD (f_tra)]);
753 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
754 written |= (1 << 3);
755 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
756 }
c7e628df 757}
cbb38b47
BE
758}
759
760 abuf->written = written;
761 SEM_BRANCH_FINI (vpc);
762#undef FLD
763}
764 NEXT (vpc);
765
766 CASE (sem, INSN_BGTU) : /* bgtu$likely $rm, $rn, $tra */
767{
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;
773 SEM_BRANCH_INIT
774 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
775
c7e628df
DB
776{
777((void) 0); /*nop*/
cbb38b47
BE
778if (GTUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
779 {
780 UDI opval = CPU (h_tr[FLD (f_tra)]);
781 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
782 written |= (1 << 3);
783 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
784 }
c7e628df 785}
cbb38b47
BE
786}
787
788 abuf->written = written;
789 SEM_BRANCH_FINI (vpc);
790#undef FLD
791}
792 NEXT (vpc);
793
794 CASE (sem, INSN_BLINK) : /* blink $trb, $rd */
795{
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;
801 SEM_BRANCH_INIT
802 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
803
804{
805 {
806 DI opval = ORDI (ADDDI (pc, 4), 1);
807 SET_H_GR (FLD (f_dest), opval);
1bbd6057 808 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
809 }
810 {
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);
814 }
c7e628df
DB
815if (EQSI (FLD (f_dest), 63)) {
816((void) 0); /*nop*/
817} else {
818((void) 0); /*nop*/
819}
cbb38b47
BE
820}
821
822 SEM_BRANCH_FINI (vpc);
823#undef FLD
824}
825 NEXT (vpc);
826
827 CASE (sem, INSN_BNE) : /* bne$likely $rm, $rn, $tra */
828{
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;
834 SEM_BRANCH_INIT
835 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
836
c7e628df
DB
837{
838((void) 0); /*nop*/
cbb38b47
BE
839if (NEDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
840 {
841 UDI opval = CPU (h_tr[FLD (f_tra)]);
842 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
843 written |= (1 << 3);
844 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
845 }
c7e628df 846}
cbb38b47
BE
847}
848
849 abuf->written = written;
850 SEM_BRANCH_FINI (vpc);
851#undef FLD
852}
853 NEXT (vpc);
854
855 CASE (sem, INSN_BNEI) : /* bnei$likely $rm, $imm6, $tra */
856{
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;
862 SEM_BRANCH_INIT
863 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
864
c7e628df
DB
865{
866((void) 0); /*nop*/
cbb38b47
BE
867if (NEDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)))) {
868 {
869 UDI opval = CPU (h_tr[FLD (f_tra)]);
870 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
871 written |= (1 << 3);
872 TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
873 }
c7e628df 874}
cbb38b47
BE
875}
876
877 abuf->written = written;
878 SEM_BRANCH_FINI (vpc);
879#undef FLD
880}
881 NEXT (vpc);
882
883 CASE (sem, INSN_BRK) : /* brk */
884{
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);
891
892sh64_break (current_cpu, pc);
893
894#undef FLD
895}
896 NEXT (vpc);
897
898 CASE (sem, INSN_BYTEREV) : /* byterev $rm, $rd */
899{
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);
906
907{
908 DI tmp_source;
909 DI tmp_result;
910 tmp_source = GET_H_GR (FLD (f_left));
911 tmp_result = 0;
912{
913 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
914 tmp_source = SRLDI (tmp_source, 8);
915}
916{
917 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
918 tmp_source = SRLDI (tmp_source, 8);
919}
920{
921 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
922 tmp_source = SRLDI (tmp_source, 8);
923}
924{
925 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
926 tmp_source = SRLDI (tmp_source, 8);
927}
928{
929 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
930 tmp_source = SRLDI (tmp_source, 8);
931}
932{
933 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
934 tmp_source = SRLDI (tmp_source, 8);
935}
936{
937 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
938 tmp_source = SRLDI (tmp_source, 8);
939}
940{
941 tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
942 tmp_source = SRLDI (tmp_source, 8);
943}
944 {
945 DI opval = tmp_result;
946 SET_H_GR (FLD (f_dest), opval);
1bbd6057 947 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
948 }
949}
950
951#undef FLD
952}
953 NEXT (vpc);
954
955 CASE (sem, INSN_CMPEQ) : /* cmpeq $rm, $rn, $rd */
956{
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);
963
964 {
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);
1bbd6057 967 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
968 }
969
970#undef FLD
971}
972 NEXT (vpc);
973
974 CASE (sem, INSN_CMPGT) : /* cmpgt $rm, $rn, $rd */
975{
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);
982
983 {
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);
1bbd6057 986 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
987 }
988
989#undef FLD
990}
991 NEXT (vpc);
992
993 CASE (sem, INSN_CMPGTU) : /* cmpgtu $rm,$rn, $rd */
994{
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);
1001
1002 {
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);
1bbd6057 1005 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1006 }
1007
1008#undef FLD
1009}
1010 NEXT (vpc);
1011
1012 CASE (sem, INSN_CMVEQ) : /* cmveq $rm, $rn, $rd */
1013{
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);
1020
1021if (EQDI (GET_H_GR (FLD (f_left)), 0)) {
1022 {
1023 DI opval = GET_H_GR (FLD (f_right));
1024 SET_H_GR (FLD (f_dest), opval);
1025 written |= (1 << 2);
1bbd6057 1026 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1027 }
1028}
1029
1030 abuf->written = written;
1031#undef FLD
1032}
1033 NEXT (vpc);
1034
1035 CASE (sem, INSN_CMVNE) : /* cmvne $rm, $rn, $rd */
1036{
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);
1043
1044if (NEDI (GET_H_GR (FLD (f_left)), 0)) {
1045 {
1046 DI opval = GET_H_GR (FLD (f_right));
1047 SET_H_GR (FLD (f_dest), opval);
1048 written |= (1 << 2);
1bbd6057 1049 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1050 }
1051}
1052
1053 abuf->written = written;
1054#undef FLD
1055}
1056 NEXT (vpc);
1057
1058 CASE (sem, INSN_FABSD) : /* fabs.d $drgh, $drf */
1059{
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);
1066
1067 {
1068 DF opval = sh64_fabsd (current_cpu, GET_H_DR (FLD (f_left_right)));
1069 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1070 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1071 }
1072
1073#undef FLD
1074}
1075 NEXT (vpc);
1076
1077 CASE (sem, INSN_FABSS) : /* fabs.s $frgh, $frf */
1078{
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);
1085
1086 {
1087 SF opval = sh64_fabss (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1088 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1089 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1090 }
1091
1092#undef FLD
1093}
1094 NEXT (vpc);
1095
1096 CASE (sem, INSN_FADDD) : /* fadd.d $drg, $drh, $drf */
1097{
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);
1104
1105 {
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);
1bbd6057 1108 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1109 }
1110
1111#undef FLD
1112}
1113 NEXT (vpc);
1114
1115 CASE (sem, INSN_FADDS) : /* fadd.s $frg, $frh, $frf */
1116{
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);
1123
1124 {
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;
1bbd6057 1127 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1128 }
1129
1130#undef FLD
1131}
1132 NEXT (vpc);
1133
1134 CASE (sem, INSN_FCMPEQD) : /* fcmpeq.d $drg, $drh, $rd */
1135{
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);
1142
1143 {
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);
1bbd6057 1146 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1147 }
1148
1149#undef FLD
1150}
1151 NEXT (vpc);
1152
1153 CASE (sem, INSN_FCMPEQS) : /* fcmpeq.s $frg, $frh, $rd */
1154{
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);
1161
1162 {
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);
1bbd6057 1165 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1166 }
1167
1168#undef FLD
1169}
1170 NEXT (vpc);
1171
1172 CASE (sem, INSN_FCMPGED) : /* fcmpge.d $drg, $drh, $rd */
1173{
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);
1180
1181 {
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);
1bbd6057 1184 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1185 }
1186
1187#undef FLD
1188}
1189 NEXT (vpc);
1190
1191 CASE (sem, INSN_FCMPGES) : /* fcmpge.s $frg, $frh, $rd */
1192{
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);
1199
1200 {
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);
1bbd6057 1203 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1204 }
1205
1206#undef FLD
1207}
1208 NEXT (vpc);
1209
1210 CASE (sem, INSN_FCMPGTD) : /* fcmpgt.d $drg, $drh, $rd */
1211{
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);
1218
1219 {
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);
1bbd6057 1222 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1223 }
1224
1225#undef FLD
1226}
1227 NEXT (vpc);
1228
1229 CASE (sem, INSN_FCMPGTS) : /* fcmpgt.s $frg, $frh, $rd */
1230{
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);
1237
1238 {
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);
1bbd6057 1241 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1242 }
1243
1244#undef FLD
1245}
1246 NEXT (vpc);
1247
1248 CASE (sem, INSN_FCMPUND) : /* fcmpun.d $drg, $drh, $rd */
1249{
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);
1256
1257 {
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);
1bbd6057 1260 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1261 }
1262
1263#undef FLD
1264}
1265 NEXT (vpc);
1266
1267 CASE (sem, INSN_FCMPUNS) : /* fcmpun.s $frg, $frh, $rd */
1268{
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);
1275
1276 {
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);
1bbd6057 1279 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1280 }
1281
1282#undef FLD
1283}
1284 NEXT (vpc);
1285
1286 CASE (sem, INSN_FCNVDS) : /* fcnv.ds $drgh, $frf */
1287{
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);
1294
1295 {
1296 SF opval = sh64_fcnvds (current_cpu, GET_H_DR (FLD (f_left_right)));
1297 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1298 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1299 }
1300
1301#undef FLD
1302}
1303 NEXT (vpc);
1304
1305 CASE (sem, INSN_FCNVSD) : /* fcnv.sd $frgh, $drf */
1306{
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);
1313
1314 {
1315 DF opval = sh64_fcnvsd (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1316 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1317 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1318 }
1319
1320#undef FLD
1321}
1322 NEXT (vpc);
1323
1324 CASE (sem, INSN_FDIVD) : /* fdiv.d $drg, $drh, $drf */
1325{
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);
1332
1333 {
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);
1bbd6057 1336 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1337 }
1338
1339#undef FLD
1340}
1341 NEXT (vpc);
1342
1343 CASE (sem, INSN_FDIVS) : /* fdiv.s $frg, $frh, $frf */
1344{
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);
1351
1352 {
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;
1bbd6057 1355 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1356 }
1357
1358#undef FLD
1359}
1360 NEXT (vpc);
1361
1362 CASE (sem, INSN_FGETSCR) : /* fgetscr $frf */
1363{
1364 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1365 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 1366#define FLD(f) abuf->fields.sfmt_shori.f
cbb38b47
BE
1367 int UNUSED written = 0;
1368 IADDR UNUSED pc = abuf->addr;
1369 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1370
c7e628df
DB
1371 {
1372 SF opval = SUBWORDSISF (CPU (h_fpscr));
1373 CPU (h_fr[FLD (f_dest)]) = opval;
1374 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1375 }
cbb38b47
BE
1376
1377#undef FLD
1378}
1379 NEXT (vpc);
1380
1381 CASE (sem, INSN_FIPRS) : /* fipr.s $fvg, $fvh, $frf */
1382{
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);
1389
1390{
cbb38b47 1391 {
c7e628df
DB
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);
1395 }
1396 {
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);
1400 }
1401 {
1402 SF opval = sh64_fiprs (current_cpu, FLD (f_left), FLD (f_right));
cbb38b47 1403 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1404 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1405 }
1406}
1407
1408#undef FLD
1409}
1410 NEXT (vpc);
1411
1412 CASE (sem, INSN_FLDD) : /* fld.d $rm, $disp10x8, $drf */
1413{
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);
1420
1421 {
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);
1bbd6057 1424 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1425 }
1426
1427#undef FLD
1428}
1429 NEXT (vpc);
1430
1431 CASE (sem, INSN_FLDP) : /* fld.p $rm, $disp10x8, $fpf */
1432{
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);
1439
1440{
cbb38b47 1441 {
c7e628df
DB
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);
cbb38b47 1445 }
c7e628df 1446sh64_fldp (current_cpu, pc, GET_H_GR (FLD (f_left)), FLD (f_disp10x8), FLD (f_dest));
cbb38b47
BE
1447}
1448
1449#undef FLD
1450}
1451 NEXT (vpc);
1452
1453 CASE (sem, INSN_FLDS) : /* fld.s $rm, $disp10x4, $frf */
1454{
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);
1461
1462 {
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;
1bbd6057 1465 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1466 }
1467
1468#undef FLD
1469}
1470 NEXT (vpc);
1471
1472 CASE (sem, INSN_FLDXD) : /* fldx.d $rm, $rn, $drf */
1473{
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);
1480
1481 {
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);
1bbd6057 1484 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1485 }
1486
1487#undef FLD
1488}
1489 NEXT (vpc);
1490
1491 CASE (sem, INSN_FLDXP) : /* fldx.p $rm, $rn, $fpf */
1492{
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);
1499
1500{
cbb38b47 1501 {
c7e628df
DB
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);
cbb38b47 1505 }
c7e628df 1506sh64_fldp (current_cpu, pc, GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)), FLD (f_dest));
cbb38b47
BE
1507}
1508
1509#undef FLD
1510}
1511 NEXT (vpc);
1512
1513 CASE (sem, INSN_FLDXS) : /* fldx.s $rm, $rn, $frf */
1514{
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);
1521
1522 {
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;
1bbd6057 1525 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1526 }
1527
1528#undef FLD
1529}
1530 NEXT (vpc);
1531
1532 CASE (sem, INSN_FLOATLD) : /* float.ld $frgh, $drf */
1533{
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);
1540
1541 {
1542 DF opval = sh64_floatld (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1543 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1544 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1545 }
1546
1547#undef FLD
1548}
1549 NEXT (vpc);
1550
1551 CASE (sem, INSN_FLOATLS) : /* float.ls $frgh, $frf */
1552{
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);
1559
1560 {
1561 SF opval = sh64_floatls (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1562 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1563 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1564 }
1565
1566#undef FLD
1567}
1568 NEXT (vpc);
1569
1570 CASE (sem, INSN_FLOATQD) : /* float.qd $drgh, $drf */
1571{
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);
1578
1579 {
1580 DF opval = sh64_floatqd (current_cpu, GET_H_DR (FLD (f_left_right)));
1581 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1582 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1583 }
1584
1585#undef FLD
1586}
1587 NEXT (vpc);
1588
1589 CASE (sem, INSN_FLOATQS) : /* float.qs $drgh, $frf */
1590{
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);
1597
1598 {
1599 SF opval = sh64_floatqs (current_cpu, GET_H_DR (FLD (f_left_right)));
1600 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1601 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1602 }
1603
1604#undef FLD
1605}
1606 NEXT (vpc);
1607
1608 CASE (sem, INSN_FMACS) : /* fmac.s $frg, $frh, $frf */
1609{
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);
1616
1617 {
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;
1bbd6057 1620 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1621 }
1622
1623#undef FLD
1624}
1625 NEXT (vpc);
1626
1627 CASE (sem, INSN_FMOVD) : /* fmov.d $drgh, $drf */
1628{
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);
1635
1636 {
1637 DF opval = GET_H_DR (FLD (f_left_right));
1638 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1639 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1640 }
1641
1642#undef FLD
1643}
1644 NEXT (vpc);
1645
1646 CASE (sem, INSN_FMOVDQ) : /* fmov.dq $drgh, $rd */
1647{
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);
1654
1655 {
1656 DI opval = SUBWORDDFDI (GET_H_DR (FLD (f_left_right)));
1657 SET_H_GR (FLD (f_dest), opval);
1bbd6057 1658 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1659 }
1660
1661#undef FLD
1662}
1663 NEXT (vpc);
1664
1665 CASE (sem, INSN_FMOVLS) : /* fmov.ls $rm, $frf */
1666{
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);
1673
1674 {
1675 SF opval = SUBWORDSISF (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1));
1676 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1677 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1678 }
1679
1680#undef FLD
1681}
1682 NEXT (vpc);
1683
1684 CASE (sem, INSN_FMOVQD) : /* fmov.qd $rm, $drf */
1685{
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);
1692
1693 {
1694 DF opval = SUBWORDDIDF (GET_H_GR (FLD (f_left)));
1695 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1696 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1697 }
1698
1699#undef FLD
1700}
1701 NEXT (vpc);
1702
1703 CASE (sem, INSN_FMOVS) : /* fmov.s $frgh, $frf */
1704{
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);
1711
1712 {
1713 SF opval = CPU (h_fr[FLD (f_left_right)]);
1714 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1715 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1716 }
1717
1718#undef FLD
1719}
1720 NEXT (vpc);
1721
1722 CASE (sem, INSN_FMOVSL) : /* fmov.sl $frgh, $rd */
1723{
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);
1730
1731 {
1732 DI opval = EXTSIDI (SUBWORDSFSI (CPU (h_fr[FLD (f_left_right)])));
1733 SET_H_GR (FLD (f_dest), opval);
1bbd6057 1734 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
1735 }
1736
1737#undef FLD
1738}
1739 NEXT (vpc);
1740
1741 CASE (sem, INSN_FMULD) : /* fmul.d $drg, $drh, $drf */
1742{
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);
1749
1750 {
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);
1bbd6057 1753 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1754 }
1755
1756#undef FLD
1757}
1758 NEXT (vpc);
1759
1760 CASE (sem, INSN_FMULS) : /* fmul.s $frg, $frh, $frf */
1761{
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);
1768
1769 {
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;
1bbd6057 1772 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1773 }
1774
1775#undef FLD
1776}
1777 NEXT (vpc);
1778
1779 CASE (sem, INSN_FNEGD) : /* fneg.d $drgh, $drf */
1780{
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);
1787
1788 {
1789 DF opval = sh64_fnegd (current_cpu, GET_H_DR (FLD (f_left_right)));
1790 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1791 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1792 }
1793
1794#undef FLD
1795}
1796 NEXT (vpc);
1797
1798 CASE (sem, INSN_FNEGS) : /* fneg.s $frgh, $frf */
1799{
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);
1806
1807 {
1808 SF opval = sh64_fnegs (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1809 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1810 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1811 }
1812
1813#undef FLD
1814}
1815 NEXT (vpc);
1816
1817 CASE (sem, INSN_FPUTSCR) : /* fputscr $frgh */
1818{
1819 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1820 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 1821#define FLD(f) abuf->fields.sfmt_fabsd.f
cbb38b47
BE
1822 int UNUSED written = 0;
1823 IADDR UNUSED pc = abuf->addr;
1824 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1825
c7e628df
DB
1826 {
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);
1830 }
cbb38b47
BE
1831
1832#undef FLD
1833}
1834 NEXT (vpc);
1835
1836 CASE (sem, INSN_FSQRTD) : /* fsqrt.d $drgh, $drf */
1837{
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);
1844
1845 {
1846 DF opval = sh64_fsqrtd (current_cpu, GET_H_DR (FLD (f_left_right)));
1847 SET_H_DR (FLD (f_dest), opval);
1bbd6057 1848 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
1849 }
1850
1851#undef FLD
1852}
1853 NEXT (vpc);
1854
1855 CASE (sem, INSN_FSQRTS) : /* fsqrt.s $frgh, $frf */
1856{
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);
1863
1864 {
1865 SF opval = sh64_fsqrts (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1866 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 1867 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
1868 }
1869
1870#undef FLD
1871}
1872 NEXT (vpc);
1873
1874 CASE (sem, INSN_FSTD) : /* fst.d $rm, $disp10x8, $drf */
1875{
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);
1882
1883 {
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);
1887 }
1888
1889#undef FLD
1890}
1891 NEXT (vpc);
1892
1893 CASE (sem, INSN_FSTP) : /* fst.p $rm, $disp10x8, $fpf */
1894{
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);
1901
1902{
cbb38b47 1903 {
c7e628df
DB
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);
cbb38b47 1907 }
c7e628df 1908sh64_fstp (current_cpu, pc, GET_H_GR (FLD (f_left)), FLD (f_disp10x8), FLD (f_dest));
cbb38b47
BE
1909}
1910
1911#undef FLD
1912}
1913 NEXT (vpc);
1914
1915 CASE (sem, INSN_FSTS) : /* fst.s $rm, $disp10x4, $frf */
1916{
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);
1923
1924 {
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);
1928 }
1929
1930#undef FLD
1931}
1932 NEXT (vpc);
1933
1934 CASE (sem, INSN_FSTXD) : /* fstx.d $rm, $rn, $drf */
1935{
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);
1942
1943 {
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);
1947 }
1948
1949#undef FLD
1950}
1951 NEXT (vpc);
1952
1953 CASE (sem, INSN_FSTXP) : /* fstx.p $rm, $rn, $fpf */
1954{
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);
1961
1962{
cbb38b47 1963 {
c7e628df
DB
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);
cbb38b47 1967 }
c7e628df 1968sh64_fstp (current_cpu, pc, GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)), FLD (f_dest));
cbb38b47
BE
1969}
1970
1971#undef FLD
1972}
1973 NEXT (vpc);
1974
1975 CASE (sem, INSN_FSTXS) : /* fstx.s $rm, $rn, $frf */
1976{
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);
1983
1984 {
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);
1988 }
1989
1990#undef FLD
1991}
1992 NEXT (vpc);
1993
1994 CASE (sem, INSN_FSUBD) : /* fsub.d $drg, $drh, $drf */
1995{
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);
2002
2003 {
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);
1bbd6057 2006 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
2007 }
2008
2009#undef FLD
2010}
2011 NEXT (vpc);
2012
2013 CASE (sem, INSN_FSUBS) : /* fsub.s $frg, $frh, $frf */
2014{
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);
2021
2022 {
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;
1bbd6057 2025 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
2026 }
2027
2028#undef FLD
2029}
2030 NEXT (vpc);
2031
2032 CASE (sem, INSN_FTRCDL) : /* ftrc.dl $drgh, $frf */
2033{
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);
2040
2041 {
2042 SF opval = sh64_ftrcdl (current_cpu, GET_H_DR (FLD (f_left_right)));
2043 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 2044 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
2045 }
2046
2047#undef FLD
2048}
2049 NEXT (vpc);
2050
2051 CASE (sem, INSN_FTRCSL) : /* ftrc.sl $frgh, $frf */
2052{
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);
2059
2060 {
2061 SF opval = sh64_ftrcsl (current_cpu, CPU (h_fr[FLD (f_left_right)]));
2062 CPU (h_fr[FLD (f_dest)]) = opval;
1bbd6057 2063 TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
cbb38b47
BE
2064 }
2065
2066#undef FLD
2067}
2068 NEXT (vpc);
2069
2070 CASE (sem, INSN_FTRCDQ) : /* ftrc.dq $drgh, $drf */
2071{
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);
2078
2079 {
2080 DF opval = sh64_ftrcdq (current_cpu, GET_H_DR (FLD (f_left_right)));
2081 SET_H_DR (FLD (f_dest), opval);
1bbd6057 2082 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
2083 }
2084
2085#undef FLD
2086}
2087 NEXT (vpc);
2088
2089 CASE (sem, INSN_FTRCSQ) : /* ftrc.sq $frgh, $drf */
2090{
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);
2097
2098 {
2099 DF opval = sh64_ftrcsq (current_cpu, CPU (h_fr[FLD (f_left_right)]));
2100 SET_H_DR (FLD (f_dest), opval);
1bbd6057 2101 TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
cbb38b47
BE
2102 }
2103
2104#undef FLD
2105}
2106 NEXT (vpc);
2107
2108 CASE (sem, INSN_FTRVS) : /* ftrv.s $mtrxg, $fvh, $fvf */
2109{
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);
2116
c7e628df
DB
2117{
2118 {
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);
2122 }
2123 {
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);
2127 }
2128 {
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);
2132 }
cbb38b47 2133sh64_ftrvs (current_cpu, FLD (f_left), FLD (f_right), FLD (f_dest));
c7e628df 2134}
cbb38b47
BE
2135
2136#undef FLD
2137}
2138 NEXT (vpc);
2139
2140 CASE (sem, INSN_GETCFG) : /* getcfg $rm, $disp6, $rd */
2141{
2142 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2143 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 2144#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
2145 int UNUSED written = 0;
2146 IADDR UNUSED pc = abuf->addr;
2147 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2148
c7e628df
DB
2149{
2150 SI tmp_address;
2151 tmp_address = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
cbb38b47 2152((void) 0); /*nop*/
c7e628df
DB
2153 {
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);
2157 }
2158}
cbb38b47
BE
2159
2160#undef FLD
2161}
2162 NEXT (vpc);
2163
2164 CASE (sem, INSN_GETCON) : /* getcon $crk, $rd */
2165{
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);
2172
2173 {
2174 DI opval = GET_H_CR (FLD (f_left));
2175 SET_H_GR (FLD (f_dest), opval);
1bbd6057 2176 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2177 }
2178
2179#undef FLD
2180}
2181 NEXT (vpc);
2182
2183 CASE (sem, INSN_GETTR) : /* gettr $trb, $rd */
2184{
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);
2191
2192 {
2193 DI opval = CPU (h_tr[FLD (f_trb)]);
2194 SET_H_GR (FLD (f_dest), opval);
1bbd6057 2195 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2196 }
2197
2198#undef FLD
2199}
2200 NEXT (vpc);
2201
2202 CASE (sem, INSN_ICBI) : /* icbi $rm, $disp6x32 */
2203{
2204 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2205 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 2206#define FLD(f) abuf->fields.sfmt_xori.f
cbb38b47
BE
2207 int UNUSED written = 0;
2208 IADDR UNUSED pc = abuf->addr;
2209 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2210
c7e628df
DB
2211{
2212 {
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);
2216 }
cbb38b47 2217((void) 0); /*nop*/
c7e628df 2218}
cbb38b47
BE
2219
2220#undef FLD
2221}
2222 NEXT (vpc);
2223
2224 CASE (sem, INSN_LDB) : /* ld.b $rm, $disp10, $rd */
2225{
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);
2232
2233 {
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);
1bbd6057 2236 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2237 }
2238
2239#undef FLD
2240}
2241 NEXT (vpc);
2242
2243 CASE (sem, INSN_LDL) : /* ld.l $rm, $disp10x4, $rd */
2244{
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);
2251
2252 {
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);
1bbd6057 2255 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2256 }
2257
2258#undef FLD
2259}
2260 NEXT (vpc);
2261
2262 CASE (sem, INSN_LDQ) : /* ld.q $rm, $disp10x8, $rd */
2263{
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);
2270
2271 {
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);
1bbd6057 2274 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2275 }
2276
2277#undef FLD
2278}
2279 NEXT (vpc);
2280
2281 CASE (sem, INSN_LDUB) : /* ld.ub $rm, $disp10, $rd */
2282{
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);
2289
2290 {
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);
1bbd6057 2293 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2294 }
2295
2296#undef FLD
2297}
2298 NEXT (vpc);
2299
2300 CASE (sem, INSN_LDUW) : /* ld.uw $rm, $disp10x2, $rd */
2301{
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);
2308
2309 {
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);
1bbd6057 2312 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2313 }
2314
2315#undef FLD
2316}
2317 NEXT (vpc);
2318
2319 CASE (sem, INSN_LDW) : /* ld.w $rm, $disp10x2, $rd */
2320{
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);
2327
2328 {
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);
1bbd6057 2331 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2332 }
2333
2334#undef FLD
2335}
2336 NEXT (vpc);
2337
2338 CASE (sem, INSN_LDHIL) : /* ldhi.l $rm, $disp6, $rd */
2339{
2340 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2341 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 2342#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
2343 int UNUSED written = 0;
2344 IADDR UNUSED pc = abuf->addr;
2345 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2346
1bbd6057
JR
2347{
2348 DI tmp_addr;
2349 QI tmp_bytecount;
2350 SI tmp_val;
2351 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2352 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 3), 1);
2353 tmp_val = 0;
2354if (ANDQI (tmp_bytecount, 4)) {
2355 {
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);
2360 }
2361} else {
2362if (GET_H_ENDIAN ()) {
2363{
2364if (ANDQI (tmp_bytecount, 2)) {
2365 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2366}
2367if (ANDQI (tmp_bytecount, 1)) {
2368 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2369}
2370 {
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);
2375 }
2376}
2377} else {
2378{
2379if (ANDQI (tmp_bytecount, 1)) {
2380 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2381}
2382if (ANDQI (tmp_bytecount, 2)) {
2383 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2384}
2385 {
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);
2390 }
2391}
2392}
2393}
2394}
cbb38b47 2395
1bbd6057 2396 abuf->written = written;
cbb38b47
BE
2397#undef FLD
2398}
2399 NEXT (vpc);
2400
2401 CASE (sem, INSN_LDHIQ) : /* ldhi.q $rm, $disp6, $rd */
2402{
2403 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2404 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 2405#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
2406 int UNUSED written = 0;
2407 IADDR UNUSED pc = abuf->addr;
2408 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2409
1bbd6057
JR
2410{
2411 DI tmp_addr;
2412 QI tmp_bytecount;
2413 DI tmp_val;
2414 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2415 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 7), 1);
2416 tmp_val = 0;
2417if (ANDQI (tmp_bytecount, 8)) {
2418 {
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);
2423 }
2424} else {
2425if (GET_H_ENDIAN ()) {
2426{
2427if (ANDQI (tmp_bytecount, 4)) {
2428 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8))));
2429}
2430if (ANDQI (tmp_bytecount, 2)) {
2431 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2432}
2433if (ANDQI (tmp_bytecount, 1)) {
2434 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2435}
2436 {
2437 DI opval = tmp_val;
2438 SET_H_GR (FLD (f_dest), opval);
2439 written |= (1 << 7);
2440 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2441 }
2442}
2443} else {
2444{
2445if (ANDQI (tmp_bytecount, 1)) {
2446 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2447}
2448if (ANDQI (tmp_bytecount, 2)) {
2449 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2450}
2451if (ANDQI (tmp_bytecount, 4)) {
2452 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8))));
2453}
2454 {
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);
2459 }
2460}
2461}
2462}
2463}
cbb38b47 2464
1bbd6057 2465 abuf->written = written;
cbb38b47
BE
2466#undef FLD
2467}
2468 NEXT (vpc);
2469
2470 CASE (sem, INSN_LDLOL) : /* ldlo.l $rm, $disp6, $rd */
2471{
2472 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2473 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 2474#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
2475 int UNUSED written = 0;
2476 IADDR UNUSED pc = abuf->addr;
2477 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2478
1bbd6057
JR
2479{
2480 DI tmp_addr;
2481 QI tmp_bytecount;
2482 SI tmp_val;
2483 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2484 tmp_bytecount = SUBSI (4, ANDDI (tmp_addr, 3));
2485 tmp_val = 0;
2486if (ANDQI (tmp_bytecount, 4)) {
2487 {
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);
2492 }
2493} else {
2494if (GET_H_ENDIAN ()) {
2495{
2496if (ANDQI (tmp_bytecount, 1)) {
2497 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2498}
2499if (ANDQI (tmp_bytecount, 2)) {
2500 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2501}
2502 {
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);
2507 }
2508}
2509} else {
2510{
2511if (ANDQI (tmp_bytecount, 2)) {
2512 tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2513}
2514if (ANDQI (tmp_bytecount, 1)) {
2515 tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2516}
2517 {
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);
2522 }
2523}
2524}
2525}
2526}
cbb38b47 2527
1bbd6057 2528 abuf->written = written;
cbb38b47
BE
2529#undef FLD
2530}
2531 NEXT (vpc);
2532
2533 CASE (sem, INSN_LDLOQ) : /* ldlo.q $rm, $disp6, $rd */
2534{
2535 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2536 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 2537#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
2538 int UNUSED written = 0;
2539 IADDR UNUSED pc = abuf->addr;
2540 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2541
1bbd6057
JR
2542{
2543 DI tmp_addr;
2544 QI tmp_bytecount;
2545 DI tmp_val;
2546 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2547 tmp_bytecount = SUBSI (8, ANDDI (tmp_addr, 7));
2548 tmp_val = 0;
2549if (ANDQI (tmp_bytecount, 8)) {
2550 {
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);
2555 }
2556} else {
2557if (GET_H_ENDIAN ()) {
2558{
2559if (ANDQI (tmp_bytecount, 1)) {
2560 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2561}
2562if (ANDQI (tmp_bytecount, 2)) {
2563 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2564}
2565if (ANDQI (tmp_bytecount, 4)) {
2566 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4))));
2567}
2568 {
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);
2573 }
2574}
2575} else {
2576{
2577if (ANDQI (tmp_bytecount, 4)) {
2578 tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4))));
2579}
2580if (ANDQI (tmp_bytecount, 2)) {
2581 tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2582}
2583if (ANDQI (tmp_bytecount, 1)) {
2584 tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2585}
2586 {
2587 DI opval = tmp_val;
2588 SET_H_GR (FLD (f_dest), opval);
2589 written |= (1 << 7);
2590 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2591 }
2592}
2593}
2594}
2595}
cbb38b47 2596
1bbd6057 2597 abuf->written = written;
cbb38b47
BE
2598#undef FLD
2599}
2600 NEXT (vpc);
2601
2602 CASE (sem, INSN_LDXB) : /* ldx.b $rm, $rn, $rd */
2603{
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);
2610
2611 {
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);
1bbd6057 2614 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2615 }
2616
2617#undef FLD
2618}
2619 NEXT (vpc);
2620
2621 CASE (sem, INSN_LDXL) : /* ldx.l $rm, $rn, $rd */
2622{
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);
2629
2630 {
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);
1bbd6057 2633 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2634 }
2635
2636#undef FLD
2637}
2638 NEXT (vpc);
2639
2640 CASE (sem, INSN_LDXQ) : /* ldx.q $rm, $rn, $rd */
2641{
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);
2648
2649 {
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);
1bbd6057 2652 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2653 }
2654
2655#undef FLD
2656}
2657 NEXT (vpc);
2658
2659 CASE (sem, INSN_LDXUB) : /* ldx.ub $rm, $rn, $rd */
2660{
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);
2667
2668 {
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);
1bbd6057 2671 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2672 }
2673
2674#undef FLD
2675}
2676 NEXT (vpc);
2677
2678 CASE (sem, INSN_LDXUW) : /* ldx.uw $rm, $rn, $rd */
2679{
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);
2686
2687 {
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);
1bbd6057 2690 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2691 }
2692
2693#undef FLD
2694}
2695 NEXT (vpc);
2696
2697 CASE (sem, INSN_LDXW) : /* ldx.w $rm, $rn, $rd */
2698{
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);
2705
2706 {
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);
1bbd6057 2709 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2710 }
2711
2712#undef FLD
2713}
2714 NEXT (vpc);
2715
2716 CASE (sem, INSN_MABSL) : /* mabs.l $rm, $rd */
2717{
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);
2724
2725{
2726 SI tmp_result1;
2727 SI tmp_result0;
2728 tmp_result0 = ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1));
2729 tmp_result1 = ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0));
2730 {
2731 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2732 SET_H_GR (FLD (f_dest), opval);
1bbd6057 2733 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2734 }
2735}
2736
2737#undef FLD
2738}
2739 NEXT (vpc);
2740
2741 CASE (sem, INSN_MABSW) : /* mabs.w $rm, $rd */
2742{
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);
2749
2750{
2751 HI tmp_result3;
2752 HI tmp_result2;
2753 HI tmp_result1;
2754 HI tmp_result0;
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));
2759 {
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);
1bbd6057 2762 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2763 }
2764}
2765
2766#undef FLD
2767}
2768 NEXT (vpc);
2769
2770 CASE (sem, INSN_MADDL) : /* madd.l $rm, $rn, $rd */
2771{
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);
2778
2779{
2780 SI tmp_result1;
2781 SI tmp_result0;
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));
2784 {
2785 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2786 SET_H_GR (FLD (f_dest), opval);
1bbd6057 2787 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2788 }
2789}
2790
2791#undef FLD
2792}
2793 NEXT (vpc);
2794
2795 CASE (sem, INSN_MADDW) : /* madd.w $rm, $rn, $rd */
2796{
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);
2803
2804{
2805 HI tmp_result3;
2806 HI tmp_result2;
2807 HI tmp_result1;
2808 HI tmp_result0;
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));
2813 {
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);
1bbd6057 2816 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2817 }
2818}
2819
2820#undef FLD
2821}
2822 NEXT (vpc);
2823
2824 CASE (sem, INSN_MADDSL) : /* madds.l $rm, $rn, $rd */
2825{
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);
2832
2833{
2834 SI tmp_result1;
2835 SI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
2838 {
2839 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2840 SET_H_GR (FLD (f_dest), opval);
1bbd6057 2841 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2842 }
2843}
2844
2845#undef FLD
2846}
2847 NEXT (vpc);
2848
2849 CASE (sem, INSN_MADDSUB) : /* madds.ub $rm, $rn, $rd */
2850{
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);
2857
2858{
2859 QI tmp_result7;
2860 QI tmp_result6;
2861 QI tmp_result5;
2862 QI tmp_result4;
2863 QI tmp_result3;
2864 QI tmp_result2;
2865 QI tmp_result1;
2866 QI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
2875 {
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);
1bbd6057 2878 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2879 }
2880}
2881
2882#undef FLD
2883}
2884 NEXT (vpc);
2885
2886 CASE (sem, INSN_MADDSW) : /* madds.w $rm, $rn, $rd */
2887{
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);
2894
2895{
2896 HI tmp_result3;
2897 HI tmp_result2;
2898 HI tmp_result1;
2899 HI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
2904 {
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);
1bbd6057 2907 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2908 }
2909}
2910
2911#undef FLD
2912}
2913 NEXT (vpc);
2914
2915 CASE (sem, INSN_MCMPEQB) : /* mcmpeq.b $rm, $rn, $rd */
2916{
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);
2923
2924{
2925 QI tmp_result7;
2926 QI tmp_result6;
2927 QI tmp_result5;
2928 QI tmp_result4;
2929 QI tmp_result3;
2930 QI tmp_result2;
2931 QI tmp_result1;
2932 QI tmp_result0;
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));
2941 {
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);
1bbd6057 2944 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2945 }
2946}
2947
2948#undef FLD
2949}
2950 NEXT (vpc);
2951
2952 CASE (sem, INSN_MCMPEQL) : /* mcmpeq.l $rm, $rn, $rd */
2953{
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);
2960
2961{
2962 SI tmp_result1;
2963 SI tmp_result0;
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));
2966 {
2967 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2968 SET_H_GR (FLD (f_dest), opval);
1bbd6057 2969 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2970 }
2971}
2972
2973#undef FLD
2974}
2975 NEXT (vpc);
2976
2977 CASE (sem, INSN_MCMPEQW) : /* mcmpeq.w $rm, $rn, $rd */
2978{
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);
2985
2986{
2987 HI tmp_result3;
2988 HI tmp_result2;
2989 HI tmp_result1;
2990 HI tmp_result0;
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));
2995 {
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);
1bbd6057 2998 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
2999 }
3000}
3001
3002#undef FLD
3003}
3004 NEXT (vpc);
3005
3006 CASE (sem, INSN_MCMPGTL) : /* mcmpgt.l $rm, $rn, $rd */
3007{
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);
3014
3015{
3016 SI tmp_result1;
3017 SI tmp_result0;
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));
3020 {
3021 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3022 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3023 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3024 }
3025}
3026
3027#undef FLD
3028}
3029 NEXT (vpc);
3030
3031 CASE (sem, INSN_MCMPGTUB) : /* mcmpgt.ub $rm, $rn, $rd */
3032{
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);
3039
3040{
3041 QI tmp_result7;
3042 QI tmp_result6;
3043 QI tmp_result5;
3044 QI tmp_result4;
3045 QI tmp_result3;
3046 QI tmp_result2;
3047 QI tmp_result1;
3048 QI tmp_result0;
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));
3057 {
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);
1bbd6057 3060 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3061 }
3062}
3063
3064#undef FLD
3065}
3066 NEXT (vpc);
3067
3068 CASE (sem, INSN_MCMPGTW) : /* mcmpgt.w $rm, $rn, $rd */
3069{
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);
3076
3077{
3078 HI tmp_result3;
3079 HI tmp_result2;
3080 HI tmp_result1;
3081 HI tmp_result0;
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));
3086 {
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);
1bbd6057 3089 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3090 }
3091}
3092
3093#undef FLD
3094}
3095 NEXT (vpc);
3096
3097 CASE (sem, INSN_MCMV) : /* mcmv $rm, $rn, $rd */
3098{
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);
3105
3106 {
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);
1bbd6057 3109 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3110 }
3111
3112#undef FLD
3113}
3114 NEXT (vpc);
3115
3116 CASE (sem, INSN_MCNVSLW) : /* mcnvs.lw $rm, $rn, $rd */
3117{
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);
3124
3125{
3126 HI tmp_result3;
3127 HI tmp_result2;
3128 HI tmp_result1;
3129 HI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3134 {
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);
1bbd6057 3137 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3138 }
3139}
3140
3141#undef FLD
3142}
3143 NEXT (vpc);
3144
3145 CASE (sem, INSN_MCNVSWB) : /* mcnvs.wb $rm, $rn, $rd */
3146{
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);
3153
3154{
3155 QI tmp_result7;
3156 QI tmp_result6;
3157 QI tmp_result5;
3158 QI tmp_result4;
3159 QI tmp_result3;
3160 QI tmp_result2;
3161 QI tmp_result1;
3162 QI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3171 {
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);
1bbd6057 3174 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3175 }
3176}
3177
3178#undef FLD
3179}
3180 NEXT (vpc);
3181
3182 CASE (sem, INSN_MCNVSWUB) : /* mcnvs.wub $rm, $rn, $rd */
3183{
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);
3190
3191{
3192 QI tmp_result7;
3193 QI tmp_result6;
3194 QI tmp_result5;
3195 QI tmp_result4;
3196 QI tmp_result3;
3197 QI tmp_result2;
3198 QI tmp_result1;
3199 QI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3208 {
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);
1bbd6057 3211 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3212 }
3213}
3214
3215#undef FLD
3216}
3217 NEXT (vpc);
3218
3219 CASE (sem, INSN_MEXTR1) : /* mextr1 $rm, $rn, $rd */
3220{
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);
3227
3228{
3229 QI tmp_count;
3230 DI tmp_mask;
3231 DI tmp_rhs;
1bbd6057 3232 tmp_count = MULQI (8, 1);
cbb38b47
BE
3233 tmp_mask = SLLDI (INVSI (0), tmp_count);
3234 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3235 tmp_count = MULQI (8, SUBQI (8, 1));
cbb38b47
BE
3236 tmp_mask = SRLDI (INVSI (0), tmp_count);
3237 {
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);
1bbd6057 3240 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3241 }
3242}
3243
3244#undef FLD
3245}
3246 NEXT (vpc);
3247
3248 CASE (sem, INSN_MEXTR2) : /* mextr2 $rm, $rn, $rd */
3249{
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);
3256
3257{
3258 QI tmp_count;
3259 DI tmp_mask;
3260 DI tmp_rhs;
1bbd6057 3261 tmp_count = MULQI (8, 2);
cbb38b47
BE
3262 tmp_mask = SLLDI (INVSI (0), tmp_count);
3263 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3264 tmp_count = MULQI (8, SUBQI (8, 2));
cbb38b47
BE
3265 tmp_mask = SRLDI (INVSI (0), tmp_count);
3266 {
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);
1bbd6057 3269 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3270 }
3271}
3272
3273#undef FLD
3274}
3275 NEXT (vpc);
3276
3277 CASE (sem, INSN_MEXTR3) : /* mextr3 $rm, $rn, $rd */
3278{
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);
3285
3286{
3287 QI tmp_count;
3288 DI tmp_mask;
3289 DI tmp_rhs;
1bbd6057 3290 tmp_count = MULQI (8, 3);
cbb38b47
BE
3291 tmp_mask = SLLDI (INVSI (0), tmp_count);
3292 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3293 tmp_count = MULQI (8, SUBQI (8, 3));
cbb38b47
BE
3294 tmp_mask = SRLDI (INVSI (0), tmp_count);
3295 {
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);
1bbd6057 3298 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3299 }
3300}
3301
3302#undef FLD
3303}
3304 NEXT (vpc);
3305
3306 CASE (sem, INSN_MEXTR4) : /* mextr4 $rm, $rn, $rd */
3307{
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);
3314
3315{
3316 QI tmp_count;
3317 DI tmp_mask;
3318 DI tmp_rhs;
1bbd6057 3319 tmp_count = MULQI (8, 4);
cbb38b47
BE
3320 tmp_mask = SLLDI (INVSI (0), tmp_count);
3321 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3322 tmp_count = MULQI (8, SUBQI (8, 4));
cbb38b47
BE
3323 tmp_mask = SRLDI (INVSI (0), tmp_count);
3324 {
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);
1bbd6057 3327 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3328 }
3329}
3330
3331#undef FLD
3332}
3333 NEXT (vpc);
3334
3335 CASE (sem, INSN_MEXTR5) : /* mextr5 $rm, $rn, $rd */
3336{
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);
3343
3344{
3345 QI tmp_count;
3346 DI tmp_mask;
3347 DI tmp_rhs;
1bbd6057 3348 tmp_count = MULQI (8, 5);
cbb38b47
BE
3349 tmp_mask = SLLDI (INVSI (0), tmp_count);
3350 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3351 tmp_count = MULQI (8, SUBQI (8, 5));
cbb38b47
BE
3352 tmp_mask = SRLDI (INVSI (0), tmp_count);
3353 {
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);
1bbd6057 3356 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3357 }
3358}
3359
3360#undef FLD
3361}
3362 NEXT (vpc);
3363
3364 CASE (sem, INSN_MEXTR6) : /* mextr6 $rm, $rn, $rd */
3365{
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);
3372
3373{
3374 QI tmp_count;
3375 DI tmp_mask;
3376 DI tmp_rhs;
1bbd6057 3377 tmp_count = MULQI (8, 6);
cbb38b47
BE
3378 tmp_mask = SLLDI (INVSI (0), tmp_count);
3379 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3380 tmp_count = MULQI (8, SUBQI (8, 6));
cbb38b47
BE
3381 tmp_mask = SRLDI (INVSI (0), tmp_count);
3382 {
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);
1bbd6057 3385 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3386 }
3387}
3388
3389#undef FLD
3390}
3391 NEXT (vpc);
3392
3393 CASE (sem, INSN_MEXTR7) : /* mextr7 $rm, $rn, $rd */
3394{
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);
3401
3402{
3403 QI tmp_count;
3404 DI tmp_mask;
3405 DI tmp_rhs;
1bbd6057 3406 tmp_count = MULQI (8, 7);
cbb38b47
BE
3407 tmp_mask = SLLDI (INVSI (0), tmp_count);
3408 tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
1bbd6057 3409 tmp_count = MULQI (8, SUBQI (8, 7));
cbb38b47
BE
3410 tmp_mask = SRLDI (INVSI (0), tmp_count);
3411 {
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);
1bbd6057 3414 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3415 }
3416}
3417
3418#undef FLD
3419}
3420 NEXT (vpc);
3421
3422 CASE (sem, INSN_MMACFXWL) : /* mmacfx.wl $rm, $rn, $rd */
3423{
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);
3430
3431{
3432 SI tmp_temp;
3433 SI tmp_result1;
3434 SI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3443 {
3444 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3445 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3446 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3447 }
3448}
3449
3450#undef FLD
3451}
3452 NEXT (vpc);
3453
3454 CASE (sem, INSN_MMACNFX_WL) : /* mmacnfx.wl $rm, $rn, $rd */
3455{
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);
3462
3463{
3464 SI tmp_temp;
3465 SI tmp_result1;
3466 SI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3475 {
3476 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3477 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3478 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3479 }
3480}
3481
3482#undef FLD
3483}
3484 NEXT (vpc);
3485
3486 CASE (sem, INSN_MMULL) : /* mmul.l $rm, $rn, $rd */
3487{
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);
3494
3495{
3496 SI tmp_result1;
3497 SI tmp_result0;
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));
3500 {
3501 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3502 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3503 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3504 }
3505}
3506
3507#undef FLD
3508}
3509 NEXT (vpc);
3510
3511 CASE (sem, INSN_MMULW) : /* mmul.w $rm, $rn, $rd */
3512{
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);
3519
3520{
3521 HI tmp_result3;
3522 HI tmp_result2;
3523 HI tmp_result1;
3524 HI tmp_result0;
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));
3529 {
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);
1bbd6057 3532 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3533 }
3534}
3535
3536#undef FLD
3537}
3538 NEXT (vpc);
3539
3540 CASE (sem, INSN_MMULFXL) : /* mmulfx.l $rm, $rn, $rd */
3541{
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);
3548
3549{
3550 DI tmp_temp;
3551 SI tmp_result0;
3552 SI tmp_result1;
cbb38b47 3553 tmp_temp = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
1bbd6057
JR
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)))));
cbb38b47
BE
3557 {
3558 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3559 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3560 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3561 }
3562}
3563
3564#undef FLD
3565}
3566 NEXT (vpc);
3567
3568 CASE (sem, INSN_MMULFXW) : /* mmulfx.w $rm, $rn, $rd */
3569{
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);
3576
3577{
3578 SI tmp_temp;
3579 HI tmp_result0;
3580 HI tmp_result1;
3581 HI tmp_result2;
3582 HI tmp_result3;
cbb38b47 3583 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
1bbd6057
JR
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)))));
cbb38b47
BE
3591 {
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);
1bbd6057 3594 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3595 }
3596}
3597
3598#undef FLD
3599}
3600 NEXT (vpc);
3601
3602 CASE (sem, INSN_MMULFXRPW) : /* mmulfxrp.w $rm, $rn, $rd */
3603{
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);
3610
3611{
3612 SI tmp_temp;
3613 HI tmp_result0;
3614 HI tmp_result1;
3615 HI tmp_result2;
3616 HI tmp_result3;
3617 HI tmp_c;
3618 tmp_c = SLLSI (1, 14);
cbb38b47 3619 tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
1bbd6057
JR
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)))));
cbb38b47
BE
3627 {
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);
1bbd6057 3630 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3631 }
3632}
3633
3634#undef FLD
3635}
3636 NEXT (vpc);
3637
3638 CASE (sem, INSN_MMULHIWL) : /* mmulhi.wl $rm, $rn, $rd */
3639{
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);
3646
3647{
3648 SI tmp_result1;
3649 SI tmp_result0;
1bbd6057
JR
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)));
cbb38b47
BE
3652 {
3653 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3654 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3655 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3656 }
3657}
3658
3659#undef FLD
3660}
3661 NEXT (vpc);
3662
3663 CASE (sem, INSN_MMULLOWL) : /* mmullo.wl $rm, $rn, $rd */
3664{
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);
3671
3672{
3673 SI tmp_result1;
3674 SI tmp_result0;
1bbd6057
JR
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)));
cbb38b47
BE
3677 {
3678 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3679 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3680 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3681 }
3682}
3683
3684#undef FLD
3685}
3686 NEXT (vpc);
3687
3688 CASE (sem, INSN_MMULSUMWQ) : /* mmulsum.wq $rm, $rn, $rd */
3689{
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);
3696
3697{
3698 DI tmp_acc;
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))));
3703 {
3704 DI opval = ADDDI (GET_H_GR (FLD (f_dest)), tmp_acc);
3705 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3706 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3707 }
3708}
3709
3710#undef FLD
3711}
3712 NEXT (vpc);
3713
3714 CASE (sem, INSN_MOVI) : /* movi $imm16, $rd */
3715{
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);
3722
3723 {
3724 DI opval = EXTSIDI (FLD (f_imm16));
3725 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3726 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3727 }
3728
3729#undef FLD
3730}
3731 NEXT (vpc);
3732
3733 CASE (sem, INSN_MPERMW) : /* mperm.w $rm, $rn, $rd */
3734{
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);
3741
3742{
3743 QI tmp_control;
3744 HI tmp_result3;
3745 HI tmp_result2;
3746 HI tmp_result1;
3747 HI tmp_result0;
1bbd6057 3748 tmp_control = ANDQI (GET_H_GR (FLD (f_right)), 255);
cbb38b47
BE
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)));
3753 {
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);
1bbd6057 3756 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3757 }
3758}
3759
3760#undef FLD
3761}
3762 NEXT (vpc);
3763
3764 CASE (sem, INSN_MSADUBQ) : /* msad.ubq $rm, $rn, $rd */
3765{
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);
3772
3773{
3774 DI tmp_acc;
1bbd6057 3775 tmp_acc = ABSDI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0)));
cbb38b47
BE
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))));
3783 {
3784 DI opval = ADDDI (GET_H_GR (FLD (f_dest)), tmp_acc);
3785 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3786 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3787 }
3788}
3789
3790#undef FLD
3791}
3792 NEXT (vpc);
3793
3794 CASE (sem, INSN_MSHALDSL) : /* mshalds.l $rm, $rn, $rd */
3795{
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);
3802
3803{
3804 SI tmp_result1;
3805 SI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3808 {
3809 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3810 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3811 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3812 }
3813}
3814
3815#undef FLD
3816}
3817 NEXT (vpc);
3818
3819 CASE (sem, INSN_MSHALDSW) : /* mshalds.w $rm, $rn, $rd */
3820{
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);
3827
3828{
3829 HI tmp_result3;
3830 HI tmp_result2;
3831 HI tmp_result1;
3832 HI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
3837 {
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);
1bbd6057 3840 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3841 }
3842}
3843
3844#undef FLD
3845}
3846 NEXT (vpc);
3847
3848 CASE (sem, INSN_MSHARDL) : /* mshard.l $rm, $rn, $rd */
3849{
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);
3856
3857{
3858 SI tmp_result1;
3859 SI tmp_result0;
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));
3862 {
3863 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3864 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3865 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3866 }
3867}
3868
3869#undef FLD
3870}
3871 NEXT (vpc);
3872
3873 CASE (sem, INSN_MSHARDW) : /* mshard.w $rm, $rn, $rd */
3874{
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);
3881
3882{
3883 HI tmp_result3;
3884 HI tmp_result2;
3885 HI tmp_result1;
3886 HI tmp_result0;
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));
3891 {
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);
1bbd6057 3894 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3895 }
3896}
3897
3898#undef FLD
3899}
3900 NEXT (vpc);
3901
3902 CASE (sem, INSN_MSHARDSQ) : /* mshards.q $rm, $rn, $rd */
3903{
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);
3910
3911 {
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);
1bbd6057 3914 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3915 }
3916
3917#undef FLD
3918}
3919 NEXT (vpc);
3920
3921 CASE (sem, INSN_MSHFHIB) : /* mshfhi.b $rm, $rn, $rd */
3922{
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);
3929
3930{
3931 QI tmp_result7;
3932 QI tmp_result6;
3933 QI tmp_result5;
3934 QI tmp_result4;
3935 QI tmp_result3;
3936 QI tmp_result2;
3937 QI tmp_result1;
3938 QI tmp_result0;
1bbd6057
JR
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);
cbb38b47
BE
3947 {
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);
1bbd6057 3950 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3951 }
3952}
3953
3954#undef FLD
3955}
3956 NEXT (vpc);
3957
3958 CASE (sem, INSN_MSHFHIL) : /* mshfhi.l $rm, $rn, $rd */
3959{
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);
3966
3967{
3968 SI tmp_result1;
3969 SI tmp_result0;
1bbd6057
JR
3970 tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_left)), 0);
3971 tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_right)), 0);
cbb38b47
BE
3972 {
3973 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3974 SET_H_GR (FLD (f_dest), opval);
1bbd6057 3975 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
3976 }
3977}
3978
3979#undef FLD
3980}
3981 NEXT (vpc);
3982
3983 CASE (sem, INSN_MSHFHIW) : /* mshfhi.w $rm, $rn, $rd */
3984{
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);
3991
3992{
3993 HI tmp_result3;
3994 HI tmp_result2;
3995 HI tmp_result1;
3996 HI tmp_result0;
1bbd6057
JR
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);
cbb38b47
BE
4001 {
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);
1bbd6057 4004 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4005 }
4006}
4007
4008#undef FLD
4009}
4010 NEXT (vpc);
4011
4012 CASE (sem, INSN_MSHFLOB) : /* mshflo.b $rm, $rn, $rd */
4013{
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);
4020
4021{
4022 QI tmp_result7;
4023 QI tmp_result6;
4024 QI tmp_result5;
4025 QI tmp_result4;
4026 QI tmp_result3;
4027 QI tmp_result2;
4028 QI tmp_result1;
4029 QI tmp_result0;
1bbd6057
JR
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);
cbb38b47
BE
4038 {
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);
1bbd6057 4041 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4042 }
4043}
4044
4045#undef FLD
4046}
4047 NEXT (vpc);
4048
4049 CASE (sem, INSN_MSHFLOL) : /* mshflo.l $rm, $rn, $rd */
4050{
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);
4057
4058{
4059 SI tmp_result1;
4060 SI tmp_result0;
1bbd6057
JR
4061 tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_left)), 1);
4062 tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_right)), 1);
cbb38b47
BE
4063 {
4064 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4065 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4066 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4067 }
4068}
4069
4070#undef FLD
4071}
4072 NEXT (vpc);
4073
4074 CASE (sem, INSN_MSHFLOW) : /* mshflo.w $rm, $rn, $rd */
4075{
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);
4082
4083{
4084 HI tmp_result3;
4085 HI tmp_result2;
4086 HI tmp_result1;
4087 HI tmp_result0;
1bbd6057
JR
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);
cbb38b47
BE
4092 {
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);
1bbd6057 4095 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4096 }
4097}
4098
4099#undef FLD
4100}
4101 NEXT (vpc);
4102
4103 CASE (sem, INSN_MSHLLDL) : /* mshlld.l $rm, $rn, $rd */
4104{
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);
4111
4112{
4113 SI tmp_result1;
4114 SI tmp_result0;
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));
4117 {
4118 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4119 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4120 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4121 }
4122}
4123
4124#undef FLD
4125}
4126 NEXT (vpc);
4127
4128 CASE (sem, INSN_MSHLLDW) : /* mshlld.w $rm, $rn, $rd */
4129{
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);
4136
4137{
4138 HI tmp_result3;
4139 HI tmp_result2;
4140 HI tmp_result1;
4141 HI tmp_result0;
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));
4146 {
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);
1bbd6057 4149 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4150 }
4151}
4152
4153#undef FLD
4154}
4155 NEXT (vpc);
4156
4157 CASE (sem, INSN_MSHLRDL) : /* mshlrd.l $rm, $rn, $rd */
4158{
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);
4165
4166{
4167 SI tmp_result1;
4168 SI tmp_result0;
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));
4171 {
4172 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4173 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4174 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4175 }
4176}
4177
4178#undef FLD
4179}
4180 NEXT (vpc);
4181
4182 CASE (sem, INSN_MSHLRDW) : /* mshlrd.w $rm, $rn, $rd */
4183{
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);
4190
4191{
4192 HI tmp_result3;
4193 HI tmp_result2;
4194 HI tmp_result1;
4195 HI tmp_result0;
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));
4200 {
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);
1bbd6057 4203 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4204 }
4205}
4206
4207#undef FLD
4208}
4209 NEXT (vpc);
4210
4211 CASE (sem, INSN_MSUBL) : /* msub.l $rm, $rn, $rd */
4212{
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);
4219
4220{
4221 SI tmp_result1;
4222 SI tmp_result0;
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));
4225 {
4226 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4227 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4228 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4229 }
4230}
4231
4232#undef FLD
4233}
4234 NEXT (vpc);
4235
4236 CASE (sem, INSN_MSUBW) : /* msub.w $rm, $rn, $rd */
4237{
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);
4244
4245{
4246 HI tmp_result3;
4247 HI tmp_result2;
4248 HI tmp_result1;
4249 HI tmp_result0;
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));
4254 {
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);
1bbd6057 4257 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4258 }
4259}
4260
4261#undef FLD
4262}
4263 NEXT (vpc);
4264
4265 CASE (sem, INSN_MSUBSL) : /* msubs.l $rm, $rn, $rd */
4266{
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);
4273
4274{
4275 SI tmp_result1;
4276 SI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
4279 {
4280 DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4281 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4282 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4283 }
4284}
4285
4286#undef FLD
4287}
4288 NEXT (vpc);
4289
4290 CASE (sem, INSN_MSUBSUB) : /* msubs.ub $rm, $rn, $rd */
4291{
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);
4298
4299{
4300 QI tmp_result7;
4301 QI tmp_result6;
4302 QI tmp_result5;
4303 QI tmp_result4;
4304 QI tmp_result3;
4305 QI tmp_result2;
4306 QI tmp_result1;
4307 QI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
4316 {
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);
1bbd6057 4319 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4320 }
4321}
4322
4323#undef FLD
4324}
4325 NEXT (vpc);
4326
4327 CASE (sem, INSN_MSUBSW) : /* msubs.w $rm, $rn, $rd */
4328{
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);
4335
4336{
4337 QI tmp_result7;
4338 QI tmp_result6;
4339 QI tmp_result5;
4340 QI tmp_result4;
4341 QI tmp_result3;
4342 QI tmp_result2;
4343 QI tmp_result1;
4344 QI tmp_result0;
1bbd6057
JR
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)))));
cbb38b47
BE
4353 {
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);
1bbd6057 4356 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4357 }
4358}
4359
4360#undef FLD
4361}
4362 NEXT (vpc);
4363
4364 CASE (sem, INSN_MULSL) : /* muls.l $rm, $rn, $rd */
4365{
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);
4372
4373 {
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);
1bbd6057 4376 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4377 }
4378
4379#undef FLD
4380}
4381 NEXT (vpc);
4382
4383 CASE (sem, INSN_MULUL) : /* mulu.l $rm, $rn, $rd */
4384{
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);
4391
4392 {
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);
1bbd6057 4395 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4396 }
4397
4398#undef FLD
4399}
4400 NEXT (vpc);
4401
4402 CASE (sem, INSN_NOP) : /* nop */
4403{
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);
4410
4411((void) 0); /*nop*/
4412
4413#undef FLD
4414}
4415 NEXT (vpc);
4416
4417 CASE (sem, INSN_NSB) : /* nsb $rm, $rd */
4418{
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);
4425
4426 {
4427 DI opval = sh64_nsb (current_cpu, GET_H_GR (FLD (f_left)));
4428 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4429 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4430 }
4431
4432#undef FLD
4433}
4434 NEXT (vpc);
4435
4436 CASE (sem, INSN_OCBI) : /* ocbi $rm, $disp6x32 */
4437{
4438 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4439 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 4440#define FLD(f) abuf->fields.sfmt_xori.f
cbb38b47
BE
4441 int UNUSED written = 0;
4442 IADDR UNUSED pc = abuf->addr;
4443 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4444
c7e628df
DB
4445{
4446 {
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);
4450 }
cbb38b47 4451((void) 0); /*nop*/
c7e628df 4452}
cbb38b47
BE
4453
4454#undef FLD
4455}
4456 NEXT (vpc);
4457
4458 CASE (sem, INSN_OCBP) : /* ocbp $rm, $disp6x32 */
4459{
4460 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4461 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 4462#define FLD(f) abuf->fields.sfmt_xori.f
cbb38b47
BE
4463 int UNUSED written = 0;
4464 IADDR UNUSED pc = abuf->addr;
4465 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4466
c7e628df
DB
4467{
4468 {
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);
4472 }
cbb38b47 4473((void) 0); /*nop*/
c7e628df 4474}
cbb38b47
BE
4475
4476#undef FLD
4477}
4478 NEXT (vpc);
4479
4480 CASE (sem, INSN_OCBWB) : /* ocbwb $rm, $disp6x32 */
4481{
4482 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4483 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 4484#define FLD(f) abuf->fields.sfmt_xori.f
cbb38b47
BE
4485 int UNUSED written = 0;
4486 IADDR UNUSED pc = abuf->addr;
4487 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4488
c7e628df
DB
4489{
4490 {
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);
4494 }
cbb38b47 4495((void) 0); /*nop*/
c7e628df 4496}
cbb38b47
BE
4497
4498#undef FLD
4499}
4500 NEXT (vpc);
4501
4502 CASE (sem, INSN_OR) : /* or $rm, $rn, $rd */
4503{
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);
4510
4511 {
4512 DI opval = ORDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
4513 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4514 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4515 }
4516
4517#undef FLD
4518}
4519 NEXT (vpc);
4520
4521 CASE (sem, INSN_ORI) : /* ori $rm, $imm10, $rd */
4522{
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);
4529
4530 {
4531 DI opval = ORDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm10)));
4532 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4533 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4534 }
4535
4536#undef FLD
4537}
4538 NEXT (vpc);
4539
4540 CASE (sem, INSN_PREFI) : /* prefi $rm, $disp6x32 */
4541{
4542 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4543 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 4544#define FLD(f) abuf->fields.sfmt_xori.f
cbb38b47
BE
4545 int UNUSED written = 0;
4546 IADDR UNUSED pc = abuf->addr;
4547 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4548
c7e628df
DB
4549{
4550 {
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);
4554 }
cbb38b47 4555((void) 0); /*nop*/
c7e628df 4556}
cbb38b47
BE
4557
4558#undef FLD
4559}
4560 NEXT (vpc);
4561
4562 CASE (sem, INSN_PTA) : /* pta$likely $disp16, $tra */
4563{
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);
4570
c7e628df
DB
4571{
4572((void) 0); /*nop*/
cbb38b47
BE
4573 {
4574 DI opval = ADDSI (FLD (f_disp16), 1);
4575 CPU (h_tr[FLD (f_tra)]) = opval;
1bbd6057 4576 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
cbb38b47 4577 }
c7e628df 4578}
cbb38b47
BE
4579
4580#undef FLD
4581}
4582 NEXT (vpc);
4583
4584 CASE (sem, INSN_PTABS) : /* ptabs$likely $rn, $tra */
4585{
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);
4592
c7e628df
DB
4593{
4594((void) 0); /*nop*/
cbb38b47
BE
4595 {
4596 DI opval = GET_H_GR (FLD (f_right));
4597 CPU (h_tr[FLD (f_tra)]) = opval;
1bbd6057 4598 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
cbb38b47 4599 }
c7e628df 4600}
cbb38b47
BE
4601
4602#undef FLD
4603}
4604 NEXT (vpc);
4605
4606 CASE (sem, INSN_PTB) : /* ptb$likely $disp16, $tra */
4607{
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);
4614
c7e628df
DB
4615{
4616((void) 0); /*nop*/
cbb38b47
BE
4617 {
4618 DI opval = FLD (f_disp16);
4619 CPU (h_tr[FLD (f_tra)]) = opval;
1bbd6057 4620 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
cbb38b47 4621 }
c7e628df 4622}
cbb38b47
BE
4623
4624#undef FLD
4625}
4626 NEXT (vpc);
4627
4628 CASE (sem, INSN_PTREL) : /* ptrel$likely $rn, $tra */
4629{
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);
4636
c7e628df
DB
4637{
4638((void) 0); /*nop*/
cbb38b47
BE
4639 {
4640 DI opval = ADDDI (pc, GET_H_GR (FLD (f_right)));
4641 CPU (h_tr[FLD (f_tra)]) = opval;
1bbd6057 4642 TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
cbb38b47 4643 }
c7e628df 4644}
cbb38b47
BE
4645
4646#undef FLD
4647}
4648 NEXT (vpc);
4649
4650 CASE (sem, INSN_PUTCFG) : /* putcfg $rm, $disp6, $rd */
4651{
4652 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4653 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 4654#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
4655 int UNUSED written = 0;
4656 IADDR UNUSED pc = abuf->addr;
4657 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4658
c7e628df
DB
4659{
4660 SI tmp_address;
4661 tmp_address = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
cbb38b47 4662((void) 0); /*nop*/
c7e628df
DB
4663 {
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);
4667 }
4668}
cbb38b47
BE
4669
4670#undef FLD
4671}
4672 NEXT (vpc);
4673
4674 CASE (sem, INSN_PUTCON) : /* putcon $rm, $crj */
4675{
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);
4682
4683 {
4684 DI opval = GET_H_GR (FLD (f_left));
4685 SET_H_CR (FLD (f_dest), opval);
1bbd6057 4686 TRACE_RESULT (current_cpu, abuf, "cr", 'D', opval);
cbb38b47
BE
4687 }
4688
4689#undef FLD
4690}
4691 NEXT (vpc);
4692
4693 CASE (sem, INSN_RTE) : /* rte */
4694{
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);
4701
4702((void) 0); /*nop*/
4703
4704#undef FLD
4705}
4706 NEXT (vpc);
4707
4708 CASE (sem, INSN_SHARD) : /* shard $rm, $rn, $rd */
4709{
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);
4716
4717 {
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);
1bbd6057 4720 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4721 }
4722
4723#undef FLD
4724}
4725 NEXT (vpc);
4726
4727 CASE (sem, INSN_SHARDL) : /* shard.l $rm, $rn, $rd */
4728{
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);
4735
4736 {
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);
1bbd6057 4739 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4740 }
4741
4742#undef FLD
4743}
4744 NEXT (vpc);
4745
4746 CASE (sem, INSN_SHARI) : /* shari $rm, $uimm6, $rd */
4747{
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);
4754
4755 {
4756 DI opval = SRADI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4757 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4758 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4759 }
4760
4761#undef FLD
4762}
4763 NEXT (vpc);
4764
4765 CASE (sem, INSN_SHARIL) : /* shari.l $rm, $uimm6, $rd */
4766{
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);
4773
4774 {
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);
1bbd6057 4777 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4778 }
4779
4780#undef FLD
4781}
4782 NEXT (vpc);
4783
4784 CASE (sem, INSN_SHLLD) : /* shlld $rm, $rn, $rd */
4785{
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);
4792
4793 {
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);
1bbd6057 4796 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4797 }
4798
4799#undef FLD
4800}
4801 NEXT (vpc);
4802
4803 CASE (sem, INSN_SHLLDL) : /* shlld.l $rm, $rn, $rd */
4804{
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);
4811
4812 {
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);
1bbd6057 4815 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4816 }
4817
4818#undef FLD
4819}
4820 NEXT (vpc);
4821
4822 CASE (sem, INSN_SHLLI) : /* shlli $rm, $uimm6, $rd */
4823{
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);
4830
4831 {
4832 DI opval = SLLDI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4833 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4834 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4835 }
4836
4837#undef FLD
4838}
4839 NEXT (vpc);
4840
4841 CASE (sem, INSN_SHLLIL) : /* shlli.l $rm, $uimm6, $rd */
4842{
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);
4849
4850 {
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);
1bbd6057 4853 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4854 }
4855
4856#undef FLD
4857}
4858 NEXT (vpc);
4859
4860 CASE (sem, INSN_SHLRD) : /* shlrd $rm, $rn, $rd */
4861{
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);
4868
4869 {
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);
1bbd6057 4872 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4873 }
4874
4875#undef FLD
4876}
4877 NEXT (vpc);
4878
4879 CASE (sem, INSN_SHLRDL) : /* shlrd.l $rm, $rn, $rd */
4880{
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);
4887
4888 {
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);
1bbd6057 4891 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4892 }
4893
4894#undef FLD
4895}
4896 NEXT (vpc);
4897
4898 CASE (sem, INSN_SHLRI) : /* shlri $rm, $uimm6, $rd */
4899{
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);
4906
4907 {
4908 DI opval = SRLDI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4909 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4910 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4911 }
4912
4913#undef FLD
4914}
4915 NEXT (vpc);
4916
4917 CASE (sem, INSN_SHLRIL) : /* shlri.l $rm, $uimm6, $rd */
4918{
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);
4925
4926 {
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);
1bbd6057 4929 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4930 }
4931
4932#undef FLD
4933}
4934 NEXT (vpc);
4935
4936 CASE (sem, INSN_SHORI) : /* shori $uimm16, $rd */
4937{
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);
4944
4945 {
4946 DI opval = ORDI (SLLDI (GET_H_GR (FLD (f_dest)), 16), ZEXTSIDI (FLD (f_uimm16)));
4947 SET_H_GR (FLD (f_dest), opval);
1bbd6057 4948 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
4949 }
4950
4951#undef FLD
4952}
4953 NEXT (vpc);
4954
4955 CASE (sem, INSN_SLEEP) : /* sleep */
4956{
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);
4963
4964((void) 0); /*nop*/
4965
4966#undef FLD
4967}
4968 NEXT (vpc);
4969
4970 CASE (sem, INSN_STB) : /* st.b $rm, $disp10, $rd */
4971{
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);
4978
4979 {
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);
4983 }
4984
4985#undef FLD
4986}
4987 NEXT (vpc);
4988
4989 CASE (sem, INSN_STL) : /* st.l $rm, $disp10x4, $rd */
4990{
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);
4997
4998 {
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);
5002 }
5003
5004#undef FLD
5005}
5006 NEXT (vpc);
5007
5008 CASE (sem, INSN_STQ) : /* st.q $rm, $disp10x8, $rd */
5009{
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);
5016
5017 {
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);
5021 }
5022
5023#undef FLD
5024}
5025 NEXT (vpc);
5026
5027 CASE (sem, INSN_STW) : /* st.w $rm, $disp10x2, $rd */
5028{
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);
5035
5036 {
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);
5040 }
5041
5042#undef FLD
5043}
5044 NEXT (vpc);
5045
5046 CASE (sem, INSN_STHIL) : /* sthi.l $rm, $disp6, $rd */
5047{
5048 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5049 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 5050#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
5051 int UNUSED written = 0;
5052 IADDR UNUSED pc = abuf->addr;
5053 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5054
5055{
5056 DI tmp_addr;
5057 QI tmp_bytecount;
5058 DI tmp_val;
5059 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5060 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 3), 1);
1bbd6057
JR
5061if (ANDQI (tmp_bytecount, 4)) {
5062 {
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);
5067 }
5068} else {
cbb38b47 5069if (GET_H_ENDIAN ()) {
1bbd6057 5070{
cbb38b47 5071 tmp_val = GET_H_GR (FLD (f_dest));
1bbd6057 5072if (ANDQI (tmp_bytecount, 1)) {
cbb38b47
BE
5073{
5074 {
5075 UQI opval = ANDQI (tmp_val, 255);
5076 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
1bbd6057 5077 written |= (1 << 6);
cbb38b47
BE
5078 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5079 }
5080 tmp_val = SRLDI (tmp_val, 8);
cbb38b47
BE
5081}
5082}
1bbd6057 5083if (ANDQI (tmp_bytecount, 2)) {
cbb38b47
BE
5084{
5085 {
1bbd6057
JR
5086 HI opval = ANDHI (tmp_val, 65535);
5087 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
cbb38b47
BE
5088 written |= (1 << 4);
5089 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5090 }
1bbd6057
JR
5091 tmp_val = SRLDI (tmp_val, 16);
5092}
cbb38b47
BE
5093}
5094}
1bbd6057
JR
5095} else {
5096{
5097 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (32, MULSI (8, tmp_bytecount)));
5098if (ANDQI (tmp_bytecount, 2)) {
cbb38b47
BE
5099{
5100 {
1bbd6057
JR
5101 HI opval = ANDHI (tmp_val, 65535);
5102 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
cbb38b47
BE
5103 written |= (1 << 4);
5104 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5105 }
1bbd6057 5106 tmp_val = SRLDI (tmp_val, 16);
cbb38b47
BE
5107}
5108}
1bbd6057 5109if (ANDQI (tmp_bytecount, 1)) {
cbb38b47
BE
5110{
5111 {
5112 UQI opval = ANDQI (tmp_val, 255);
5113 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
1bbd6057 5114 written |= (1 << 6);
cbb38b47
BE
5115 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5116 }
5117 tmp_val = SRLDI (tmp_val, 8);
1bbd6057
JR
5118}
5119}
5120}
cbb38b47
BE
5121}
5122}
5123}
5124
5125 abuf->written = written;
5126#undef FLD
5127}
5128 NEXT (vpc);
5129
5130 CASE (sem, INSN_STHIQ) : /* sthi.q $rm, $disp6, $rd */
5131{
5132 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5133 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 5134#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
5135 int UNUSED written = 0;
5136 IADDR UNUSED pc = abuf->addr;
5137 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5138
5139{
5140 DI tmp_addr;
5141 QI tmp_bytecount;
5142 DI tmp_val;
5143 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5144 tmp_bytecount = ADDDI (ANDDI (tmp_addr, 7), 1);
1bbd6057
JR
5145if (ANDQI (tmp_bytecount, 8)) {
5146 {
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);
5151 }
5152} else {
cbb38b47 5153if (GET_H_ENDIAN ()) {
1bbd6057 5154{
cbb38b47 5155 tmp_val = GET_H_GR (FLD (f_dest));
1bbd6057 5156if (ANDQI (tmp_bytecount, 1)) {
cbb38b47
BE
5157{
5158 {
5159 UQI opval = ANDQI (tmp_val, 255);
5160 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
1bbd6057 5161 written |= (1 << 7);
cbb38b47
BE
5162 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5163 }
5164 tmp_val = SRLDI (tmp_val, 8);
cbb38b47
BE
5165}
5166}
1bbd6057 5167if (ANDQI (tmp_bytecount, 2)) {
cbb38b47
BE
5168{
5169 {
1bbd6057
JR
5170 HI opval = ANDHI (tmp_val, 65535);
5171 SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5172 written |= (1 << 5);
cbb38b47
BE
5173 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5174 }
1bbd6057 5175 tmp_val = SRLDI (tmp_val, 16);
cbb38b47
BE
5176}
5177}
1bbd6057 5178if (ANDQI (tmp_bytecount, 4)) {
cbb38b47
BE
5179{
5180 {
1bbd6057
JR
5181 SI opval = ANDSI (tmp_val, 0xffffffff);
5182 SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5183 written |= (1 << 6);
cbb38b47
BE
5184 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5185 }
1bbd6057
JR
5186 tmp_val = SRLDI (tmp_val, 32);
5187}
5188}
5189}
5190} else {
5191{
5192 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (64, MULSI (8, tmp_bytecount)));
5193if (ANDQI (tmp_bytecount, 4)) {
5194{
5195 {
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);
5200 }
5201 tmp_val = SRLDI (tmp_val, 32);
cbb38b47
BE
5202}
5203}
1bbd6057
JR
5204if (ANDQI (tmp_bytecount, 2)) {
5205{
5206 {
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);
5211 }
5212 tmp_val = SRLDI (tmp_val, 16);
5213}
5214}
5215if (ANDQI (tmp_bytecount, 1)) {
cbb38b47
BE
5216{
5217 {
5218 UQI opval = ANDQI (tmp_val, 255);
5219 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
1bbd6057 5220 written |= (1 << 7);
cbb38b47
BE
5221 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5222 }
5223 tmp_val = SRLDI (tmp_val, 8);
cbb38b47
BE
5224}
5225}
1bbd6057
JR
5226}
5227}
5228}
5229}
5230
5231 abuf->written = written;
5232#undef FLD
5233}
5234 NEXT (vpc);
5235
5236 CASE (sem, INSN_STLOL) : /* stlo.l $rm, $disp6, $rd */
5237{
5238 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5239 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 5240#define FLD(f) abuf->fields.sfmt_getcfg.f
1bbd6057
JR
5241 int UNUSED written = 0;
5242 IADDR UNUSED pc = abuf->addr;
5243 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5244
cbb38b47 5245{
1bbd6057
JR
5246 DI tmp_addr;
5247 QI tmp_bytecount;
5248 DI tmp_val;
5249 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5250 tmp_bytecount = SUBSI (4, ANDDI (tmp_addr, 3));
5251if (ANDQI (tmp_bytecount, 4)) {
cbb38b47 5252 {
1bbd6057
JR
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);
5257 }
5258} else {
5259if (GET_H_ENDIAN ()) {
5260{
5261 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (32, MULSI (8, tmp_bytecount)));
5262if (ANDQI (tmp_bytecount, 2)) {
5263{
5264 {
5265 UHI opval = ANDHI (tmp_val, 65535);
5266 SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
cbb38b47
BE
5267 written |= (1 << 4);
5268 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5269 }
1bbd6057 5270 tmp_val = SRLDI (tmp_val, 16);
cbb38b47
BE
5271}
5272}
1bbd6057 5273if (ANDQI (tmp_bytecount, 1)) {
cbb38b47
BE
5274{
5275 {
5276 UQI opval = ANDQI (tmp_val, 255);
5277 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
1bbd6057 5278 written |= (1 << 5);
cbb38b47
BE
5279 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5280 }
5281 tmp_val = SRLDI (tmp_val, 8);
cbb38b47
BE
5282}
5283}
1bbd6057
JR
5284}
5285} else {
5286{
5287 tmp_val = GET_H_GR (FLD (f_dest));
5288if (ANDQI (tmp_bytecount, 1)) {
cbb38b47
BE
5289{
5290 {
5291 UQI opval = ANDQI (tmp_val, 255);
5292 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
1bbd6057 5293 written |= (1 << 5);
cbb38b47
BE
5294 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5295 }
5296 tmp_val = SRLDI (tmp_val, 8);
cbb38b47
BE
5297}
5298}
1bbd6057 5299if (ANDQI (tmp_bytecount, 2)) {
cbb38b47
BE
5300{
5301 {
1bbd6057
JR
5302 UHI opval = ANDHI (tmp_val, 65535);
5303 SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
cbb38b47
BE
5304 written |= (1 << 4);
5305 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5306 }
1bbd6057
JR
5307 tmp_val = SRLDI (tmp_val, 16);
5308}
5309}
5310}
cbb38b47
BE
5311}
5312}
5313}
5314
5315 abuf->written = written;
5316#undef FLD
5317}
5318 NEXT (vpc);
5319
1bbd6057 5320 CASE (sem, INSN_STLOQ) : /* stlo.q $rm, $disp6, $rd */
cbb38b47
BE
5321{
5322 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5323 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
c7e628df 5324#define FLD(f) abuf->fields.sfmt_getcfg.f
cbb38b47
BE
5325 int UNUSED written = 0;
5326 IADDR UNUSED pc = abuf->addr;
5327 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5328
1bbd6057
JR
5329{
5330 DI tmp_addr;
5331 QI tmp_bytecount;
5332 DI tmp_val;
5333 tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5334 tmp_bytecount = SUBSI (8, ANDDI (tmp_addr, 7));
5335if (ANDQI (tmp_bytecount, 8)) {
5336 {
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);
5341 }
5342} else {
5343if (GET_H_ENDIAN ()) {
5344{
5345 tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (64, MULSI (8, tmp_bytecount)));
5346if (ANDQI (tmp_bytecount, 4)) {
5347{
5348 {
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);
5353 }
5354 tmp_val = SRLDI (tmp_val, 32);
cbb38b47 5355}
1bbd6057
JR
5356}
5357if (ANDQI (tmp_bytecount, 2)) {
cbb38b47 5358{
1bbd6057
JR
5359 {
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);
5364 }
5365 tmp_val = SRLDI (tmp_val, 16);
5366}
5367}
5368if (ANDQI (tmp_bytecount, 1)) {
5369{
5370 {
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);
5375 }
5376 tmp_val = SRLDI (tmp_val, 8);
5377}
5378}
5379}
5380} else {
5381{
5382 tmp_val = GET_H_GR (FLD (f_dest));
5383if (ANDQI (tmp_bytecount, 1)) {
5384{
5385 {
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);
5390 }
5391 tmp_val = SRLDI (tmp_val, 8);
5392}
5393}
5394if (ANDQI (tmp_bytecount, 2)) {
5395{
5396 {
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);
5401 }
5402 tmp_val = SRLDI (tmp_val, 16);
5403}
5404}
5405if (ANDQI (tmp_bytecount, 4)) {
5406{
5407 {
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);
5412 }
5413 tmp_val = SRLDI (tmp_val, 32);
5414}
5415}
5416}
5417}
5418}
5419}
cbb38b47 5420
1bbd6057 5421 abuf->written = written;
cbb38b47
BE
5422#undef FLD
5423}
5424 NEXT (vpc);
5425
5426 CASE (sem, INSN_STXB) : /* stx.b $rm, $rn, $rd */
5427{
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);
5434
5435 {
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);
5439 }
5440
5441#undef FLD
5442}
5443 NEXT (vpc);
5444
5445 CASE (sem, INSN_STXL) : /* stx.l $rm, $rn, $rd */
5446{
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);
5453
5454 {
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);
5458 }
5459
5460#undef FLD
5461}
5462 NEXT (vpc);
5463
5464 CASE (sem, INSN_STXQ) : /* stx.q $rm, $rn, $rd */
5465{
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);
5472
5473 {
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);
5477 }
5478
5479#undef FLD
5480}
5481 NEXT (vpc);
5482
5483 CASE (sem, INSN_STXW) : /* stx.w $rm, $rn, $rd */
5484{
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);
5491
5492 {
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);
5496 }
5497
5498#undef FLD
5499}
5500 NEXT (vpc);
5501
5502 CASE (sem, INSN_SUB) : /* sub $rm, $rn, $rd */
5503{
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);
5510
5511 {
5512 DI opval = SUBDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5513 SET_H_GR (FLD (f_dest), opval);
1bbd6057 5514 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
5515 }
5516
5517#undef FLD
5518}
5519 NEXT (vpc);
5520
5521 CASE (sem, INSN_SUBL) : /* sub.l $rm, $rn, $rd */
5522{
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);
5529
5530 {
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);
1bbd6057 5533 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
5534 }
5535
5536#undef FLD
5537}
5538 NEXT (vpc);
5539
5540 CASE (sem, INSN_SWAPQ) : /* swap.q $rm, $rn, $rd */
5541{
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);
5548
5549{
5550 DI tmp_addr;
5551 DI tmp_temp;
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);
5554 {
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);
5558 }
5559 {
5560 DI opval = tmp_temp;
5561 SET_H_GR (FLD (f_dest), opval);
1bbd6057 5562 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
5563 }
5564}
5565
5566#undef FLD
5567}
5568 NEXT (vpc);
5569
5570 CASE (sem, INSN_SYNCI) : /* synci */
5571{
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);
5578
5579((void) 0); /*nop*/
5580
5581#undef FLD
5582}
5583 NEXT (vpc);
5584
5585 CASE (sem, INSN_SYNCO) : /* synco */
5586{
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);
5593
5594((void) 0); /*nop*/
5595
5596#undef FLD
5597}
5598 NEXT (vpc);
5599
5600 CASE (sem, INSN_TRAPA) : /* trapa $rm */
5601{
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);
5608
5609sh64_trapa (current_cpu, GET_H_GR (FLD (f_left)), pc);
5610
5611#undef FLD
5612}
5613 NEXT (vpc);
5614
5615 CASE (sem, INSN_XOR) : /* xor $rm, $rn, $rd */
5616{
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);
5623
5624 {
5625 DI opval = XORDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5626 SET_H_GR (FLD (f_dest), opval);
1bbd6057 5627 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
5628 }
5629
5630#undef FLD
5631}
5632 NEXT (vpc);
5633
5634 CASE (sem, INSN_XORI) : /* xori $rm, $imm6, $rd */
5635{
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);
5642
5643 {
5644 DI opval = XORDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)));
5645 SET_H_GR (FLD (f_dest), opval);
1bbd6057 5646 TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
cbb38b47
BE
5647 }
5648
5649#undef FLD
5650}
5651 NEXT (vpc);
5652
5653
5654 }
5655 ENDSWITCH (sem) /* End of semantic switch. */
5656
5657 /* At this point `vpc' contains the next insn to execute. */
5658}
5659
5660#undef DEFINE_SWITCH
5661#endif /* DEFINE_SWITCH */
This page took 0.601394 seconds and 4 git commands to generate.