OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [sim/] [sh64/] [sem-media-switch.c] - Blame information for rev 816

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
/* Simulator instruction semantics for sh64.
2
 
3
THIS FILE IS MACHINE GENERATED WITH CGEN.
4
 
5
Copyright 1996-2005 Free Software Foundation, Inc.
6
 
7
This file is part of the GNU simulators.
8
 
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 3 of the License, or
12
(at your option) any later version.
13
 
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
GNU General Public License for more details.
18
 
19
You should have received a copy of the GNU General Public License
20
along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 
22
*/
23
 
24
#ifdef DEFINE_LABELS
25
 
26
  /* The labels have the case they have because the enum of insn types
27
     is all uppercase and in the non-stdc case the insn symbol is built
28
     into the enum name.  */
29
 
30
  static struct {
31
    int index;
32
    void *label;
33
  } labels[] = {
34
    { SH64_MEDIA_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
35
    { SH64_MEDIA_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
36
    { SH64_MEDIA_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
37
    { SH64_MEDIA_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
38
    { SH64_MEDIA_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
39
    { SH64_MEDIA_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
40
    { SH64_MEDIA_INSN_ADD, && case_sem_INSN_ADD },
41
    { SH64_MEDIA_INSN_ADDL, && case_sem_INSN_ADDL },
42
    { SH64_MEDIA_INSN_ADDI, && case_sem_INSN_ADDI },
43
    { SH64_MEDIA_INSN_ADDIL, && case_sem_INSN_ADDIL },
44
    { SH64_MEDIA_INSN_ADDZL, && case_sem_INSN_ADDZL },
45
    { SH64_MEDIA_INSN_ALLOCO, && case_sem_INSN_ALLOCO },
46
    { SH64_MEDIA_INSN_AND, && case_sem_INSN_AND },
47
    { SH64_MEDIA_INSN_ANDC, && case_sem_INSN_ANDC },
48
    { SH64_MEDIA_INSN_ANDI, && case_sem_INSN_ANDI },
49
    { SH64_MEDIA_INSN_BEQ, && case_sem_INSN_BEQ },
50
    { SH64_MEDIA_INSN_BEQI, && case_sem_INSN_BEQI },
51
    { SH64_MEDIA_INSN_BGE, && case_sem_INSN_BGE },
52
    { SH64_MEDIA_INSN_BGEU, && case_sem_INSN_BGEU },
53
    { SH64_MEDIA_INSN_BGT, && case_sem_INSN_BGT },
54
    { SH64_MEDIA_INSN_BGTU, && case_sem_INSN_BGTU },
55
    { SH64_MEDIA_INSN_BLINK, && case_sem_INSN_BLINK },
56
    { SH64_MEDIA_INSN_BNE, && case_sem_INSN_BNE },
57
    { SH64_MEDIA_INSN_BNEI, && case_sem_INSN_BNEI },
58
    { SH64_MEDIA_INSN_BRK, && case_sem_INSN_BRK },
59
    { SH64_MEDIA_INSN_BYTEREV, && case_sem_INSN_BYTEREV },
60
    { SH64_MEDIA_INSN_CMPEQ, && case_sem_INSN_CMPEQ },
61
    { SH64_MEDIA_INSN_CMPGT, && case_sem_INSN_CMPGT },
62
    { SH64_MEDIA_INSN_CMPGTU, && case_sem_INSN_CMPGTU },
63
    { SH64_MEDIA_INSN_CMVEQ, && case_sem_INSN_CMVEQ },
64
    { SH64_MEDIA_INSN_CMVNE, && case_sem_INSN_CMVNE },
65
    { SH64_MEDIA_INSN_FABSD, && case_sem_INSN_FABSD },
66
    { SH64_MEDIA_INSN_FABSS, && case_sem_INSN_FABSS },
67
    { SH64_MEDIA_INSN_FADDD, && case_sem_INSN_FADDD },
68
    { SH64_MEDIA_INSN_FADDS, && case_sem_INSN_FADDS },
69
    { SH64_MEDIA_INSN_FCMPEQD, && case_sem_INSN_FCMPEQD },
70
    { SH64_MEDIA_INSN_FCMPEQS, && case_sem_INSN_FCMPEQS },
71
    { SH64_MEDIA_INSN_FCMPGED, && case_sem_INSN_FCMPGED },
72
    { SH64_MEDIA_INSN_FCMPGES, && case_sem_INSN_FCMPGES },
73
    { SH64_MEDIA_INSN_FCMPGTD, && case_sem_INSN_FCMPGTD },
74
    { SH64_MEDIA_INSN_FCMPGTS, && case_sem_INSN_FCMPGTS },
75
    { SH64_MEDIA_INSN_FCMPUND, && case_sem_INSN_FCMPUND },
76
    { SH64_MEDIA_INSN_FCMPUNS, && case_sem_INSN_FCMPUNS },
77
    { SH64_MEDIA_INSN_FCNVDS, && case_sem_INSN_FCNVDS },
78
    { SH64_MEDIA_INSN_FCNVSD, && case_sem_INSN_FCNVSD },
79
    { SH64_MEDIA_INSN_FDIVD, && case_sem_INSN_FDIVD },
80
    { SH64_MEDIA_INSN_FDIVS, && case_sem_INSN_FDIVS },
81
    { SH64_MEDIA_INSN_FGETSCR, && case_sem_INSN_FGETSCR },
82
    { SH64_MEDIA_INSN_FIPRS, && case_sem_INSN_FIPRS },
83
    { SH64_MEDIA_INSN_FLDD, && case_sem_INSN_FLDD },
84
    { SH64_MEDIA_INSN_FLDP, && case_sem_INSN_FLDP },
85
    { SH64_MEDIA_INSN_FLDS, && case_sem_INSN_FLDS },
86
    { SH64_MEDIA_INSN_FLDXD, && case_sem_INSN_FLDXD },
87
    { SH64_MEDIA_INSN_FLDXP, && case_sem_INSN_FLDXP },
88
    { SH64_MEDIA_INSN_FLDXS, && case_sem_INSN_FLDXS },
89
    { SH64_MEDIA_INSN_FLOATLD, && case_sem_INSN_FLOATLD },
90
    { SH64_MEDIA_INSN_FLOATLS, && case_sem_INSN_FLOATLS },
91
    { SH64_MEDIA_INSN_FLOATQD, && case_sem_INSN_FLOATQD },
92
    { SH64_MEDIA_INSN_FLOATQS, && case_sem_INSN_FLOATQS },
93
    { SH64_MEDIA_INSN_FMACS, && case_sem_INSN_FMACS },
94
    { SH64_MEDIA_INSN_FMOVD, && case_sem_INSN_FMOVD },
95
    { SH64_MEDIA_INSN_FMOVDQ, && case_sem_INSN_FMOVDQ },
96
    { SH64_MEDIA_INSN_FMOVLS, && case_sem_INSN_FMOVLS },
97
    { SH64_MEDIA_INSN_FMOVQD, && case_sem_INSN_FMOVQD },
98
    { SH64_MEDIA_INSN_FMOVS, && case_sem_INSN_FMOVS },
99
    { SH64_MEDIA_INSN_FMOVSL, && case_sem_INSN_FMOVSL },
100
    { SH64_MEDIA_INSN_FMULD, && case_sem_INSN_FMULD },
101
    { SH64_MEDIA_INSN_FMULS, && case_sem_INSN_FMULS },
102
    { SH64_MEDIA_INSN_FNEGD, && case_sem_INSN_FNEGD },
103
    { SH64_MEDIA_INSN_FNEGS, && case_sem_INSN_FNEGS },
104
    { SH64_MEDIA_INSN_FPUTSCR, && case_sem_INSN_FPUTSCR },
105
    { SH64_MEDIA_INSN_FSQRTD, && case_sem_INSN_FSQRTD },
106
    { SH64_MEDIA_INSN_FSQRTS, && case_sem_INSN_FSQRTS },
107
    { SH64_MEDIA_INSN_FSTD, && case_sem_INSN_FSTD },
108
    { SH64_MEDIA_INSN_FSTP, && case_sem_INSN_FSTP },
109
    { SH64_MEDIA_INSN_FSTS, && case_sem_INSN_FSTS },
110
    { SH64_MEDIA_INSN_FSTXD, && case_sem_INSN_FSTXD },
111
    { SH64_MEDIA_INSN_FSTXP, && case_sem_INSN_FSTXP },
112
    { SH64_MEDIA_INSN_FSTXS, && case_sem_INSN_FSTXS },
113
    { SH64_MEDIA_INSN_FSUBD, && case_sem_INSN_FSUBD },
114
    { SH64_MEDIA_INSN_FSUBS, && case_sem_INSN_FSUBS },
115
    { SH64_MEDIA_INSN_FTRCDL, && case_sem_INSN_FTRCDL },
116
    { SH64_MEDIA_INSN_FTRCSL, && case_sem_INSN_FTRCSL },
117
    { SH64_MEDIA_INSN_FTRCDQ, && case_sem_INSN_FTRCDQ },
118
    { SH64_MEDIA_INSN_FTRCSQ, && case_sem_INSN_FTRCSQ },
119
    { SH64_MEDIA_INSN_FTRVS, && case_sem_INSN_FTRVS },
120
    { SH64_MEDIA_INSN_GETCFG, && case_sem_INSN_GETCFG },
121
    { SH64_MEDIA_INSN_GETCON, && case_sem_INSN_GETCON },
122
    { SH64_MEDIA_INSN_GETTR, && case_sem_INSN_GETTR },
123
    { SH64_MEDIA_INSN_ICBI, && case_sem_INSN_ICBI },
124
    { SH64_MEDIA_INSN_LDB, && case_sem_INSN_LDB },
125
    { SH64_MEDIA_INSN_LDL, && case_sem_INSN_LDL },
126
    { SH64_MEDIA_INSN_LDQ, && case_sem_INSN_LDQ },
127
    { SH64_MEDIA_INSN_LDUB, && case_sem_INSN_LDUB },
128
    { SH64_MEDIA_INSN_LDUW, && case_sem_INSN_LDUW },
129
    { SH64_MEDIA_INSN_LDW, && case_sem_INSN_LDW },
130
    { SH64_MEDIA_INSN_LDHIL, && case_sem_INSN_LDHIL },
131
    { SH64_MEDIA_INSN_LDHIQ, && case_sem_INSN_LDHIQ },
132
    { SH64_MEDIA_INSN_LDLOL, && case_sem_INSN_LDLOL },
133
    { SH64_MEDIA_INSN_LDLOQ, && case_sem_INSN_LDLOQ },
134
    { SH64_MEDIA_INSN_LDXB, && case_sem_INSN_LDXB },
135
    { SH64_MEDIA_INSN_LDXL, && case_sem_INSN_LDXL },
136
    { SH64_MEDIA_INSN_LDXQ, && case_sem_INSN_LDXQ },
137
    { SH64_MEDIA_INSN_LDXUB, && case_sem_INSN_LDXUB },
138
    { SH64_MEDIA_INSN_LDXUW, && case_sem_INSN_LDXUW },
139
    { SH64_MEDIA_INSN_LDXW, && case_sem_INSN_LDXW },
140
    { SH64_MEDIA_INSN_MABSL, && case_sem_INSN_MABSL },
141
    { SH64_MEDIA_INSN_MABSW, && case_sem_INSN_MABSW },
142
    { SH64_MEDIA_INSN_MADDL, && case_sem_INSN_MADDL },
143
    { SH64_MEDIA_INSN_MADDW, && case_sem_INSN_MADDW },
144
    { SH64_MEDIA_INSN_MADDSL, && case_sem_INSN_MADDSL },
145
    { SH64_MEDIA_INSN_MADDSUB, && case_sem_INSN_MADDSUB },
146
    { SH64_MEDIA_INSN_MADDSW, && case_sem_INSN_MADDSW },
147
    { SH64_MEDIA_INSN_MCMPEQB, && case_sem_INSN_MCMPEQB },
148
    { SH64_MEDIA_INSN_MCMPEQL, && case_sem_INSN_MCMPEQL },
149
    { SH64_MEDIA_INSN_MCMPEQW, && case_sem_INSN_MCMPEQW },
150
    { SH64_MEDIA_INSN_MCMPGTL, && case_sem_INSN_MCMPGTL },
151
    { SH64_MEDIA_INSN_MCMPGTUB, && case_sem_INSN_MCMPGTUB },
152
    { SH64_MEDIA_INSN_MCMPGTW, && case_sem_INSN_MCMPGTW },
153
    { SH64_MEDIA_INSN_MCMV, && case_sem_INSN_MCMV },
154
    { SH64_MEDIA_INSN_MCNVSLW, && case_sem_INSN_MCNVSLW },
155
    { SH64_MEDIA_INSN_MCNVSWB, && case_sem_INSN_MCNVSWB },
156
    { SH64_MEDIA_INSN_MCNVSWUB, && case_sem_INSN_MCNVSWUB },
157
    { SH64_MEDIA_INSN_MEXTR1, && case_sem_INSN_MEXTR1 },
158
    { SH64_MEDIA_INSN_MEXTR2, && case_sem_INSN_MEXTR2 },
159
    { SH64_MEDIA_INSN_MEXTR3, && case_sem_INSN_MEXTR3 },
160
    { SH64_MEDIA_INSN_MEXTR4, && case_sem_INSN_MEXTR4 },
161
    { SH64_MEDIA_INSN_MEXTR5, && case_sem_INSN_MEXTR5 },
162
    { SH64_MEDIA_INSN_MEXTR6, && case_sem_INSN_MEXTR6 },
163
    { SH64_MEDIA_INSN_MEXTR7, && case_sem_INSN_MEXTR7 },
164
    { SH64_MEDIA_INSN_MMACFXWL, && case_sem_INSN_MMACFXWL },
165
    { SH64_MEDIA_INSN_MMACNFX_WL, && case_sem_INSN_MMACNFX_WL },
166
    { SH64_MEDIA_INSN_MMULL, && case_sem_INSN_MMULL },
167
    { SH64_MEDIA_INSN_MMULW, && case_sem_INSN_MMULW },
168
    { SH64_MEDIA_INSN_MMULFXL, && case_sem_INSN_MMULFXL },
169
    { SH64_MEDIA_INSN_MMULFXW, && case_sem_INSN_MMULFXW },
170
    { SH64_MEDIA_INSN_MMULFXRPW, && case_sem_INSN_MMULFXRPW },
171
    { SH64_MEDIA_INSN_MMULHIWL, && case_sem_INSN_MMULHIWL },
172
    { SH64_MEDIA_INSN_MMULLOWL, && case_sem_INSN_MMULLOWL },
173
    { SH64_MEDIA_INSN_MMULSUMWQ, && case_sem_INSN_MMULSUMWQ },
174
    { SH64_MEDIA_INSN_MOVI, && case_sem_INSN_MOVI },
175
    { SH64_MEDIA_INSN_MPERMW, && case_sem_INSN_MPERMW },
176
    { SH64_MEDIA_INSN_MSADUBQ, && case_sem_INSN_MSADUBQ },
177
    { SH64_MEDIA_INSN_MSHALDSL, && case_sem_INSN_MSHALDSL },
178
    { SH64_MEDIA_INSN_MSHALDSW, && case_sem_INSN_MSHALDSW },
179
    { SH64_MEDIA_INSN_MSHARDL, && case_sem_INSN_MSHARDL },
180
    { SH64_MEDIA_INSN_MSHARDW, && case_sem_INSN_MSHARDW },
181
    { SH64_MEDIA_INSN_MSHARDSQ, && case_sem_INSN_MSHARDSQ },
182
    { SH64_MEDIA_INSN_MSHFHIB, && case_sem_INSN_MSHFHIB },
183
    { SH64_MEDIA_INSN_MSHFHIL, && case_sem_INSN_MSHFHIL },
184
    { SH64_MEDIA_INSN_MSHFHIW, && case_sem_INSN_MSHFHIW },
185
    { SH64_MEDIA_INSN_MSHFLOB, && case_sem_INSN_MSHFLOB },
186
    { SH64_MEDIA_INSN_MSHFLOL, && case_sem_INSN_MSHFLOL },
187
    { SH64_MEDIA_INSN_MSHFLOW, && case_sem_INSN_MSHFLOW },
188
    { SH64_MEDIA_INSN_MSHLLDL, && case_sem_INSN_MSHLLDL },
189
    { SH64_MEDIA_INSN_MSHLLDW, && case_sem_INSN_MSHLLDW },
190
    { SH64_MEDIA_INSN_MSHLRDL, && case_sem_INSN_MSHLRDL },
191
    { SH64_MEDIA_INSN_MSHLRDW, && case_sem_INSN_MSHLRDW },
192
    { SH64_MEDIA_INSN_MSUBL, && case_sem_INSN_MSUBL },
193
    { SH64_MEDIA_INSN_MSUBW, && case_sem_INSN_MSUBW },
194
    { SH64_MEDIA_INSN_MSUBSL, && case_sem_INSN_MSUBSL },
195
    { SH64_MEDIA_INSN_MSUBSUB, && case_sem_INSN_MSUBSUB },
196
    { SH64_MEDIA_INSN_MSUBSW, && case_sem_INSN_MSUBSW },
197
    { SH64_MEDIA_INSN_MULSL, && case_sem_INSN_MULSL },
198
    { SH64_MEDIA_INSN_MULUL, && case_sem_INSN_MULUL },
199
    { SH64_MEDIA_INSN_NOP, && case_sem_INSN_NOP },
200
    { SH64_MEDIA_INSN_NSB, && case_sem_INSN_NSB },
201
    { SH64_MEDIA_INSN_OCBI, && case_sem_INSN_OCBI },
202
    { SH64_MEDIA_INSN_OCBP, && case_sem_INSN_OCBP },
203
    { SH64_MEDIA_INSN_OCBWB, && case_sem_INSN_OCBWB },
204
    { SH64_MEDIA_INSN_OR, && case_sem_INSN_OR },
205
    { SH64_MEDIA_INSN_ORI, && case_sem_INSN_ORI },
206
    { SH64_MEDIA_INSN_PREFI, && case_sem_INSN_PREFI },
207
    { SH64_MEDIA_INSN_PTA, && case_sem_INSN_PTA },
208
    { SH64_MEDIA_INSN_PTABS, && case_sem_INSN_PTABS },
209
    { SH64_MEDIA_INSN_PTB, && case_sem_INSN_PTB },
210
    { SH64_MEDIA_INSN_PTREL, && case_sem_INSN_PTREL },
211
    { SH64_MEDIA_INSN_PUTCFG, && case_sem_INSN_PUTCFG },
212
    { SH64_MEDIA_INSN_PUTCON, && case_sem_INSN_PUTCON },
213
    { SH64_MEDIA_INSN_RTE, && case_sem_INSN_RTE },
214
    { SH64_MEDIA_INSN_SHARD, && case_sem_INSN_SHARD },
215
    { SH64_MEDIA_INSN_SHARDL, && case_sem_INSN_SHARDL },
216
    { SH64_MEDIA_INSN_SHARI, && case_sem_INSN_SHARI },
217
    { SH64_MEDIA_INSN_SHARIL, && case_sem_INSN_SHARIL },
218
    { SH64_MEDIA_INSN_SHLLD, && case_sem_INSN_SHLLD },
219
    { SH64_MEDIA_INSN_SHLLDL, && case_sem_INSN_SHLLDL },
220
    { SH64_MEDIA_INSN_SHLLI, && case_sem_INSN_SHLLI },
221
    { SH64_MEDIA_INSN_SHLLIL, && case_sem_INSN_SHLLIL },
222
    { SH64_MEDIA_INSN_SHLRD, && case_sem_INSN_SHLRD },
223
    { SH64_MEDIA_INSN_SHLRDL, && case_sem_INSN_SHLRDL },
224
    { SH64_MEDIA_INSN_SHLRI, && case_sem_INSN_SHLRI },
225
    { SH64_MEDIA_INSN_SHLRIL, && case_sem_INSN_SHLRIL },
226
    { SH64_MEDIA_INSN_SHORI, && case_sem_INSN_SHORI },
227
    { SH64_MEDIA_INSN_SLEEP, && case_sem_INSN_SLEEP },
228
    { SH64_MEDIA_INSN_STB, && case_sem_INSN_STB },
229
    { SH64_MEDIA_INSN_STL, && case_sem_INSN_STL },
230
    { SH64_MEDIA_INSN_STQ, && case_sem_INSN_STQ },
231
    { SH64_MEDIA_INSN_STW, && case_sem_INSN_STW },
232
    { SH64_MEDIA_INSN_STHIL, && case_sem_INSN_STHIL },
233
    { SH64_MEDIA_INSN_STHIQ, && case_sem_INSN_STHIQ },
234
    { SH64_MEDIA_INSN_STLOL, && case_sem_INSN_STLOL },
235
    { SH64_MEDIA_INSN_STLOQ, && case_sem_INSN_STLOQ },
236
    { SH64_MEDIA_INSN_STXB, && case_sem_INSN_STXB },
237
    { SH64_MEDIA_INSN_STXL, && case_sem_INSN_STXL },
238
    { SH64_MEDIA_INSN_STXQ, && case_sem_INSN_STXQ },
239
    { SH64_MEDIA_INSN_STXW, && case_sem_INSN_STXW },
240
    { SH64_MEDIA_INSN_SUB, && case_sem_INSN_SUB },
241
    { SH64_MEDIA_INSN_SUBL, && case_sem_INSN_SUBL },
242
    { SH64_MEDIA_INSN_SWAPQ, && case_sem_INSN_SWAPQ },
243
    { SH64_MEDIA_INSN_SYNCI, && case_sem_INSN_SYNCI },
244
    { SH64_MEDIA_INSN_SYNCO, && case_sem_INSN_SYNCO },
245
    { SH64_MEDIA_INSN_TRAPA, && case_sem_INSN_TRAPA },
246
    { SH64_MEDIA_INSN_XOR, && case_sem_INSN_XOR },
247
    { SH64_MEDIA_INSN_XORI, && case_sem_INSN_XORI },
248
    { 0, 0 }
249
  };
250
  int i;
251
 
252
  for (i = 0; labels[i].label != 0; ++i)
253
    {
254
#if FAST_P
255
      CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
256
#else
257
      CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
258
#endif
259
    }
260
 
261
#undef DEFINE_LABELS
262
#endif /* DEFINE_LABELS */
263
 
264
#ifdef DEFINE_SWITCH
265
 
266
/* If hyper-fast [well not unnecessarily slow] execution is selected, turn
267
   off frills like tracing and profiling.  */
268
/* FIXME: A better way would be to have TRACE_RESULT check for something
269
   that can cause it to be optimized out.  Another way would be to emit
270
   special handlers into the instruction "stream".  */
271
 
272
#if FAST_P
273
#undef TRACE_RESULT
274
#define TRACE_RESULT(cpu, abuf, name, type, val)
275
#endif
276
 
277
#undef GET_ATTR
278
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
279
#define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
280
#else
281
#define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
282
#endif
283
 
284
{
285
 
286
#if WITH_SCACHE_PBB
287
 
288
/* Branch to next handler without going around main loop.  */
289
#define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
290
SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
291
 
292
#else /* ! WITH_SCACHE_PBB */
293
 
294
#define NEXT(vpc) BREAK (sem)
295
#ifdef __GNUC__
296
#if FAST_P
297
  SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
298
#else
299
  SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
300
#endif
301
#else
302
  SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
303
#endif
304
 
305
#endif /* ! WITH_SCACHE_PBB */
306
 
307
    {
308
 
309
  CASE (sem, INSN_X_INVALID) : /* --invalid-- */
310
{
311
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
312
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
313
#define FLD(f) abuf->fields.fmt_empty.f
314
  int UNUSED written = 0;
315
  IADDR UNUSED pc = abuf->addr;
316
  vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
317
 
318
  {
319
    /* Update the recorded pc in the cpu state struct.
320
       Only necessary for WITH_SCACHE case, but to avoid the
321
       conditional compilation ....  */
322
    SET_H_PC (pc);
323
    /* Virtual insns have zero size.  Overwrite vpc with address of next insn
324
       using the default-insn-bitsize spec.  When executing insns in parallel
325
       we may want to queue the fault and continue execution.  */
326
    vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
327
    vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
328
  }
329
 
330
#undef FLD
331
}
332
  NEXT (vpc);
333
 
334
  CASE (sem, INSN_X_AFTER) : /* --after-- */
335
{
336
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
337
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
338
#define FLD(f) abuf->fields.fmt_empty.f
339
  int UNUSED written = 0;
340
  IADDR UNUSED pc = abuf->addr;
341
  vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
342
 
343
  {
344
#if WITH_SCACHE_PBB_SH64_MEDIA
345
    sh64_media_pbb_after (current_cpu, sem_arg);
346
#endif
347
  }
348
 
349
#undef FLD
350
}
351
  NEXT (vpc);
352
 
353
  CASE (sem, INSN_X_BEFORE) : /* --before-- */
354
{
355
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
356
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
357
#define FLD(f) abuf->fields.fmt_empty.f
358
  int UNUSED written = 0;
359
  IADDR UNUSED pc = abuf->addr;
360
  vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
361
 
362
  {
363
#if WITH_SCACHE_PBB_SH64_MEDIA
364
    sh64_media_pbb_before (current_cpu, sem_arg);
365
#endif
366
  }
367
 
368
#undef FLD
369
}
370
  NEXT (vpc);
371
 
372
  CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
373
{
374
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
375
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
376
#define FLD(f) abuf->fields.fmt_empty.f
377
  int UNUSED written = 0;
378
  IADDR UNUSED pc = abuf->addr;
379
  vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
380
 
381
  {
382
#if WITH_SCACHE_PBB_SH64_MEDIA
383
#ifdef DEFINE_SWITCH
384
    vpc = sh64_media_pbb_cti_chain (current_cpu, sem_arg,
385
                               pbb_br_type, pbb_br_npc);
386
    BREAK (sem);
387
#else
388
    /* FIXME: Allow provision of explicit ifmt spec in insn spec.  */
389
    vpc = sh64_media_pbb_cti_chain (current_cpu, sem_arg,
390
                               CPU_PBB_BR_TYPE (current_cpu),
391
                               CPU_PBB_BR_NPC (current_cpu));
392
#endif
393
#endif
394
  }
395
 
396
#undef FLD
397
}
398
  NEXT (vpc);
399
 
400
  CASE (sem, INSN_X_CHAIN) : /* --chain-- */
401
{
402
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
403
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
404
#define FLD(f) abuf->fields.fmt_empty.f
405
  int UNUSED written = 0;
406
  IADDR UNUSED pc = abuf->addr;
407
  vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
408
 
409
  {
410
#if WITH_SCACHE_PBB_SH64_MEDIA
411
    vpc = sh64_media_pbb_chain (current_cpu, sem_arg);
412
#ifdef DEFINE_SWITCH
413
    BREAK (sem);
414
#endif
415
#endif
416
  }
417
 
418
#undef FLD
419
}
420
  NEXT (vpc);
421
 
422
  CASE (sem, INSN_X_BEGIN) : /* --begin-- */
423
{
424
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
425
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
426
#define FLD(f) abuf->fields.fmt_empty.f
427
  int UNUSED written = 0;
428
  IADDR UNUSED pc = abuf->addr;
429
  vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
430
 
431
  {
432
#if WITH_SCACHE_PBB_SH64_MEDIA
433
#if defined DEFINE_SWITCH || defined FAST_P
434
    /* In the switch case FAST_P is a constant, allowing several optimizations
435
       in any called inline functions.  */
436
    vpc = sh64_media_pbb_begin (current_cpu, FAST_P);
437
#else
438
#if 0 /* cgen engine can't handle dynamic fast/full switching yet.  */
439
    vpc = sh64_media_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
440
#else
441
    vpc = sh64_media_pbb_begin (current_cpu, 0);
442
#endif
443
#endif
444
#endif
445
  }
446
 
447
#undef FLD
448
}
449
  NEXT (vpc);
450
 
451
  CASE (sem, INSN_ADD) : /* add $rm, $rn, $rd */
452
{
453
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
454
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
455
#define FLD(f) abuf->fields.sfmt_add.f
456
  int UNUSED written = 0;
457
  IADDR UNUSED pc = abuf->addr;
458
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
459
 
460
  {
461
    DI opval = ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
462
    SET_H_GR (FLD (f_dest), opval);
463
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
464
  }
465
 
466
#undef FLD
467
}
468
  NEXT (vpc);
469
 
470
  CASE (sem, INSN_ADDL) : /* add.l $rm, $rn, $rd */
471
{
472
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
473
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
474
#define FLD(f) abuf->fields.sfmt_add.f
475
  int UNUSED written = 0;
476
  IADDR UNUSED pc = abuf->addr;
477
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
478
 
479
  {
480
    DI opval = ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
481
    SET_H_GR (FLD (f_dest), opval);
482
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
483
  }
484
 
485
#undef FLD
486
}
487
  NEXT (vpc);
488
 
489
  CASE (sem, INSN_ADDI) : /* addi $rm, $disp10, $rd */
490
{
491
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
492
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
493
#define FLD(f) abuf->fields.sfmt_addi.f
494
  int UNUSED written = 0;
495
  IADDR UNUSED pc = abuf->addr;
496
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
497
 
498
  {
499
    DI opval = ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)));
500
    SET_H_GR (FLD (f_dest), opval);
501
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
502
  }
503
 
504
#undef FLD
505
}
506
  NEXT (vpc);
507
 
508
  CASE (sem, INSN_ADDIL) : /* addi.l $rm, $disp10, $rd */
509
{
510
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
511
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
512
#define FLD(f) abuf->fields.sfmt_addi.f
513
  int UNUSED written = 0;
514
  IADDR UNUSED pc = abuf->addr;
515
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
516
 
517
  {
518
    DI opval = EXTSIDI (ADDSI (EXTSISI (FLD (f_disp10)), SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)));
519
    SET_H_GR (FLD (f_dest), opval);
520
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
521
  }
522
 
523
#undef FLD
524
}
525
  NEXT (vpc);
526
 
527
  CASE (sem, INSN_ADDZL) : /* addz.l $rm, $rn, $rd */
528
{
529
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
530
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
531
#define FLD(f) abuf->fields.sfmt_add.f
532
  int UNUSED written = 0;
533
  IADDR UNUSED pc = abuf->addr;
534
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
535
 
536
  {
537
    DI opval = ZEXTSIDI (ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
538
    SET_H_GR (FLD (f_dest), opval);
539
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
540
  }
541
 
542
#undef FLD
543
}
544
  NEXT (vpc);
545
 
546
  CASE (sem, INSN_ALLOCO) : /* alloco $rm, $disp6x32 */
547
{
548
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
549
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
550
#define FLD(f) abuf->fields.sfmt_xori.f
551
  int UNUSED written = 0;
552
  IADDR UNUSED pc = abuf->addr;
553
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
554
 
555
{
556
  {
557
    DI opval = GET_H_GR (FLD (f_left));
558
    SET_H_GR (FLD (f_left), opval);
559
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
560
  }
561
((void) 0); /*nop*/
562
}
563
 
564
#undef FLD
565
}
566
  NEXT (vpc);
567
 
568
  CASE (sem, INSN_AND) : /* and $rm, $rn, $rd */
569
{
570
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
571
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
572
#define FLD(f) abuf->fields.sfmt_add.f
573
  int UNUSED written = 0;
574
  IADDR UNUSED pc = abuf->addr;
575
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
576
 
577
  {
578
    DI opval = ANDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
579
    SET_H_GR (FLD (f_dest), opval);
580
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
581
  }
582
 
583
#undef FLD
584
}
585
  NEXT (vpc);
586
 
587
  CASE (sem, INSN_ANDC) : /* andc $rm, $rn, $rd */
588
{
589
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
590
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
591
#define FLD(f) abuf->fields.sfmt_add.f
592
  int UNUSED written = 0;
593
  IADDR UNUSED pc = abuf->addr;
594
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
595
 
596
  {
597
    DI opval = ANDDI (GET_H_GR (FLD (f_left)), INVDI (GET_H_GR (FLD (f_right))));
598
    SET_H_GR (FLD (f_dest), opval);
599
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
600
  }
601
 
602
#undef FLD
603
}
604
  NEXT (vpc);
605
 
606
  CASE (sem, INSN_ANDI) : /* andi $rm, $disp10, $rd */
607
{
608
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
609
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
610
#define FLD(f) abuf->fields.sfmt_addi.f
611
  int UNUSED written = 0;
612
  IADDR UNUSED pc = abuf->addr;
613
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
614
 
615
  {
616
    DI opval = ANDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)));
617
    SET_H_GR (FLD (f_dest), opval);
618
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
619
  }
620
 
621
#undef FLD
622
}
623
  NEXT (vpc);
624
 
625
  CASE (sem, INSN_BEQ) : /* beq$likely $rm, $rn, $tra */
626
{
627
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
628
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
629
#define FLD(f) abuf->fields.sfmt_beq.f
630
  int UNUSED written = 0;
631
  IADDR UNUSED pc = abuf->addr;
632
  SEM_BRANCH_INIT
633
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
634
 
635
{
636
((void) 0); /*nop*/
637
if (EQDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
638
  {
639
    UDI opval = CPU (h_tr[FLD (f_tra)]);
640
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
641
    written |= (1 << 3);
642
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
643
  }
644
}
645
}
646
 
647
  abuf->written = written;
648
  SEM_BRANCH_FINI (vpc);
649
#undef FLD
650
}
651
  NEXT (vpc);
652
 
653
  CASE (sem, INSN_BEQI) : /* beqi$likely $rm, $imm6, $tra */
654
{
655
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
656
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
657
#define FLD(f) abuf->fields.sfmt_beqi.f
658
  int UNUSED written = 0;
659
  IADDR UNUSED pc = abuf->addr;
660
  SEM_BRANCH_INIT
661
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
662
 
663
{
664
((void) 0); /*nop*/
665
if (EQDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)))) {
666
  {
667
    UDI opval = CPU (h_tr[FLD (f_tra)]);
668
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
669
    written |= (1 << 3);
670
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
671
  }
672
}
673
}
674
 
675
  abuf->written = written;
676
  SEM_BRANCH_FINI (vpc);
677
#undef FLD
678
}
679
  NEXT (vpc);
680
 
681
  CASE (sem, INSN_BGE) : /* bge$likely $rm, $rn, $tra */
682
{
683
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
684
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
685
#define FLD(f) abuf->fields.sfmt_beq.f
686
  int UNUSED written = 0;
687
  IADDR UNUSED pc = abuf->addr;
688
  SEM_BRANCH_INIT
689
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
690
 
691
{
692
((void) 0); /*nop*/
693
if (GEDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
694
  {
695
    UDI opval = CPU (h_tr[FLD (f_tra)]);
696
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
697
    written |= (1 << 3);
698
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
699
  }
700
}
701
}
702
 
703
  abuf->written = written;
704
  SEM_BRANCH_FINI (vpc);
705
#undef FLD
706
}
707
  NEXT (vpc);
708
 
709
  CASE (sem, INSN_BGEU) : /* bgeu$likely $rm, $rn, $tra */
710
{
711
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
712
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
713
#define FLD(f) abuf->fields.sfmt_beq.f
714
  int UNUSED written = 0;
715
  IADDR UNUSED pc = abuf->addr;
716
  SEM_BRANCH_INIT
717
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
718
 
719
{
720
((void) 0); /*nop*/
721
if (GEUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
722
  {
723
    UDI opval = CPU (h_tr[FLD (f_tra)]);
724
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
725
    written |= (1 << 3);
726
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
727
  }
728
}
729
}
730
 
731
  abuf->written = written;
732
  SEM_BRANCH_FINI (vpc);
733
#undef FLD
734
}
735
  NEXT (vpc);
736
 
737
  CASE (sem, INSN_BGT) : /* bgt$likely $rm, $rn, $tra */
738
{
739
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
740
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
741
#define FLD(f) abuf->fields.sfmt_beq.f
742
  int UNUSED written = 0;
743
  IADDR UNUSED pc = abuf->addr;
744
  SEM_BRANCH_INIT
745
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
746
 
747
{
748
((void) 0); /*nop*/
749
if (GTDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
750
  {
751
    UDI opval = CPU (h_tr[FLD (f_tra)]);
752
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
753
    written |= (1 << 3);
754
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
755
  }
756
}
757
}
758
 
759
  abuf->written = written;
760
  SEM_BRANCH_FINI (vpc);
761
#undef FLD
762
}
763
  NEXT (vpc);
764
 
765
  CASE (sem, INSN_BGTU) : /* bgtu$likely $rm, $rn, $tra */
766
{
767
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
768
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
769
#define FLD(f) abuf->fields.sfmt_beq.f
770
  int UNUSED written = 0;
771
  IADDR UNUSED pc = abuf->addr;
772
  SEM_BRANCH_INIT
773
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
774
 
775
{
776
((void) 0); /*nop*/
777
if (GTUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
778
  {
779
    UDI opval = CPU (h_tr[FLD (f_tra)]);
780
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
781
    written |= (1 << 3);
782
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
783
  }
784
}
785
}
786
 
787
  abuf->written = written;
788
  SEM_BRANCH_FINI (vpc);
789
#undef FLD
790
}
791
  NEXT (vpc);
792
 
793
  CASE (sem, INSN_BLINK) : /* blink $trb, $rd */
794
{
795
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
796
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
797
#define FLD(f) abuf->fields.sfmt_blink.f
798
  int UNUSED written = 0;
799
  IADDR UNUSED pc = abuf->addr;
800
  SEM_BRANCH_INIT
801
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
802
 
803
{
804
  {
805
    DI opval = ORDI (ADDDI (pc, 4), 1);
806
    SET_H_GR (FLD (f_dest), opval);
807
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
808
  }
809
  {
810
    UDI opval = CPU (h_tr[FLD (f_trb)]);
811
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
812
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
813
  }
814
if (EQSI (FLD (f_dest), 63)) {
815
((void) 0); /*nop*/
816
} else {
817
((void) 0); /*nop*/
818
}
819
}
820
 
821
  SEM_BRANCH_FINI (vpc);
822
#undef FLD
823
}
824
  NEXT (vpc);
825
 
826
  CASE (sem, INSN_BNE) : /* bne$likely $rm, $rn, $tra */
827
{
828
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
829
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
830
#define FLD(f) abuf->fields.sfmt_beq.f
831
  int UNUSED written = 0;
832
  IADDR UNUSED pc = abuf->addr;
833
  SEM_BRANCH_INIT
834
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
835
 
836
{
837
((void) 0); /*nop*/
838
if (NEDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) {
839
  {
840
    UDI opval = CPU (h_tr[FLD (f_tra)]);
841
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
842
    written |= (1 << 3);
843
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
844
  }
845
}
846
}
847
 
848
  abuf->written = written;
849
  SEM_BRANCH_FINI (vpc);
850
#undef FLD
851
}
852
  NEXT (vpc);
853
 
854
  CASE (sem, INSN_BNEI) : /* bnei$likely $rm, $imm6, $tra */
855
{
856
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
857
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
858
#define FLD(f) abuf->fields.sfmt_beqi.f
859
  int UNUSED written = 0;
860
  IADDR UNUSED pc = abuf->addr;
861
  SEM_BRANCH_INIT
862
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
863
 
864
{
865
((void) 0); /*nop*/
866
if (NEDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)))) {
867
  {
868
    UDI opval = CPU (h_tr[FLD (f_tra)]);
869
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
870
    written |= (1 << 3);
871
    TRACE_RESULT (current_cpu, abuf, "pc", 'D', opval);
872
  }
873
}
874
}
875
 
876
  abuf->written = written;
877
  SEM_BRANCH_FINI (vpc);
878
#undef FLD
879
}
880
  NEXT (vpc);
881
 
882
  CASE (sem, INSN_BRK) : /* brk */
883
{
884
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
885
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
886
#define FLD(f) abuf->fields.fmt_empty.f
887
  int UNUSED written = 0;
888
  IADDR UNUSED pc = abuf->addr;
889
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
890
 
891
sh64_break (current_cpu, pc);
892
 
893
#undef FLD
894
}
895
  NEXT (vpc);
896
 
897
  CASE (sem, INSN_BYTEREV) : /* byterev $rm, $rd */
898
{
899
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
900
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
901
#define FLD(f) abuf->fields.sfmt_xori.f
902
  int UNUSED written = 0;
903
  IADDR UNUSED pc = abuf->addr;
904
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
905
 
906
{
907
  DI tmp_source;
908
  DI tmp_result;
909
  tmp_source = GET_H_GR (FLD (f_left));
910
  tmp_result = 0;
911
{
912
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
913
  tmp_source = SRLDI (tmp_source, 8);
914
}
915
{
916
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
917
  tmp_source = SRLDI (tmp_source, 8);
918
}
919
{
920
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
921
  tmp_source = SRLDI (tmp_source, 8);
922
}
923
{
924
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
925
  tmp_source = SRLDI (tmp_source, 8);
926
}
927
{
928
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
929
  tmp_source = SRLDI (tmp_source, 8);
930
}
931
{
932
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
933
  tmp_source = SRLDI (tmp_source, 8);
934
}
935
{
936
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
937
  tmp_source = SRLDI (tmp_source, 8);
938
}
939
{
940
  tmp_result = ORDI (SLLDI (tmp_result, 8), ANDDI (tmp_source, 255));
941
  tmp_source = SRLDI (tmp_source, 8);
942
}
943
  {
944
    DI opval = tmp_result;
945
    SET_H_GR (FLD (f_dest), opval);
946
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
947
  }
948
}
949
 
950
#undef FLD
951
}
952
  NEXT (vpc);
953
 
954
  CASE (sem, INSN_CMPEQ) : /* cmpeq $rm, $rn, $rd */
955
{
956
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
957
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
958
#define FLD(f) abuf->fields.sfmt_add.f
959
  int UNUSED written = 0;
960
  IADDR UNUSED pc = abuf->addr;
961
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
962
 
963
  {
964
    DI opval = ((EQDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) ? (1) : (0));
965
    SET_H_GR (FLD (f_dest), opval);
966
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
967
  }
968
 
969
#undef FLD
970
}
971
  NEXT (vpc);
972
 
973
  CASE (sem, INSN_CMPGT) : /* cmpgt $rm, $rn, $rd */
974
{
975
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
976
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
977
#define FLD(f) abuf->fields.sfmt_add.f
978
  int UNUSED written = 0;
979
  IADDR UNUSED pc = abuf->addr;
980
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
981
 
982
  {
983
    DI opval = ((GTDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) ? (1) : (0));
984
    SET_H_GR (FLD (f_dest), opval);
985
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
986
  }
987
 
988
#undef FLD
989
}
990
  NEXT (vpc);
991
 
992
  CASE (sem, INSN_CMPGTU) : /* cmpgtu $rm,$rn, $rd */
993
{
994
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
995
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
996
#define FLD(f) abuf->fields.sfmt_add.f
997
  int UNUSED written = 0;
998
  IADDR UNUSED pc = abuf->addr;
999
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1000
 
1001
  {
1002
    DI opval = ((GTUDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))) ? (1) : (0));
1003
    SET_H_GR (FLD (f_dest), opval);
1004
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1005
  }
1006
 
1007
#undef FLD
1008
}
1009
  NEXT (vpc);
1010
 
1011
  CASE (sem, INSN_CMVEQ) : /* cmveq $rm, $rn, $rd */
1012
{
1013
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1014
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1015
#define FLD(f) abuf->fields.sfmt_add.f
1016
  int UNUSED written = 0;
1017
  IADDR UNUSED pc = abuf->addr;
1018
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1019
 
1020
if (EQDI (GET_H_GR (FLD (f_left)), 0)) {
1021
  {
1022
    DI opval = GET_H_GR (FLD (f_right));
1023
    SET_H_GR (FLD (f_dest), opval);
1024
    written |= (1 << 2);
1025
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1026
  }
1027
}
1028
 
1029
  abuf->written = written;
1030
#undef FLD
1031
}
1032
  NEXT (vpc);
1033
 
1034
  CASE (sem, INSN_CMVNE) : /* cmvne $rm, $rn, $rd */
1035
{
1036
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1037
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1038
#define FLD(f) abuf->fields.sfmt_add.f
1039
  int UNUSED written = 0;
1040
  IADDR UNUSED pc = abuf->addr;
1041
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1042
 
1043
if (NEDI (GET_H_GR (FLD (f_left)), 0)) {
1044
  {
1045
    DI opval = GET_H_GR (FLD (f_right));
1046
    SET_H_GR (FLD (f_dest), opval);
1047
    written |= (1 << 2);
1048
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1049
  }
1050
}
1051
 
1052
  abuf->written = written;
1053
#undef FLD
1054
}
1055
  NEXT (vpc);
1056
 
1057
  CASE (sem, INSN_FABSD) : /* fabs.d $drgh, $drf */
1058
{
1059
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1060
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1061
#define FLD(f) abuf->fields.sfmt_fabsd.f
1062
  int UNUSED written = 0;
1063
  IADDR UNUSED pc = abuf->addr;
1064
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1065
 
1066
  {
1067
    DF opval = sh64_fabsd (current_cpu, GET_H_DR (FLD (f_left_right)));
1068
    SET_H_DR (FLD (f_dest), opval);
1069
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1070
  }
1071
 
1072
#undef FLD
1073
}
1074
  NEXT (vpc);
1075
 
1076
  CASE (sem, INSN_FABSS) : /* fabs.s $frgh, $frf */
1077
{
1078
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1079
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1080
#define FLD(f) abuf->fields.sfmt_fabsd.f
1081
  int UNUSED written = 0;
1082
  IADDR UNUSED pc = abuf->addr;
1083
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1084
 
1085
  {
1086
    SF opval = sh64_fabss (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1087
    CPU (h_fr[FLD (f_dest)]) = opval;
1088
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1089
  }
1090
 
1091
#undef FLD
1092
}
1093
  NEXT (vpc);
1094
 
1095
  CASE (sem, INSN_FADDD) : /* fadd.d $drg, $drh, $drf */
1096
{
1097
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1098
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1099
#define FLD(f) abuf->fields.sfmt_add.f
1100
  int UNUSED written = 0;
1101
  IADDR UNUSED pc = abuf->addr;
1102
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1103
 
1104
  {
1105
    DF opval = sh64_faddd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
1106
    SET_H_DR (FLD (f_dest), opval);
1107
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1108
  }
1109
 
1110
#undef FLD
1111
}
1112
  NEXT (vpc);
1113
 
1114
  CASE (sem, INSN_FADDS) : /* fadd.s $frg, $frh, $frf */
1115
{
1116
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1117
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1118
#define FLD(f) abuf->fields.sfmt_add.f
1119
  int UNUSED written = 0;
1120
  IADDR UNUSED pc = abuf->addr;
1121
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1122
 
1123
  {
1124
    SF opval = sh64_fadds (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
1125
    CPU (h_fr[FLD (f_dest)]) = opval;
1126
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1127
  }
1128
 
1129
#undef FLD
1130
}
1131
  NEXT (vpc);
1132
 
1133
  CASE (sem, INSN_FCMPEQD) : /* fcmpeq.d $drg, $drh, $rd */
1134
{
1135
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1136
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1137
#define FLD(f) abuf->fields.sfmt_add.f
1138
  int UNUSED written = 0;
1139
  IADDR UNUSED pc = abuf->addr;
1140
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1141
 
1142
  {
1143
    DI opval = ZEXTBIDI (sh64_fcmpeqd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1144
    SET_H_GR (FLD (f_dest), opval);
1145
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1146
  }
1147
 
1148
#undef FLD
1149
}
1150
  NEXT (vpc);
1151
 
1152
  CASE (sem, INSN_FCMPEQS) : /* fcmpeq.s $frg, $frh, $rd */
1153
{
1154
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1155
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1156
#define FLD(f) abuf->fields.sfmt_add.f
1157
  int UNUSED written = 0;
1158
  IADDR UNUSED pc = abuf->addr;
1159
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1160
 
1161
  {
1162
    DI opval = ZEXTBIDI (sh64_fcmpeqs (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1163
    SET_H_GR (FLD (f_dest), opval);
1164
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1165
  }
1166
 
1167
#undef FLD
1168
}
1169
  NEXT (vpc);
1170
 
1171
  CASE (sem, INSN_FCMPGED) : /* fcmpge.d $drg, $drh, $rd */
1172
{
1173
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1174
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1175
#define FLD(f) abuf->fields.sfmt_add.f
1176
  int UNUSED written = 0;
1177
  IADDR UNUSED pc = abuf->addr;
1178
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1179
 
1180
  {
1181
    DI opval = ZEXTBIDI (sh64_fcmpged (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1182
    SET_H_GR (FLD (f_dest), opval);
1183
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1184
  }
1185
 
1186
#undef FLD
1187
}
1188
  NEXT (vpc);
1189
 
1190
  CASE (sem, INSN_FCMPGES) : /* fcmpge.s $frg, $frh, $rd */
1191
{
1192
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1193
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1194
#define FLD(f) abuf->fields.sfmt_add.f
1195
  int UNUSED written = 0;
1196
  IADDR UNUSED pc = abuf->addr;
1197
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1198
 
1199
  {
1200
    DI opval = ZEXTBIDI (sh64_fcmpges (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1201
    SET_H_GR (FLD (f_dest), opval);
1202
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1203
  }
1204
 
1205
#undef FLD
1206
}
1207
  NEXT (vpc);
1208
 
1209
  CASE (sem, INSN_FCMPGTD) : /* fcmpgt.d $drg, $drh, $rd */
1210
{
1211
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1212
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1213
#define FLD(f) abuf->fields.sfmt_add.f
1214
  int UNUSED written = 0;
1215
  IADDR UNUSED pc = abuf->addr;
1216
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1217
 
1218
  {
1219
    DI opval = ZEXTBIDI (sh64_fcmpgtd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1220
    SET_H_GR (FLD (f_dest), opval);
1221
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1222
  }
1223
 
1224
#undef FLD
1225
}
1226
  NEXT (vpc);
1227
 
1228
  CASE (sem, INSN_FCMPGTS) : /* fcmpgt.s $frg, $frh, $rd */
1229
{
1230
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1231
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1232
#define FLD(f) abuf->fields.sfmt_add.f
1233
  int UNUSED written = 0;
1234
  IADDR UNUSED pc = abuf->addr;
1235
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1236
 
1237
  {
1238
    DI opval = ZEXTBIDI (sh64_fcmpgts (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1239
    SET_H_GR (FLD (f_dest), opval);
1240
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1241
  }
1242
 
1243
#undef FLD
1244
}
1245
  NEXT (vpc);
1246
 
1247
  CASE (sem, INSN_FCMPUND) : /* fcmpun.d $drg, $drh, $rd */
1248
{
1249
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1250
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1251
#define FLD(f) abuf->fields.sfmt_add.f
1252
  int UNUSED written = 0;
1253
  IADDR UNUSED pc = abuf->addr;
1254
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1255
 
1256
  {
1257
    DI opval = ZEXTBIDI (sh64_fcmpund (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right))));
1258
    SET_H_GR (FLD (f_dest), opval);
1259
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1260
  }
1261
 
1262
#undef FLD
1263
}
1264
  NEXT (vpc);
1265
 
1266
  CASE (sem, INSN_FCMPUNS) : /* fcmpun.s $frg, $frh, $rd */
1267
{
1268
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1269
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1270
#define FLD(f) abuf->fields.sfmt_add.f
1271
  int UNUSED written = 0;
1272
  IADDR UNUSED pc = abuf->addr;
1273
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1274
 
1275
  {
1276
    DI opval = ZEXTBIDI (sh64_fcmpuns (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)])));
1277
    SET_H_GR (FLD (f_dest), opval);
1278
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1279
  }
1280
 
1281
#undef FLD
1282
}
1283
  NEXT (vpc);
1284
 
1285
  CASE (sem, INSN_FCNVDS) : /* fcnv.ds $drgh, $frf */
1286
{
1287
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1288
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1289
#define FLD(f) abuf->fields.sfmt_fabsd.f
1290
  int UNUSED written = 0;
1291
  IADDR UNUSED pc = abuf->addr;
1292
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1293
 
1294
  {
1295
    SF opval = sh64_fcnvds (current_cpu, GET_H_DR (FLD (f_left_right)));
1296
    CPU (h_fr[FLD (f_dest)]) = opval;
1297
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1298
  }
1299
 
1300
#undef FLD
1301
}
1302
  NEXT (vpc);
1303
 
1304
  CASE (sem, INSN_FCNVSD) : /* fcnv.sd $frgh, $drf */
1305
{
1306
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1307
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1308
#define FLD(f) abuf->fields.sfmt_fabsd.f
1309
  int UNUSED written = 0;
1310
  IADDR UNUSED pc = abuf->addr;
1311
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1312
 
1313
  {
1314
    DF opval = sh64_fcnvsd (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1315
    SET_H_DR (FLD (f_dest), opval);
1316
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1317
  }
1318
 
1319
#undef FLD
1320
}
1321
  NEXT (vpc);
1322
 
1323
  CASE (sem, INSN_FDIVD) : /* fdiv.d $drg, $drh, $drf */
1324
{
1325
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1326
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1327
#define FLD(f) abuf->fields.sfmt_add.f
1328
  int UNUSED written = 0;
1329
  IADDR UNUSED pc = abuf->addr;
1330
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1331
 
1332
  {
1333
    DF opval = sh64_fdivd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
1334
    SET_H_DR (FLD (f_dest), opval);
1335
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1336
  }
1337
 
1338
#undef FLD
1339
}
1340
  NEXT (vpc);
1341
 
1342
  CASE (sem, INSN_FDIVS) : /* fdiv.s $frg, $frh, $frf */
1343
{
1344
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1345
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1346
#define FLD(f) abuf->fields.sfmt_add.f
1347
  int UNUSED written = 0;
1348
  IADDR UNUSED pc = abuf->addr;
1349
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1350
 
1351
  {
1352
    SF opval = sh64_fdivs (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
1353
    CPU (h_fr[FLD (f_dest)]) = opval;
1354
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1355
  }
1356
 
1357
#undef FLD
1358
}
1359
  NEXT (vpc);
1360
 
1361
  CASE (sem, INSN_FGETSCR) : /* fgetscr $frf */
1362
{
1363
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1364
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1365
#define FLD(f) abuf->fields.sfmt_shori.f
1366
  int UNUSED written = 0;
1367
  IADDR UNUSED pc = abuf->addr;
1368
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1369
 
1370
  {
1371
    SF opval = SUBWORDSISF (CPU (h_fpscr));
1372
    CPU (h_fr[FLD (f_dest)]) = opval;
1373
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1374
  }
1375
 
1376
#undef FLD
1377
}
1378
  NEXT (vpc);
1379
 
1380
  CASE (sem, INSN_FIPRS) : /* fipr.s $fvg, $fvh, $frf */
1381
{
1382
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1383
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1384
#define FLD(f) abuf->fields.sfmt_add.f
1385
  int UNUSED written = 0;
1386
  IADDR UNUSED pc = abuf->addr;
1387
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1388
 
1389
{
1390
  {
1391
    SF opval = GET_H_FV (FLD (f_left));
1392
    SET_H_FV (FLD (f_left), opval);
1393
    TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
1394
  }
1395
  {
1396
    SF opval = GET_H_FV (FLD (f_right));
1397
    SET_H_FV (FLD (f_right), opval);
1398
    TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
1399
  }
1400
  {
1401
    SF opval = sh64_fiprs (current_cpu, FLD (f_left), FLD (f_right));
1402
    CPU (h_fr[FLD (f_dest)]) = opval;
1403
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1404
  }
1405
}
1406
 
1407
#undef FLD
1408
}
1409
  NEXT (vpc);
1410
 
1411
  CASE (sem, INSN_FLDD) : /* fld.d $rm, $disp10x8, $drf */
1412
{
1413
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1414
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1415
#define FLD(f) abuf->fields.sfmt_fldd.f
1416
  int UNUSED written = 0;
1417
  IADDR UNUSED pc = abuf->addr;
1418
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1419
 
1420
  {
1421
    DF opval = GETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x8)));
1422
    SET_H_DR (FLD (f_dest), opval);
1423
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1424
  }
1425
 
1426
#undef FLD
1427
}
1428
  NEXT (vpc);
1429
 
1430
  CASE (sem, INSN_FLDP) : /* fld.p $rm, $disp10x8, $fpf */
1431
{
1432
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1433
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1434
#define FLD(f) abuf->fields.sfmt_fldd.f
1435
  int UNUSED written = 0;
1436
  IADDR UNUSED pc = abuf->addr;
1437
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1438
 
1439
{
1440
  {
1441
    SF opval = GET_H_FP (FLD (f_dest));
1442
    SET_H_FP (FLD (f_dest), opval);
1443
    TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1444
  }
1445
sh64_fldp (current_cpu, pc, GET_H_GR (FLD (f_left)), FLD (f_disp10x8), FLD (f_dest));
1446
}
1447
 
1448
#undef FLD
1449
}
1450
  NEXT (vpc);
1451
 
1452
  CASE (sem, INSN_FLDS) : /* fld.s $rm, $disp10x4, $frf */
1453
{
1454
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1455
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1456
#define FLD(f) abuf->fields.sfmt_flds.f
1457
  int UNUSED written = 0;
1458
  IADDR UNUSED pc = abuf->addr;
1459
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1460
 
1461
  {
1462
    SF opval = GETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x4)));
1463
    CPU (h_fr[FLD (f_dest)]) = opval;
1464
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1465
  }
1466
 
1467
#undef FLD
1468
}
1469
  NEXT (vpc);
1470
 
1471
  CASE (sem, INSN_FLDXD) : /* fldx.d $rm, $rn, $drf */
1472
{
1473
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1474
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1475
#define FLD(f) abuf->fields.sfmt_add.f
1476
  int UNUSED written = 0;
1477
  IADDR UNUSED pc = abuf->addr;
1478
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1479
 
1480
  {
1481
    DF opval = GETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))));
1482
    SET_H_DR (FLD (f_dest), opval);
1483
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1484
  }
1485
 
1486
#undef FLD
1487
}
1488
  NEXT (vpc);
1489
 
1490
  CASE (sem, INSN_FLDXP) : /* fldx.p $rm, $rn, $fpf */
1491
{
1492
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1493
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1494
#define FLD(f) abuf->fields.sfmt_add.f
1495
  int UNUSED written = 0;
1496
  IADDR UNUSED pc = abuf->addr;
1497
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1498
 
1499
{
1500
  {
1501
    SF opval = GET_H_FP (FLD (f_dest));
1502
    SET_H_FP (FLD (f_dest), opval);
1503
    TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1504
  }
1505
sh64_fldp (current_cpu, pc, GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)), FLD (f_dest));
1506
}
1507
 
1508
#undef FLD
1509
}
1510
  NEXT (vpc);
1511
 
1512
  CASE (sem, INSN_FLDXS) : /* fldx.s $rm, $rn, $frf */
1513
{
1514
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1515
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1516
#define FLD(f) abuf->fields.sfmt_add.f
1517
  int UNUSED written = 0;
1518
  IADDR UNUSED pc = abuf->addr;
1519
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1520
 
1521
  {
1522
    SF opval = GETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))));
1523
    CPU (h_fr[FLD (f_dest)]) = opval;
1524
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1525
  }
1526
 
1527
#undef FLD
1528
}
1529
  NEXT (vpc);
1530
 
1531
  CASE (sem, INSN_FLOATLD) : /* float.ld $frgh, $drf */
1532
{
1533
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1534
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1535
#define FLD(f) abuf->fields.sfmt_fabsd.f
1536
  int UNUSED written = 0;
1537
  IADDR UNUSED pc = abuf->addr;
1538
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1539
 
1540
  {
1541
    DF opval = sh64_floatld (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1542
    SET_H_DR (FLD (f_dest), opval);
1543
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1544
  }
1545
 
1546
#undef FLD
1547
}
1548
  NEXT (vpc);
1549
 
1550
  CASE (sem, INSN_FLOATLS) : /* float.ls $frgh, $frf */
1551
{
1552
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1553
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1554
#define FLD(f) abuf->fields.sfmt_fabsd.f
1555
  int UNUSED written = 0;
1556
  IADDR UNUSED pc = abuf->addr;
1557
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1558
 
1559
  {
1560
    SF opval = sh64_floatls (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1561
    CPU (h_fr[FLD (f_dest)]) = opval;
1562
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1563
  }
1564
 
1565
#undef FLD
1566
}
1567
  NEXT (vpc);
1568
 
1569
  CASE (sem, INSN_FLOATQD) : /* float.qd $drgh, $drf */
1570
{
1571
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1572
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1573
#define FLD(f) abuf->fields.sfmt_fabsd.f
1574
  int UNUSED written = 0;
1575
  IADDR UNUSED pc = abuf->addr;
1576
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1577
 
1578
  {
1579
    DF opval = sh64_floatqd (current_cpu, GET_H_DR (FLD (f_left_right)));
1580
    SET_H_DR (FLD (f_dest), opval);
1581
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1582
  }
1583
 
1584
#undef FLD
1585
}
1586
  NEXT (vpc);
1587
 
1588
  CASE (sem, INSN_FLOATQS) : /* float.qs $drgh, $frf */
1589
{
1590
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1591
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1592
#define FLD(f) abuf->fields.sfmt_fabsd.f
1593
  int UNUSED written = 0;
1594
  IADDR UNUSED pc = abuf->addr;
1595
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1596
 
1597
  {
1598
    SF opval = sh64_floatqs (current_cpu, GET_H_DR (FLD (f_left_right)));
1599
    CPU (h_fr[FLD (f_dest)]) = opval;
1600
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1601
  }
1602
 
1603
#undef FLD
1604
}
1605
  NEXT (vpc);
1606
 
1607
  CASE (sem, INSN_FMACS) : /* fmac.s $frg, $frh, $frf */
1608
{
1609
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1610
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1611
#define FLD(f) abuf->fields.sfmt_add.f
1612
  int UNUSED written = 0;
1613
  IADDR UNUSED pc = abuf->addr;
1614
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1615
 
1616
  {
1617
    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)])));
1618
    CPU (h_fr[FLD (f_dest)]) = opval;
1619
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1620
  }
1621
 
1622
#undef FLD
1623
}
1624
  NEXT (vpc);
1625
 
1626
  CASE (sem, INSN_FMOVD) : /* fmov.d $drgh, $drf */
1627
{
1628
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1629
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1630
#define FLD(f) abuf->fields.sfmt_fabsd.f
1631
  int UNUSED written = 0;
1632
  IADDR UNUSED pc = abuf->addr;
1633
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1634
 
1635
  {
1636
    DF opval = GET_H_DR (FLD (f_left_right));
1637
    SET_H_DR (FLD (f_dest), opval);
1638
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1639
  }
1640
 
1641
#undef FLD
1642
}
1643
  NEXT (vpc);
1644
 
1645
  CASE (sem, INSN_FMOVDQ) : /* fmov.dq $drgh, $rd */
1646
{
1647
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1648
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1649
#define FLD(f) abuf->fields.sfmt_fabsd.f
1650
  int UNUSED written = 0;
1651
  IADDR UNUSED pc = abuf->addr;
1652
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1653
 
1654
  {
1655
    DI opval = SUBWORDDFDI (GET_H_DR (FLD (f_left_right)));
1656
    SET_H_GR (FLD (f_dest), opval);
1657
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1658
  }
1659
 
1660
#undef FLD
1661
}
1662
  NEXT (vpc);
1663
 
1664
  CASE (sem, INSN_FMOVLS) : /* fmov.ls $rm, $frf */
1665
{
1666
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1667
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1668
#define FLD(f) abuf->fields.sfmt_xori.f
1669
  int UNUSED written = 0;
1670
  IADDR UNUSED pc = abuf->addr;
1671
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1672
 
1673
  {
1674
    SF opval = SUBWORDSISF (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1));
1675
    CPU (h_fr[FLD (f_dest)]) = opval;
1676
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1677
  }
1678
 
1679
#undef FLD
1680
}
1681
  NEXT (vpc);
1682
 
1683
  CASE (sem, INSN_FMOVQD) : /* fmov.qd $rm, $drf */
1684
{
1685
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1686
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1687
#define FLD(f) abuf->fields.sfmt_xori.f
1688
  int UNUSED written = 0;
1689
  IADDR UNUSED pc = abuf->addr;
1690
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1691
 
1692
  {
1693
    DF opval = SUBWORDDIDF (GET_H_GR (FLD (f_left)));
1694
    SET_H_DR (FLD (f_dest), opval);
1695
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1696
  }
1697
 
1698
#undef FLD
1699
}
1700
  NEXT (vpc);
1701
 
1702
  CASE (sem, INSN_FMOVS) : /* fmov.s $frgh, $frf */
1703
{
1704
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1705
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1706
#define FLD(f) abuf->fields.sfmt_fabsd.f
1707
  int UNUSED written = 0;
1708
  IADDR UNUSED pc = abuf->addr;
1709
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1710
 
1711
  {
1712
    SF opval = CPU (h_fr[FLD (f_left_right)]);
1713
    CPU (h_fr[FLD (f_dest)]) = opval;
1714
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1715
  }
1716
 
1717
#undef FLD
1718
}
1719
  NEXT (vpc);
1720
 
1721
  CASE (sem, INSN_FMOVSL) : /* fmov.sl $frgh, $rd */
1722
{
1723
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1724
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1725
#define FLD(f) abuf->fields.sfmt_fabsd.f
1726
  int UNUSED written = 0;
1727
  IADDR UNUSED pc = abuf->addr;
1728
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1729
 
1730
  {
1731
    DI opval = EXTSIDI (SUBWORDSFSI (CPU (h_fr[FLD (f_left_right)])));
1732
    SET_H_GR (FLD (f_dest), opval);
1733
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
1734
  }
1735
 
1736
#undef FLD
1737
}
1738
  NEXT (vpc);
1739
 
1740
  CASE (sem, INSN_FMULD) : /* fmul.d $drg, $drh, $drf */
1741
{
1742
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1743
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1744
#define FLD(f) abuf->fields.sfmt_add.f
1745
  int UNUSED written = 0;
1746
  IADDR UNUSED pc = abuf->addr;
1747
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1748
 
1749
  {
1750
    DF opval = sh64_fmuld (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
1751
    SET_H_DR (FLD (f_dest), opval);
1752
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1753
  }
1754
 
1755
#undef FLD
1756
}
1757
  NEXT (vpc);
1758
 
1759
  CASE (sem, INSN_FMULS) : /* fmul.s $frg, $frh, $frf */
1760
{
1761
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1762
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1763
#define FLD(f) abuf->fields.sfmt_add.f
1764
  int UNUSED written = 0;
1765
  IADDR UNUSED pc = abuf->addr;
1766
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1767
 
1768
  {
1769
    SF opval = sh64_fmuls (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
1770
    CPU (h_fr[FLD (f_dest)]) = opval;
1771
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1772
  }
1773
 
1774
#undef FLD
1775
}
1776
  NEXT (vpc);
1777
 
1778
  CASE (sem, INSN_FNEGD) : /* fneg.d $drgh, $drf */
1779
{
1780
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1781
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1782
#define FLD(f) abuf->fields.sfmt_fabsd.f
1783
  int UNUSED written = 0;
1784
  IADDR UNUSED pc = abuf->addr;
1785
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1786
 
1787
  {
1788
    DF opval = sh64_fnegd (current_cpu, GET_H_DR (FLD (f_left_right)));
1789
    SET_H_DR (FLD (f_dest), opval);
1790
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1791
  }
1792
 
1793
#undef FLD
1794
}
1795
  NEXT (vpc);
1796
 
1797
  CASE (sem, INSN_FNEGS) : /* fneg.s $frgh, $frf */
1798
{
1799
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1800
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1801
#define FLD(f) abuf->fields.sfmt_fabsd.f
1802
  int UNUSED written = 0;
1803
  IADDR UNUSED pc = abuf->addr;
1804
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1805
 
1806
  {
1807
    SF opval = sh64_fnegs (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1808
    CPU (h_fr[FLD (f_dest)]) = opval;
1809
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1810
  }
1811
 
1812
#undef FLD
1813
}
1814
  NEXT (vpc);
1815
 
1816
  CASE (sem, INSN_FPUTSCR) : /* fputscr $frgh */
1817
{
1818
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1819
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1820
#define FLD(f) abuf->fields.sfmt_fabsd.f
1821
  int UNUSED written = 0;
1822
  IADDR UNUSED pc = abuf->addr;
1823
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1824
 
1825
  {
1826
    SI opval = SUBWORDSFSI (CPU (h_fr[FLD (f_left_right)]));
1827
    CPU (h_fpscr) = opval;
1828
    TRACE_RESULT (current_cpu, abuf, "fpscr", 'x', opval);
1829
  }
1830
 
1831
#undef FLD
1832
}
1833
  NEXT (vpc);
1834
 
1835
  CASE (sem, INSN_FSQRTD) : /* fsqrt.d $drgh, $drf */
1836
{
1837
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1838
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1839
#define FLD(f) abuf->fields.sfmt_fabsd.f
1840
  int UNUSED written = 0;
1841
  IADDR UNUSED pc = abuf->addr;
1842
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1843
 
1844
  {
1845
    DF opval = sh64_fsqrtd (current_cpu, GET_H_DR (FLD (f_left_right)));
1846
    SET_H_DR (FLD (f_dest), opval);
1847
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
1848
  }
1849
 
1850
#undef FLD
1851
}
1852
  NEXT (vpc);
1853
 
1854
  CASE (sem, INSN_FSQRTS) : /* fsqrt.s $frgh, $frf */
1855
{
1856
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1857
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1858
#define FLD(f) abuf->fields.sfmt_fabsd.f
1859
  int UNUSED written = 0;
1860
  IADDR UNUSED pc = abuf->addr;
1861
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1862
 
1863
  {
1864
    SF opval = sh64_fsqrts (current_cpu, CPU (h_fr[FLD (f_left_right)]));
1865
    CPU (h_fr[FLD (f_dest)]) = opval;
1866
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
1867
  }
1868
 
1869
#undef FLD
1870
}
1871
  NEXT (vpc);
1872
 
1873
  CASE (sem, INSN_FSTD) : /* fst.d $rm, $disp10x8, $drf */
1874
{
1875
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1876
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1877
#define FLD(f) abuf->fields.sfmt_fldd.f
1878
  int UNUSED written = 0;
1879
  IADDR UNUSED pc = abuf->addr;
1880
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1881
 
1882
  {
1883
    DF opval = GET_H_DR (FLD (f_dest));
1884
    SETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x8)), opval);
1885
    TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1886
  }
1887
 
1888
#undef FLD
1889
}
1890
  NEXT (vpc);
1891
 
1892
  CASE (sem, INSN_FSTP) : /* fst.p $rm, $disp10x8, $fpf */
1893
{
1894
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1895
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1896
#define FLD(f) abuf->fields.sfmt_fldd.f
1897
  int UNUSED written = 0;
1898
  IADDR UNUSED pc = abuf->addr;
1899
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1900
 
1901
{
1902
  {
1903
    SF opval = GET_H_FP (FLD (f_dest));
1904
    SET_H_FP (FLD (f_dest), opval);
1905
    TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1906
  }
1907
sh64_fstp (current_cpu, pc, GET_H_GR (FLD (f_left)), FLD (f_disp10x8), FLD (f_dest));
1908
}
1909
 
1910
#undef FLD
1911
}
1912
  NEXT (vpc);
1913
 
1914
  CASE (sem, INSN_FSTS) : /* fst.s $rm, $disp10x4, $frf */
1915
{
1916
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1917
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1918
#define FLD(f) abuf->fields.sfmt_flds.f
1919
  int UNUSED written = 0;
1920
  IADDR UNUSED pc = abuf->addr;
1921
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1922
 
1923
  {
1924
    SF opval = CPU (h_fr[FLD (f_dest)]);
1925
    SETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp10x4)), opval);
1926
    TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1927
  }
1928
 
1929
#undef FLD
1930
}
1931
  NEXT (vpc);
1932
 
1933
  CASE (sem, INSN_FSTXD) : /* fstx.d $rm, $rn, $drf */
1934
{
1935
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1936
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1937
#define FLD(f) abuf->fields.sfmt_add.f
1938
  int UNUSED written = 0;
1939
  IADDR UNUSED pc = abuf->addr;
1940
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1941
 
1942
  {
1943
    DF opval = GET_H_DR (FLD (f_dest));
1944
    SETMEMDF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
1945
    TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1946
  }
1947
 
1948
#undef FLD
1949
}
1950
  NEXT (vpc);
1951
 
1952
  CASE (sem, INSN_FSTXP) : /* fstx.p $rm, $rn, $fpf */
1953
{
1954
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1955
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1956
#define FLD(f) abuf->fields.sfmt_add.f
1957
  int UNUSED written = 0;
1958
  IADDR UNUSED pc = abuf->addr;
1959
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1960
 
1961
{
1962
  {
1963
    SF opval = GET_H_FP (FLD (f_dest));
1964
    SET_H_FP (FLD (f_dest), opval);
1965
    TRACE_RESULT (current_cpu, abuf, "fp", 'f', opval);
1966
  }
1967
sh64_fstp (current_cpu, pc, GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)), FLD (f_dest));
1968
}
1969
 
1970
#undef FLD
1971
}
1972
  NEXT (vpc);
1973
 
1974
  CASE (sem, INSN_FSTXS) : /* fstx.s $rm, $rn, $frf */
1975
{
1976
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1977
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1978
#define FLD(f) abuf->fields.sfmt_add.f
1979
  int UNUSED written = 0;
1980
  IADDR UNUSED pc = abuf->addr;
1981
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1982
 
1983
  {
1984
    SF opval = CPU (h_fr[FLD (f_dest)]);
1985
    SETMEMSF (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
1986
    TRACE_RESULT (current_cpu, abuf, "memory", 'f', opval);
1987
  }
1988
 
1989
#undef FLD
1990
}
1991
  NEXT (vpc);
1992
 
1993
  CASE (sem, INSN_FSUBD) : /* fsub.d $drg, $drh, $drf */
1994
{
1995
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1996
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1997
#define FLD(f) abuf->fields.sfmt_add.f
1998
  int UNUSED written = 0;
1999
  IADDR UNUSED pc = abuf->addr;
2000
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2001
 
2002
  {
2003
    DF opval = sh64_fsubd (current_cpu, GET_H_DR (FLD (f_left)), GET_H_DR (FLD (f_right)));
2004
    SET_H_DR (FLD (f_dest), opval);
2005
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
2006
  }
2007
 
2008
#undef FLD
2009
}
2010
  NEXT (vpc);
2011
 
2012
  CASE (sem, INSN_FSUBS) : /* fsub.s $frg, $frh, $frf */
2013
{
2014
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2015
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2016
#define FLD(f) abuf->fields.sfmt_add.f
2017
  int UNUSED written = 0;
2018
  IADDR UNUSED pc = abuf->addr;
2019
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2020
 
2021
  {
2022
    SF opval = sh64_fsubs (current_cpu, CPU (h_fr[FLD (f_left)]), CPU (h_fr[FLD (f_right)]));
2023
    CPU (h_fr[FLD (f_dest)]) = opval;
2024
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
2025
  }
2026
 
2027
#undef FLD
2028
}
2029
  NEXT (vpc);
2030
 
2031
  CASE (sem, INSN_FTRCDL) : /* ftrc.dl $drgh, $frf */
2032
{
2033
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2034
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2035
#define FLD(f) abuf->fields.sfmt_fabsd.f
2036
  int UNUSED written = 0;
2037
  IADDR UNUSED pc = abuf->addr;
2038
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2039
 
2040
  {
2041
    SF opval = sh64_ftrcdl (current_cpu, GET_H_DR (FLD (f_left_right)));
2042
    CPU (h_fr[FLD (f_dest)]) = opval;
2043
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
2044
  }
2045
 
2046
#undef FLD
2047
}
2048
  NEXT (vpc);
2049
 
2050
  CASE (sem, INSN_FTRCSL) : /* ftrc.sl $frgh, $frf */
2051
{
2052
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2053
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2054
#define FLD(f) abuf->fields.sfmt_fabsd.f
2055
  int UNUSED written = 0;
2056
  IADDR UNUSED pc = abuf->addr;
2057
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2058
 
2059
  {
2060
    SF opval = sh64_ftrcsl (current_cpu, CPU (h_fr[FLD (f_left_right)]));
2061
    CPU (h_fr[FLD (f_dest)]) = opval;
2062
    TRACE_RESULT (current_cpu, abuf, "fr", 'f', opval);
2063
  }
2064
 
2065
#undef FLD
2066
}
2067
  NEXT (vpc);
2068
 
2069
  CASE (sem, INSN_FTRCDQ) : /* ftrc.dq $drgh, $drf */
2070
{
2071
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2072
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2073
#define FLD(f) abuf->fields.sfmt_fabsd.f
2074
  int UNUSED written = 0;
2075
  IADDR UNUSED pc = abuf->addr;
2076
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2077
 
2078
  {
2079
    DF opval = sh64_ftrcdq (current_cpu, GET_H_DR (FLD (f_left_right)));
2080
    SET_H_DR (FLD (f_dest), opval);
2081
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
2082
  }
2083
 
2084
#undef FLD
2085
}
2086
  NEXT (vpc);
2087
 
2088
  CASE (sem, INSN_FTRCSQ) : /* ftrc.sq $frgh, $drf */
2089
{
2090
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2091
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2092
#define FLD(f) abuf->fields.sfmt_fabsd.f
2093
  int UNUSED written = 0;
2094
  IADDR UNUSED pc = abuf->addr;
2095
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2096
 
2097
  {
2098
    DF opval = sh64_ftrcsq (current_cpu, CPU (h_fr[FLD (f_left_right)]));
2099
    SET_H_DR (FLD (f_dest), opval);
2100
    TRACE_RESULT (current_cpu, abuf, "dr", 'f', opval);
2101
  }
2102
 
2103
#undef FLD
2104
}
2105
  NEXT (vpc);
2106
 
2107
  CASE (sem, INSN_FTRVS) : /* ftrv.s $mtrxg, $fvh, $fvf */
2108
{
2109
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2110
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2111
#define FLD(f) abuf->fields.sfmt_add.f
2112
  int UNUSED written = 0;
2113
  IADDR UNUSED pc = abuf->addr;
2114
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2115
 
2116
{
2117
  {
2118
    SF opval = GET_H_FMTX (FLD (f_left));
2119
    SET_H_FMTX (FLD (f_left), opval);
2120
    TRACE_RESULT (current_cpu, abuf, "fmtx", 'f', opval);
2121
  }
2122
  {
2123
    SF opval = GET_H_FV (FLD (f_right));
2124
    SET_H_FV (FLD (f_right), opval);
2125
    TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
2126
  }
2127
  {
2128
    SF opval = GET_H_FV (FLD (f_dest));
2129
    SET_H_FV (FLD (f_dest), opval);
2130
    TRACE_RESULT (current_cpu, abuf, "fv", 'f', opval);
2131
  }
2132
sh64_ftrvs (current_cpu, FLD (f_left), FLD (f_right), FLD (f_dest));
2133
}
2134
 
2135
#undef FLD
2136
}
2137
  NEXT (vpc);
2138
 
2139
  CASE (sem, INSN_GETCFG) : /* getcfg $rm, $disp6, $rd */
2140
{
2141
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2142
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2143
#define FLD(f) abuf->fields.sfmt_getcfg.f
2144
  int UNUSED written = 0;
2145
  IADDR UNUSED pc = abuf->addr;
2146
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2147
 
2148
{
2149
  SI tmp_address;
2150
  tmp_address = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2151
((void) 0); /*nop*/
2152
  {
2153
    DI opval = GETMEMSI (current_cpu, pc, tmp_address);
2154
    SET_H_GR (FLD (f_dest), opval);
2155
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2156
  }
2157
}
2158
 
2159
#undef FLD
2160
}
2161
  NEXT (vpc);
2162
 
2163
  CASE (sem, INSN_GETCON) : /* getcon $crk, $rd */
2164
{
2165
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2166
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2167
#define FLD(f) abuf->fields.sfmt_xori.f
2168
  int UNUSED written = 0;
2169
  IADDR UNUSED pc = abuf->addr;
2170
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2171
 
2172
  {
2173
    DI opval = GET_H_CR (FLD (f_left));
2174
    SET_H_GR (FLD (f_dest), opval);
2175
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2176
  }
2177
 
2178
#undef FLD
2179
}
2180
  NEXT (vpc);
2181
 
2182
  CASE (sem, INSN_GETTR) : /* gettr $trb, $rd */
2183
{
2184
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2185
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2186
#define FLD(f) abuf->fields.sfmt_blink.f
2187
  int UNUSED written = 0;
2188
  IADDR UNUSED pc = abuf->addr;
2189
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2190
 
2191
  {
2192
    DI opval = CPU (h_tr[FLD (f_trb)]);
2193
    SET_H_GR (FLD (f_dest), opval);
2194
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2195
  }
2196
 
2197
#undef FLD
2198
}
2199
  NEXT (vpc);
2200
 
2201
  CASE (sem, INSN_ICBI) : /* icbi $rm, $disp6x32 */
2202
{
2203
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2204
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2205
#define FLD(f) abuf->fields.sfmt_xori.f
2206
  int UNUSED written = 0;
2207
  IADDR UNUSED pc = abuf->addr;
2208
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2209
 
2210
{
2211
  {
2212
    DI opval = GET_H_GR (FLD (f_left));
2213
    SET_H_GR (FLD (f_left), opval);
2214
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2215
  }
2216
((void) 0); /*nop*/
2217
}
2218
 
2219
#undef FLD
2220
}
2221
  NEXT (vpc);
2222
 
2223
  CASE (sem, INSN_LDB) : /* ld.b $rm, $disp10, $rd */
2224
{
2225
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2226
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2227
#define FLD(f) abuf->fields.sfmt_addi.f
2228
  int UNUSED written = 0;
2229
  IADDR UNUSED pc = abuf->addr;
2230
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2231
 
2232
  {
2233
    DI opval = EXTQIDI (GETMEMQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)))));
2234
    SET_H_GR (FLD (f_dest), opval);
2235
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2236
  }
2237
 
2238
#undef FLD
2239
}
2240
  NEXT (vpc);
2241
 
2242
  CASE (sem, INSN_LDL) : /* ld.l $rm, $disp10x4, $rd */
2243
{
2244
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2245
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2246
#define FLD(f) abuf->fields.sfmt_flds.f
2247
  int UNUSED written = 0;
2248
  IADDR UNUSED pc = abuf->addr;
2249
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2250
 
2251
  {
2252
    DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x4)))));
2253
    SET_H_GR (FLD (f_dest), opval);
2254
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2255
  }
2256
 
2257
#undef FLD
2258
}
2259
  NEXT (vpc);
2260
 
2261
  CASE (sem, INSN_LDQ) : /* ld.q $rm, $disp10x8, $rd */
2262
{
2263
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2264
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2265
#define FLD(f) abuf->fields.sfmt_fldd.f
2266
  int UNUSED written = 0;
2267
  IADDR UNUSED pc = abuf->addr;
2268
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2269
 
2270
  {
2271
    DI opval = GETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x8))));
2272
    SET_H_GR (FLD (f_dest), opval);
2273
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2274
  }
2275
 
2276
#undef FLD
2277
}
2278
  NEXT (vpc);
2279
 
2280
  CASE (sem, INSN_LDUB) : /* ld.ub $rm, $disp10, $rd */
2281
{
2282
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2283
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2284
#define FLD(f) abuf->fields.sfmt_addi.f
2285
  int UNUSED written = 0;
2286
  IADDR UNUSED pc = abuf->addr;
2287
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2288
 
2289
  {
2290
    DI opval = ZEXTQIDI (GETMEMQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10)))));
2291
    SET_H_GR (FLD (f_dest), opval);
2292
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2293
  }
2294
 
2295
#undef FLD
2296
}
2297
  NEXT (vpc);
2298
 
2299
  CASE (sem, INSN_LDUW) : /* ld.uw $rm, $disp10x2, $rd */
2300
{
2301
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2302
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2303
#define FLD(f) abuf->fields.sfmt_lduw.f
2304
  int UNUSED written = 0;
2305
  IADDR UNUSED pc = abuf->addr;
2306
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2307
 
2308
  {
2309
    DI opval = ZEXTHIDI (GETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x2)))));
2310
    SET_H_GR (FLD (f_dest), opval);
2311
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2312
  }
2313
 
2314
#undef FLD
2315
}
2316
  NEXT (vpc);
2317
 
2318
  CASE (sem, INSN_LDW) : /* ld.w $rm, $disp10x2, $rd */
2319
{
2320
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2321
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2322
#define FLD(f) abuf->fields.sfmt_lduw.f
2323
  int UNUSED written = 0;
2324
  IADDR UNUSED pc = abuf->addr;
2325
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2326
 
2327
  {
2328
    DI opval = EXTHIDI (GETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x2)))));
2329
    SET_H_GR (FLD (f_dest), opval);
2330
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2331
  }
2332
 
2333
#undef FLD
2334
}
2335
  NEXT (vpc);
2336
 
2337
  CASE (sem, INSN_LDHIL) : /* ldhi.l $rm, $disp6, $rd */
2338
{
2339
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2340
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2341
#define FLD(f) abuf->fields.sfmt_getcfg.f
2342
  int UNUSED written = 0;
2343
  IADDR UNUSED pc = abuf->addr;
2344
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2345
 
2346
{
2347
  DI tmp_addr;
2348
  QI tmp_bytecount;
2349
  SI tmp_val;
2350
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2351
  tmp_bytecount = ADDDI (ANDDI (tmp_addr, 3), 1);
2352
  tmp_val = 0;
2353
if (ANDQI (tmp_bytecount, 4)) {
2354
  {
2355
    DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -4)));
2356
    SET_H_GR (FLD (f_dest), opval);
2357
    written |= (1 << 6);
2358
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2359
  }
2360
} else {
2361
if (GET_H_ENDIAN ()) {
2362
{
2363
if (ANDQI (tmp_bytecount, 2)) {
2364
  tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2365
}
2366
if (ANDQI (tmp_bytecount, 1)) {
2367
  tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2368
}
2369
  {
2370
    DI opval = EXTSIDI (tmp_val);
2371
    SET_H_GR (FLD (f_dest), opval);
2372
    written |= (1 << 6);
2373
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2374
  }
2375
}
2376
} else {
2377
{
2378
if (ANDQI (tmp_bytecount, 1)) {
2379
  tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2380
}
2381
if (ANDQI (tmp_bytecount, 2)) {
2382
  tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2383
}
2384
  {
2385
    DI opval = EXTSIDI (SLLSI (tmp_val, SUBSI (32, MULSI (8, tmp_bytecount))));
2386
    SET_H_GR (FLD (f_dest), opval);
2387
    written |= (1 << 6);
2388
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2389
  }
2390
}
2391
}
2392
}
2393
}
2394
 
2395
  abuf->written = written;
2396
#undef FLD
2397
}
2398
  NEXT (vpc);
2399
 
2400
  CASE (sem, INSN_LDHIQ) : /* ldhi.q $rm, $disp6, $rd */
2401
{
2402
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2403
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2404
#define FLD(f) abuf->fields.sfmt_getcfg.f
2405
  int UNUSED written = 0;
2406
  IADDR UNUSED pc = abuf->addr;
2407
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2408
 
2409
{
2410
  DI tmp_addr;
2411
  QI tmp_bytecount;
2412
  DI tmp_val;
2413
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2414
  tmp_bytecount = ADDDI (ANDDI (tmp_addr, 7), 1);
2415
  tmp_val = 0;
2416
if (ANDQI (tmp_bytecount, 8)) {
2417
  {
2418
    DI opval = GETMEMDI (current_cpu, pc, ANDDI (tmp_addr, -8));
2419
    SET_H_GR (FLD (f_dest), opval);
2420
    written |= (1 << 7);
2421
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2422
  }
2423
} else {
2424
if (GET_H_ENDIAN ()) {
2425
{
2426
if (ANDQI (tmp_bytecount, 4)) {
2427
  tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8))));
2428
}
2429
if (ANDQI (tmp_bytecount, 2)) {
2430
  tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2431
}
2432
if (ANDQI (tmp_bytecount, 1)) {
2433
  tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2434
}
2435
  {
2436
    DI opval = tmp_val;
2437
    SET_H_GR (FLD (f_dest), opval);
2438
    written |= (1 << 7);
2439
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2440
  }
2441
}
2442
} else {
2443
{
2444
if (ANDQI (tmp_bytecount, 1)) {
2445
  tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2446
}
2447
if (ANDQI (tmp_bytecount, 2)) {
2448
  tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4))));
2449
}
2450
if (ANDQI (tmp_bytecount, 4)) {
2451
  tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8))));
2452
}
2453
  {
2454
    DI opval = SLLDI (tmp_val, SUBSI (64, MULSI (8, tmp_bytecount)));
2455
    SET_H_GR (FLD (f_dest), opval);
2456
    written |= (1 << 7);
2457
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2458
  }
2459
}
2460
}
2461
}
2462
}
2463
 
2464
  abuf->written = written;
2465
#undef FLD
2466
}
2467
  NEXT (vpc);
2468
 
2469
  CASE (sem, INSN_LDLOL) : /* ldlo.l $rm, $disp6, $rd */
2470
{
2471
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2472
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2473
#define FLD(f) abuf->fields.sfmt_getcfg.f
2474
  int UNUSED written = 0;
2475
  IADDR UNUSED pc = abuf->addr;
2476
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2477
 
2478
{
2479
  DI tmp_addr;
2480
  QI tmp_bytecount;
2481
  SI tmp_val;
2482
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2483
  tmp_bytecount = SUBSI (4, ANDDI (tmp_addr, 3));
2484
  tmp_val = 0;
2485
if (ANDQI (tmp_bytecount, 4)) {
2486
  {
2487
    DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, tmp_addr));
2488
    SET_H_GR (FLD (f_dest), opval);
2489
    written |= (1 << 6);
2490
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2491
  }
2492
} else {
2493
if (GET_H_ENDIAN ()) {
2494
{
2495
if (ANDQI (tmp_bytecount, 1)) {
2496
  tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2497
}
2498
if (ANDQI (tmp_bytecount, 2)) {
2499
  tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2500
}
2501
  {
2502
    DI opval = EXTSIDI (SLLSI (tmp_val, SUBSI (32, MULSI (8, tmp_bytecount))));
2503
    SET_H_GR (FLD (f_dest), opval);
2504
    written |= (1 << 6);
2505
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2506
  }
2507
}
2508
} else {
2509
{
2510
if (ANDQI (tmp_bytecount, 2)) {
2511
  tmp_val = ADDSI (SLLSI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2512
}
2513
if (ANDQI (tmp_bytecount, 1)) {
2514
  tmp_val = ADDSI (SLLSI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2515
}
2516
  {
2517
    DI opval = EXTSIDI (tmp_val);
2518
    SET_H_GR (FLD (f_dest), opval);
2519
    written |= (1 << 6);
2520
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2521
  }
2522
}
2523
}
2524
}
2525
}
2526
 
2527
  abuf->written = written;
2528
#undef FLD
2529
}
2530
  NEXT (vpc);
2531
 
2532
  CASE (sem, INSN_LDLOQ) : /* ldlo.q $rm, $disp6, $rd */
2533
{
2534
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2535
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2536
#define FLD(f) abuf->fields.sfmt_getcfg.f
2537
  int UNUSED written = 0;
2538
  IADDR UNUSED pc = abuf->addr;
2539
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2540
 
2541
{
2542
  DI tmp_addr;
2543
  QI tmp_bytecount;
2544
  DI tmp_val;
2545
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
2546
  tmp_bytecount = SUBSI (8, ANDDI (tmp_addr, 7));
2547
  tmp_val = 0;
2548
if (ANDQI (tmp_bytecount, 8)) {
2549
  {
2550
    DI opval = GETMEMDI (current_cpu, pc, tmp_addr);
2551
    SET_H_GR (FLD (f_dest), opval);
2552
    written |= (1 << 7);
2553
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2554
  }
2555
} else {
2556
if (GET_H_ENDIAN ()) {
2557
{
2558
if (ANDQI (tmp_bytecount, 1)) {
2559
  tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2560
}
2561
if (ANDQI (tmp_bytecount, 2)) {
2562
  tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2563
}
2564
if (ANDQI (tmp_bytecount, 4)) {
2565
  tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4))));
2566
}
2567
  {
2568
    DI opval = SLLDI (tmp_val, SUBSI (64, MULSI (8, tmp_bytecount)));
2569
    SET_H_GR (FLD (f_dest), opval);
2570
    written |= (1 << 7);
2571
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2572
  }
2573
}
2574
} else {
2575
{
2576
if (ANDQI (tmp_bytecount, 4)) {
2577
  tmp_val = ADDDI (SLLDI (tmp_val, 32), ZEXTSIDI (GETMEMSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4))));
2578
}
2579
if (ANDQI (tmp_bytecount, 2)) {
2580
  tmp_val = ADDDI (SLLDI (tmp_val, 16), ZEXTHIDI (GETMEMHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2))));
2581
}
2582
if (ANDQI (tmp_bytecount, 1)) {
2583
  tmp_val = ADDDI (SLLDI (tmp_val, 8), ZEXTQIDI (GETMEMQI (current_cpu, pc, tmp_addr)));
2584
}
2585
  {
2586
    DI opval = tmp_val;
2587
    SET_H_GR (FLD (f_dest), opval);
2588
    written |= (1 << 7);
2589
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2590
  }
2591
}
2592
}
2593
}
2594
}
2595
 
2596
  abuf->written = written;
2597
#undef FLD
2598
}
2599
  NEXT (vpc);
2600
 
2601
  CASE (sem, INSN_LDXB) : /* ldx.b $rm, $rn, $rd */
2602
{
2603
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2604
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2605
#define FLD(f) abuf->fields.sfmt_add.f
2606
  int UNUSED written = 0;
2607
  IADDR UNUSED pc = abuf->addr;
2608
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2609
 
2610
  {
2611
    DI opval = EXTQIDI (GETMEMQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2612
    SET_H_GR (FLD (f_dest), opval);
2613
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2614
  }
2615
 
2616
#undef FLD
2617
}
2618
  NEXT (vpc);
2619
 
2620
  CASE (sem, INSN_LDXL) : /* ldx.l $rm, $rn, $rd */
2621
{
2622
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2623
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2624
#define FLD(f) abuf->fields.sfmt_add.f
2625
  int UNUSED written = 0;
2626
  IADDR UNUSED pc = abuf->addr;
2627
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2628
 
2629
  {
2630
    DI opval = EXTSIDI (GETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2631
    SET_H_GR (FLD (f_dest), opval);
2632
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2633
  }
2634
 
2635
#undef FLD
2636
}
2637
  NEXT (vpc);
2638
 
2639
  CASE (sem, INSN_LDXQ) : /* ldx.q $rm, $rn, $rd */
2640
{
2641
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2642
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2643
#define FLD(f) abuf->fields.sfmt_add.f
2644
  int UNUSED written = 0;
2645
  IADDR UNUSED pc = abuf->addr;
2646
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2647
 
2648
  {
2649
    DI opval = GETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))));
2650
    SET_H_GR (FLD (f_dest), opval);
2651
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2652
  }
2653
 
2654
#undef FLD
2655
}
2656
  NEXT (vpc);
2657
 
2658
  CASE (sem, INSN_LDXUB) : /* ldx.ub $rm, $rn, $rd */
2659
{
2660
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2661
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2662
#define FLD(f) abuf->fields.sfmt_add.f
2663
  int UNUSED written = 0;
2664
  IADDR UNUSED pc = abuf->addr;
2665
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2666
 
2667
  {
2668
    DI opval = ZEXTQIDI (GETMEMUQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2669
    SET_H_GR (FLD (f_dest), opval);
2670
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2671
  }
2672
 
2673
#undef FLD
2674
}
2675
  NEXT (vpc);
2676
 
2677
  CASE (sem, INSN_LDXUW) : /* ldx.uw $rm, $rn, $rd */
2678
{
2679
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2680
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2681
#define FLD(f) abuf->fields.sfmt_add.f
2682
  int UNUSED written = 0;
2683
  IADDR UNUSED pc = abuf->addr;
2684
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2685
 
2686
  {
2687
    DI opval = ZEXTHIDI (GETMEMUHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2688
    SET_H_GR (FLD (f_dest), opval);
2689
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2690
  }
2691
 
2692
#undef FLD
2693
}
2694
  NEXT (vpc);
2695
 
2696
  CASE (sem, INSN_LDXW) : /* ldx.w $rm, $rn, $rd */
2697
{
2698
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2699
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2700
#define FLD(f) abuf->fields.sfmt_add.f
2701
  int UNUSED written = 0;
2702
  IADDR UNUSED pc = abuf->addr;
2703
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2704
 
2705
  {
2706
    DI opval = EXTHIDI (GETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)))));
2707
    SET_H_GR (FLD (f_dest), opval);
2708
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2709
  }
2710
 
2711
#undef FLD
2712
}
2713
  NEXT (vpc);
2714
 
2715
  CASE (sem, INSN_MABSL) : /* mabs.l $rm, $rd */
2716
{
2717
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2718
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2719
#define FLD(f) abuf->fields.sfmt_xori.f
2720
  int UNUSED written = 0;
2721
  IADDR UNUSED pc = abuf->addr;
2722
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2723
 
2724
{
2725
  SI tmp_result1;
2726
  SI tmp_result0;
2727
  tmp_result0 = ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1));
2728
  tmp_result1 = ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0));
2729
  {
2730
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2731
    SET_H_GR (FLD (f_dest), opval);
2732
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2733
  }
2734
}
2735
 
2736
#undef FLD
2737
}
2738
  NEXT (vpc);
2739
 
2740
  CASE (sem, INSN_MABSW) : /* mabs.w $rm, $rd */
2741
{
2742
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2743
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2744
#define FLD(f) abuf->fields.sfmt_xori.f
2745
  int UNUSED written = 0;
2746
  IADDR UNUSED pc = abuf->addr;
2747
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2748
 
2749
{
2750
  HI tmp_result3;
2751
  HI tmp_result2;
2752
  HI tmp_result1;
2753
  HI tmp_result0;
2754
  tmp_result0 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3));
2755
  tmp_result1 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2));
2756
  tmp_result2 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1));
2757
  tmp_result3 = ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0));
2758
  {
2759
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2760
    SET_H_GR (FLD (f_dest), opval);
2761
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2762
  }
2763
}
2764
 
2765
#undef FLD
2766
}
2767
  NEXT (vpc);
2768
 
2769
  CASE (sem, INSN_MADDL) : /* madd.l $rm, $rn, $rd */
2770
{
2771
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2772
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2773
#define FLD(f) abuf->fields.sfmt_add.f
2774
  int UNUSED written = 0;
2775
  IADDR UNUSED pc = abuf->addr;
2776
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2777
 
2778
{
2779
  SI tmp_result1;
2780
  SI tmp_result0;
2781
  tmp_result0 = ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
2782
  tmp_result1 = ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0));
2783
  {
2784
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2785
    SET_H_GR (FLD (f_dest), opval);
2786
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2787
  }
2788
}
2789
 
2790
#undef FLD
2791
}
2792
  NEXT (vpc);
2793
 
2794
  CASE (sem, INSN_MADDW) : /* madd.w $rm, $rn, $rd */
2795
{
2796
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2797
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2798
#define FLD(f) abuf->fields.sfmt_add.f
2799
  int UNUSED written = 0;
2800
  IADDR UNUSED pc = abuf->addr;
2801
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2802
 
2803
{
2804
  HI tmp_result3;
2805
  HI tmp_result2;
2806
  HI tmp_result1;
2807
  HI tmp_result0;
2808
  tmp_result0 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3));
2809
  tmp_result1 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2));
2810
  tmp_result2 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1));
2811
  tmp_result3 = ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0));
2812
  {
2813
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2814
    SET_H_GR (FLD (f_dest), opval);
2815
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2816
  }
2817
}
2818
 
2819
#undef FLD
2820
}
2821
  NEXT (vpc);
2822
 
2823
  CASE (sem, INSN_MADDSL) : /* madds.l $rm, $rn, $rd */
2824
{
2825
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2826
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2827
#define FLD(f) abuf->fields.sfmt_add.f
2828
  int UNUSED written = 0;
2829
  IADDR UNUSED pc = abuf->addr;
2830
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2831
 
2832
{
2833
  SI tmp_result1;
2834
  SI tmp_result0;
2835
  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)))));
2836
  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)))));
2837
  {
2838
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2839
    SET_H_GR (FLD (f_dest), opval);
2840
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2841
  }
2842
}
2843
 
2844
#undef FLD
2845
}
2846
  NEXT (vpc);
2847
 
2848
  CASE (sem, INSN_MADDSUB) : /* madds.ub $rm, $rn, $rd */
2849
{
2850
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2851
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2852
#define FLD(f) abuf->fields.sfmt_add.f
2853
  int UNUSED written = 0;
2854
  IADDR UNUSED pc = abuf->addr;
2855
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2856
 
2857
{
2858
  QI tmp_result7;
2859
  QI tmp_result6;
2860
  QI tmp_result5;
2861
  QI tmp_result4;
2862
  QI tmp_result3;
2863
  QI tmp_result2;
2864
  QI tmp_result1;
2865
  QI tmp_result0;
2866
  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)))));
2867
  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)))));
2868
  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)))));
2869
  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)))));
2870
  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)))));
2871
  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)))));
2872
  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)))));
2873
  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)))));
2874
  {
2875
    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))))))));
2876
    SET_H_GR (FLD (f_dest), opval);
2877
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2878
  }
2879
}
2880
 
2881
#undef FLD
2882
}
2883
  NEXT (vpc);
2884
 
2885
  CASE (sem, INSN_MADDSW) : /* madds.w $rm, $rn, $rd */
2886
{
2887
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2888
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2889
#define FLD(f) abuf->fields.sfmt_add.f
2890
  int UNUSED written = 0;
2891
  IADDR UNUSED pc = abuf->addr;
2892
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2893
 
2894
{
2895
  HI tmp_result3;
2896
  HI tmp_result2;
2897
  HI tmp_result1;
2898
  HI tmp_result0;
2899
  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)))));
2900
  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)))));
2901
  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)))));
2902
  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)))));
2903
  {
2904
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2905
    SET_H_GR (FLD (f_dest), opval);
2906
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2907
  }
2908
}
2909
 
2910
#undef FLD
2911
}
2912
  NEXT (vpc);
2913
 
2914
  CASE (sem, INSN_MCMPEQB) : /* mcmpeq.b $rm, $rn, $rd */
2915
{
2916
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2917
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2918
#define FLD(f) abuf->fields.sfmt_add.f
2919
  int UNUSED written = 0;
2920
  IADDR UNUSED pc = abuf->addr;
2921
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2922
 
2923
{
2924
  QI tmp_result7;
2925
  QI tmp_result6;
2926
  QI tmp_result5;
2927
  QI tmp_result4;
2928
  QI tmp_result3;
2929
  QI tmp_result2;
2930
  QI tmp_result1;
2931
  QI tmp_result0;
2932
  tmp_result0 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))) ? (INVQI (0)) : (0));
2933
  tmp_result1 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))) ? (INVQI (0)) : (0));
2934
  tmp_result2 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))) ? (INVQI (0)) : (0));
2935
  tmp_result3 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))) ? (INVQI (0)) : (0));
2936
  tmp_result4 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))) ? (INVQI (0)) : (0));
2937
  tmp_result5 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))) ? (INVQI (0)) : (0));
2938
  tmp_result6 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))) ? (INVQI (0)) : (0));
2939
  tmp_result7 = ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))) ? (INVQI (0)) : (0));
2940
  {
2941
    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))))))));
2942
    SET_H_GR (FLD (f_dest), opval);
2943
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2944
  }
2945
}
2946
 
2947
#undef FLD
2948
}
2949
  NEXT (vpc);
2950
 
2951
  CASE (sem, INSN_MCMPEQL) : /* mcmpeq.l $rm, $rn, $rd */
2952
{
2953
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2954
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2955
#define FLD(f) abuf->fields.sfmt_add.f
2956
  int UNUSED written = 0;
2957
  IADDR UNUSED pc = abuf->addr;
2958
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2959
 
2960
{
2961
  SI tmp_result1;
2962
  SI tmp_result0;
2963
  tmp_result0 = ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))) ? (INVSI (0)) : (0));
2964
  tmp_result1 = ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))) ? (INVSI (0)) : (0));
2965
  {
2966
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
2967
    SET_H_GR (FLD (f_dest), opval);
2968
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2969
  }
2970
}
2971
 
2972
#undef FLD
2973
}
2974
  NEXT (vpc);
2975
 
2976
  CASE (sem, INSN_MCMPEQW) : /* mcmpeq.w $rm, $rn, $rd */
2977
{
2978
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2979
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2980
#define FLD(f) abuf->fields.sfmt_add.f
2981
  int UNUSED written = 0;
2982
  IADDR UNUSED pc = abuf->addr;
2983
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2984
 
2985
{
2986
  HI tmp_result3;
2987
  HI tmp_result2;
2988
  HI tmp_result1;
2989
  HI tmp_result0;
2990
  tmp_result0 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))) ? (INVHI (0)) : (0));
2991
  tmp_result1 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))) ? (INVHI (0)) : (0));
2992
  tmp_result2 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))) ? (INVHI (0)) : (0));
2993
  tmp_result3 = ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0))) ? (INVHI (0)) : (0));
2994
  {
2995
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
2996
    SET_H_GR (FLD (f_dest), opval);
2997
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
2998
  }
2999
}
3000
 
3001
#undef FLD
3002
}
3003
  NEXT (vpc);
3004
 
3005
  CASE (sem, INSN_MCMPGTL) : /* mcmpgt.l $rm, $rn, $rd */
3006
{
3007
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3008
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3009
#define FLD(f) abuf->fields.sfmt_add.f
3010
  int UNUSED written = 0;
3011
  IADDR UNUSED pc = abuf->addr;
3012
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3013
 
3014
{
3015
  SI tmp_result1;
3016
  SI tmp_result0;
3017
  tmp_result0 = ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1))) ? (INVSI (0)) : (0));
3018
  tmp_result1 = ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0))) ? (INVSI (0)) : (0));
3019
  {
3020
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3021
    SET_H_GR (FLD (f_dest), opval);
3022
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3023
  }
3024
}
3025
 
3026
#undef FLD
3027
}
3028
  NEXT (vpc);
3029
 
3030
  CASE (sem, INSN_MCMPGTUB) : /* mcmpgt.ub $rm, $rn, $rd */
3031
{
3032
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3033
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3034
#define FLD(f) abuf->fields.sfmt_add.f
3035
  int UNUSED written = 0;
3036
  IADDR UNUSED pc = abuf->addr;
3037
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3038
 
3039
{
3040
  QI tmp_result7;
3041
  QI tmp_result6;
3042
  QI tmp_result5;
3043
  QI tmp_result4;
3044
  QI tmp_result3;
3045
  QI tmp_result2;
3046
  QI tmp_result1;
3047
  QI tmp_result0;
3048
  tmp_result0 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))) ? (INVQI (0)) : (0));
3049
  tmp_result1 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))) ? (INVQI (0)) : (0));
3050
  tmp_result2 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))) ? (INVQI (0)) : (0));
3051
  tmp_result3 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))) ? (INVQI (0)) : (0));
3052
  tmp_result4 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))) ? (INVQI (0)) : (0));
3053
  tmp_result5 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))) ? (INVQI (0)) : (0));
3054
  tmp_result6 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))) ? (INVQI (0)) : (0));
3055
  tmp_result7 = ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0))) ? (INVQI (0)) : (0));
3056
  {
3057
    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))))))));
3058
    SET_H_GR (FLD (f_dest), opval);
3059
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3060
  }
3061
}
3062
 
3063
#undef FLD
3064
}
3065
  NEXT (vpc);
3066
 
3067
  CASE (sem, INSN_MCMPGTW) : /* mcmpgt.w $rm, $rn, $rd */
3068
{
3069
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3070
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3071
#define FLD(f) abuf->fields.sfmt_add.f
3072
  int UNUSED written = 0;
3073
  IADDR UNUSED pc = abuf->addr;
3074
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3075
 
3076
{
3077
  HI tmp_result3;
3078
  HI tmp_result2;
3079
  HI tmp_result1;
3080
  HI tmp_result0;
3081
  tmp_result0 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))) ? (INVHI (0)) : (0));
3082
  tmp_result1 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))) ? (INVHI (0)) : (0));
3083
  tmp_result2 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))) ? (INVHI (0)) : (0));
3084
  tmp_result3 = ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0))) ? (INVHI (0)) : (0));
3085
  {
3086
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3087
    SET_H_GR (FLD (f_dest), opval);
3088
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3089
  }
3090
}
3091
 
3092
#undef FLD
3093
}
3094
  NEXT (vpc);
3095
 
3096
  CASE (sem, INSN_MCMV) : /* mcmv $rm, $rn, $rd */
3097
{
3098
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3099
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3100
#define FLD(f) abuf->fields.sfmt_add.f
3101
  int UNUSED written = 0;
3102
  IADDR UNUSED pc = abuf->addr;
3103
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3104
 
3105
  {
3106
    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)))));
3107
    SET_H_GR (FLD (f_dest), opval);
3108
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3109
  }
3110
 
3111
#undef FLD
3112
}
3113
  NEXT (vpc);
3114
 
3115
  CASE (sem, INSN_MCNVSLW) : /* mcnvs.lw $rm, $rn, $rd */
3116
{
3117
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3118
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3119
#define FLD(f) abuf->fields.sfmt_add.f
3120
  int UNUSED written = 0;
3121
  IADDR UNUSED pc = abuf->addr;
3122
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3123
 
3124
{
3125
  HI tmp_result3;
3126
  HI tmp_result2;
3127
  HI tmp_result1;
3128
  HI tmp_result0;
3129
  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)))));
3130
  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)))));
3131
  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)))));
3132
  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)))));
3133
  {
3134
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3135
    SET_H_GR (FLD (f_dest), opval);
3136
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3137
  }
3138
}
3139
 
3140
#undef FLD
3141
}
3142
  NEXT (vpc);
3143
 
3144
  CASE (sem, INSN_MCNVSWB) : /* mcnvs.wb $rm, $rn, $rd */
3145
{
3146
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3147
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3148
#define FLD(f) abuf->fields.sfmt_add.f
3149
  int UNUSED written = 0;
3150
  IADDR UNUSED pc = abuf->addr;
3151
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3152
 
3153
{
3154
  QI tmp_result7;
3155
  QI tmp_result6;
3156
  QI tmp_result5;
3157
  QI tmp_result4;
3158
  QI tmp_result3;
3159
  QI tmp_result2;
3160
  QI tmp_result1;
3161
  QI tmp_result0;
3162
  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)))));
3163
  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)))));
3164
  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)))));
3165
  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)))));
3166
  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)))));
3167
  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)))));
3168
  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)))));
3169
  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)))));
3170
  {
3171
    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))))))));
3172
    SET_H_GR (FLD (f_dest), opval);
3173
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3174
  }
3175
}
3176
 
3177
#undef FLD
3178
}
3179
  NEXT (vpc);
3180
 
3181
  CASE (sem, INSN_MCNVSWUB) : /* mcnvs.wub $rm, $rn, $rd */
3182
{
3183
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3184
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3185
#define FLD(f) abuf->fields.sfmt_add.f
3186
  int UNUSED written = 0;
3187
  IADDR UNUSED pc = abuf->addr;
3188
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3189
 
3190
{
3191
  QI tmp_result7;
3192
  QI tmp_result6;
3193
  QI tmp_result5;
3194
  QI tmp_result4;
3195
  QI tmp_result3;
3196
  QI tmp_result2;
3197
  QI tmp_result1;
3198
  QI tmp_result0;
3199
  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)))));
3200
  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)))));
3201
  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)))));
3202
  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)))));
3203
  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)))));
3204
  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)))));
3205
  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)))));
3206
  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)))));
3207
  {
3208
    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))))))));
3209
    SET_H_GR (FLD (f_dest), opval);
3210
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3211
  }
3212
}
3213
 
3214
#undef FLD
3215
}
3216
  NEXT (vpc);
3217
 
3218
  CASE (sem, INSN_MEXTR1) : /* mextr1 $rm, $rn, $rd */
3219
{
3220
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3221
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3222
#define FLD(f) abuf->fields.sfmt_add.f
3223
  int UNUSED written = 0;
3224
  IADDR UNUSED pc = abuf->addr;
3225
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3226
 
3227
{
3228
  QI tmp_count;
3229
  DI tmp_mask;
3230
  DI tmp_rhs;
3231
  tmp_count = MULQI (8, 1);
3232
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3233
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3234
  tmp_count = MULQI (8, SUBQI (8, 1));
3235
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3236
  {
3237
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3238
    SET_H_GR (FLD (f_dest), opval);
3239
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3240
  }
3241
}
3242
 
3243
#undef FLD
3244
}
3245
  NEXT (vpc);
3246
 
3247
  CASE (sem, INSN_MEXTR2) : /* mextr2 $rm, $rn, $rd */
3248
{
3249
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3250
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3251
#define FLD(f) abuf->fields.sfmt_add.f
3252
  int UNUSED written = 0;
3253
  IADDR UNUSED pc = abuf->addr;
3254
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3255
 
3256
{
3257
  QI tmp_count;
3258
  DI tmp_mask;
3259
  DI tmp_rhs;
3260
  tmp_count = MULQI (8, 2);
3261
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3262
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3263
  tmp_count = MULQI (8, SUBQI (8, 2));
3264
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3265
  {
3266
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3267
    SET_H_GR (FLD (f_dest), opval);
3268
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3269
  }
3270
}
3271
 
3272
#undef FLD
3273
}
3274
  NEXT (vpc);
3275
 
3276
  CASE (sem, INSN_MEXTR3) : /* mextr3 $rm, $rn, $rd */
3277
{
3278
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3279
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3280
#define FLD(f) abuf->fields.sfmt_add.f
3281
  int UNUSED written = 0;
3282
  IADDR UNUSED pc = abuf->addr;
3283
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3284
 
3285
{
3286
  QI tmp_count;
3287
  DI tmp_mask;
3288
  DI tmp_rhs;
3289
  tmp_count = MULQI (8, 3);
3290
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3291
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3292
  tmp_count = MULQI (8, SUBQI (8, 3));
3293
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3294
  {
3295
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3296
    SET_H_GR (FLD (f_dest), opval);
3297
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3298
  }
3299
}
3300
 
3301
#undef FLD
3302
}
3303
  NEXT (vpc);
3304
 
3305
  CASE (sem, INSN_MEXTR4) : /* mextr4 $rm, $rn, $rd */
3306
{
3307
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3308
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3309
#define FLD(f) abuf->fields.sfmt_add.f
3310
  int UNUSED written = 0;
3311
  IADDR UNUSED pc = abuf->addr;
3312
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3313
 
3314
{
3315
  QI tmp_count;
3316
  DI tmp_mask;
3317
  DI tmp_rhs;
3318
  tmp_count = MULQI (8, 4);
3319
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3320
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3321
  tmp_count = MULQI (8, SUBQI (8, 4));
3322
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3323
  {
3324
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3325
    SET_H_GR (FLD (f_dest), opval);
3326
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3327
  }
3328
}
3329
 
3330
#undef FLD
3331
}
3332
  NEXT (vpc);
3333
 
3334
  CASE (sem, INSN_MEXTR5) : /* mextr5 $rm, $rn, $rd */
3335
{
3336
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3337
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3338
#define FLD(f) abuf->fields.sfmt_add.f
3339
  int UNUSED written = 0;
3340
  IADDR UNUSED pc = abuf->addr;
3341
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3342
 
3343
{
3344
  QI tmp_count;
3345
  DI tmp_mask;
3346
  DI tmp_rhs;
3347
  tmp_count = MULQI (8, 5);
3348
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3349
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3350
  tmp_count = MULQI (8, SUBQI (8, 5));
3351
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3352
  {
3353
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3354
    SET_H_GR (FLD (f_dest), opval);
3355
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3356
  }
3357
}
3358
 
3359
#undef FLD
3360
}
3361
  NEXT (vpc);
3362
 
3363
  CASE (sem, INSN_MEXTR6) : /* mextr6 $rm, $rn, $rd */
3364
{
3365
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3366
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3367
#define FLD(f) abuf->fields.sfmt_add.f
3368
  int UNUSED written = 0;
3369
  IADDR UNUSED pc = abuf->addr;
3370
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3371
 
3372
{
3373
  QI tmp_count;
3374
  DI tmp_mask;
3375
  DI tmp_rhs;
3376
  tmp_count = MULQI (8, 6);
3377
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3378
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3379
  tmp_count = MULQI (8, SUBQI (8, 6));
3380
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3381
  {
3382
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3383
    SET_H_GR (FLD (f_dest), opval);
3384
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3385
  }
3386
}
3387
 
3388
#undef FLD
3389
}
3390
  NEXT (vpc);
3391
 
3392
  CASE (sem, INSN_MEXTR7) : /* mextr7 $rm, $rn, $rd */
3393
{
3394
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3395
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3396
#define FLD(f) abuf->fields.sfmt_add.f
3397
  int UNUSED written = 0;
3398
  IADDR UNUSED pc = abuf->addr;
3399
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3400
 
3401
{
3402
  QI tmp_count;
3403
  DI tmp_mask;
3404
  DI tmp_rhs;
3405
  tmp_count = MULQI (8, 7);
3406
  tmp_mask = SLLDI (INVSI (0), tmp_count);
3407
  tmp_rhs = SRLDI (ANDDI (GET_H_GR (FLD (f_left)), tmp_mask), tmp_count);
3408
  tmp_count = MULQI (8, SUBQI (8, 7));
3409
  tmp_mask = SRLDI (INVSI (0), tmp_count);
3410
  {
3411
    DI opval = ORDI (tmp_rhs, SLLDI (ANDDI (GET_H_GR (FLD (f_right)), tmp_mask), tmp_count));
3412
    SET_H_GR (FLD (f_dest), opval);
3413
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3414
  }
3415
}
3416
 
3417
#undef FLD
3418
}
3419
  NEXT (vpc);
3420
 
3421
  CASE (sem, INSN_MMACFXWL) : /* mmacfx.wl $rm, $rn, $rd */
3422
{
3423
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3424
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3425
#define FLD(f) abuf->fields.sfmt_add.f
3426
  int UNUSED written = 0;
3427
  IADDR UNUSED pc = abuf->addr;
3428
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3429
 
3430
{
3431
  SI tmp_temp;
3432
  SI tmp_result1;
3433
  SI tmp_result0;
3434
  tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 1);
3435
  tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 0);
3436
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3437
  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)))));
3438
  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)))));
3439
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3440
  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)))));
3441
  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)))));
3442
  {
3443
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3444
    SET_H_GR (FLD (f_dest), opval);
3445
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3446
  }
3447
}
3448
 
3449
#undef FLD
3450
}
3451
  NEXT (vpc);
3452
 
3453
  CASE (sem, INSN_MMACNFX_WL) : /* mmacnfx.wl $rm, $rn, $rd */
3454
{
3455
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3456
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3457
#define FLD(f) abuf->fields.sfmt_add.f
3458
  int UNUSED written = 0;
3459
  IADDR UNUSED pc = abuf->addr;
3460
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3461
 
3462
{
3463
  SI tmp_temp;
3464
  SI tmp_result1;
3465
  SI tmp_result0;
3466
  tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 1);
3467
  tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 0);
3468
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3469
  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)))));
3470
  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)))));
3471
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3472
  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)))));
3473
  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)))));
3474
  {
3475
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3476
    SET_H_GR (FLD (f_dest), opval);
3477
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3478
  }
3479
}
3480
 
3481
#undef FLD
3482
}
3483
  NEXT (vpc);
3484
 
3485
  CASE (sem, INSN_MMULL) : /* mmul.l $rm, $rn, $rd */
3486
{
3487
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3488
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3489
#define FLD(f) abuf->fields.sfmt_add.f
3490
  int UNUSED written = 0;
3491
  IADDR UNUSED pc = abuf->addr;
3492
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3493
 
3494
{
3495
  SI tmp_result1;
3496
  SI tmp_result0;
3497
  tmp_result0 = MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
3498
  tmp_result1 = MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0));
3499
  {
3500
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3501
    SET_H_GR (FLD (f_dest), opval);
3502
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3503
  }
3504
}
3505
 
3506
#undef FLD
3507
}
3508
  NEXT (vpc);
3509
 
3510
  CASE (sem, INSN_MMULW) : /* mmul.w $rm, $rn, $rd */
3511
{
3512
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3513
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3514
#define FLD(f) abuf->fields.sfmt_add.f
3515
  int UNUSED written = 0;
3516
  IADDR UNUSED pc = abuf->addr;
3517
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3518
 
3519
{
3520
  HI tmp_result3;
3521
  HI tmp_result2;
3522
  HI tmp_result1;
3523
  HI tmp_result0;
3524
  tmp_result0 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3));
3525
  tmp_result1 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2));
3526
  tmp_result2 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1));
3527
  tmp_result3 = MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0));
3528
  {
3529
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3530
    SET_H_GR (FLD (f_dest), opval);
3531
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3532
  }
3533
}
3534
 
3535
#undef FLD
3536
}
3537
  NEXT (vpc);
3538
 
3539
  CASE (sem, INSN_MMULFXL) : /* mmulfx.l $rm, $rn, $rd */
3540
{
3541
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3542
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3543
#define FLD(f) abuf->fields.sfmt_add.f
3544
  int UNUSED written = 0;
3545
  IADDR UNUSED pc = abuf->addr;
3546
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3547
 
3548
{
3549
  DI tmp_temp;
3550
  SI tmp_result0;
3551
  SI tmp_result1;
3552
  tmp_temp = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
3553
  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)))));
3554
  tmp_temp = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 0)));
3555
  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)))));
3556
  {
3557
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3558
    SET_H_GR (FLD (f_dest), opval);
3559
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3560
  }
3561
}
3562
 
3563
#undef FLD
3564
}
3565
  NEXT (vpc);
3566
 
3567
  CASE (sem, INSN_MMULFXW) : /* mmulfx.w $rm, $rn, $rd */
3568
{
3569
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3570
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3571
#define FLD(f) abuf->fields.sfmt_add.f
3572
  int UNUSED written = 0;
3573
  IADDR UNUSED pc = abuf->addr;
3574
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3575
 
3576
{
3577
  SI tmp_temp;
3578
  HI tmp_result0;
3579
  HI tmp_result1;
3580
  HI tmp_result2;
3581
  HI tmp_result3;
3582
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3583
  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)))));
3584
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3585
  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)))));
3586
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)));
3587
  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)))));
3588
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3589
  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)))));
3590
  {
3591
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3592
    SET_H_GR (FLD (f_dest), opval);
3593
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3594
  }
3595
}
3596
 
3597
#undef FLD
3598
}
3599
  NEXT (vpc);
3600
 
3601
  CASE (sem, INSN_MMULFXRPW) : /* mmulfxrp.w $rm, $rn, $rd */
3602
{
3603
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3604
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3605
#define FLD(f) abuf->fields.sfmt_add.f
3606
  int UNUSED written = 0;
3607
  IADDR UNUSED pc = abuf->addr;
3608
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3609
 
3610
{
3611
  SI tmp_temp;
3612
  HI tmp_result0;
3613
  HI tmp_result1;
3614
  HI tmp_result2;
3615
  HI tmp_result3;
3616
  HI tmp_c;
3617
  tmp_c = SLLSI (1, 14);
3618
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3619
  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)))));
3620
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3621
  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)))));
3622
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)));
3623
  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)))));
3624
  tmp_temp = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3625
  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)))));
3626
  {
3627
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3628
    SET_H_GR (FLD (f_dest), opval);
3629
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3630
  }
3631
}
3632
 
3633
#undef FLD
3634
}
3635
  NEXT (vpc);
3636
 
3637
  CASE (sem, INSN_MMULHIWL) : /* mmulhi.wl $rm, $rn, $rd */
3638
{
3639
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3640
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3641
#define FLD(f) abuf->fields.sfmt_add.f
3642
  int UNUSED written = 0;
3643
  IADDR UNUSED pc = abuf->addr;
3644
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3645
 
3646
{
3647
  SI tmp_result1;
3648
  SI tmp_result0;
3649
  tmp_result0 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1)));
3650
  tmp_result1 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3651
  {
3652
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3653
    SET_H_GR (FLD (f_dest), opval);
3654
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3655
  }
3656
}
3657
 
3658
#undef FLD
3659
}
3660
  NEXT (vpc);
3661
 
3662
  CASE (sem, INSN_MMULLOWL) : /* mmullo.wl $rm, $rn, $rd */
3663
{
3664
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3665
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3666
#define FLD(f) abuf->fields.sfmt_add.f
3667
  int UNUSED written = 0;
3668
  IADDR UNUSED pc = abuf->addr;
3669
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3670
 
3671
{
3672
  SI tmp_result1;
3673
  SI tmp_result0;
3674
  tmp_result0 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3)));
3675
  tmp_result1 = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2)));
3676
  {
3677
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3678
    SET_H_GR (FLD (f_dest), opval);
3679
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3680
  }
3681
}
3682
 
3683
#undef FLD
3684
}
3685
  NEXT (vpc);
3686
 
3687
  CASE (sem, INSN_MMULSUMWQ) : /* mmulsum.wq $rm, $rn, $rd */
3688
{
3689
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3690
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3691
#define FLD(f) abuf->fields.sfmt_add.f
3692
  int UNUSED written = 0;
3693
  IADDR UNUSED pc = abuf->addr;
3694
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3695
 
3696
{
3697
  DI tmp_acc;
3698
  tmp_acc = MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0)));
3699
  tmp_acc = ADDDI (tmp_acc, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1))));
3700
  tmp_acc = ADDDI (tmp_acc, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2))));
3701
  tmp_acc = ADDDI (tmp_acc, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3))));
3702
  {
3703
    DI opval = ADDDI (GET_H_GR (FLD (f_dest)), tmp_acc);
3704
    SET_H_GR (FLD (f_dest), opval);
3705
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3706
  }
3707
}
3708
 
3709
#undef FLD
3710
}
3711
  NEXT (vpc);
3712
 
3713
  CASE (sem, INSN_MOVI) : /* movi $imm16, $rd */
3714
{
3715
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3716
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3717
#define FLD(f) abuf->fields.sfmt_movi.f
3718
  int UNUSED written = 0;
3719
  IADDR UNUSED pc = abuf->addr;
3720
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3721
 
3722
  {
3723
    DI opval = EXTSIDI (FLD (f_imm16));
3724
    SET_H_GR (FLD (f_dest), opval);
3725
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3726
  }
3727
 
3728
#undef FLD
3729
}
3730
  NEXT (vpc);
3731
 
3732
  CASE (sem, INSN_MPERMW) : /* mperm.w $rm, $rn, $rd */
3733
{
3734
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3735
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3736
#define FLD(f) abuf->fields.sfmt_add.f
3737
  int UNUSED written = 0;
3738
  IADDR UNUSED pc = abuf->addr;
3739
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3740
 
3741
{
3742
  QI tmp_control;
3743
  HI tmp_result3;
3744
  HI tmp_result2;
3745
  HI tmp_result1;
3746
  HI tmp_result0;
3747
  tmp_control = ANDQI (GET_H_GR (FLD (f_right)), 255);
3748
  tmp_result0 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (tmp_control, 3)));
3749
  tmp_result1 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (SRLQI (tmp_control, 2), 3)));
3750
  tmp_result2 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (SRLQI (tmp_control, 4), 3)));
3751
  tmp_result3 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), SUBSI (3, ANDQI (SRLQI (tmp_control, 6), 3)));
3752
  {
3753
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3754
    SET_H_GR (FLD (f_dest), opval);
3755
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3756
  }
3757
}
3758
 
3759
#undef FLD
3760
}
3761
  NEXT (vpc);
3762
 
3763
  CASE (sem, INSN_MSADUBQ) : /* msad.ubq $rm, $rn, $rd */
3764
{
3765
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3766
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3767
#define FLD(f) abuf->fields.sfmt_add.f
3768
  int UNUSED written = 0;
3769
  IADDR UNUSED pc = abuf->addr;
3770
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3771
 
3772
{
3773
  DI tmp_acc;
3774
  tmp_acc = ABSDI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0)));
3775
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1))));
3776
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2))));
3777
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3))));
3778
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4))));
3779
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5))));
3780
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6))));
3781
  tmp_acc = ADDDI (tmp_acc, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7))));
3782
  {
3783
    DI opval = ADDDI (GET_H_GR (FLD (f_dest)), tmp_acc);
3784
    SET_H_GR (FLD (f_dest), opval);
3785
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3786
  }
3787
}
3788
 
3789
#undef FLD
3790
}
3791
  NEXT (vpc);
3792
 
3793
  CASE (sem, INSN_MSHALDSL) : /* mshalds.l $rm, $rn, $rd */
3794
{
3795
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3796
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3797
#define FLD(f) abuf->fields.sfmt_add.f
3798
  int UNUSED written = 0;
3799
  IADDR UNUSED pc = abuf->addr;
3800
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3801
 
3802
{
3803
  SI tmp_result1;
3804
  SI tmp_result0;
3805
  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)))));
3806
  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)))));
3807
  {
3808
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3809
    SET_H_GR (FLD (f_dest), opval);
3810
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3811
  }
3812
}
3813
 
3814
#undef FLD
3815
}
3816
  NEXT (vpc);
3817
 
3818
  CASE (sem, INSN_MSHALDSW) : /* mshalds.w $rm, $rn, $rd */
3819
{
3820
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3821
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3822
#define FLD(f) abuf->fields.sfmt_add.f
3823
  int UNUSED written = 0;
3824
  IADDR UNUSED pc = abuf->addr;
3825
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3826
 
3827
{
3828
  HI tmp_result3;
3829
  HI tmp_result2;
3830
  HI tmp_result1;
3831
  HI tmp_result0;
3832
  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)))));
3833
  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)))));
3834
  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)))));
3835
  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)))));
3836
  {
3837
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3838
    SET_H_GR (FLD (f_dest), opval);
3839
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3840
  }
3841
}
3842
 
3843
#undef FLD
3844
}
3845
  NEXT (vpc);
3846
 
3847
  CASE (sem, INSN_MSHARDL) : /* mshard.l $rm, $rn, $rd */
3848
{
3849
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3850
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3851
#define FLD(f) abuf->fields.sfmt_add.f
3852
  int UNUSED written = 0;
3853
  IADDR UNUSED pc = abuf->addr;
3854
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3855
 
3856
{
3857
  SI tmp_result1;
3858
  SI tmp_result0;
3859
  tmp_result0 = SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31));
3860
  tmp_result1 = SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31));
3861
  {
3862
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3863
    SET_H_GR (FLD (f_dest), opval);
3864
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3865
  }
3866
}
3867
 
3868
#undef FLD
3869
}
3870
  NEXT (vpc);
3871
 
3872
  CASE (sem, INSN_MSHARDW) : /* mshard.w $rm, $rn, $rd */
3873
{
3874
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3875
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3876
#define FLD(f) abuf->fields.sfmt_add.f
3877
  int UNUSED written = 0;
3878
  IADDR UNUSED pc = abuf->addr;
3879
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3880
 
3881
{
3882
  HI tmp_result3;
3883
  HI tmp_result2;
3884
  HI tmp_result1;
3885
  HI tmp_result0;
3886
  tmp_result0 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15));
3887
  tmp_result1 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15));
3888
  tmp_result2 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15));
3889
  tmp_result3 = SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15));
3890
  {
3891
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
3892
    SET_H_GR (FLD (f_dest), opval);
3893
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3894
  }
3895
}
3896
 
3897
#undef FLD
3898
}
3899
  NEXT (vpc);
3900
 
3901
  CASE (sem, INSN_MSHARDSQ) : /* mshards.q $rm, $rn, $rd */
3902
{
3903
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3904
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3905
#define FLD(f) abuf->fields.sfmt_add.f
3906
  int UNUSED written = 0;
3907
  IADDR UNUSED pc = abuf->addr;
3908
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3909
 
3910
  {
3911
    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)))));
3912
    SET_H_GR (FLD (f_dest), opval);
3913
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3914
  }
3915
 
3916
#undef FLD
3917
}
3918
  NEXT (vpc);
3919
 
3920
  CASE (sem, INSN_MSHFHIB) : /* mshfhi.b $rm, $rn, $rd */
3921
{
3922
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3923
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3924
#define FLD(f) abuf->fields.sfmt_add.f
3925
  int UNUSED written = 0;
3926
  IADDR UNUSED pc = abuf->addr;
3927
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3928
 
3929
{
3930
  QI tmp_result7;
3931
  QI tmp_result6;
3932
  QI tmp_result5;
3933
  QI tmp_result4;
3934
  QI tmp_result3;
3935
  QI tmp_result2;
3936
  QI tmp_result1;
3937
  QI tmp_result0;
3938
  tmp_result0 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 3);
3939
  tmp_result1 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 3);
3940
  tmp_result2 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 2);
3941
  tmp_result3 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 2);
3942
  tmp_result4 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 1);
3943
  tmp_result5 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 1);
3944
  tmp_result6 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 0);
3945
  tmp_result7 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 0);
3946
  {
3947
    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))))))));
3948
    SET_H_GR (FLD (f_dest), opval);
3949
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3950
  }
3951
}
3952
 
3953
#undef FLD
3954
}
3955
  NEXT (vpc);
3956
 
3957
  CASE (sem, INSN_MSHFHIL) : /* mshfhi.l $rm, $rn, $rd */
3958
{
3959
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3960
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3961
#define FLD(f) abuf->fields.sfmt_add.f
3962
  int UNUSED written = 0;
3963
  IADDR UNUSED pc = abuf->addr;
3964
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3965
 
3966
{
3967
  SI tmp_result1;
3968
  SI tmp_result0;
3969
  tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_left)), 0);
3970
  tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_right)), 0);
3971
  {
3972
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
3973
    SET_H_GR (FLD (f_dest), opval);
3974
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
3975
  }
3976
}
3977
 
3978
#undef FLD
3979
}
3980
  NEXT (vpc);
3981
 
3982
  CASE (sem, INSN_MSHFHIW) : /* mshfhi.w $rm, $rn, $rd */
3983
{
3984
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3985
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3986
#define FLD(f) abuf->fields.sfmt_add.f
3987
  int UNUSED written = 0;
3988
  IADDR UNUSED pc = abuf->addr;
3989
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3990
 
3991
{
3992
  HI tmp_result3;
3993
  HI tmp_result2;
3994
  HI tmp_result1;
3995
  HI tmp_result0;
3996
  tmp_result0 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1);
3997
  tmp_result1 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1);
3998
  tmp_result2 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0);
3999
  tmp_result3 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0);
4000
  {
4001
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4002
    SET_H_GR (FLD (f_dest), opval);
4003
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4004
  }
4005
}
4006
 
4007
#undef FLD
4008
}
4009
  NEXT (vpc);
4010
 
4011
  CASE (sem, INSN_MSHFLOB) : /* mshflo.b $rm, $rn, $rd */
4012
{
4013
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4014
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4015
#define FLD(f) abuf->fields.sfmt_add.f
4016
  int UNUSED written = 0;
4017
  IADDR UNUSED pc = abuf->addr;
4018
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4019
 
4020
{
4021
  QI tmp_result7;
4022
  QI tmp_result6;
4023
  QI tmp_result5;
4024
  QI tmp_result4;
4025
  QI tmp_result3;
4026
  QI tmp_result2;
4027
  QI tmp_result1;
4028
  QI tmp_result0;
4029
  tmp_result0 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 7);
4030
  tmp_result1 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 7);
4031
  tmp_result2 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 6);
4032
  tmp_result3 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 6);
4033
  tmp_result4 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 5);
4034
  tmp_result5 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 5);
4035
  tmp_result6 = SUBWORDDIQI (GET_H_GR (FLD (f_left)), 4);
4036
  tmp_result7 = SUBWORDDIQI (GET_H_GR (FLD (f_right)), 4);
4037
  {
4038
    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))))))));
4039
    SET_H_GR (FLD (f_dest), opval);
4040
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4041
  }
4042
}
4043
 
4044
#undef FLD
4045
}
4046
  NEXT (vpc);
4047
 
4048
  CASE (sem, INSN_MSHFLOL) : /* mshflo.l $rm, $rn, $rd */
4049
{
4050
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4051
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4052
#define FLD(f) abuf->fields.sfmt_add.f
4053
  int UNUSED written = 0;
4054
  IADDR UNUSED pc = abuf->addr;
4055
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4056
 
4057
{
4058
  SI tmp_result1;
4059
  SI tmp_result0;
4060
  tmp_result0 = SUBWORDDISI (GET_H_GR (FLD (f_left)), 1);
4061
  tmp_result1 = SUBWORDDISI (GET_H_GR (FLD (f_right)), 1);
4062
  {
4063
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4064
    SET_H_GR (FLD (f_dest), opval);
4065
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4066
  }
4067
}
4068
 
4069
#undef FLD
4070
}
4071
  NEXT (vpc);
4072
 
4073
  CASE (sem, INSN_MSHFLOW) : /* mshflo.w $rm, $rn, $rd */
4074
{
4075
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4076
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4077
#define FLD(f) abuf->fields.sfmt_add.f
4078
  int UNUSED written = 0;
4079
  IADDR UNUSED pc = abuf->addr;
4080
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4081
 
4082
{
4083
  HI tmp_result3;
4084
  HI tmp_result2;
4085
  HI tmp_result1;
4086
  HI tmp_result0;
4087
  tmp_result0 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3);
4088
  tmp_result1 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3);
4089
  tmp_result2 = SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2);
4090
  tmp_result3 = SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2);
4091
  {
4092
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4093
    SET_H_GR (FLD (f_dest), opval);
4094
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4095
  }
4096
}
4097
 
4098
#undef FLD
4099
}
4100
  NEXT (vpc);
4101
 
4102
  CASE (sem, INSN_MSHLLDL) : /* mshlld.l $rm, $rn, $rd */
4103
{
4104
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4105
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4106
#define FLD(f) abuf->fields.sfmt_add.f
4107
  int UNUSED written = 0;
4108
  IADDR UNUSED pc = abuf->addr;
4109
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4110
 
4111
{
4112
  SI tmp_result1;
4113
  SI tmp_result0;
4114
  tmp_result0 = SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31));
4115
  tmp_result1 = SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31));
4116
  {
4117
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4118
    SET_H_GR (FLD (f_dest), opval);
4119
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4120
  }
4121
}
4122
 
4123
#undef FLD
4124
}
4125
  NEXT (vpc);
4126
 
4127
  CASE (sem, INSN_MSHLLDW) : /* mshlld.w $rm, $rn, $rd */
4128
{
4129
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4130
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4131
#define FLD(f) abuf->fields.sfmt_add.f
4132
  int UNUSED written = 0;
4133
  IADDR UNUSED pc = abuf->addr;
4134
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4135
 
4136
{
4137
  HI tmp_result3;
4138
  HI tmp_result2;
4139
  HI tmp_result1;
4140
  HI tmp_result0;
4141
  tmp_result0 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15));
4142
  tmp_result1 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15));
4143
  tmp_result2 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15));
4144
  tmp_result3 = SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15));
4145
  {
4146
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4147
    SET_H_GR (FLD (f_dest), opval);
4148
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4149
  }
4150
}
4151
 
4152
#undef FLD
4153
}
4154
  NEXT (vpc);
4155
 
4156
  CASE (sem, INSN_MSHLRDL) : /* mshlrd.l $rm, $rn, $rd */
4157
{
4158
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4159
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4160
#define FLD(f) abuf->fields.sfmt_add.f
4161
  int UNUSED written = 0;
4162
  IADDR UNUSED pc = abuf->addr;
4163
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4164
 
4165
{
4166
  SI tmp_result1;
4167
  SI tmp_result0;
4168
  tmp_result0 = SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 31));
4169
  tmp_result1 = SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 31));
4170
  {
4171
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4172
    SET_H_GR (FLD (f_dest), opval);
4173
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4174
  }
4175
}
4176
 
4177
#undef FLD
4178
}
4179
  NEXT (vpc);
4180
 
4181
  CASE (sem, INSN_MSHLRDW) : /* mshlrd.w $rm, $rn, $rd */
4182
{
4183
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4184
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4185
#define FLD(f) abuf->fields.sfmt_add.f
4186
  int UNUSED written = 0;
4187
  IADDR UNUSED pc = abuf->addr;
4188
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4189
 
4190
{
4191
  HI tmp_result3;
4192
  HI tmp_result2;
4193
  HI tmp_result1;
4194
  HI tmp_result0;
4195
  tmp_result0 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), ANDDI (GET_H_GR (FLD (f_right)), 15));
4196
  tmp_result1 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), ANDDI (GET_H_GR (FLD (f_right)), 15));
4197
  tmp_result2 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 15));
4198
  tmp_result3 = SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), ANDDI (GET_H_GR (FLD (f_right)), 15));
4199
  {
4200
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4201
    SET_H_GR (FLD (f_dest), opval);
4202
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4203
  }
4204
}
4205
 
4206
#undef FLD
4207
}
4208
  NEXT (vpc);
4209
 
4210
  CASE (sem, INSN_MSUBL) : /* msub.l $rm, $rn, $rd */
4211
{
4212
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4213
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4214
#define FLD(f) abuf->fields.sfmt_add.f
4215
  int UNUSED written = 0;
4216
  IADDR UNUSED pc = abuf->addr;
4217
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4218
 
4219
{
4220
  SI tmp_result1;
4221
  SI tmp_result0;
4222
  tmp_result0 = SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1));
4223
  tmp_result1 = SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right)), 0));
4224
  {
4225
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4226
    SET_H_GR (FLD (f_dest), opval);
4227
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4228
  }
4229
}
4230
 
4231
#undef FLD
4232
}
4233
  NEXT (vpc);
4234
 
4235
  CASE (sem, INSN_MSUBW) : /* msub.w $rm, $rn, $rd */
4236
{
4237
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4238
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4239
#define FLD(f) abuf->fields.sfmt_add.f
4240
  int UNUSED written = 0;
4241
  IADDR UNUSED pc = abuf->addr;
4242
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4243
 
4244
{
4245
  HI tmp_result3;
4246
  HI tmp_result2;
4247
  HI tmp_result1;
4248
  HI tmp_result0;
4249
  tmp_result0 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 3));
4250
  tmp_result1 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 2));
4251
  tmp_result2 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 1));
4252
  tmp_result3 = SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right)), 0));
4253
  {
4254
    DI opval = ORDI (SLLDI (ZEXTHIDI (tmp_result3), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1), 16), ZEXTHIDI (tmp_result0))));
4255
    SET_H_GR (FLD (f_dest), opval);
4256
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4257
  }
4258
}
4259
 
4260
#undef FLD
4261
}
4262
  NEXT (vpc);
4263
 
4264
  CASE (sem, INSN_MSUBSL) : /* msubs.l $rm, $rn, $rd */
4265
{
4266
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4267
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4268
#define FLD(f) abuf->fields.sfmt_add.f
4269
  int UNUSED written = 0;
4270
  IADDR UNUSED pc = abuf->addr;
4271
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4272
 
4273
{
4274
  SI tmp_result1;
4275
  SI tmp_result0;
4276
  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)))));
4277
  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)))));
4278
  {
4279
    DI opval = ORDI (SLLDI (ZEXTSIDI (tmp_result1), 32), ZEXTSIDI (tmp_result0));
4280
    SET_H_GR (FLD (f_dest), opval);
4281
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4282
  }
4283
}
4284
 
4285
#undef FLD
4286
}
4287
  NEXT (vpc);
4288
 
4289
  CASE (sem, INSN_MSUBSUB) : /* msubs.ub $rm, $rn, $rd */
4290
{
4291
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4292
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4293
#define FLD(f) abuf->fields.sfmt_add.f
4294
  int UNUSED written = 0;
4295
  IADDR UNUSED pc = abuf->addr;
4296
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4297
 
4298
{
4299
  QI tmp_result7;
4300
  QI tmp_result6;
4301
  QI tmp_result5;
4302
  QI tmp_result4;
4303
  QI tmp_result3;
4304
  QI tmp_result2;
4305
  QI tmp_result1;
4306
  QI tmp_result0;
4307
  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)))));
4308
  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)))));
4309
  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)))));
4310
  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)))));
4311
  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)))));
4312
  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)))));
4313
  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)))));
4314
  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)))));
4315
  {
4316
    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))))))));
4317
    SET_H_GR (FLD (f_dest), opval);
4318
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4319
  }
4320
}
4321
 
4322
#undef FLD
4323
}
4324
  NEXT (vpc);
4325
 
4326
  CASE (sem, INSN_MSUBSW) : /* msubs.w $rm, $rn, $rd */
4327
{
4328
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4329
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4330
#define FLD(f) abuf->fields.sfmt_add.f
4331
  int UNUSED written = 0;
4332
  IADDR UNUSED pc = abuf->addr;
4333
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4334
 
4335
{
4336
  QI tmp_result7;
4337
  QI tmp_result6;
4338
  QI tmp_result5;
4339
  QI tmp_result4;
4340
  QI tmp_result3;
4341
  QI tmp_result2;
4342
  QI tmp_result1;
4343
  QI tmp_result0;
4344
  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)))));
4345
  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)))));
4346
  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)))));
4347
  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)))));
4348
  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)))));
4349
  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)))));
4350
  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)))));
4351
  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)))));
4352
  {
4353
    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))))))));
4354
    SET_H_GR (FLD (f_dest), opval);
4355
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4356
  }
4357
}
4358
 
4359
#undef FLD
4360
}
4361
  NEXT (vpc);
4362
 
4363
  CASE (sem, INSN_MULSL) : /* muls.l $rm, $rn, $rd */
4364
{
4365
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4366
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4367
#define FLD(f) abuf->fields.sfmt_add.f
4368
  int UNUSED written = 0;
4369
  IADDR UNUSED pc = abuf->addr;
4370
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4371
 
4372
  {
4373
    DI opval = MULDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
4374
    SET_H_GR (FLD (f_dest), opval);
4375
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4376
  }
4377
 
4378
#undef FLD
4379
}
4380
  NEXT (vpc);
4381
 
4382
  CASE (sem, INSN_MULUL) : /* mulu.l $rm, $rn, $rd */
4383
{
4384
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4385
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4386
#define FLD(f) abuf->fields.sfmt_add.f
4387
  int UNUSED written = 0;
4388
  IADDR UNUSED pc = abuf->addr;
4389
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4390
 
4391
  {
4392
    DI opval = MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
4393
    SET_H_GR (FLD (f_dest), opval);
4394
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4395
  }
4396
 
4397
#undef FLD
4398
}
4399
  NEXT (vpc);
4400
 
4401
  CASE (sem, INSN_NOP) : /* nop */
4402
{
4403
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4404
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4405
#define FLD(f) abuf->fields.fmt_empty.f
4406
  int UNUSED written = 0;
4407
  IADDR UNUSED pc = abuf->addr;
4408
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4409
 
4410
((void) 0); /*nop*/
4411
 
4412
#undef FLD
4413
}
4414
  NEXT (vpc);
4415
 
4416
  CASE (sem, INSN_NSB) : /* nsb $rm, $rd */
4417
{
4418
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4419
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4420
#define FLD(f) abuf->fields.sfmt_xori.f
4421
  int UNUSED written = 0;
4422
  IADDR UNUSED pc = abuf->addr;
4423
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4424
 
4425
  {
4426
    DI opval = sh64_nsb (current_cpu, GET_H_GR (FLD (f_left)));
4427
    SET_H_GR (FLD (f_dest), opval);
4428
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4429
  }
4430
 
4431
#undef FLD
4432
}
4433
  NEXT (vpc);
4434
 
4435
  CASE (sem, INSN_OCBI) : /* ocbi $rm, $disp6x32 */
4436
{
4437
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4438
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4439
#define FLD(f) abuf->fields.sfmt_xori.f
4440
  int UNUSED written = 0;
4441
  IADDR UNUSED pc = abuf->addr;
4442
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4443
 
4444
{
4445
  {
4446
    DI opval = GET_H_GR (FLD (f_left));
4447
    SET_H_GR (FLD (f_left), opval);
4448
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4449
  }
4450
((void) 0); /*nop*/
4451
}
4452
 
4453
#undef FLD
4454
}
4455
  NEXT (vpc);
4456
 
4457
  CASE (sem, INSN_OCBP) : /* ocbp $rm, $disp6x32 */
4458
{
4459
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4460
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4461
#define FLD(f) abuf->fields.sfmt_xori.f
4462
  int UNUSED written = 0;
4463
  IADDR UNUSED pc = abuf->addr;
4464
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4465
 
4466
{
4467
  {
4468
    DI opval = GET_H_GR (FLD (f_left));
4469
    SET_H_GR (FLD (f_left), opval);
4470
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4471
  }
4472
((void) 0); /*nop*/
4473
}
4474
 
4475
#undef FLD
4476
}
4477
  NEXT (vpc);
4478
 
4479
  CASE (sem, INSN_OCBWB) : /* ocbwb $rm, $disp6x32 */
4480
{
4481
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4482
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4483
#define FLD(f) abuf->fields.sfmt_xori.f
4484
  int UNUSED written = 0;
4485
  IADDR UNUSED pc = abuf->addr;
4486
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4487
 
4488
{
4489
  {
4490
    DI opval = GET_H_GR (FLD (f_left));
4491
    SET_H_GR (FLD (f_left), opval);
4492
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4493
  }
4494
((void) 0); /*nop*/
4495
}
4496
 
4497
#undef FLD
4498
}
4499
  NEXT (vpc);
4500
 
4501
  CASE (sem, INSN_OR) : /* or $rm, $rn, $rd */
4502
{
4503
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4504
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4505
#define FLD(f) abuf->fields.sfmt_add.f
4506
  int UNUSED written = 0;
4507
  IADDR UNUSED pc = abuf->addr;
4508
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4509
 
4510
  {
4511
    DI opval = ORDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
4512
    SET_H_GR (FLD (f_dest), opval);
4513
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4514
  }
4515
 
4516
#undef FLD
4517
}
4518
  NEXT (vpc);
4519
 
4520
  CASE (sem, INSN_ORI) : /* ori $rm, $imm10, $rd */
4521
{
4522
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4523
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4524
#define FLD(f) abuf->fields.sfmt_ori.f
4525
  int UNUSED written = 0;
4526
  IADDR UNUSED pc = abuf->addr;
4527
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4528
 
4529
  {
4530
    DI opval = ORDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm10)));
4531
    SET_H_GR (FLD (f_dest), opval);
4532
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4533
  }
4534
 
4535
#undef FLD
4536
}
4537
  NEXT (vpc);
4538
 
4539
  CASE (sem, INSN_PREFI) : /* prefi $rm, $disp6x32 */
4540
{
4541
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4542
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4543
#define FLD(f) abuf->fields.sfmt_xori.f
4544
  int UNUSED written = 0;
4545
  IADDR UNUSED pc = abuf->addr;
4546
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4547
 
4548
{
4549
  {
4550
    DI opval = GET_H_GR (FLD (f_left));
4551
    SET_H_GR (FLD (f_left), opval);
4552
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4553
  }
4554
((void) 0); /*nop*/
4555
}
4556
 
4557
#undef FLD
4558
}
4559
  NEXT (vpc);
4560
 
4561
  CASE (sem, INSN_PTA) : /* pta$likely $disp16, $tra */
4562
{
4563
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4564
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4565
#define FLD(f) abuf->fields.sfmt_pta.f
4566
  int UNUSED written = 0;
4567
  IADDR UNUSED pc = abuf->addr;
4568
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4569
 
4570
{
4571
((void) 0); /*nop*/
4572
  {
4573
    DI opval = ADDSI (FLD (f_disp16), 1);
4574
    CPU (h_tr[FLD (f_tra)]) = opval;
4575
    TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4576
  }
4577
}
4578
 
4579
#undef FLD
4580
}
4581
  NEXT (vpc);
4582
 
4583
  CASE (sem, INSN_PTABS) : /* ptabs$likely $rn, $tra */
4584
{
4585
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4586
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4587
#define FLD(f) abuf->fields.sfmt_beq.f
4588
  int UNUSED written = 0;
4589
  IADDR UNUSED pc = abuf->addr;
4590
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4591
 
4592
{
4593
((void) 0); /*nop*/
4594
  {
4595
    DI opval = GET_H_GR (FLD (f_right));
4596
    CPU (h_tr[FLD (f_tra)]) = opval;
4597
    TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4598
  }
4599
}
4600
 
4601
#undef FLD
4602
}
4603
  NEXT (vpc);
4604
 
4605
  CASE (sem, INSN_PTB) : /* ptb$likely $disp16, $tra */
4606
{
4607
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4608
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4609
#define FLD(f) abuf->fields.sfmt_pta.f
4610
  int UNUSED written = 0;
4611
  IADDR UNUSED pc = abuf->addr;
4612
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4613
 
4614
{
4615
((void) 0); /*nop*/
4616
  {
4617
    DI opval = FLD (f_disp16);
4618
    CPU (h_tr[FLD (f_tra)]) = opval;
4619
    TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4620
  }
4621
}
4622
 
4623
#undef FLD
4624
}
4625
  NEXT (vpc);
4626
 
4627
  CASE (sem, INSN_PTREL) : /* ptrel$likely $rn, $tra */
4628
{
4629
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4630
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4631
#define FLD(f) abuf->fields.sfmt_beq.f
4632
  int UNUSED written = 0;
4633
  IADDR UNUSED pc = abuf->addr;
4634
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4635
 
4636
{
4637
((void) 0); /*nop*/
4638
  {
4639
    DI opval = ADDDI (pc, GET_H_GR (FLD (f_right)));
4640
    CPU (h_tr[FLD (f_tra)]) = opval;
4641
    TRACE_RESULT (current_cpu, abuf, "tr", 'D', opval);
4642
  }
4643
}
4644
 
4645
#undef FLD
4646
}
4647
  NEXT (vpc);
4648
 
4649
  CASE (sem, INSN_PUTCFG) : /* putcfg $rm, $disp6, $rd */
4650
{
4651
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4652
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4653
#define FLD(f) abuf->fields.sfmt_getcfg.f
4654
  int UNUSED written = 0;
4655
  IADDR UNUSED pc = abuf->addr;
4656
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4657
 
4658
{
4659
  SI tmp_address;
4660
  tmp_address = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
4661
((void) 0); /*nop*/
4662
  {
4663
    SI opval = GET_H_GR (FLD (f_dest));
4664
    SETMEMSI (current_cpu, pc, tmp_address, opval);
4665
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4666
  }
4667
}
4668
 
4669
#undef FLD
4670
}
4671
  NEXT (vpc);
4672
 
4673
  CASE (sem, INSN_PUTCON) : /* putcon $rm, $crj */
4674
{
4675
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4676
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4677
#define FLD(f) abuf->fields.sfmt_xori.f
4678
  int UNUSED written = 0;
4679
  IADDR UNUSED pc = abuf->addr;
4680
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4681
 
4682
  {
4683
    DI opval = GET_H_GR (FLD (f_left));
4684
    SET_H_CR (FLD (f_dest), opval);
4685
    TRACE_RESULT (current_cpu, abuf, "cr", 'D', opval);
4686
  }
4687
 
4688
#undef FLD
4689
}
4690
  NEXT (vpc);
4691
 
4692
  CASE (sem, INSN_RTE) : /* rte */
4693
{
4694
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4695
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4696
#define FLD(f) abuf->fields.fmt_empty.f
4697
  int UNUSED written = 0;
4698
  IADDR UNUSED pc = abuf->addr;
4699
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4700
 
4701
((void) 0); /*nop*/
4702
 
4703
#undef FLD
4704
}
4705
  NEXT (vpc);
4706
 
4707
  CASE (sem, INSN_SHARD) : /* shard $rm, $rn, $rd */
4708
{
4709
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4710
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4711
#define FLD(f) abuf->fields.sfmt_add.f
4712
  int UNUSED written = 0;
4713
  IADDR UNUSED pc = abuf->addr;
4714
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4715
 
4716
  {
4717
    DI opval = SRADI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63));
4718
    SET_H_GR (FLD (f_dest), opval);
4719
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4720
  }
4721
 
4722
#undef FLD
4723
}
4724
  NEXT (vpc);
4725
 
4726
  CASE (sem, INSN_SHARDL) : /* shard.l $rm, $rn, $rd */
4727
{
4728
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4729
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4730
#define FLD(f) abuf->fields.sfmt_add.f
4731
  int UNUSED written = 0;
4732
  IADDR UNUSED pc = abuf->addr;
4733
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4734
 
4735
  {
4736
    DI opval = EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 63)));
4737
    SET_H_GR (FLD (f_dest), opval);
4738
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4739
  }
4740
 
4741
#undef FLD
4742
}
4743
  NEXT (vpc);
4744
 
4745
  CASE (sem, INSN_SHARI) : /* shari $rm, $uimm6, $rd */
4746
{
4747
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4748
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4749
#define FLD(f) abuf->fields.sfmt_shari.f
4750
  int UNUSED written = 0;
4751
  IADDR UNUSED pc = abuf->addr;
4752
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4753
 
4754
  {
4755
    DI opval = SRADI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4756
    SET_H_GR (FLD (f_dest), opval);
4757
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4758
  }
4759
 
4760
#undef FLD
4761
}
4762
  NEXT (vpc);
4763
 
4764
  CASE (sem, INSN_SHARIL) : /* shari.l $rm, $uimm6, $rd */
4765
{
4766
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4767
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4768
#define FLD(f) abuf->fields.sfmt_shari.f
4769
  int UNUSED written = 0;
4770
  IADDR UNUSED pc = abuf->addr;
4771
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4772
 
4773
  {
4774
    DI opval = EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDSI (FLD (f_uimm6), 63)));
4775
    SET_H_GR (FLD (f_dest), opval);
4776
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4777
  }
4778
 
4779
#undef FLD
4780
}
4781
  NEXT (vpc);
4782
 
4783
  CASE (sem, INSN_SHLLD) : /* shlld $rm, $rn, $rd */
4784
{
4785
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4786
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4787
#define FLD(f) abuf->fields.sfmt_add.f
4788
  int UNUSED written = 0;
4789
  IADDR UNUSED pc = abuf->addr;
4790
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4791
 
4792
  {
4793
    DI opval = SLLDI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63));
4794
    SET_H_GR (FLD (f_dest), opval);
4795
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4796
  }
4797
 
4798
#undef FLD
4799
}
4800
  NEXT (vpc);
4801
 
4802
  CASE (sem, INSN_SHLLDL) : /* shlld.l $rm, $rn, $rd */
4803
{
4804
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4805
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4806
#define FLD(f) abuf->fields.sfmt_add.f
4807
  int UNUSED written = 0;
4808
  IADDR UNUSED pc = abuf->addr;
4809
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4810
 
4811
  {
4812
    DI opval = EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 63)));
4813
    SET_H_GR (FLD (f_dest), opval);
4814
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4815
  }
4816
 
4817
#undef FLD
4818
}
4819
  NEXT (vpc);
4820
 
4821
  CASE (sem, INSN_SHLLI) : /* shlli $rm, $uimm6, $rd */
4822
{
4823
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4824
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4825
#define FLD(f) abuf->fields.sfmt_shari.f
4826
  int UNUSED written = 0;
4827
  IADDR UNUSED pc = abuf->addr;
4828
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4829
 
4830
  {
4831
    DI opval = SLLDI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4832
    SET_H_GR (FLD (f_dest), opval);
4833
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4834
  }
4835
 
4836
#undef FLD
4837
}
4838
  NEXT (vpc);
4839
 
4840
  CASE (sem, INSN_SHLLIL) : /* shlli.l $rm, $uimm6, $rd */
4841
{
4842
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4843
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4844
#define FLD(f) abuf->fields.sfmt_shari.f
4845
  int UNUSED written = 0;
4846
  IADDR UNUSED pc = abuf->addr;
4847
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4848
 
4849
  {
4850
    DI opval = EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDSI (FLD (f_uimm6), 63)));
4851
    SET_H_GR (FLD (f_dest), opval);
4852
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4853
  }
4854
 
4855
#undef FLD
4856
}
4857
  NEXT (vpc);
4858
 
4859
  CASE (sem, INSN_SHLRD) : /* shlrd $rm, $rn, $rd */
4860
{
4861
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4862
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4863
#define FLD(f) abuf->fields.sfmt_add.f
4864
  int UNUSED written = 0;
4865
  IADDR UNUSED pc = abuf->addr;
4866
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4867
 
4868
  {
4869
    DI opval = SRLDI (GET_H_GR (FLD (f_left)), ANDDI (GET_H_GR (FLD (f_right)), 63));
4870
    SET_H_GR (FLD (f_dest), opval);
4871
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4872
  }
4873
 
4874
#undef FLD
4875
}
4876
  NEXT (vpc);
4877
 
4878
  CASE (sem, INSN_SHLRDL) : /* shlrd.l $rm, $rn, $rd */
4879
{
4880
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4881
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4882
#define FLD(f) abuf->fields.sfmt_add.f
4883
  int UNUSED written = 0;
4884
  IADDR UNUSED pc = abuf->addr;
4885
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4886
 
4887
  {
4888
    DI opval = EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDDI (GET_H_GR (FLD (f_right)), 63)));
4889
    SET_H_GR (FLD (f_dest), opval);
4890
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4891
  }
4892
 
4893
#undef FLD
4894
}
4895
  NEXT (vpc);
4896
 
4897
  CASE (sem, INSN_SHLRI) : /* shlri $rm, $uimm6, $rd */
4898
{
4899
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4900
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4901
#define FLD(f) abuf->fields.sfmt_shari.f
4902
  int UNUSED written = 0;
4903
  IADDR UNUSED pc = abuf->addr;
4904
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4905
 
4906
  {
4907
    DI opval = SRLDI (GET_H_GR (FLD (f_left)), FLD (f_uimm6));
4908
    SET_H_GR (FLD (f_dest), opval);
4909
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4910
  }
4911
 
4912
#undef FLD
4913
}
4914
  NEXT (vpc);
4915
 
4916
  CASE (sem, INSN_SHLRIL) : /* shlri.l $rm, $uimm6, $rd */
4917
{
4918
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4919
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4920
#define FLD(f) abuf->fields.sfmt_shari.f
4921
  int UNUSED written = 0;
4922
  IADDR UNUSED pc = abuf->addr;
4923
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4924
 
4925
  {
4926
    DI opval = EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), ANDSI (FLD (f_uimm6), 63)));
4927
    SET_H_GR (FLD (f_dest), opval);
4928
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4929
  }
4930
 
4931
#undef FLD
4932
}
4933
  NEXT (vpc);
4934
 
4935
  CASE (sem, INSN_SHORI) : /* shori $uimm16, $rd */
4936
{
4937
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4938
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4939
#define FLD(f) abuf->fields.sfmt_shori.f
4940
  int UNUSED written = 0;
4941
  IADDR UNUSED pc = abuf->addr;
4942
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4943
 
4944
  {
4945
    DI opval = ORDI (SLLDI (GET_H_GR (FLD (f_dest)), 16), ZEXTSIDI (FLD (f_uimm16)));
4946
    SET_H_GR (FLD (f_dest), opval);
4947
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
4948
  }
4949
 
4950
#undef FLD
4951
}
4952
  NEXT (vpc);
4953
 
4954
  CASE (sem, INSN_SLEEP) : /* sleep */
4955
{
4956
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4957
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4958
#define FLD(f) abuf->fields.fmt_empty.f
4959
  int UNUSED written = 0;
4960
  IADDR UNUSED pc = abuf->addr;
4961
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4962
 
4963
((void) 0); /*nop*/
4964
 
4965
#undef FLD
4966
}
4967
  NEXT (vpc);
4968
 
4969
  CASE (sem, INSN_STB) : /* st.b $rm, $disp10, $rd */
4970
{
4971
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4972
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4973
#define FLD(f) abuf->fields.sfmt_addi.f
4974
  int UNUSED written = 0;
4975
  IADDR UNUSED pc = abuf->addr;
4976
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4977
 
4978
  {
4979
    UQI opval = ANDQI (GET_H_GR (FLD (f_dest)), 255);
4980
    SETMEMUQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10))), opval);
4981
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4982
  }
4983
 
4984
#undef FLD
4985
}
4986
  NEXT (vpc);
4987
 
4988
  CASE (sem, INSN_STL) : /* st.l $rm, $disp10x4, $rd */
4989
{
4990
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
4991
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4992
#define FLD(f) abuf->fields.sfmt_flds.f
4993
  int UNUSED written = 0;
4994
  IADDR UNUSED pc = abuf->addr;
4995
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4996
 
4997
  {
4998
    SI opval = ANDSI (GET_H_GR (FLD (f_dest)), 0xffffffff);
4999
    SETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x4))), opval);
5000
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5001
  }
5002
 
5003
#undef FLD
5004
}
5005
  NEXT (vpc);
5006
 
5007
  CASE (sem, INSN_STQ) : /* st.q $rm, $disp10x8, $rd */
5008
{
5009
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5010
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5011
#define FLD(f) abuf->fields.sfmt_fldd.f
5012
  int UNUSED written = 0;
5013
  IADDR UNUSED pc = abuf->addr;
5014
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5015
 
5016
  {
5017
    DI opval = GET_H_GR (FLD (f_dest));
5018
    SETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x8))), opval);
5019
    TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5020
  }
5021
 
5022
#undef FLD
5023
}
5024
  NEXT (vpc);
5025
 
5026
  CASE (sem, INSN_STW) : /* st.w $rm, $disp10x2, $rd */
5027
{
5028
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5029
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5030
#define FLD(f) abuf->fields.sfmt_lduw.f
5031
  int UNUSED written = 0;
5032
  IADDR UNUSED pc = abuf->addr;
5033
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5034
 
5035
  {
5036
    HI opval = ANDHI (GET_H_GR (FLD (f_dest)), 65535);
5037
    SETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_disp10x2))), opval);
5038
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5039
  }
5040
 
5041
#undef FLD
5042
}
5043
  NEXT (vpc);
5044
 
5045
  CASE (sem, INSN_STHIL) : /* sthi.l $rm, $disp6, $rd */
5046
{
5047
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5048
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5049
#define FLD(f) abuf->fields.sfmt_getcfg.f
5050
  int UNUSED written = 0;
5051
  IADDR UNUSED pc = abuf->addr;
5052
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5053
 
5054
{
5055
  DI tmp_addr;
5056
  QI tmp_bytecount;
5057
  DI tmp_val;
5058
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5059
  tmp_bytecount = ADDDI (ANDDI (tmp_addr, 3), 1);
5060
if (ANDQI (tmp_bytecount, 4)) {
5061
  {
5062
    SI opval = GET_H_GR (FLD (f_dest));
5063
    SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5064
    written |= (1 << 5);
5065
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5066
  }
5067
} else {
5068
if (GET_H_ENDIAN ()) {
5069
{
5070
  tmp_val = GET_H_GR (FLD (f_dest));
5071
if (ANDQI (tmp_bytecount, 1)) {
5072
{
5073
  {
5074
    UQI opval = ANDQI (tmp_val, 255);
5075
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5076
    written |= (1 << 6);
5077
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5078
  }
5079
  tmp_val = SRLDI (tmp_val, 8);
5080
}
5081
}
5082
if (ANDQI (tmp_bytecount, 2)) {
5083
{
5084
  {
5085
    HI opval = ANDHI (tmp_val, 65535);
5086
    SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5087
    written |= (1 << 4);
5088
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5089
  }
5090
  tmp_val = SRLDI (tmp_val, 16);
5091
}
5092
}
5093
}
5094
} else {
5095
{
5096
  tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (32, MULSI (8, tmp_bytecount)));
5097
if (ANDQI (tmp_bytecount, 2)) {
5098
{
5099
  {
5100
    HI opval = ANDHI (tmp_val, 65535);
5101
    SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5102
    written |= (1 << 4);
5103
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5104
  }
5105
  tmp_val = SRLDI (tmp_val, 16);
5106
}
5107
}
5108
if (ANDQI (tmp_bytecount, 1)) {
5109
{
5110
  {
5111
    UQI opval = ANDQI (tmp_val, 255);
5112
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5113
    written |= (1 << 6);
5114
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5115
  }
5116
  tmp_val = SRLDI (tmp_val, 8);
5117
}
5118
}
5119
}
5120
}
5121
}
5122
}
5123
 
5124
  abuf->written = written;
5125
#undef FLD
5126
}
5127
  NEXT (vpc);
5128
 
5129
  CASE (sem, INSN_STHIQ) : /* sthi.q $rm, $disp6, $rd */
5130
{
5131
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5132
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5133
#define FLD(f) abuf->fields.sfmt_getcfg.f
5134
  int UNUSED written = 0;
5135
  IADDR UNUSED pc = abuf->addr;
5136
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5137
 
5138
{
5139
  DI tmp_addr;
5140
  QI tmp_bytecount;
5141
  DI tmp_val;
5142
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5143
  tmp_bytecount = ADDDI (ANDDI (tmp_addr, 7), 1);
5144
if (ANDQI (tmp_bytecount, 8)) {
5145
  {
5146
    DI opval = GET_H_GR (FLD (f_dest));
5147
    SETMEMDI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5148
    written |= (1 << 4);
5149
    TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5150
  }
5151
} else {
5152
if (GET_H_ENDIAN ()) {
5153
{
5154
  tmp_val = GET_H_GR (FLD (f_dest));
5155
if (ANDQI (tmp_bytecount, 1)) {
5156
{
5157
  {
5158
    UQI opval = ANDQI (tmp_val, 255);
5159
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5160
    written |= (1 << 7);
5161
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5162
  }
5163
  tmp_val = SRLDI (tmp_val, 8);
5164
}
5165
}
5166
if (ANDQI (tmp_bytecount, 2)) {
5167
{
5168
  {
5169
    HI opval = ANDHI (tmp_val, 65535);
5170
    SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5171
    written |= (1 << 5);
5172
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5173
  }
5174
  tmp_val = SRLDI (tmp_val, 16);
5175
}
5176
}
5177
if (ANDQI (tmp_bytecount, 4)) {
5178
{
5179
  {
5180
    SI opval = ANDSI (tmp_val, 0xffffffff);
5181
    SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5182
    written |= (1 << 6);
5183
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5184
  }
5185
  tmp_val = SRLDI (tmp_val, 32);
5186
}
5187
}
5188
}
5189
} else {
5190
{
5191
  tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (64, MULSI (8, tmp_bytecount)));
5192
if (ANDQI (tmp_bytecount, 4)) {
5193
{
5194
  {
5195
    SI opval = ANDSI (tmp_val, 0xffffffff);
5196
    SETMEMSI (current_cpu, pc, ANDDI (tmp_addr, -8), opval);
5197
    written |= (1 << 6);
5198
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5199
  }
5200
  tmp_val = SRLDI (tmp_val, 32);
5201
}
5202
}
5203
if (ANDQI (tmp_bytecount, 2)) {
5204
{
5205
  {
5206
    HI opval = ANDHI (tmp_val, 65535);
5207
    SETMEMHI (current_cpu, pc, ANDDI (tmp_addr, -4), opval);
5208
    written |= (1 << 5);
5209
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5210
  }
5211
  tmp_val = SRLDI (tmp_val, 16);
5212
}
5213
}
5214
if (ANDQI (tmp_bytecount, 1)) {
5215
{
5216
  {
5217
    UQI opval = ANDQI (tmp_val, 255);
5218
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5219
    written |= (1 << 7);
5220
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5221
  }
5222
  tmp_val = SRLDI (tmp_val, 8);
5223
}
5224
}
5225
}
5226
}
5227
}
5228
}
5229
 
5230
  abuf->written = written;
5231
#undef FLD
5232
}
5233
  NEXT (vpc);
5234
 
5235
  CASE (sem, INSN_STLOL) : /* stlo.l $rm, $disp6, $rd */
5236
{
5237
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5238
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5239
#define FLD(f) abuf->fields.sfmt_getcfg.f
5240
  int UNUSED written = 0;
5241
  IADDR UNUSED pc = abuf->addr;
5242
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5243
 
5244
{
5245
  DI tmp_addr;
5246
  QI tmp_bytecount;
5247
  DI tmp_val;
5248
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5249
  tmp_bytecount = SUBSI (4, ANDDI (tmp_addr, 3));
5250
if (ANDQI (tmp_bytecount, 4)) {
5251
  {
5252
    USI opval = GET_H_GR (FLD (f_dest));
5253
    SETMEMUSI (current_cpu, pc, tmp_addr, opval);
5254
    written |= (1 << 6);
5255
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5256
  }
5257
} else {
5258
if (GET_H_ENDIAN ()) {
5259
{
5260
  tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (32, MULSI (8, tmp_bytecount)));
5261
if (ANDQI (tmp_bytecount, 2)) {
5262
{
5263
  {
5264
    UHI opval = ANDHI (tmp_val, 65535);
5265
    SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5266
    written |= (1 << 4);
5267
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5268
  }
5269
  tmp_val = SRLDI (tmp_val, 16);
5270
}
5271
}
5272
if (ANDQI (tmp_bytecount, 1)) {
5273
{
5274
  {
5275
    UQI opval = ANDQI (tmp_val, 255);
5276
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5277
    written |= (1 << 5);
5278
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5279
  }
5280
  tmp_val = SRLDI (tmp_val, 8);
5281
}
5282
}
5283
}
5284
} else {
5285
{
5286
  tmp_val = GET_H_GR (FLD (f_dest));
5287
if (ANDQI (tmp_bytecount, 1)) {
5288
{
5289
  {
5290
    UQI opval = ANDQI (tmp_val, 255);
5291
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5292
    written |= (1 << 5);
5293
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5294
  }
5295
  tmp_val = SRLDI (tmp_val, 8);
5296
}
5297
}
5298
if (ANDQI (tmp_bytecount, 2)) {
5299
{
5300
  {
5301
    UHI opval = ANDHI (tmp_val, 65535);
5302
    SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5303
    written |= (1 << 4);
5304
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5305
  }
5306
  tmp_val = SRLDI (tmp_val, 16);
5307
}
5308
}
5309
}
5310
}
5311
}
5312
}
5313
 
5314
  abuf->written = written;
5315
#undef FLD
5316
}
5317
  NEXT (vpc);
5318
 
5319
  CASE (sem, INSN_STLOQ) : /* stlo.q $rm, $disp6, $rd */
5320
{
5321
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5322
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5323
#define FLD(f) abuf->fields.sfmt_getcfg.f
5324
  int UNUSED written = 0;
5325
  IADDR UNUSED pc = abuf->addr;
5326
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5327
 
5328
{
5329
  DI tmp_addr;
5330
  QI tmp_bytecount;
5331
  DI tmp_val;
5332
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), FLD (f_disp6));
5333
  tmp_bytecount = SUBSI (8, ANDDI (tmp_addr, 7));
5334
if (ANDQI (tmp_bytecount, 8)) {
5335
  {
5336
    UDI opval = GET_H_GR (FLD (f_dest));
5337
    SETMEMUDI (current_cpu, pc, tmp_addr, opval);
5338
    written |= (1 << 4);
5339
    TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5340
  }
5341
} else {
5342
if (GET_H_ENDIAN ()) {
5343
{
5344
  tmp_val = SRLDI (GET_H_GR (FLD (f_dest)), SUBSI (64, MULSI (8, tmp_bytecount)));
5345
if (ANDQI (tmp_bytecount, 4)) {
5346
{
5347
  {
5348
    USI opval = ANDSI (tmp_val, 0xffffffff);
5349
    SETMEMUSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4), opval);
5350
    written |= (1 << 7);
5351
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5352
  }
5353
  tmp_val = SRLDI (tmp_val, 32);
5354
}
5355
}
5356
if (ANDQI (tmp_bytecount, 2)) {
5357
{
5358
  {
5359
    UHI opval = ANDHI (tmp_val, 65535);
5360
    SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5361
    written |= (1 << 5);
5362
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5363
  }
5364
  tmp_val = SRLDI (tmp_val, 16);
5365
}
5366
}
5367
if (ANDQI (tmp_bytecount, 1)) {
5368
{
5369
  {
5370
    UQI opval = ANDQI (tmp_val, 255);
5371
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5372
    written |= (1 << 6);
5373
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5374
  }
5375
  tmp_val = SRLDI (tmp_val, 8);
5376
}
5377
}
5378
}
5379
} else {
5380
{
5381
  tmp_val = GET_H_GR (FLD (f_dest));
5382
if (ANDQI (tmp_bytecount, 1)) {
5383
{
5384
  {
5385
    UQI opval = ANDQI (tmp_val, 255);
5386
    SETMEMUQI (current_cpu, pc, tmp_addr, opval);
5387
    written |= (1 << 6);
5388
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5389
  }
5390
  tmp_val = SRLDI (tmp_val, 8);
5391
}
5392
}
5393
if (ANDQI (tmp_bytecount, 2)) {
5394
{
5395
  {
5396
    UHI opval = ANDHI (tmp_val, 65535);
5397
    SETMEMUHI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 1), -2), opval);
5398
    written |= (1 << 5);
5399
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5400
  }
5401
  tmp_val = SRLDI (tmp_val, 16);
5402
}
5403
}
5404
if (ANDQI (tmp_bytecount, 4)) {
5405
{
5406
  {
5407
    USI opval = ANDSI (tmp_val, 0xffffffff);
5408
    SETMEMUSI (current_cpu, pc, ANDDI (ADDDI (tmp_addr, 3), -4), opval);
5409
    written |= (1 << 7);
5410
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5411
  }
5412
  tmp_val = SRLDI (tmp_val, 32);
5413
}
5414
}
5415
}
5416
}
5417
}
5418
}
5419
 
5420
  abuf->written = written;
5421
#undef FLD
5422
}
5423
  NEXT (vpc);
5424
 
5425
  CASE (sem, INSN_STXB) : /* stx.b $rm, $rn, $rd */
5426
{
5427
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5428
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5429
#define FLD(f) abuf->fields.sfmt_add.f
5430
  int UNUSED written = 0;
5431
  IADDR UNUSED pc = abuf->addr;
5432
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5433
 
5434
  {
5435
    UQI opval = SUBWORDDIQI (GET_H_GR (FLD (f_dest)), 7);
5436
    SETMEMUQI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5437
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5438
  }
5439
 
5440
#undef FLD
5441
}
5442
  NEXT (vpc);
5443
 
5444
  CASE (sem, INSN_STXL) : /* stx.l $rm, $rn, $rd */
5445
{
5446
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5447
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5448
#define FLD(f) abuf->fields.sfmt_add.f
5449
  int UNUSED written = 0;
5450
  IADDR UNUSED pc = abuf->addr;
5451
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5452
 
5453
  {
5454
    SI opval = SUBWORDDISI (GET_H_GR (FLD (f_dest)), 1);
5455
    SETMEMSI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5456
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5457
  }
5458
 
5459
#undef FLD
5460
}
5461
  NEXT (vpc);
5462
 
5463
  CASE (sem, INSN_STXQ) : /* stx.q $rm, $rn, $rd */
5464
{
5465
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5466
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5467
#define FLD(f) abuf->fields.sfmt_add.f
5468
  int UNUSED written = 0;
5469
  IADDR UNUSED pc = abuf->addr;
5470
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5471
 
5472
  {
5473
    DI opval = GET_H_GR (FLD (f_dest));
5474
    SETMEMDI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5475
    TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5476
  }
5477
 
5478
#undef FLD
5479
}
5480
  NEXT (vpc);
5481
 
5482
  CASE (sem, INSN_STXW) : /* stx.w $rm, $rn, $rd */
5483
{
5484
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5485
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5486
#define FLD(f) abuf->fields.sfmt_add.f
5487
  int UNUSED written = 0;
5488
  IADDR UNUSED pc = abuf->addr;
5489
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5490
 
5491
  {
5492
    HI opval = SUBWORDDIHI (GET_H_GR (FLD (f_dest)), 3);
5493
    SETMEMHI (current_cpu, pc, ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right))), opval);
5494
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5495
  }
5496
 
5497
#undef FLD
5498
}
5499
  NEXT (vpc);
5500
 
5501
  CASE (sem, INSN_SUB) : /* sub $rm, $rn, $rd */
5502
{
5503
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5504
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5505
#define FLD(f) abuf->fields.sfmt_add.f
5506
  int UNUSED written = 0;
5507
  IADDR UNUSED pc = abuf->addr;
5508
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5509
 
5510
  {
5511
    DI opval = SUBDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5512
    SET_H_GR (FLD (f_dest), opval);
5513
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5514
  }
5515
 
5516
#undef FLD
5517
}
5518
  NEXT (vpc);
5519
 
5520
  CASE (sem, INSN_SUBL) : /* sub.l $rm, $rn, $rd */
5521
{
5522
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5523
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5524
#define FLD(f) abuf->fields.sfmt_add.f
5525
  int UNUSED written = 0;
5526
  IADDR UNUSED pc = abuf->addr;
5527
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5528
 
5529
  {
5530
    DI opval = EXTSIDI (SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right)), 1)));
5531
    SET_H_GR (FLD (f_dest), opval);
5532
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5533
  }
5534
 
5535
#undef FLD
5536
}
5537
  NEXT (vpc);
5538
 
5539
  CASE (sem, INSN_SWAPQ) : /* swap.q $rm, $rn, $rd */
5540
{
5541
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5542
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5543
#define FLD(f) abuf->fields.sfmt_add.f
5544
  int UNUSED written = 0;
5545
  IADDR UNUSED pc = abuf->addr;
5546
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5547
 
5548
{
5549
  DI tmp_addr;
5550
  DI tmp_temp;
5551
  tmp_addr = ADDDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5552
  tmp_temp = GETMEMDI (current_cpu, pc, tmp_addr);
5553
  {
5554
    DI opval = GET_H_GR (FLD (f_dest));
5555
    SETMEMDI (current_cpu, pc, tmp_addr, opval);
5556
    TRACE_RESULT (current_cpu, abuf, "memory", 'D', opval);
5557
  }
5558
  {
5559
    DI opval = tmp_temp;
5560
    SET_H_GR (FLD (f_dest), opval);
5561
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5562
  }
5563
}
5564
 
5565
#undef FLD
5566
}
5567
  NEXT (vpc);
5568
 
5569
  CASE (sem, INSN_SYNCI) : /* synci */
5570
{
5571
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5572
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5573
#define FLD(f) abuf->fields.fmt_empty.f
5574
  int UNUSED written = 0;
5575
  IADDR UNUSED pc = abuf->addr;
5576
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5577
 
5578
((void) 0); /*nop*/
5579
 
5580
#undef FLD
5581
}
5582
  NEXT (vpc);
5583
 
5584
  CASE (sem, INSN_SYNCO) : /* synco */
5585
{
5586
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5587
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5588
#define FLD(f) abuf->fields.fmt_empty.f
5589
  int UNUSED written = 0;
5590
  IADDR UNUSED pc = abuf->addr;
5591
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5592
 
5593
((void) 0); /*nop*/
5594
 
5595
#undef FLD
5596
}
5597
  NEXT (vpc);
5598
 
5599
  CASE (sem, INSN_TRAPA) : /* trapa $rm */
5600
{
5601
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5602
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5603
#define FLD(f) abuf->fields.sfmt_xori.f
5604
  int UNUSED written = 0;
5605
  IADDR UNUSED pc = abuf->addr;
5606
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5607
 
5608
sh64_trapa (current_cpu, GET_H_GR (FLD (f_left)), pc);
5609
 
5610
#undef FLD
5611
}
5612
  NEXT (vpc);
5613
 
5614
  CASE (sem, INSN_XOR) : /* xor $rm, $rn, $rd */
5615
{
5616
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5617
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5618
#define FLD(f) abuf->fields.sfmt_add.f
5619
  int UNUSED written = 0;
5620
  IADDR UNUSED pc = abuf->addr;
5621
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5622
 
5623
  {
5624
    DI opval = XORDI (GET_H_GR (FLD (f_left)), GET_H_GR (FLD (f_right)));
5625
    SET_H_GR (FLD (f_dest), opval);
5626
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5627
  }
5628
 
5629
#undef FLD
5630
}
5631
  NEXT (vpc);
5632
 
5633
  CASE (sem, INSN_XORI) : /* xori $rm, $imm6, $rd */
5634
{
5635
  SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
5636
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5637
#define FLD(f) abuf->fields.sfmt_xori.f
5638
  int UNUSED written = 0;
5639
  IADDR UNUSED pc = abuf->addr;
5640
  vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5641
 
5642
  {
5643
    DI opval = XORDI (GET_H_GR (FLD (f_left)), EXTSIDI (FLD (f_imm6)));
5644
    SET_H_GR (FLD (f_dest), opval);
5645
    TRACE_RESULT (current_cpu, abuf, "gr", 'D', opval);
5646
  }
5647
 
5648
#undef FLD
5649
}
5650
  NEXT (vpc);
5651
 
5652
 
5653
    }
5654
  ENDSWITCH (sem) /* End of semantic switch.  */
5655
 
5656
  /* At this point `vpc' contains the next insn to execute.  */
5657
}
5658
 
5659
#undef DEFINE_SWITCH
5660
#endif /* DEFINE_SWITCH */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.