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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [sh64/] [sem-media-switch.c] - Blame information for rev 318

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

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

powered by: WebSVN 2.1.0

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