1 /* Simulator instruction semantics for sh64.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2019 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, see <http://www.gnu.org/licenses/>.
26 /* The labels have the case they have because the enum of insn types
27 is all uppercase and in the non-stdc case the insn symbol is built
28 into the enum name. */
34 { SH64_MEDIA_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
35 { SH64_MEDIA_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
36 { SH64_MEDIA_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
37 { SH64_MEDIA_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
38 { SH64_MEDIA_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
39 { SH64_MEDIA_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
40 { SH64_MEDIA_INSN_ADD
, && case_sem_INSN_ADD
},
41 { SH64_MEDIA_INSN_ADDL
, && case_sem_INSN_ADDL
},
42 { SH64_MEDIA_INSN_ADDI
, && case_sem_INSN_ADDI
},
43 { SH64_MEDIA_INSN_ADDIL
, && case_sem_INSN_ADDIL
},
44 { SH64_MEDIA_INSN_ADDZL
, && case_sem_INSN_ADDZL
},
45 { SH64_MEDIA_INSN_ALLOCO
, && case_sem_INSN_ALLOCO
},
46 { SH64_MEDIA_INSN_AND
, && case_sem_INSN_AND
},
47 { SH64_MEDIA_INSN_ANDC
, && case_sem_INSN_ANDC
},
48 { SH64_MEDIA_INSN_ANDI
, && case_sem_INSN_ANDI
},
49 { SH64_MEDIA_INSN_BEQ
, && case_sem_INSN_BEQ
},
50 { SH64_MEDIA_INSN_BEQI
, && case_sem_INSN_BEQI
},
51 { SH64_MEDIA_INSN_BGE
, && case_sem_INSN_BGE
},
52 { SH64_MEDIA_INSN_BGEU
, && case_sem_INSN_BGEU
},
53 { SH64_MEDIA_INSN_BGT
, && case_sem_INSN_BGT
},
54 { SH64_MEDIA_INSN_BGTU
, && case_sem_INSN_BGTU
},
55 { SH64_MEDIA_INSN_BLINK
, && case_sem_INSN_BLINK
},
56 { SH64_MEDIA_INSN_BNE
, && case_sem_INSN_BNE
},
57 { SH64_MEDIA_INSN_BNEI
, && case_sem_INSN_BNEI
},
58 { SH64_MEDIA_INSN_BRK
, && case_sem_INSN_BRK
},
59 { SH64_MEDIA_INSN_BYTEREV
, && case_sem_INSN_BYTEREV
},
60 { SH64_MEDIA_INSN_CMPEQ
, && case_sem_INSN_CMPEQ
},
61 { SH64_MEDIA_INSN_CMPGT
, && case_sem_INSN_CMPGT
},
62 { SH64_MEDIA_INSN_CMPGTU
, && case_sem_INSN_CMPGTU
},
63 { SH64_MEDIA_INSN_CMVEQ
, && case_sem_INSN_CMVEQ
},
64 { SH64_MEDIA_INSN_CMVNE
, && case_sem_INSN_CMVNE
},
65 { SH64_MEDIA_INSN_FABSD
, && case_sem_INSN_FABSD
},
66 { SH64_MEDIA_INSN_FABSS
, && case_sem_INSN_FABSS
},
67 { SH64_MEDIA_INSN_FADDD
, && case_sem_INSN_FADDD
},
68 { SH64_MEDIA_INSN_FADDS
, && case_sem_INSN_FADDS
},
69 { SH64_MEDIA_INSN_FCMPEQD
, && case_sem_INSN_FCMPEQD
},
70 { SH64_MEDIA_INSN_FCMPEQS
, && case_sem_INSN_FCMPEQS
},
71 { SH64_MEDIA_INSN_FCMPGED
, && case_sem_INSN_FCMPGED
},
72 { SH64_MEDIA_INSN_FCMPGES
, && case_sem_INSN_FCMPGES
},
73 { SH64_MEDIA_INSN_FCMPGTD
, && case_sem_INSN_FCMPGTD
},
74 { SH64_MEDIA_INSN_FCMPGTS
, && case_sem_INSN_FCMPGTS
},
75 { SH64_MEDIA_INSN_FCMPUND
, && case_sem_INSN_FCMPUND
},
76 { SH64_MEDIA_INSN_FCMPUNS
, && case_sem_INSN_FCMPUNS
},
77 { SH64_MEDIA_INSN_FCNVDS
, && case_sem_INSN_FCNVDS
},
78 { SH64_MEDIA_INSN_FCNVSD
, && case_sem_INSN_FCNVSD
},
79 { SH64_MEDIA_INSN_FDIVD
, && case_sem_INSN_FDIVD
},
80 { SH64_MEDIA_INSN_FDIVS
, && case_sem_INSN_FDIVS
},
81 { SH64_MEDIA_INSN_FGETSCR
, && case_sem_INSN_FGETSCR
},
82 { SH64_MEDIA_INSN_FIPRS
, && case_sem_INSN_FIPRS
},
83 { SH64_MEDIA_INSN_FLDD
, && case_sem_INSN_FLDD
},
84 { SH64_MEDIA_INSN_FLDP
, && case_sem_INSN_FLDP
},
85 { SH64_MEDIA_INSN_FLDS
, && case_sem_INSN_FLDS
},
86 { SH64_MEDIA_INSN_FLDXD
, && case_sem_INSN_FLDXD
},
87 { SH64_MEDIA_INSN_FLDXP
, && case_sem_INSN_FLDXP
},
88 { SH64_MEDIA_INSN_FLDXS
, && case_sem_INSN_FLDXS
},
89 { SH64_MEDIA_INSN_FLOATLD
, && case_sem_INSN_FLOATLD
},
90 { SH64_MEDIA_INSN_FLOATLS
, && case_sem_INSN_FLOATLS
},
91 { SH64_MEDIA_INSN_FLOATQD
, && case_sem_INSN_FLOATQD
},
92 { SH64_MEDIA_INSN_FLOATQS
, && case_sem_INSN_FLOATQS
},
93 { SH64_MEDIA_INSN_FMACS
, && case_sem_INSN_FMACS
},
94 { SH64_MEDIA_INSN_FMOVD
, && case_sem_INSN_FMOVD
},
95 { SH64_MEDIA_INSN_FMOVDQ
, && case_sem_INSN_FMOVDQ
},
96 { SH64_MEDIA_INSN_FMOVLS
, && case_sem_INSN_FMOVLS
},
97 { SH64_MEDIA_INSN_FMOVQD
, && case_sem_INSN_FMOVQD
},
98 { SH64_MEDIA_INSN_FMOVS
, && case_sem_INSN_FMOVS
},
99 { SH64_MEDIA_INSN_FMOVSL
, && case_sem_INSN_FMOVSL
},
100 { SH64_MEDIA_INSN_FMULD
, && case_sem_INSN_FMULD
},
101 { SH64_MEDIA_INSN_FMULS
, && case_sem_INSN_FMULS
},
102 { SH64_MEDIA_INSN_FNEGD
, && case_sem_INSN_FNEGD
},
103 { SH64_MEDIA_INSN_FNEGS
, && case_sem_INSN_FNEGS
},
104 { SH64_MEDIA_INSN_FPUTSCR
, && case_sem_INSN_FPUTSCR
},
105 { SH64_MEDIA_INSN_FSQRTD
, && case_sem_INSN_FSQRTD
},
106 { SH64_MEDIA_INSN_FSQRTS
, && case_sem_INSN_FSQRTS
},
107 { SH64_MEDIA_INSN_FSTD
, && case_sem_INSN_FSTD
},
108 { SH64_MEDIA_INSN_FSTP
, && case_sem_INSN_FSTP
},
109 { SH64_MEDIA_INSN_FSTS
, && case_sem_INSN_FSTS
},
110 { SH64_MEDIA_INSN_FSTXD
, && case_sem_INSN_FSTXD
},
111 { SH64_MEDIA_INSN_FSTXP
, && case_sem_INSN_FSTXP
},
112 { SH64_MEDIA_INSN_FSTXS
, && case_sem_INSN_FSTXS
},
113 { SH64_MEDIA_INSN_FSUBD
, && case_sem_INSN_FSUBD
},
114 { SH64_MEDIA_INSN_FSUBS
, && case_sem_INSN_FSUBS
},
115 { SH64_MEDIA_INSN_FTRCDL
, && case_sem_INSN_FTRCDL
},
116 { SH64_MEDIA_INSN_FTRCSL
, && case_sem_INSN_FTRCSL
},
117 { SH64_MEDIA_INSN_FTRCDQ
, && case_sem_INSN_FTRCDQ
},
118 { SH64_MEDIA_INSN_FTRCSQ
, && case_sem_INSN_FTRCSQ
},
119 { SH64_MEDIA_INSN_FTRVS
, && case_sem_INSN_FTRVS
},
120 { SH64_MEDIA_INSN_GETCFG
, && case_sem_INSN_GETCFG
},
121 { SH64_MEDIA_INSN_GETCON
, && case_sem_INSN_GETCON
},
122 { SH64_MEDIA_INSN_GETTR
, && case_sem_INSN_GETTR
},
123 { SH64_MEDIA_INSN_ICBI
, && case_sem_INSN_ICBI
},
124 { SH64_MEDIA_INSN_LDB
, && case_sem_INSN_LDB
},
125 { SH64_MEDIA_INSN_LDL
, && case_sem_INSN_LDL
},
126 { SH64_MEDIA_INSN_LDQ
, && case_sem_INSN_LDQ
},
127 { SH64_MEDIA_INSN_LDUB
, && case_sem_INSN_LDUB
},
128 { SH64_MEDIA_INSN_LDUW
, && case_sem_INSN_LDUW
},
129 { SH64_MEDIA_INSN_LDW
, && case_sem_INSN_LDW
},
130 { SH64_MEDIA_INSN_LDHIL
, && case_sem_INSN_LDHIL
},
131 { SH64_MEDIA_INSN_LDHIQ
, && case_sem_INSN_LDHIQ
},
132 { SH64_MEDIA_INSN_LDLOL
, && case_sem_INSN_LDLOL
},
133 { SH64_MEDIA_INSN_LDLOQ
, && case_sem_INSN_LDLOQ
},
134 { SH64_MEDIA_INSN_LDXB
, && case_sem_INSN_LDXB
},
135 { SH64_MEDIA_INSN_LDXL
, && case_sem_INSN_LDXL
},
136 { SH64_MEDIA_INSN_LDXQ
, && case_sem_INSN_LDXQ
},
137 { SH64_MEDIA_INSN_LDXUB
, && case_sem_INSN_LDXUB
},
138 { SH64_MEDIA_INSN_LDXUW
, && case_sem_INSN_LDXUW
},
139 { SH64_MEDIA_INSN_LDXW
, && case_sem_INSN_LDXW
},
140 { SH64_MEDIA_INSN_MABSL
, && case_sem_INSN_MABSL
},
141 { SH64_MEDIA_INSN_MABSW
, && case_sem_INSN_MABSW
},
142 { SH64_MEDIA_INSN_MADDL
, && case_sem_INSN_MADDL
},
143 { SH64_MEDIA_INSN_MADDW
, && case_sem_INSN_MADDW
},
144 { SH64_MEDIA_INSN_MADDSL
, && case_sem_INSN_MADDSL
},
145 { SH64_MEDIA_INSN_MADDSUB
, && case_sem_INSN_MADDSUB
},
146 { SH64_MEDIA_INSN_MADDSW
, && case_sem_INSN_MADDSW
},
147 { SH64_MEDIA_INSN_MCMPEQB
, && case_sem_INSN_MCMPEQB
},
148 { SH64_MEDIA_INSN_MCMPEQL
, && case_sem_INSN_MCMPEQL
},
149 { SH64_MEDIA_INSN_MCMPEQW
, && case_sem_INSN_MCMPEQW
},
150 { SH64_MEDIA_INSN_MCMPGTL
, && case_sem_INSN_MCMPGTL
},
151 { SH64_MEDIA_INSN_MCMPGTUB
, && case_sem_INSN_MCMPGTUB
},
152 { SH64_MEDIA_INSN_MCMPGTW
, && case_sem_INSN_MCMPGTW
},
153 { SH64_MEDIA_INSN_MCMV
, && case_sem_INSN_MCMV
},
154 { SH64_MEDIA_INSN_MCNVSLW
, && case_sem_INSN_MCNVSLW
},
155 { SH64_MEDIA_INSN_MCNVSWB
, && case_sem_INSN_MCNVSWB
},
156 { SH64_MEDIA_INSN_MCNVSWUB
, && case_sem_INSN_MCNVSWUB
},
157 { SH64_MEDIA_INSN_MEXTR1
, && case_sem_INSN_MEXTR1
},
158 { SH64_MEDIA_INSN_MEXTR2
, && case_sem_INSN_MEXTR2
},
159 { SH64_MEDIA_INSN_MEXTR3
, && case_sem_INSN_MEXTR3
},
160 { SH64_MEDIA_INSN_MEXTR4
, && case_sem_INSN_MEXTR4
},
161 { SH64_MEDIA_INSN_MEXTR5
, && case_sem_INSN_MEXTR5
},
162 { SH64_MEDIA_INSN_MEXTR6
, && case_sem_INSN_MEXTR6
},
163 { SH64_MEDIA_INSN_MEXTR7
, && case_sem_INSN_MEXTR7
},
164 { SH64_MEDIA_INSN_MMACFXWL
, && case_sem_INSN_MMACFXWL
},
165 { SH64_MEDIA_INSN_MMACNFX_WL
, && case_sem_INSN_MMACNFX_WL
},
166 { SH64_MEDIA_INSN_MMULL
, && case_sem_INSN_MMULL
},
167 { SH64_MEDIA_INSN_MMULW
, && case_sem_INSN_MMULW
},
168 { SH64_MEDIA_INSN_MMULFXL
, && case_sem_INSN_MMULFXL
},
169 { SH64_MEDIA_INSN_MMULFXW
, && case_sem_INSN_MMULFXW
},
170 { SH64_MEDIA_INSN_MMULFXRPW
, && case_sem_INSN_MMULFXRPW
},
171 { SH64_MEDIA_INSN_MMULHIWL
, && case_sem_INSN_MMULHIWL
},
172 { SH64_MEDIA_INSN_MMULLOWL
, && case_sem_INSN_MMULLOWL
},
173 { SH64_MEDIA_INSN_MMULSUMWQ
, && case_sem_INSN_MMULSUMWQ
},
174 { SH64_MEDIA_INSN_MOVI
, && case_sem_INSN_MOVI
},
175 { SH64_MEDIA_INSN_MPERMW
, && case_sem_INSN_MPERMW
},
176 { SH64_MEDIA_INSN_MSADUBQ
, && case_sem_INSN_MSADUBQ
},
177 { SH64_MEDIA_INSN_MSHALDSL
, && case_sem_INSN_MSHALDSL
},
178 { SH64_MEDIA_INSN_MSHALDSW
, && case_sem_INSN_MSHALDSW
},
179 { SH64_MEDIA_INSN_MSHARDL
, && case_sem_INSN_MSHARDL
},
180 { SH64_MEDIA_INSN_MSHARDW
, && case_sem_INSN_MSHARDW
},
181 { SH64_MEDIA_INSN_MSHARDSQ
, && case_sem_INSN_MSHARDSQ
},
182 { SH64_MEDIA_INSN_MSHFHIB
, && case_sem_INSN_MSHFHIB
},
183 { SH64_MEDIA_INSN_MSHFHIL
, && case_sem_INSN_MSHFHIL
},
184 { SH64_MEDIA_INSN_MSHFHIW
, && case_sem_INSN_MSHFHIW
},
185 { SH64_MEDIA_INSN_MSHFLOB
, && case_sem_INSN_MSHFLOB
},
186 { SH64_MEDIA_INSN_MSHFLOL
, && case_sem_INSN_MSHFLOL
},
187 { SH64_MEDIA_INSN_MSHFLOW
, && case_sem_INSN_MSHFLOW
},
188 { SH64_MEDIA_INSN_MSHLLDL
, && case_sem_INSN_MSHLLDL
},
189 { SH64_MEDIA_INSN_MSHLLDW
, && case_sem_INSN_MSHLLDW
},
190 { SH64_MEDIA_INSN_MSHLRDL
, && case_sem_INSN_MSHLRDL
},
191 { SH64_MEDIA_INSN_MSHLRDW
, && case_sem_INSN_MSHLRDW
},
192 { SH64_MEDIA_INSN_MSUBL
, && case_sem_INSN_MSUBL
},
193 { SH64_MEDIA_INSN_MSUBW
, && case_sem_INSN_MSUBW
},
194 { SH64_MEDIA_INSN_MSUBSL
, && case_sem_INSN_MSUBSL
},
195 { SH64_MEDIA_INSN_MSUBSUB
, && case_sem_INSN_MSUBSUB
},
196 { SH64_MEDIA_INSN_MSUBSW
, && case_sem_INSN_MSUBSW
},
197 { SH64_MEDIA_INSN_MULSL
, && case_sem_INSN_MULSL
},
198 { SH64_MEDIA_INSN_MULUL
, && case_sem_INSN_MULUL
},
199 { SH64_MEDIA_INSN_NOP
, && case_sem_INSN_NOP
},
200 { SH64_MEDIA_INSN_NSB
, && case_sem_INSN_NSB
},
201 { SH64_MEDIA_INSN_OCBI
, && case_sem_INSN_OCBI
},
202 { SH64_MEDIA_INSN_OCBP
, && case_sem_INSN_OCBP
},
203 { SH64_MEDIA_INSN_OCBWB
, && case_sem_INSN_OCBWB
},
204 { SH64_MEDIA_INSN_OR
, && case_sem_INSN_OR
},
205 { SH64_MEDIA_INSN_ORI
, && case_sem_INSN_ORI
},
206 { SH64_MEDIA_INSN_PREFI
, && case_sem_INSN_PREFI
},
207 { SH64_MEDIA_INSN_PTA
, && case_sem_INSN_PTA
},
208 { SH64_MEDIA_INSN_PTABS
, && case_sem_INSN_PTABS
},
209 { SH64_MEDIA_INSN_PTB
, && case_sem_INSN_PTB
},
210 { SH64_MEDIA_INSN_PTREL
, && case_sem_INSN_PTREL
},
211 { SH64_MEDIA_INSN_PUTCFG
, && case_sem_INSN_PUTCFG
},
212 { SH64_MEDIA_INSN_PUTCON
, && case_sem_INSN_PUTCON
},
213 { SH64_MEDIA_INSN_RTE
, && case_sem_INSN_RTE
},
214 { SH64_MEDIA_INSN_SHARD
, && case_sem_INSN_SHARD
},
215 { SH64_MEDIA_INSN_SHARDL
, && case_sem_INSN_SHARDL
},
216 { SH64_MEDIA_INSN_SHARI
, && case_sem_INSN_SHARI
},
217 { SH64_MEDIA_INSN_SHARIL
, && case_sem_INSN_SHARIL
},
218 { SH64_MEDIA_INSN_SHLLD
, && case_sem_INSN_SHLLD
},
219 { SH64_MEDIA_INSN_SHLLDL
, && case_sem_INSN_SHLLDL
},
220 { SH64_MEDIA_INSN_SHLLI
, && case_sem_INSN_SHLLI
},
221 { SH64_MEDIA_INSN_SHLLIL
, && case_sem_INSN_SHLLIL
},
222 { SH64_MEDIA_INSN_SHLRD
, && case_sem_INSN_SHLRD
},
223 { SH64_MEDIA_INSN_SHLRDL
, && case_sem_INSN_SHLRDL
},
224 { SH64_MEDIA_INSN_SHLRI
, && case_sem_INSN_SHLRI
},
225 { SH64_MEDIA_INSN_SHLRIL
, && case_sem_INSN_SHLRIL
},
226 { SH64_MEDIA_INSN_SHORI
, && case_sem_INSN_SHORI
},
227 { SH64_MEDIA_INSN_SLEEP
, && case_sem_INSN_SLEEP
},
228 { SH64_MEDIA_INSN_STB
, && case_sem_INSN_STB
},
229 { SH64_MEDIA_INSN_STL
, && case_sem_INSN_STL
},
230 { SH64_MEDIA_INSN_STQ
, && case_sem_INSN_STQ
},
231 { SH64_MEDIA_INSN_STW
, && case_sem_INSN_STW
},
232 { SH64_MEDIA_INSN_STHIL
, && case_sem_INSN_STHIL
},
233 { SH64_MEDIA_INSN_STHIQ
, && case_sem_INSN_STHIQ
},
234 { SH64_MEDIA_INSN_STLOL
, && case_sem_INSN_STLOL
},
235 { SH64_MEDIA_INSN_STLOQ
, && case_sem_INSN_STLOQ
},
236 { SH64_MEDIA_INSN_STXB
, && case_sem_INSN_STXB
},
237 { SH64_MEDIA_INSN_STXL
, && case_sem_INSN_STXL
},
238 { SH64_MEDIA_INSN_STXQ
, && case_sem_INSN_STXQ
},
239 { SH64_MEDIA_INSN_STXW
, && case_sem_INSN_STXW
},
240 { SH64_MEDIA_INSN_SUB
, && case_sem_INSN_SUB
},
241 { SH64_MEDIA_INSN_SUBL
, && case_sem_INSN_SUBL
},
242 { SH64_MEDIA_INSN_SWAPQ
, && case_sem_INSN_SWAPQ
},
243 { SH64_MEDIA_INSN_SYNCI
, && case_sem_INSN_SYNCI
},
244 { SH64_MEDIA_INSN_SYNCO
, && case_sem_INSN_SYNCO
},
245 { SH64_MEDIA_INSN_TRAPA
, && case_sem_INSN_TRAPA
},
246 { SH64_MEDIA_INSN_XOR
, && case_sem_INSN_XOR
},
247 { SH64_MEDIA_INSN_XORI
, && case_sem_INSN_XORI
},
252 for (i
= 0; labels
[i
].label
!= 0; ++i
)
255 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
257 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
262 #endif /* DEFINE_LABELS */
266 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
267 off frills like tracing and profiling. */
268 /* FIXME: A better way would be to have CGEN_TRACE_RESULT check for something
269 that can cause it to be optimized out. Another way would be to emit
270 special handlers into the instruction "stream". */
273 #undef CGEN_TRACE_RESULT
274 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
278 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
284 /* Branch to next handler without going around main loop. */
285 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
286 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
288 #else /* ! WITH_SCACHE_PBB */
290 #define NEXT(vpc) BREAK (sem)
293 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
295 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
298 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
301 #endif /* ! WITH_SCACHE_PBB */
305 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
307 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
308 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
309 #define FLD(f) abuf->fields.sfmt_empty.f
310 int UNUSED written
= 0;
311 IADDR UNUSED pc
= abuf
->addr
;
312 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
315 /* Update the recorded pc in the cpu state struct.
316 Only necessary for WITH_SCACHE case, but to avoid the
317 conditional compilation .... */
319 /* Virtual insns have zero size. Overwrite vpc with address of next insn
320 using the default-insn-bitsize spec. When executing insns in parallel
321 we may want to queue the fault and continue execution. */
322 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
323 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
330 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
334 #define FLD(f) abuf->fields.sfmt_empty.f
335 int UNUSED written
= 0;
336 IADDR UNUSED pc
= abuf
->addr
;
337 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
340 #if WITH_SCACHE_PBB_SH64_MEDIA
341 sh64_media_pbb_after (current_cpu
, sem_arg
);
349 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
351 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
352 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
353 #define FLD(f) abuf->fields.sfmt_empty.f
354 int UNUSED written
= 0;
355 IADDR UNUSED pc
= abuf
->addr
;
356 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
359 #if WITH_SCACHE_PBB_SH64_MEDIA
360 sh64_media_pbb_before (current_cpu
, sem_arg
);
368 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
370 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
371 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
372 #define FLD(f) abuf->fields.sfmt_empty.f
373 int UNUSED written
= 0;
374 IADDR UNUSED pc
= abuf
->addr
;
375 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
378 #if WITH_SCACHE_PBB_SH64_MEDIA
380 vpc
= sh64_media_pbb_cti_chain (current_cpu
, sem_arg
,
381 pbb_br_type
, pbb_br_npc
);
384 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
385 vpc
= sh64_media_pbb_cti_chain (current_cpu
, sem_arg
,
386 CPU_PBB_BR_TYPE (current_cpu
),
387 CPU_PBB_BR_NPC (current_cpu
));
396 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
398 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
399 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
400 #define FLD(f) abuf->fields.sfmt_empty.f
401 int UNUSED written
= 0;
402 IADDR UNUSED pc
= abuf
->addr
;
403 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
406 #if WITH_SCACHE_PBB_SH64_MEDIA
407 vpc
= sh64_media_pbb_chain (current_cpu
, sem_arg
);
418 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
420 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
421 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
422 #define FLD(f) abuf->fields.sfmt_empty.f
423 int UNUSED written
= 0;
424 IADDR UNUSED pc
= abuf
->addr
;
425 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
428 #if WITH_SCACHE_PBB_SH64_MEDIA
429 #if defined DEFINE_SWITCH || defined FAST_P
430 /* In the switch case FAST_P is a constant, allowing several optimizations
431 in any called inline functions. */
432 vpc
= sh64_media_pbb_begin (current_cpu
, FAST_P
);
434 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
435 vpc
= sh64_media_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
437 vpc
= sh64_media_pbb_begin (current_cpu
, 0);
447 CASE (sem
, INSN_ADD
) : /* add $rm, $rn, $rd */
449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
451 #define FLD(f) abuf->fields.sfmt_add.f
452 int UNUSED written
= 0;
453 IADDR UNUSED pc
= abuf
->addr
;
454 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
457 DI opval
= ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
458 SET_H_GR (FLD (f_dest
), opval
);
459 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
466 CASE (sem
, INSN_ADDL
) : /* add.l $rm, $rn, $rd */
468 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
469 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
470 #define FLD(f) abuf->fields.sfmt_add.f
471 int UNUSED written
= 0;
472 IADDR UNUSED pc
= abuf
->addr
;
473 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
476 DI opval
= ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
477 SET_H_GR (FLD (f_dest
), opval
);
478 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
485 CASE (sem
, INSN_ADDI
) : /* addi $rm, $disp10, $rd */
487 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
488 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
489 #define FLD(f) abuf->fields.sfmt_addi.f
490 int UNUSED written
= 0;
491 IADDR UNUSED pc
= abuf
->addr
;
492 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
495 DI opval
= ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)));
496 SET_H_GR (FLD (f_dest
), opval
);
497 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
504 CASE (sem
, INSN_ADDIL
) : /* addi.l $rm, $disp10, $rd */
506 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
508 #define FLD(f) abuf->fields.sfmt_addi.f
509 int UNUSED written
= 0;
510 IADDR UNUSED pc
= abuf
->addr
;
511 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
514 DI opval
= EXTSIDI (ADDSI (EXTSISI (FLD (f_disp10
)), SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)));
515 SET_H_GR (FLD (f_dest
), opval
);
516 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
523 CASE (sem
, INSN_ADDZL
) : /* addz.l $rm, $rn, $rd */
525 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
526 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
527 #define FLD(f) abuf->fields.sfmt_add.f
528 int UNUSED written
= 0;
529 IADDR UNUSED pc
= abuf
->addr
;
530 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
533 DI opval
= ZEXTSIDI (ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
534 SET_H_GR (FLD (f_dest
), opval
);
535 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
542 CASE (sem
, INSN_ALLOCO
) : /* alloco $rm, $disp6x32 */
544 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
545 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
546 #define FLD(f) abuf->fields.sfmt_xori.f
547 int UNUSED written
= 0;
548 IADDR UNUSED pc
= abuf
->addr
;
549 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
553 DI opval
= GET_H_GR (FLD (f_left
));
554 SET_H_GR (FLD (f_left
), opval
);
555 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
564 CASE (sem
, INSN_AND
) : /* and $rm, $rn, $rd */
566 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
567 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
568 #define FLD(f) abuf->fields.sfmt_add.f
569 int UNUSED written
= 0;
570 IADDR UNUSED pc
= abuf
->addr
;
571 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
574 DI opval
= ANDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
575 SET_H_GR (FLD (f_dest
), opval
);
576 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
583 CASE (sem
, INSN_ANDC
) : /* andc $rm, $rn, $rd */
585 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
586 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
587 #define FLD(f) abuf->fields.sfmt_add.f
588 int UNUSED written
= 0;
589 IADDR UNUSED pc
= abuf
->addr
;
590 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
593 DI opval
= ANDDI (GET_H_GR (FLD (f_left
)), INVDI (GET_H_GR (FLD (f_right
))));
594 SET_H_GR (FLD (f_dest
), opval
);
595 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
602 CASE (sem
, INSN_ANDI
) : /* andi $rm, $disp10, $rd */
604 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
605 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
606 #define FLD(f) abuf->fields.sfmt_addi.f
607 int UNUSED written
= 0;
608 IADDR UNUSED pc
= abuf
->addr
;
609 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
612 DI opval
= ANDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)));
613 SET_H_GR (FLD (f_dest
), opval
);
614 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
621 CASE (sem
, INSN_BEQ
) : /* beq$likely $rm, $rn, $tra */
623 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
624 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
625 #define FLD(f) abuf->fields.sfmt_beq.f
626 int UNUSED written
= 0;
627 IADDR UNUSED pc
= abuf
->addr
;
629 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
633 if (EQDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
635 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
636 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
638 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
643 abuf
->written
= written
;
644 SEM_BRANCH_FINI (vpc
);
649 CASE (sem
, INSN_BEQI
) : /* beqi$likely $rm, $imm6, $tra */
651 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
652 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
653 #define FLD(f) abuf->fields.sfmt_beqi.f
654 int UNUSED written
= 0;
655 IADDR UNUSED pc
= abuf
->addr
;
657 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
661 if (EQDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm6
)))) {
663 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
664 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
666 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
671 abuf
->written
= written
;
672 SEM_BRANCH_FINI (vpc
);
677 CASE (sem
, INSN_BGE
) : /* bge$likely $rm, $rn, $tra */
679 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
680 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
681 #define FLD(f) abuf->fields.sfmt_beq.f
682 int UNUSED written
= 0;
683 IADDR UNUSED pc
= abuf
->addr
;
685 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
689 if (GEDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
691 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
692 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
694 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
699 abuf
->written
= written
;
700 SEM_BRANCH_FINI (vpc
);
705 CASE (sem
, INSN_BGEU
) : /* bgeu$likely $rm, $rn, $tra */
707 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
708 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
709 #define FLD(f) abuf->fields.sfmt_beq.f
710 int UNUSED written
= 0;
711 IADDR UNUSED pc
= abuf
->addr
;
713 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
717 if (GEUDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
719 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
720 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
722 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
727 abuf
->written
= written
;
728 SEM_BRANCH_FINI (vpc
);
733 CASE (sem
, INSN_BGT
) : /* bgt$likely $rm, $rn, $tra */
735 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
736 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
737 #define FLD(f) abuf->fields.sfmt_beq.f
738 int UNUSED written
= 0;
739 IADDR UNUSED pc
= abuf
->addr
;
741 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
745 if (GTDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
747 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
748 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
750 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
755 abuf
->written
= written
;
756 SEM_BRANCH_FINI (vpc
);
761 CASE (sem
, INSN_BGTU
) : /* bgtu$likely $rm, $rn, $tra */
763 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
764 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
765 #define FLD(f) abuf->fields.sfmt_beq.f
766 int UNUSED written
= 0;
767 IADDR UNUSED pc
= abuf
->addr
;
769 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
773 if (GTUDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
775 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
776 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
778 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
783 abuf
->written
= written
;
784 SEM_BRANCH_FINI (vpc
);
789 CASE (sem
, INSN_BLINK
) : /* blink $trb, $rd */
791 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
793 #define FLD(f) abuf->fields.sfmt_blink.f
794 int UNUSED written
= 0;
795 IADDR UNUSED pc
= abuf
->addr
;
797 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
801 DI opval
= ORDI (ADDDI (pc
, 4), 1);
802 SET_H_GR (FLD (f_dest
), opval
);
803 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
806 UDI opval
= CPU (h_tr
[FLD (f_trb
)]);
807 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
808 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
810 if (EQSI (FLD (f_dest
), 63)) {
817 SEM_BRANCH_FINI (vpc
);
822 CASE (sem
, INSN_BNE
) : /* bne$likely $rm, $rn, $tra */
824 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
825 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
826 #define FLD(f) abuf->fields.sfmt_beq.f
827 int UNUSED written
= 0;
828 IADDR UNUSED pc
= abuf
->addr
;
830 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
834 if (NEDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
836 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
837 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
839 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
844 abuf
->written
= written
;
845 SEM_BRANCH_FINI (vpc
);
850 CASE (sem
, INSN_BNEI
) : /* bnei$likely $rm, $imm6, $tra */
852 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
854 #define FLD(f) abuf->fields.sfmt_beqi.f
855 int UNUSED written
= 0;
856 IADDR UNUSED pc
= abuf
->addr
;
858 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
862 if (NEDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm6
)))) {
864 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
865 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
867 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
872 abuf
->written
= written
;
873 SEM_BRANCH_FINI (vpc
);
878 CASE (sem
, INSN_BRK
) : /* brk */
880 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
881 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
882 #define FLD(f) abuf->fields.sfmt_empty.f
883 int UNUSED written
= 0;
884 IADDR UNUSED pc
= abuf
->addr
;
885 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
887 sh64_break (current_cpu
, pc
);
893 CASE (sem
, INSN_BYTEREV
) : /* byterev $rm, $rd */
895 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
896 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
897 #define FLD(f) abuf->fields.sfmt_xori.f
898 int UNUSED written
= 0;
899 IADDR UNUSED pc
= abuf
->addr
;
900 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
905 tmp_source
= GET_H_GR (FLD (f_left
));
908 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
909 tmp_source
= SRLDI (tmp_source
, 8);
912 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
913 tmp_source
= SRLDI (tmp_source
, 8);
916 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
917 tmp_source
= SRLDI (tmp_source
, 8);
920 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
921 tmp_source
= SRLDI (tmp_source
, 8);
924 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
925 tmp_source
= SRLDI (tmp_source
, 8);
928 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
929 tmp_source
= SRLDI (tmp_source
, 8);
932 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
933 tmp_source
= SRLDI (tmp_source
, 8);
936 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
937 tmp_source
= SRLDI (tmp_source
, 8);
940 DI opval
= tmp_result
;
941 SET_H_GR (FLD (f_dest
), opval
);
942 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
950 CASE (sem
, INSN_CMPEQ
) : /* cmpeq $rm, $rn, $rd */
952 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
953 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
954 #define FLD(f) abuf->fields.sfmt_add.f
955 int UNUSED written
= 0;
956 IADDR UNUSED pc
= abuf
->addr
;
957 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
960 DI opval
= ((EQDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) ? (1) : (0));
961 SET_H_GR (FLD (f_dest
), opval
);
962 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
969 CASE (sem
, INSN_CMPGT
) : /* cmpgt $rm, $rn, $rd */
971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
972 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
973 #define FLD(f) abuf->fields.sfmt_add.f
974 int UNUSED written
= 0;
975 IADDR UNUSED pc
= abuf
->addr
;
976 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
979 DI opval
= ((GTDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) ? (1) : (0));
980 SET_H_GR (FLD (f_dest
), opval
);
981 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
988 CASE (sem
, INSN_CMPGTU
) : /* cmpgtu $rm,$rn, $rd */
990 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
991 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
992 #define FLD(f) abuf->fields.sfmt_add.f
993 int UNUSED written
= 0;
994 IADDR UNUSED pc
= abuf
->addr
;
995 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
998 DI opval
= ((GTUDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) ? (1) : (0));
999 SET_H_GR (FLD (f_dest
), opval
);
1000 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1007 CASE (sem
, INSN_CMVEQ
) : /* cmveq $rm, $rn, $rd */
1009 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1010 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1011 #define FLD(f) abuf->fields.sfmt_add.f
1012 int UNUSED written
= 0;
1013 IADDR UNUSED pc
= abuf
->addr
;
1014 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1016 if (EQDI (GET_H_GR (FLD (f_left
)), 0)) {
1018 DI opval
= GET_H_GR (FLD (f_right
));
1019 SET_H_GR (FLD (f_dest
), opval
);
1020 written
|= (1 << 2);
1021 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1025 abuf
->written
= written
;
1030 CASE (sem
, INSN_CMVNE
) : /* cmvne $rm, $rn, $rd */
1032 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1033 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1034 #define FLD(f) abuf->fields.sfmt_add.f
1035 int UNUSED written
= 0;
1036 IADDR UNUSED pc
= abuf
->addr
;
1037 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1039 if (NEDI (GET_H_GR (FLD (f_left
)), 0)) {
1041 DI opval
= GET_H_GR (FLD (f_right
));
1042 SET_H_GR (FLD (f_dest
), opval
);
1043 written
|= (1 << 2);
1044 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1048 abuf
->written
= written
;
1053 CASE (sem
, INSN_FABSD
) : /* fabs.d $drgh, $drf */
1055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1057 #define FLD(f) abuf->fields.sfmt_fabsd.f
1058 int UNUSED written
= 0;
1059 IADDR UNUSED pc
= abuf
->addr
;
1060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1063 DF opval
= sh64_fabsd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1064 SET_H_DR (FLD (f_dest
), opval
);
1065 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1072 CASE (sem
, INSN_FABSS
) : /* fabs.s $frgh, $frf */
1074 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1075 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1076 #define FLD(f) abuf->fields.sfmt_fabsd.f
1077 int UNUSED written
= 0;
1078 IADDR UNUSED pc
= abuf
->addr
;
1079 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1082 SF opval
= sh64_fabss (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1083 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1084 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1091 CASE (sem
, INSN_FADDD
) : /* fadd.d $drg, $drh, $drf */
1093 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1095 #define FLD(f) abuf->fields.sfmt_add.f
1096 int UNUSED written
= 0;
1097 IADDR UNUSED pc
= abuf
->addr
;
1098 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1101 DF opval
= sh64_faddd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
1102 SET_H_DR (FLD (f_dest
), opval
);
1103 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1110 CASE (sem
, INSN_FADDS
) : /* fadd.s $frg, $frh, $frf */
1112 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1113 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1114 #define FLD(f) abuf->fields.sfmt_add.f
1115 int UNUSED written
= 0;
1116 IADDR UNUSED pc
= abuf
->addr
;
1117 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1120 SF opval
= sh64_fadds (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
1121 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1122 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1129 CASE (sem
, INSN_FCMPEQD
) : /* fcmpeq.d $drg, $drh, $rd */
1131 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1132 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1133 #define FLD(f) abuf->fields.sfmt_add.f
1134 int UNUSED written
= 0;
1135 IADDR UNUSED pc
= abuf
->addr
;
1136 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1139 DI opval
= ZEXTBIDI (sh64_fcmpeqd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
1140 SET_H_GR (FLD (f_dest
), opval
);
1141 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1148 CASE (sem
, INSN_FCMPEQS
) : /* fcmpeq.s $frg, $frh, $rd */
1150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1152 #define FLD(f) abuf->fields.sfmt_add.f
1153 int UNUSED written
= 0;
1154 IADDR UNUSED pc
= abuf
->addr
;
1155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1158 DI opval
= ZEXTBIDI (sh64_fcmpeqs (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1159 SET_H_GR (FLD (f_dest
), opval
);
1160 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1167 CASE (sem
, INSN_FCMPGED
) : /* fcmpge.d $drg, $drh, $rd */
1169 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1170 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1171 #define FLD(f) abuf->fields.sfmt_add.f
1172 int UNUSED written
= 0;
1173 IADDR UNUSED pc
= abuf
->addr
;
1174 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1177 DI opval
= ZEXTBIDI (sh64_fcmpged (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
1178 SET_H_GR (FLD (f_dest
), opval
);
1179 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1186 CASE (sem
, INSN_FCMPGES
) : /* fcmpge.s $frg, $frh, $rd */
1188 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1189 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1190 #define FLD(f) abuf->fields.sfmt_add.f
1191 int UNUSED written
= 0;
1192 IADDR UNUSED pc
= abuf
->addr
;
1193 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1196 DI opval
= ZEXTBIDI (sh64_fcmpges (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1197 SET_H_GR (FLD (f_dest
), opval
);
1198 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1205 CASE (sem
, INSN_FCMPGTD
) : /* fcmpgt.d $drg, $drh, $rd */
1207 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1208 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1209 #define FLD(f) abuf->fields.sfmt_add.f
1210 int UNUSED written
= 0;
1211 IADDR UNUSED pc
= abuf
->addr
;
1212 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1215 DI opval
= ZEXTBIDI (sh64_fcmpgtd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
1216 SET_H_GR (FLD (f_dest
), opval
);
1217 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1224 CASE (sem
, INSN_FCMPGTS
) : /* fcmpgt.s $frg, $frh, $rd */
1226 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1227 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1228 #define FLD(f) abuf->fields.sfmt_add.f
1229 int UNUSED written
= 0;
1230 IADDR UNUSED pc
= abuf
->addr
;
1231 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1234 DI opval
= ZEXTBIDI (sh64_fcmpgts (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1235 SET_H_GR (FLD (f_dest
), opval
);
1236 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1243 CASE (sem
, INSN_FCMPUND
) : /* fcmpun.d $drg, $drh, $rd */
1245 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1247 #define FLD(f) abuf->fields.sfmt_add.f
1248 int UNUSED written
= 0;
1249 IADDR UNUSED pc
= abuf
->addr
;
1250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1253 DI opval
= ZEXTBIDI (sh64_fcmpund (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
1254 SET_H_GR (FLD (f_dest
), opval
);
1255 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1262 CASE (sem
, INSN_FCMPUNS
) : /* fcmpun.s $frg, $frh, $rd */
1264 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1265 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1266 #define FLD(f) abuf->fields.sfmt_add.f
1267 int UNUSED written
= 0;
1268 IADDR UNUSED pc
= abuf
->addr
;
1269 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1272 DI opval
= ZEXTBIDI (sh64_fcmpuns (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1273 SET_H_GR (FLD (f_dest
), opval
);
1274 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1281 CASE (sem
, INSN_FCNVDS
) : /* fcnv.ds $drgh, $frf */
1283 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1284 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1285 #define FLD(f) abuf->fields.sfmt_fabsd.f
1286 int UNUSED written
= 0;
1287 IADDR UNUSED pc
= abuf
->addr
;
1288 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1291 SF opval
= sh64_fcnvds (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1292 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1293 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1300 CASE (sem
, INSN_FCNVSD
) : /* fcnv.sd $frgh, $drf */
1302 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1303 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1304 #define FLD(f) abuf->fields.sfmt_fabsd.f
1305 int UNUSED written
= 0;
1306 IADDR UNUSED pc
= abuf
->addr
;
1307 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1310 DF opval
= sh64_fcnvsd (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1311 SET_H_DR (FLD (f_dest
), opval
);
1312 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1319 CASE (sem
, INSN_FDIVD
) : /* fdiv.d $drg, $drh, $drf */
1321 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1322 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1323 #define FLD(f) abuf->fields.sfmt_add.f
1324 int UNUSED written
= 0;
1325 IADDR UNUSED pc
= abuf
->addr
;
1326 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1329 DF opval
= sh64_fdivd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
1330 SET_H_DR (FLD (f_dest
), opval
);
1331 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1338 CASE (sem
, INSN_FDIVS
) : /* fdiv.s $frg, $frh, $frf */
1340 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1341 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1342 #define FLD(f) abuf->fields.sfmt_add.f
1343 int UNUSED written
= 0;
1344 IADDR UNUSED pc
= abuf
->addr
;
1345 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1348 SF opval
= sh64_fdivs (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
1349 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1350 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1357 CASE (sem
, INSN_FGETSCR
) : /* fgetscr $frf */
1359 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1360 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1361 #define FLD(f) abuf->fields.sfmt_shori.f
1362 int UNUSED written
= 0;
1363 IADDR UNUSED pc
= abuf
->addr
;
1364 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1367 SF opval
= SUBWORDSISF (CPU (h_fpscr
));
1368 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1369 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1376 CASE (sem
, INSN_FIPRS
) : /* fipr.s $fvg, $fvh, $frf */
1378 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1379 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1380 #define FLD(f) abuf->fields.sfmt_add.f
1381 int UNUSED written
= 0;
1382 IADDR UNUSED pc
= abuf
->addr
;
1383 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1387 SF opval
= GET_H_FV (FLD (f_left
));
1388 SET_H_FV (FLD (f_left
), opval
);
1389 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
1392 SF opval
= GET_H_FV (FLD (f_right
));
1393 SET_H_FV (FLD (f_right
), opval
);
1394 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
1397 SF opval
= sh64_fiprs (current_cpu
, FLD (f_left
), FLD (f_right
));
1398 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1399 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1407 CASE (sem
, INSN_FLDD
) : /* fld.d $rm, $disp10x8, $drf */
1409 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1410 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1411 #define FLD(f) abuf->fields.sfmt_fldd.f
1412 int UNUSED written
= 0;
1413 IADDR UNUSED pc
= abuf
->addr
;
1414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1417 DF opval
= GETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
)));
1418 SET_H_DR (FLD (f_dest
), opval
);
1419 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1426 CASE (sem
, INSN_FLDP
) : /* fld.p $rm, $disp10x8, $fpf */
1428 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1429 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1430 #define FLD(f) abuf->fields.sfmt_fldd.f
1431 int UNUSED written
= 0;
1432 IADDR UNUSED pc
= abuf
->addr
;
1433 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1437 SF opval
= GET_H_FP (FLD (f_dest
));
1438 SET_H_FP (FLD (f_dest
), opval
);
1439 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1441 sh64_fldp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
), FLD (f_dest
));
1448 CASE (sem
, INSN_FLDS
) : /* fld.s $rm, $disp10x4, $frf */
1450 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1452 #define FLD(f) abuf->fields.sfmt_flds.f
1453 int UNUSED written
= 0;
1454 IADDR UNUSED pc
= abuf
->addr
;
1455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1458 SF opval
= GETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x4
)));
1459 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1460 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1467 CASE (sem
, INSN_FLDXD
) : /* fldx.d $rm, $rn, $drf */
1469 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1470 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1471 #define FLD(f) abuf->fields.sfmt_add.f
1472 int UNUSED written
= 0;
1473 IADDR UNUSED pc
= abuf
->addr
;
1474 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1477 DF opval
= GETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))));
1478 SET_H_DR (FLD (f_dest
), opval
);
1479 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1486 CASE (sem
, INSN_FLDXP
) : /* fldx.p $rm, $rn, $fpf */
1488 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1489 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1490 #define FLD(f) abuf->fields.sfmt_add.f
1491 int UNUSED written
= 0;
1492 IADDR UNUSED pc
= abuf
->addr
;
1493 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1497 SF opval
= GET_H_FP (FLD (f_dest
));
1498 SET_H_FP (FLD (f_dest
), opval
);
1499 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1501 sh64_fldp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)), FLD (f_dest
));
1508 CASE (sem
, INSN_FLDXS
) : /* fldx.s $rm, $rn, $frf */
1510 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1511 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1512 #define FLD(f) abuf->fields.sfmt_add.f
1513 int UNUSED written
= 0;
1514 IADDR UNUSED pc
= abuf
->addr
;
1515 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1518 SF opval
= GETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))));
1519 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1520 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1527 CASE (sem
, INSN_FLOATLD
) : /* float.ld $frgh, $drf */
1529 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1530 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1531 #define FLD(f) abuf->fields.sfmt_fabsd.f
1532 int UNUSED written
= 0;
1533 IADDR UNUSED pc
= abuf
->addr
;
1534 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1537 DF opval
= sh64_floatld (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1538 SET_H_DR (FLD (f_dest
), opval
);
1539 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1546 CASE (sem
, INSN_FLOATLS
) : /* float.ls $frgh, $frf */
1548 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1549 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1550 #define FLD(f) abuf->fields.sfmt_fabsd.f
1551 int UNUSED written
= 0;
1552 IADDR UNUSED pc
= abuf
->addr
;
1553 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1556 SF opval
= sh64_floatls (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1557 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1558 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1565 CASE (sem
, INSN_FLOATQD
) : /* float.qd $drgh, $drf */
1567 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1568 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1569 #define FLD(f) abuf->fields.sfmt_fabsd.f
1570 int UNUSED written
= 0;
1571 IADDR UNUSED pc
= abuf
->addr
;
1572 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1575 DF opval
= sh64_floatqd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1576 SET_H_DR (FLD (f_dest
), opval
);
1577 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1584 CASE (sem
, INSN_FLOATQS
) : /* float.qs $drgh, $frf */
1586 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1587 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1588 #define FLD(f) abuf->fields.sfmt_fabsd.f
1589 int UNUSED written
= 0;
1590 IADDR UNUSED pc
= abuf
->addr
;
1591 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1594 SF opval
= sh64_floatqs (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1595 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1596 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1603 CASE (sem
, INSN_FMACS
) : /* fmac.s $frg, $frh, $frf */
1605 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1606 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1607 #define FLD(f) abuf->fields.sfmt_add.f
1608 int UNUSED written
= 0;
1609 IADDR UNUSED pc
= abuf
->addr
;
1610 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1613 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
)])));
1614 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1615 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1622 CASE (sem
, INSN_FMOVD
) : /* fmov.d $drgh, $drf */
1624 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1625 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1626 #define FLD(f) abuf->fields.sfmt_fabsd.f
1627 int UNUSED written
= 0;
1628 IADDR UNUSED pc
= abuf
->addr
;
1629 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1632 DF opval
= GET_H_DR (FLD (f_left_right
));
1633 SET_H_DR (FLD (f_dest
), opval
);
1634 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1641 CASE (sem
, INSN_FMOVDQ
) : /* fmov.dq $drgh, $rd */
1643 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1644 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1645 #define FLD(f) abuf->fields.sfmt_fabsd.f
1646 int UNUSED written
= 0;
1647 IADDR UNUSED pc
= abuf
->addr
;
1648 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1651 DI opval
= SUBWORDDFDI (GET_H_DR (FLD (f_left_right
)));
1652 SET_H_GR (FLD (f_dest
), opval
);
1653 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1660 CASE (sem
, INSN_FMOVLS
) : /* fmov.ls $rm, $frf */
1662 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1663 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1664 #define FLD(f) abuf->fields.sfmt_xori.f
1665 int UNUSED written
= 0;
1666 IADDR UNUSED pc
= abuf
->addr
;
1667 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1670 SF opval
= SUBWORDSISF (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1));
1671 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1672 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1679 CASE (sem
, INSN_FMOVQD
) : /* fmov.qd $rm, $drf */
1681 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1682 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1683 #define FLD(f) abuf->fields.sfmt_xori.f
1684 int UNUSED written
= 0;
1685 IADDR UNUSED pc
= abuf
->addr
;
1686 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1689 DF opval
= SUBWORDDIDF (GET_H_GR (FLD (f_left
)));
1690 SET_H_DR (FLD (f_dest
), opval
);
1691 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1698 CASE (sem
, INSN_FMOVS
) : /* fmov.s $frgh, $frf */
1700 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1701 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1702 #define FLD(f) abuf->fields.sfmt_fabsd.f
1703 int UNUSED written
= 0;
1704 IADDR UNUSED pc
= abuf
->addr
;
1705 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1708 SF opval
= CPU (h_fr
[FLD (f_left_right
)]);
1709 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1717 CASE (sem
, INSN_FMOVSL
) : /* fmov.sl $frgh, $rd */
1719 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1720 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1721 #define FLD(f) abuf->fields.sfmt_fabsd.f
1722 int UNUSED written
= 0;
1723 IADDR UNUSED pc
= abuf
->addr
;
1724 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1727 DI opval
= EXTSIDI (SUBWORDSFSI (CPU (h_fr
[FLD (f_left_right
)])));
1728 SET_H_GR (FLD (f_dest
), opval
);
1729 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1736 CASE (sem
, INSN_FMULD
) : /* fmul.d $drg, $drh, $drf */
1738 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1740 #define FLD(f) abuf->fields.sfmt_add.f
1741 int UNUSED written
= 0;
1742 IADDR UNUSED pc
= abuf
->addr
;
1743 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1746 DF opval
= sh64_fmuld (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
1747 SET_H_DR (FLD (f_dest
), opval
);
1748 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1755 CASE (sem
, INSN_FMULS
) : /* fmul.s $frg, $frh, $frf */
1757 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1758 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1759 #define FLD(f) abuf->fields.sfmt_add.f
1760 int UNUSED written
= 0;
1761 IADDR UNUSED pc
= abuf
->addr
;
1762 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1765 SF opval
= sh64_fmuls (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
1766 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1767 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1774 CASE (sem
, INSN_FNEGD
) : /* fneg.d $drgh, $drf */
1776 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1777 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1778 #define FLD(f) abuf->fields.sfmt_fabsd.f
1779 int UNUSED written
= 0;
1780 IADDR UNUSED pc
= abuf
->addr
;
1781 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1784 DF opval
= sh64_fnegd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1785 SET_H_DR (FLD (f_dest
), opval
);
1786 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1793 CASE (sem
, INSN_FNEGS
) : /* fneg.s $frgh, $frf */
1795 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1796 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1797 #define FLD(f) abuf->fields.sfmt_fabsd.f
1798 int UNUSED written
= 0;
1799 IADDR UNUSED pc
= abuf
->addr
;
1800 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1803 SF opval
= sh64_fnegs (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1804 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1805 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1812 CASE (sem
, INSN_FPUTSCR
) : /* fputscr $frgh */
1814 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1815 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1816 #define FLD(f) abuf->fields.sfmt_fabsd.f
1817 int UNUSED written
= 0;
1818 IADDR UNUSED pc
= abuf
->addr
;
1819 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1822 SI opval
= SUBWORDSFSI (CPU (h_fr
[FLD (f_left_right
)]));
1823 CPU (h_fpscr
) = opval
;
1824 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
1831 CASE (sem
, INSN_FSQRTD
) : /* fsqrt.d $drgh, $drf */
1833 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1835 #define FLD(f) abuf->fields.sfmt_fabsd.f
1836 int UNUSED written
= 0;
1837 IADDR UNUSED pc
= abuf
->addr
;
1838 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1841 DF opval
= sh64_fsqrtd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1842 SET_H_DR (FLD (f_dest
), opval
);
1843 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1850 CASE (sem
, INSN_FSQRTS
) : /* fsqrt.s $frgh, $frf */
1852 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1854 #define FLD(f) abuf->fields.sfmt_fabsd.f
1855 int UNUSED written
= 0;
1856 IADDR UNUSED pc
= abuf
->addr
;
1857 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1860 SF opval
= sh64_fsqrts (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1861 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1862 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1869 CASE (sem
, INSN_FSTD
) : /* fst.d $rm, $disp10x8, $drf */
1871 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1872 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1873 #define FLD(f) abuf->fields.sfmt_fldd.f
1874 int UNUSED written
= 0;
1875 IADDR UNUSED pc
= abuf
->addr
;
1876 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1879 DF opval
= GET_H_DR (FLD (f_dest
));
1880 SETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
)), opval
);
1881 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1888 CASE (sem
, INSN_FSTP
) : /* fst.p $rm, $disp10x8, $fpf */
1890 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1891 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1892 #define FLD(f) abuf->fields.sfmt_fldd.f
1893 int UNUSED written
= 0;
1894 IADDR UNUSED pc
= abuf
->addr
;
1895 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1899 SF opval
= GET_H_FP (FLD (f_dest
));
1900 SET_H_FP (FLD (f_dest
), opval
);
1901 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1903 sh64_fstp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
), FLD (f_dest
));
1910 CASE (sem
, INSN_FSTS
) : /* fst.s $rm, $disp10x4, $frf */
1912 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1913 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1914 #define FLD(f) abuf->fields.sfmt_flds.f
1915 int UNUSED written
= 0;
1916 IADDR UNUSED pc
= abuf
->addr
;
1917 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1920 SF opval
= CPU (h_fr
[FLD (f_dest
)]);
1921 SETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x4
)), opval
);
1922 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1929 CASE (sem
, INSN_FSTXD
) : /* fstx.d $rm, $rn, $drf */
1931 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1932 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1933 #define FLD(f) abuf->fields.sfmt_add.f
1934 int UNUSED written
= 0;
1935 IADDR UNUSED pc
= abuf
->addr
;
1936 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1939 DF opval
= GET_H_DR (FLD (f_dest
));
1940 SETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
1941 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1948 CASE (sem
, INSN_FSTXP
) : /* fstx.p $rm, $rn, $fpf */
1950 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1951 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1952 #define FLD(f) abuf->fields.sfmt_add.f
1953 int UNUSED written
= 0;
1954 IADDR UNUSED pc
= abuf
->addr
;
1955 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1959 SF opval
= GET_H_FP (FLD (f_dest
));
1960 SET_H_FP (FLD (f_dest
), opval
);
1961 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1963 sh64_fstp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)), FLD (f_dest
));
1970 CASE (sem
, INSN_FSTXS
) : /* fstx.s $rm, $rn, $frf */
1972 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1973 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1974 #define FLD(f) abuf->fields.sfmt_add.f
1975 int UNUSED written
= 0;
1976 IADDR UNUSED pc
= abuf
->addr
;
1977 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1980 SF opval
= CPU (h_fr
[FLD (f_dest
)]);
1981 SETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
1982 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1989 CASE (sem
, INSN_FSUBD
) : /* fsub.d $drg, $drh, $drf */
1991 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1992 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1993 #define FLD(f) abuf->fields.sfmt_add.f
1994 int UNUSED written
= 0;
1995 IADDR UNUSED pc
= abuf
->addr
;
1996 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1999 DF opval
= sh64_fsubd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
2000 SET_H_DR (FLD (f_dest
), opval
);
2001 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
2008 CASE (sem
, INSN_FSUBS
) : /* fsub.s $frg, $frh, $frf */
2010 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2011 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2012 #define FLD(f) abuf->fields.sfmt_add.f
2013 int UNUSED written
= 0;
2014 IADDR UNUSED pc
= abuf
->addr
;
2015 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2018 SF opval
= sh64_fsubs (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
2019 CPU (h_fr
[FLD (f_dest
)]) = opval
;
2020 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2027 CASE (sem
, INSN_FTRCDL
) : /* ftrc.dl $drgh, $frf */
2029 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2031 #define FLD(f) abuf->fields.sfmt_fabsd.f
2032 int UNUSED written
= 0;
2033 IADDR UNUSED pc
= abuf
->addr
;
2034 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2037 SF opval
= sh64_ftrcdl (current_cpu
, GET_H_DR (FLD (f_left_right
)));
2038 CPU (h_fr
[FLD (f_dest
)]) = opval
;
2039 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2046 CASE (sem
, INSN_FTRCSL
) : /* ftrc.sl $frgh, $frf */
2048 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2049 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2050 #define FLD(f) abuf->fields.sfmt_fabsd.f
2051 int UNUSED written
= 0;
2052 IADDR UNUSED pc
= abuf
->addr
;
2053 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2056 SF opval
= sh64_ftrcsl (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
2057 CPU (h_fr
[FLD (f_dest
)]) = opval
;
2058 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2065 CASE (sem
, INSN_FTRCDQ
) : /* ftrc.dq $drgh, $drf */
2067 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2068 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2069 #define FLD(f) abuf->fields.sfmt_fabsd.f
2070 int UNUSED written
= 0;
2071 IADDR UNUSED pc
= abuf
->addr
;
2072 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2075 DF opval
= sh64_ftrcdq (current_cpu
, GET_H_DR (FLD (f_left_right
)));
2076 SET_H_DR (FLD (f_dest
), opval
);
2077 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
2084 CASE (sem
, INSN_FTRCSQ
) : /* ftrc.sq $frgh, $drf */
2086 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2087 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2088 #define FLD(f) abuf->fields.sfmt_fabsd.f
2089 int UNUSED written
= 0;
2090 IADDR UNUSED pc
= abuf
->addr
;
2091 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2094 DF opval
= sh64_ftrcsq (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
2095 SET_H_DR (FLD (f_dest
), opval
);
2096 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
2103 CASE (sem
, INSN_FTRVS
) : /* ftrv.s $mtrxg, $fvh, $fvf */
2105 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2106 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2107 #define FLD(f) abuf->fields.sfmt_add.f
2108 int UNUSED written
= 0;
2109 IADDR UNUSED pc
= abuf
->addr
;
2110 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2114 SF opval
= GET_H_FMTX (FLD (f_left
));
2115 SET_H_FMTX (FLD (f_left
), opval
);
2116 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fmtx", 'f', opval
);
2119 SF opval
= GET_H_FV (FLD (f_right
));
2120 SET_H_FV (FLD (f_right
), opval
);
2121 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
2124 SF opval
= GET_H_FV (FLD (f_dest
));
2125 SET_H_FV (FLD (f_dest
), opval
);
2126 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
2128 sh64_ftrvs (current_cpu
, FLD (f_left
), FLD (f_right
), FLD (f_dest
));
2135 CASE (sem
, INSN_GETCFG
) : /* getcfg $rm, $disp6, $rd */
2137 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2138 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2139 #define FLD(f) abuf->fields.sfmt_getcfg.f
2140 int UNUSED written
= 0;
2141 IADDR UNUSED pc
= abuf
->addr
;
2142 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2146 tmp_address
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2149 DI opval
= GETMEMSI (current_cpu
, pc
, tmp_address
);
2150 SET_H_GR (FLD (f_dest
), opval
);
2151 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2159 CASE (sem
, INSN_GETCON
) : /* getcon $crk, $rd */
2161 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2162 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2163 #define FLD(f) abuf->fields.sfmt_xori.f
2164 int UNUSED written
= 0;
2165 IADDR UNUSED pc
= abuf
->addr
;
2166 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2169 DI opval
= GET_H_CR (FLD (f_left
));
2170 SET_H_GR (FLD (f_dest
), opval
);
2171 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2178 CASE (sem
, INSN_GETTR
) : /* gettr $trb, $rd */
2180 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2181 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2182 #define FLD(f) abuf->fields.sfmt_blink.f
2183 int UNUSED written
= 0;
2184 IADDR UNUSED pc
= abuf
->addr
;
2185 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2188 DI opval
= CPU (h_tr
[FLD (f_trb
)]);
2189 SET_H_GR (FLD (f_dest
), opval
);
2190 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2197 CASE (sem
, INSN_ICBI
) : /* icbi $rm, $disp6x32 */
2199 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2200 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2201 #define FLD(f) abuf->fields.sfmt_xori.f
2202 int UNUSED written
= 0;
2203 IADDR UNUSED pc
= abuf
->addr
;
2204 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2208 DI opval
= GET_H_GR (FLD (f_left
));
2209 SET_H_GR (FLD (f_left
), opval
);
2210 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2219 CASE (sem
, INSN_LDB
) : /* ld.b $rm, $disp10, $rd */
2221 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2222 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2223 #define FLD(f) abuf->fields.sfmt_addi.f
2224 int UNUSED written
= 0;
2225 IADDR UNUSED pc
= abuf
->addr
;
2226 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2229 DI opval
= EXTQIDI (GETMEMQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)))));
2230 SET_H_GR (FLD (f_dest
), opval
);
2231 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2238 CASE (sem
, INSN_LDL
) : /* ld.l $rm, $disp10x4, $rd */
2240 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2241 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2242 #define FLD(f) abuf->fields.sfmt_flds.f
2243 int UNUSED written
= 0;
2244 IADDR UNUSED pc
= abuf
->addr
;
2245 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2248 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x4
)))));
2249 SET_H_GR (FLD (f_dest
), opval
);
2250 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2257 CASE (sem
, INSN_LDQ
) : /* ld.q $rm, $disp10x8, $rd */
2259 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2260 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2261 #define FLD(f) abuf->fields.sfmt_fldd.f
2262 int UNUSED written
= 0;
2263 IADDR UNUSED pc
= abuf
->addr
;
2264 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2267 DI opval
= GETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x8
))));
2268 SET_H_GR (FLD (f_dest
), opval
);
2269 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2276 CASE (sem
, INSN_LDUB
) : /* ld.ub $rm, $disp10, $rd */
2278 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2279 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2280 #define FLD(f) abuf->fields.sfmt_addi.f
2281 int UNUSED written
= 0;
2282 IADDR UNUSED pc
= abuf
->addr
;
2283 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2286 DI opval
= ZEXTQIDI (GETMEMQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)))));
2287 SET_H_GR (FLD (f_dest
), opval
);
2288 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2295 CASE (sem
, INSN_LDUW
) : /* ld.uw $rm, $disp10x2, $rd */
2297 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2298 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2299 #define FLD(f) abuf->fields.sfmt_lduw.f
2300 int UNUSED written
= 0;
2301 IADDR UNUSED pc
= abuf
->addr
;
2302 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2305 DI opval
= ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x2
)))));
2306 SET_H_GR (FLD (f_dest
), opval
);
2307 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2314 CASE (sem
, INSN_LDW
) : /* ld.w $rm, $disp10x2, $rd */
2316 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2317 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2318 #define FLD(f) abuf->fields.sfmt_lduw.f
2319 int UNUSED written
= 0;
2320 IADDR UNUSED pc
= abuf
->addr
;
2321 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2324 DI opval
= EXTHIDI (GETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x2
)))));
2325 SET_H_GR (FLD (f_dest
), opval
);
2326 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2333 CASE (sem
, INSN_LDHIL
) : /* ldhi.l $rm, $disp6, $rd */
2335 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2336 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2337 #define FLD(f) abuf->fields.sfmt_getcfg.f
2338 int UNUSED written
= 0;
2339 IADDR UNUSED pc
= abuf
->addr
;
2340 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2346 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2347 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 3), 1);
2349 if (ANDQI (tmp_bytecount
, 4)) {
2351 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -4)));
2352 SET_H_GR (FLD (f_dest
), opval
);
2353 written
|= (1 << 6);
2354 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2357 if (GET_H_ENDIAN ()) {
2359 if (ANDQI (tmp_bytecount
, 2)) {
2360 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2362 if (ANDQI (tmp_bytecount
, 1)) {
2363 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2366 DI opval
= EXTSIDI (tmp_val
);
2367 SET_H_GR (FLD (f_dest
), opval
);
2368 written
|= (1 << 6);
2369 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2374 if (ANDQI (tmp_bytecount
, 1)) {
2375 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2377 if (ANDQI (tmp_bytecount
, 2)) {
2378 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2381 DI opval
= EXTSIDI (SLLSI (tmp_val
, SUBSI (32, MULSI (8, tmp_bytecount
))));
2382 SET_H_GR (FLD (f_dest
), opval
);
2383 written
|= (1 << 6);
2384 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2391 abuf
->written
= written
;
2396 CASE (sem
, INSN_LDHIQ
) : /* ldhi.q $rm, $disp6, $rd */
2398 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2399 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2400 #define FLD(f) abuf->fields.sfmt_getcfg.f
2401 int UNUSED written
= 0;
2402 IADDR UNUSED pc
= abuf
->addr
;
2403 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2409 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2410 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 7), 1);
2412 if (ANDQI (tmp_bytecount
, 8)) {
2414 DI opval
= GETMEMDI (current_cpu
, pc
, ANDDI (tmp_addr
, -8));
2415 SET_H_GR (FLD (f_dest
), opval
);
2416 written
|= (1 << 7);
2417 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2420 if (GET_H_ENDIAN ()) {
2422 if (ANDQI (tmp_bytecount
, 4)) {
2423 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8))));
2425 if (ANDQI (tmp_bytecount
, 2)) {
2426 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2428 if (ANDQI (tmp_bytecount
, 1)) {
2429 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2433 SET_H_GR (FLD (f_dest
), opval
);
2434 written
|= (1 << 7);
2435 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2440 if (ANDQI (tmp_bytecount
, 1)) {
2441 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2443 if (ANDQI (tmp_bytecount
, 2)) {
2444 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2446 if (ANDQI (tmp_bytecount
, 4)) {
2447 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8))));
2450 DI opval
= SLLDI (tmp_val
, SUBSI (64, MULSI (8, tmp_bytecount
)));
2451 SET_H_GR (FLD (f_dest
), opval
);
2452 written
|= (1 << 7);
2453 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2460 abuf
->written
= written
;
2465 CASE (sem
, INSN_LDLOL
) : /* ldlo.l $rm, $disp6, $rd */
2467 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2468 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2469 #define FLD(f) abuf->fields.sfmt_getcfg.f
2470 int UNUSED written
= 0;
2471 IADDR UNUSED pc
= abuf
->addr
;
2472 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2478 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2479 tmp_bytecount
= SUBSI (4, ANDDI (tmp_addr
, 3));
2481 if (ANDQI (tmp_bytecount
, 4)) {
2483 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, tmp_addr
));
2484 SET_H_GR (FLD (f_dest
), opval
);
2485 written
|= (1 << 6);
2486 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2489 if (GET_H_ENDIAN ()) {
2491 if (ANDQI (tmp_bytecount
, 1)) {
2492 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2494 if (ANDQI (tmp_bytecount
, 2)) {
2495 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2498 DI opval
= EXTSIDI (SLLSI (tmp_val
, SUBSI (32, MULSI (8, tmp_bytecount
))));
2499 SET_H_GR (FLD (f_dest
), opval
);
2500 written
|= (1 << 6);
2501 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2506 if (ANDQI (tmp_bytecount
, 2)) {
2507 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2509 if (ANDQI (tmp_bytecount
, 1)) {
2510 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2513 DI opval
= EXTSIDI (tmp_val
);
2514 SET_H_GR (FLD (f_dest
), opval
);
2515 written
|= (1 << 6);
2516 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2523 abuf
->written
= written
;
2528 CASE (sem
, INSN_LDLOQ
) : /* ldlo.q $rm, $disp6, $rd */
2530 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2531 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2532 #define FLD(f) abuf->fields.sfmt_getcfg.f
2533 int UNUSED written
= 0;
2534 IADDR UNUSED pc
= abuf
->addr
;
2535 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2541 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2542 tmp_bytecount
= SUBSI (8, ANDDI (tmp_addr
, 7));
2544 if (ANDQI (tmp_bytecount
, 8)) {
2546 DI opval
= GETMEMDI (current_cpu
, pc
, tmp_addr
);
2547 SET_H_GR (FLD (f_dest
), opval
);
2548 written
|= (1 << 7);
2549 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2552 if (GET_H_ENDIAN ()) {
2554 if (ANDQI (tmp_bytecount
, 1)) {
2555 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2557 if (ANDQI (tmp_bytecount
, 2)) {
2558 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2560 if (ANDQI (tmp_bytecount
, 4)) {
2561 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4))));
2564 DI opval
= SLLDI (tmp_val
, SUBSI (64, MULSI (8, tmp_bytecount
)));
2565 SET_H_GR (FLD (f_dest
), opval
);
2566 written
|= (1 << 7);
2567 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2572 if (ANDQI (tmp_bytecount
, 4)) {
2573 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4))));
2575 if (ANDQI (tmp_bytecount
, 2)) {
2576 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2578 if (ANDQI (tmp_bytecount
, 1)) {
2579 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2583 SET_H_GR (FLD (f_dest
), opval
);
2584 written
|= (1 << 7);
2585 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2592 abuf
->written
= written
;
2597 CASE (sem
, INSN_LDXB
) : /* ldx.b $rm, $rn, $rd */
2599 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2600 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2601 #define FLD(f) abuf->fields.sfmt_add.f
2602 int UNUSED written
= 0;
2603 IADDR UNUSED pc
= abuf
->addr
;
2604 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2607 DI opval
= EXTQIDI (GETMEMQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2608 SET_H_GR (FLD (f_dest
), opval
);
2609 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2616 CASE (sem
, INSN_LDXL
) : /* ldx.l $rm, $rn, $rd */
2618 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2619 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2620 #define FLD(f) abuf->fields.sfmt_add.f
2621 int UNUSED written
= 0;
2622 IADDR UNUSED pc
= abuf
->addr
;
2623 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2626 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2627 SET_H_GR (FLD (f_dest
), opval
);
2628 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2635 CASE (sem
, INSN_LDXQ
) : /* ldx.q $rm, $rn, $rd */
2637 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2638 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2639 #define FLD(f) abuf->fields.sfmt_add.f
2640 int UNUSED written
= 0;
2641 IADDR UNUSED pc
= abuf
->addr
;
2642 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2645 DI opval
= GETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))));
2646 SET_H_GR (FLD (f_dest
), opval
);
2647 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2654 CASE (sem
, INSN_LDXUB
) : /* ldx.ub $rm, $rn, $rd */
2656 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2657 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2658 #define FLD(f) abuf->fields.sfmt_add.f
2659 int UNUSED written
= 0;
2660 IADDR UNUSED pc
= abuf
->addr
;
2661 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2664 DI opval
= ZEXTQIDI (GETMEMUQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2665 SET_H_GR (FLD (f_dest
), opval
);
2666 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2673 CASE (sem
, INSN_LDXUW
) : /* ldx.uw $rm, $rn, $rd */
2675 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2676 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2677 #define FLD(f) abuf->fields.sfmt_add.f
2678 int UNUSED written
= 0;
2679 IADDR UNUSED pc
= abuf
->addr
;
2680 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2683 DI opval
= ZEXTHIDI (GETMEMUHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2684 SET_H_GR (FLD (f_dest
), opval
);
2685 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2692 CASE (sem
, INSN_LDXW
) : /* ldx.w $rm, $rn, $rd */
2694 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2695 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2696 #define FLD(f) abuf->fields.sfmt_add.f
2697 int UNUSED written
= 0;
2698 IADDR UNUSED pc
= abuf
->addr
;
2699 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2702 DI opval
= EXTHIDI (GETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2703 SET_H_GR (FLD (f_dest
), opval
);
2704 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2711 CASE (sem
, INSN_MABSL
) : /* mabs.l $rm, $rd */
2713 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2714 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2715 #define FLD(f) abuf->fields.sfmt_xori.f
2716 int UNUSED written
= 0;
2717 IADDR UNUSED pc
= abuf
->addr
;
2718 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2723 tmp_result0
= ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1));
2724 tmp_result1
= ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0));
2726 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2727 SET_H_GR (FLD (f_dest
), opval
);
2728 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2736 CASE (sem
, INSN_MABSW
) : /* mabs.w $rm, $rd */
2738 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2740 #define FLD(f) abuf->fields.sfmt_xori.f
2741 int UNUSED written
= 0;
2742 IADDR UNUSED pc
= abuf
->addr
;
2743 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2750 tmp_result0
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3));
2751 tmp_result1
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2));
2752 tmp_result2
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1));
2753 tmp_result3
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0));
2755 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2756 SET_H_GR (FLD (f_dest
), opval
);
2757 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2765 CASE (sem
, INSN_MADDL
) : /* madd.l $rm, $rn, $rd */
2767 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2768 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2769 #define FLD(f) abuf->fields.sfmt_add.f
2770 int UNUSED written
= 0;
2771 IADDR UNUSED pc
= abuf
->addr
;
2772 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2777 tmp_result0
= ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
2778 tmp_result1
= ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0));
2780 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2781 SET_H_GR (FLD (f_dest
), opval
);
2782 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2790 CASE (sem
, INSN_MADDW
) : /* madd.w $rm, $rn, $rd */
2792 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2793 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2794 #define FLD(f) abuf->fields.sfmt_add.f
2795 int UNUSED written
= 0;
2796 IADDR UNUSED pc
= abuf
->addr
;
2797 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2804 tmp_result0
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3));
2805 tmp_result1
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2));
2806 tmp_result2
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1));
2807 tmp_result3
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0));
2809 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2810 SET_H_GR (FLD (f_dest
), opval
);
2811 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2819 CASE (sem
, INSN_MADDSL
) : /* madds.l $rm, $rn, $rd */
2821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2823 #define FLD(f) abuf->fields.sfmt_add.f
2824 int UNUSED written
= 0;
2825 IADDR UNUSED pc
= abuf
->addr
;
2826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2831 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)))));
2832 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 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2835 SET_H_GR (FLD (f_dest
), opval
);
2836 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2844 CASE (sem
, INSN_MADDSUB
) : /* madds.ub $rm, $rn, $rd */
2846 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2847 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2848 #define FLD(f) abuf->fields.sfmt_add.f
2849 int UNUSED written
= 0;
2850 IADDR UNUSED pc
= abuf
->addr
;
2851 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2862 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)))));
2863 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)))));
2864 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)))));
2865 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)))));
2866 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)))));
2867 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)))));
2868 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)))));
2869 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 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
))))))));
2872 SET_H_GR (FLD (f_dest
), opval
);
2873 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2881 CASE (sem
, INSN_MADDSW
) : /* madds.w $rm, $rn, $rd */
2883 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2884 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2885 #define FLD(f) abuf->fields.sfmt_add.f
2886 int UNUSED written
= 0;
2887 IADDR UNUSED pc
= abuf
->addr
;
2888 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2895 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)))));
2896 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)))));
2897 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)))));
2898 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 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2901 SET_H_GR (FLD (f_dest
), opval
);
2902 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2910 CASE (sem
, INSN_MCMPEQB
) : /* mcmpeq.b $rm, $rn, $rd */
2912 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2913 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2914 #define FLD(f) abuf->fields.sfmt_add.f
2915 int UNUSED written
= 0;
2916 IADDR UNUSED pc
= abuf
->addr
;
2917 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2928 tmp_result0
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))) ? (INVQI (0)) : (0));
2929 tmp_result1
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))) ? (INVQI (0)) : (0));
2930 tmp_result2
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))) ? (INVQI (0)) : (0));
2931 tmp_result3
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))) ? (INVQI (0)) : (0));
2932 tmp_result4
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))) ? (INVQI (0)) : (0));
2933 tmp_result5
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))) ? (INVQI (0)) : (0));
2934 tmp_result6
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))) ? (INVQI (0)) : (0));
2935 tmp_result7
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))) ? (INVQI (0)) : (0));
2937 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
))))))));
2938 SET_H_GR (FLD (f_dest
), opval
);
2939 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2947 CASE (sem
, INSN_MCMPEQL
) : /* mcmpeq.l $rm, $rn, $rd */
2949 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2950 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2951 #define FLD(f) abuf->fields.sfmt_add.f
2952 int UNUSED written
= 0;
2953 IADDR UNUSED pc
= abuf
->addr
;
2954 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2959 tmp_result0
= ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))) ? (INVSI (0)) : (0));
2960 tmp_result1
= ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))) ? (INVSI (0)) : (0));
2962 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2963 SET_H_GR (FLD (f_dest
), opval
);
2964 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2972 CASE (sem
, INSN_MCMPEQW
) : /* mcmpeq.w $rm, $rn, $rd */
2974 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2975 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2976 #define FLD(f) abuf->fields.sfmt_add.f
2977 int UNUSED written
= 0;
2978 IADDR UNUSED pc
= abuf
->addr
;
2979 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2986 tmp_result0
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))) ? (INVHI (0)) : (0));
2987 tmp_result1
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))) ? (INVHI (0)) : (0));
2988 tmp_result2
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))) ? (INVHI (0)) : (0));
2989 tmp_result3
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0))) ? (INVHI (0)) : (0));
2991 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2992 SET_H_GR (FLD (f_dest
), opval
);
2993 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3001 CASE (sem
, INSN_MCMPGTL
) : /* mcmpgt.l $rm, $rn, $rd */
3003 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3004 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3005 #define FLD(f) abuf->fields.sfmt_add.f
3006 int UNUSED written
= 0;
3007 IADDR UNUSED pc
= abuf
->addr
;
3008 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3013 tmp_result0
= ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))) ? (INVSI (0)) : (0));
3014 tmp_result1
= ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))) ? (INVSI (0)) : (0));
3016 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3017 SET_H_GR (FLD (f_dest
), opval
);
3018 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3026 CASE (sem
, INSN_MCMPGTUB
) : /* mcmpgt.ub $rm, $rn, $rd */
3028 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3029 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3030 #define FLD(f) abuf->fields.sfmt_add.f
3031 int UNUSED written
= 0;
3032 IADDR UNUSED pc
= abuf
->addr
;
3033 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3044 tmp_result0
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))) ? (INVQI (0)) : (0));
3045 tmp_result1
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))) ? (INVQI (0)) : (0));
3046 tmp_result2
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))) ? (INVQI (0)) : (0));
3047 tmp_result3
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))) ? (INVQI (0)) : (0));
3048 tmp_result4
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))) ? (INVQI (0)) : (0));
3049 tmp_result5
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))) ? (INVQI (0)) : (0));
3050 tmp_result6
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))) ? (INVQI (0)) : (0));
3051 tmp_result7
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))) ? (INVQI (0)) : (0));
3053 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
))))))));
3054 SET_H_GR (FLD (f_dest
), opval
);
3055 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3063 CASE (sem
, INSN_MCMPGTW
) : /* mcmpgt.w $rm, $rn, $rd */
3065 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3066 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3067 #define FLD(f) abuf->fields.sfmt_add.f
3068 int UNUSED written
= 0;
3069 IADDR UNUSED pc
= abuf
->addr
;
3070 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3077 tmp_result0
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))) ? (INVHI (0)) : (0));
3078 tmp_result1
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))) ? (INVHI (0)) : (0));
3079 tmp_result2
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))) ? (INVHI (0)) : (0));
3080 tmp_result3
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0))) ? (INVHI (0)) : (0));
3082 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3083 SET_H_GR (FLD (f_dest
), opval
);
3084 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3092 CASE (sem
, INSN_MCMV
) : /* mcmv $rm, $rn, $rd */
3094 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3095 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3096 #define FLD(f) abuf->fields.sfmt_add.f
3097 int UNUSED written
= 0;
3098 IADDR UNUSED pc
= abuf
->addr
;
3099 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3102 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
)))));
3103 SET_H_GR (FLD (f_dest
), opval
);
3104 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3111 CASE (sem
, INSN_MCNVSLW
) : /* mcnvs.lw $rm, $rn, $rd */
3113 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3114 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3115 #define FLD(f) abuf->fields.sfmt_add.f
3116 int UNUSED written
= 0;
3117 IADDR UNUSED pc
= abuf
->addr
;
3118 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3125 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)))));
3126 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)))));
3127 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)))));
3128 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 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3131 SET_H_GR (FLD (f_dest
), opval
);
3132 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3140 CASE (sem
, INSN_MCNVSWB
) : /* mcnvs.wb $rm, $rn, $rd */
3142 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3143 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3144 #define FLD(f) abuf->fields.sfmt_add.f
3145 int UNUSED written
= 0;
3146 IADDR UNUSED pc
= abuf
->addr
;
3147 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3158 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)))));
3159 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)))));
3160 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)))));
3161 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)))));
3162 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)))));
3163 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)))));
3164 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)))));
3165 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 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
))))))));
3168 SET_H_GR (FLD (f_dest
), opval
);
3169 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3177 CASE (sem
, INSN_MCNVSWUB
) : /* mcnvs.wub $rm, $rn, $rd */
3179 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3180 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3181 #define FLD(f) abuf->fields.sfmt_add.f
3182 int UNUSED written
= 0;
3183 IADDR UNUSED pc
= abuf
->addr
;
3184 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3195 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)))));
3196 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)))));
3197 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)))));
3198 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)))));
3199 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)))));
3200 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)))));
3201 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)))));
3202 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 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
))))))));
3205 SET_H_GR (FLD (f_dest
), opval
);
3206 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3214 CASE (sem
, INSN_MEXTR1
) : /* mextr1 $rm, $rn, $rd */
3216 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3217 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3218 #define FLD(f) abuf->fields.sfmt_add.f
3219 int UNUSED written
= 0;
3220 IADDR UNUSED pc
= abuf
->addr
;
3221 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3227 tmp_count
= MULQI (8, 1);
3228 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3229 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3230 tmp_count
= MULQI (8, SUBQI (8, 1));
3231 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3233 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3234 SET_H_GR (FLD (f_dest
), opval
);
3235 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3243 CASE (sem
, INSN_MEXTR2
) : /* mextr2 $rm, $rn, $rd */
3245 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3247 #define FLD(f) abuf->fields.sfmt_add.f
3248 int UNUSED written
= 0;
3249 IADDR UNUSED pc
= abuf
->addr
;
3250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3256 tmp_count
= MULQI (8, 2);
3257 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3258 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3259 tmp_count
= MULQI (8, SUBQI (8, 2));
3260 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3262 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3263 SET_H_GR (FLD (f_dest
), opval
);
3264 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3272 CASE (sem
, INSN_MEXTR3
) : /* mextr3 $rm, $rn, $rd */
3274 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3275 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3276 #define FLD(f) abuf->fields.sfmt_add.f
3277 int UNUSED written
= 0;
3278 IADDR UNUSED pc
= abuf
->addr
;
3279 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3285 tmp_count
= MULQI (8, 3);
3286 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3287 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3288 tmp_count
= MULQI (8, SUBQI (8, 3));
3289 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3291 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3292 SET_H_GR (FLD (f_dest
), opval
);
3293 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3301 CASE (sem
, INSN_MEXTR4
) : /* mextr4 $rm, $rn, $rd */
3303 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3304 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3305 #define FLD(f) abuf->fields.sfmt_add.f
3306 int UNUSED written
= 0;
3307 IADDR UNUSED pc
= abuf
->addr
;
3308 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3314 tmp_count
= MULQI (8, 4);
3315 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3316 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3317 tmp_count
= MULQI (8, SUBQI (8, 4));
3318 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3320 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3321 SET_H_GR (FLD (f_dest
), opval
);
3322 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3330 CASE (sem
, INSN_MEXTR5
) : /* mextr5 $rm, $rn, $rd */
3332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3334 #define FLD(f) abuf->fields.sfmt_add.f
3335 int UNUSED written
= 0;
3336 IADDR UNUSED pc
= abuf
->addr
;
3337 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3343 tmp_count
= MULQI (8, 5);
3344 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3345 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3346 tmp_count
= MULQI (8, SUBQI (8, 5));
3347 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3349 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3350 SET_H_GR (FLD (f_dest
), opval
);
3351 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3359 CASE (sem
, INSN_MEXTR6
) : /* mextr6 $rm, $rn, $rd */
3361 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3363 #define FLD(f) abuf->fields.sfmt_add.f
3364 int UNUSED written
= 0;
3365 IADDR UNUSED pc
= abuf
->addr
;
3366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3372 tmp_count
= MULQI (8, 6);
3373 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3374 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3375 tmp_count
= MULQI (8, SUBQI (8, 6));
3376 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3378 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3379 SET_H_GR (FLD (f_dest
), opval
);
3380 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3388 CASE (sem
, INSN_MEXTR7
) : /* mextr7 $rm, $rn, $rd */
3390 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3391 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3392 #define FLD(f) abuf->fields.sfmt_add.f
3393 int UNUSED written
= 0;
3394 IADDR UNUSED pc
= abuf
->addr
;
3395 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3401 tmp_count
= MULQI (8, 7);
3402 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3403 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3404 tmp_count
= MULQI (8, SUBQI (8, 7));
3405 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3407 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3408 SET_H_GR (FLD (f_dest
), opval
);
3409 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3417 CASE (sem
, INSN_MMACFXWL
) : /* mmacfx.wl $rm, $rn, $rd */
3419 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3420 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3421 #define FLD(f) abuf->fields.sfmt_add.f
3422 int UNUSED written
= 0;
3423 IADDR UNUSED pc
= abuf
->addr
;
3424 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3430 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 1);
3431 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 0);
3432 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3433 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)))));
3434 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)))));
3435 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3436 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)))));
3437 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 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3440 SET_H_GR (FLD (f_dest
), opval
);
3441 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3449 CASE (sem
, INSN_MMACNFX_WL
) : /* mmacnfx.wl $rm, $rn, $rd */
3451 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3452 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3453 #define FLD(f) abuf->fields.sfmt_add.f
3454 int UNUSED written
= 0;
3455 IADDR UNUSED pc
= abuf
->addr
;
3456 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3462 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 1);
3463 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 0);
3464 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3465 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)))));
3466 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)))));
3467 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3468 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)))));
3469 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 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3472 SET_H_GR (FLD (f_dest
), opval
);
3473 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3481 CASE (sem
, INSN_MMULL
) : /* mmul.l $rm, $rn, $rd */
3483 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3484 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3485 #define FLD(f) abuf->fields.sfmt_add.f
3486 int UNUSED written
= 0;
3487 IADDR UNUSED pc
= abuf
->addr
;
3488 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3493 tmp_result0
= MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
3494 tmp_result1
= MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0));
3496 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3497 SET_H_GR (FLD (f_dest
), opval
);
3498 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3506 CASE (sem
, INSN_MMULW
) : /* mmul.w $rm, $rn, $rd */
3508 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3509 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3510 #define FLD(f) abuf->fields.sfmt_add.f
3511 int UNUSED written
= 0;
3512 IADDR UNUSED pc
= abuf
->addr
;
3513 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3520 tmp_result0
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3));
3521 tmp_result1
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2));
3522 tmp_result2
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1));
3523 tmp_result3
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0));
3525 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3526 SET_H_GR (FLD (f_dest
), opval
);
3527 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3535 CASE (sem
, INSN_MMULFXL
) : /* mmulfx.l $rm, $rn, $rd */
3537 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3539 #define FLD(f) abuf->fields.sfmt_add.f
3540 int UNUSED written
= 0;
3541 IADDR UNUSED pc
= abuf
->addr
;
3542 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3548 tmp_temp
= MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
3549 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)))));
3550 tmp_temp
= MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0)));
3551 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 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3554 SET_H_GR (FLD (f_dest
), opval
);
3555 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3563 CASE (sem
, INSN_MMULFXW
) : /* mmulfx.w $rm, $rn, $rd */
3565 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3566 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3567 #define FLD(f) abuf->fields.sfmt_add.f
3568 int UNUSED written
= 0;
3569 IADDR UNUSED pc
= abuf
->addr
;
3570 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3578 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3579 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)))));
3580 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3581 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)))));
3582 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)));
3583 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)))));
3584 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3585 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 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3588 SET_H_GR (FLD (f_dest
), opval
);
3589 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3597 CASE (sem
, INSN_MMULFXRPW
) : /* mmulfxrp.w $rm, $rn, $rd */
3599 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3600 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3601 #define FLD(f) abuf->fields.sfmt_add.f
3602 int UNUSED written
= 0;
3603 IADDR UNUSED pc
= abuf
->addr
;
3604 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3613 tmp_c
= SLLSI (1, 14);
3614 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3615 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)))));
3616 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3617 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)))));
3618 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)));
3619 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)))));
3620 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3621 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 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3624 SET_H_GR (FLD (f_dest
), opval
);
3625 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3633 CASE (sem
, INSN_MMULHIWL
) : /* mmulhi.wl $rm, $rn, $rd */
3635 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3636 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3637 #define FLD(f) abuf->fields.sfmt_add.f
3638 int UNUSED written
= 0;
3639 IADDR UNUSED pc
= abuf
->addr
;
3640 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3645 tmp_result0
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)));
3646 tmp_result1
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3648 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3649 SET_H_GR (FLD (f_dest
), opval
);
3650 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3658 CASE (sem
, INSN_MMULLOWL
) : /* mmullo.wl $rm, $rn, $rd */
3660 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3661 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3662 #define FLD(f) abuf->fields.sfmt_add.f
3663 int UNUSED written
= 0;
3664 IADDR UNUSED pc
= abuf
->addr
;
3665 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3670 tmp_result0
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3671 tmp_result1
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3673 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3674 SET_H_GR (FLD (f_dest
), opval
);
3675 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3683 CASE (sem
, INSN_MMULSUMWQ
) : /* mmulsum.wq $rm, $rn, $rd */
3685 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3686 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3687 #define FLD(f) abuf->fields.sfmt_add.f
3688 int UNUSED written
= 0;
3689 IADDR UNUSED pc
= abuf
->addr
;
3690 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3694 tmp_acc
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3695 tmp_acc
= ADDDI (tmp_acc
, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))));
3696 tmp_acc
= ADDDI (tmp_acc
, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))));
3697 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 DI opval
= ADDDI (GET_H_GR (FLD (f_dest
)), tmp_acc
);
3700 SET_H_GR (FLD (f_dest
), opval
);
3701 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3709 CASE (sem
, INSN_MOVI
) : /* movi $imm16, $rd */
3711 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3712 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3713 #define FLD(f) abuf->fields.sfmt_movi.f
3714 int UNUSED written
= 0;
3715 IADDR UNUSED pc
= abuf
->addr
;
3716 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3719 DI opval
= EXTSIDI (FLD (f_imm16
));
3720 SET_H_GR (FLD (f_dest
), opval
);
3721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3728 CASE (sem
, INSN_MPERMW
) : /* mperm.w $rm, $rn, $rd */
3730 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3731 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3732 #define FLD(f) abuf->fields.sfmt_add.f
3733 int UNUSED written
= 0;
3734 IADDR UNUSED pc
= abuf
->addr
;
3735 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3743 tmp_control
= ANDQI (GET_H_GR (FLD (f_right
)), 255);
3744 tmp_result0
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (tmp_control
, 3)));
3745 tmp_result1
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (SRLQI (tmp_control
, 2), 3)));
3746 tmp_result2
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (SRLQI (tmp_control
, 4), 3)));
3747 tmp_result3
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (SRLQI (tmp_control
, 6), 3)));
3749 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3750 SET_H_GR (FLD (f_dest
), opval
);
3751 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3759 CASE (sem
, INSN_MSADUBQ
) : /* msad.ubq $rm, $rn, $rd */
3761 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3762 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3763 #define FLD(f) abuf->fields.sfmt_add.f
3764 int UNUSED written
= 0;
3765 IADDR UNUSED pc
= abuf
->addr
;
3766 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3770 tmp_acc
= ABSDI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0)));
3771 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))));
3772 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))));
3773 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))));
3774 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))));
3775 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))));
3776 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))));
3777 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))));
3779 DI opval
= ADDDI (GET_H_GR (FLD (f_dest
)), tmp_acc
);
3780 SET_H_GR (FLD (f_dest
), opval
);
3781 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3789 CASE (sem
, INSN_MSHALDSL
) : /* mshalds.l $rm, $rn, $rd */
3791 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3793 #define FLD(f) abuf->fields.sfmt_add.f
3794 int UNUSED written
= 0;
3795 IADDR UNUSED pc
= abuf
->addr
;
3796 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3801 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)))));
3802 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 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3805 SET_H_GR (FLD (f_dest
), opval
);
3806 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3814 CASE (sem
, INSN_MSHALDSW
) : /* mshalds.w $rm, $rn, $rd */
3816 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3817 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3818 #define FLD(f) abuf->fields.sfmt_add.f
3819 int UNUSED written
= 0;
3820 IADDR UNUSED pc
= abuf
->addr
;
3821 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3828 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)))));
3829 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)))));
3830 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)))));
3831 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 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3834 SET_H_GR (FLD (f_dest
), opval
);
3835 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3843 CASE (sem
, INSN_MSHARDL
) : /* mshard.l $rm, $rn, $rd */
3845 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3846 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3847 #define FLD(f) abuf->fields.sfmt_add.f
3848 int UNUSED written
= 0;
3849 IADDR UNUSED pc
= abuf
->addr
;
3850 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3855 tmp_result0
= SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31));
3856 tmp_result1
= SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31));
3858 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3859 SET_H_GR (FLD (f_dest
), opval
);
3860 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3868 CASE (sem
, INSN_MSHARDW
) : /* mshard.w $rm, $rn, $rd */
3870 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3871 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3872 #define FLD(f) abuf->fields.sfmt_add.f
3873 int UNUSED written
= 0;
3874 IADDR UNUSED pc
= abuf
->addr
;
3875 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3882 tmp_result0
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3883 tmp_result1
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3884 tmp_result2
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3885 tmp_result3
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3887 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3888 SET_H_GR (FLD (f_dest
), opval
);
3889 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3897 CASE (sem
, INSN_MSHARDSQ
) : /* mshards.q $rm, $rn, $rd */
3899 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3900 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3901 #define FLD(f) abuf->fields.sfmt_add.f
3902 int UNUSED written
= 0;
3903 IADDR UNUSED pc
= abuf
->addr
;
3904 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3907 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)))));
3908 SET_H_GR (FLD (f_dest
), opval
);
3909 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3916 CASE (sem
, INSN_MSHFHIB
) : /* mshfhi.b $rm, $rn, $rd */
3918 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3919 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3920 #define FLD(f) abuf->fields.sfmt_add.f
3921 int UNUSED written
= 0;
3922 IADDR UNUSED pc
= abuf
->addr
;
3923 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3934 tmp_result0
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3);
3935 tmp_result1
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3);
3936 tmp_result2
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2);
3937 tmp_result3
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2);
3938 tmp_result4
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1);
3939 tmp_result5
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1);
3940 tmp_result6
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0);
3941 tmp_result7
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0);
3943 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
))))))));
3944 SET_H_GR (FLD (f_dest
), opval
);
3945 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3953 CASE (sem
, INSN_MSHFHIL
) : /* mshfhi.l $rm, $rn, $rd */
3955 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3957 #define FLD(f) abuf->fields.sfmt_add.f
3958 int UNUSED written
= 0;
3959 IADDR UNUSED pc
= abuf
->addr
;
3960 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3965 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0);
3966 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0);
3968 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3969 SET_H_GR (FLD (f_dest
), opval
);
3970 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3978 CASE (sem
, INSN_MSHFHIW
) : /* mshfhi.w $rm, $rn, $rd */
3980 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3981 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3982 #define FLD(f) abuf->fields.sfmt_add.f
3983 int UNUSED written
= 0;
3984 IADDR UNUSED pc
= abuf
->addr
;
3985 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3992 tmp_result0
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1);
3993 tmp_result1
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1);
3994 tmp_result2
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0);
3995 tmp_result3
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0);
3997 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3998 SET_H_GR (FLD (f_dest
), opval
);
3999 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4007 CASE (sem
, INSN_MSHFLOB
) : /* mshflo.b $rm, $rn, $rd */
4009 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4010 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4011 #define FLD(f) abuf->fields.sfmt_add.f
4012 int UNUSED written
= 0;
4013 IADDR UNUSED pc
= abuf
->addr
;
4014 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4025 tmp_result0
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7);
4026 tmp_result1
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7);
4027 tmp_result2
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6);
4028 tmp_result3
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6);
4029 tmp_result4
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5);
4030 tmp_result5
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5);
4031 tmp_result6
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4);
4032 tmp_result7
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4);
4034 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
))))))));
4035 SET_H_GR (FLD (f_dest
), opval
);
4036 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4044 CASE (sem
, INSN_MSHFLOL
) : /* mshflo.l $rm, $rn, $rd */
4046 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4048 #define FLD(f) abuf->fields.sfmt_add.f
4049 int UNUSED written
= 0;
4050 IADDR UNUSED pc
= abuf
->addr
;
4051 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4056 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1);
4057 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1);
4059 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4060 SET_H_GR (FLD (f_dest
), opval
);
4061 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4069 CASE (sem
, INSN_MSHFLOW
) : /* mshflo.w $rm, $rn, $rd */
4071 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4072 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4073 #define FLD(f) abuf->fields.sfmt_add.f
4074 int UNUSED written
= 0;
4075 IADDR UNUSED pc
= abuf
->addr
;
4076 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4083 tmp_result0
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3);
4084 tmp_result1
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3);
4085 tmp_result2
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2);
4086 tmp_result3
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2);
4088 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4089 SET_H_GR (FLD (f_dest
), opval
);
4090 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4098 CASE (sem
, INSN_MSHLLDL
) : /* mshlld.l $rm, $rn, $rd */
4100 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4101 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4102 #define FLD(f) abuf->fields.sfmt_add.f
4103 int UNUSED written
= 0;
4104 IADDR UNUSED pc
= abuf
->addr
;
4105 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4110 tmp_result0
= SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4111 tmp_result1
= SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4113 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4114 SET_H_GR (FLD (f_dest
), opval
);
4115 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4123 CASE (sem
, INSN_MSHLLDW
) : /* mshlld.w $rm, $rn, $rd */
4125 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4126 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4127 #define FLD(f) abuf->fields.sfmt_add.f
4128 int UNUSED written
= 0;
4129 IADDR UNUSED pc
= abuf
->addr
;
4130 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4137 tmp_result0
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4138 tmp_result1
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4139 tmp_result2
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4140 tmp_result3
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4142 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4143 SET_H_GR (FLD (f_dest
), opval
);
4144 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4152 CASE (sem
, INSN_MSHLRDL
) : /* mshlrd.l $rm, $rn, $rd */
4154 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4155 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4156 #define FLD(f) abuf->fields.sfmt_add.f
4157 int UNUSED written
= 0;
4158 IADDR UNUSED pc
= abuf
->addr
;
4159 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4164 tmp_result0
= SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4165 tmp_result1
= SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4167 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4168 SET_H_GR (FLD (f_dest
), opval
);
4169 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4177 CASE (sem
, INSN_MSHLRDW
) : /* mshlrd.w $rm, $rn, $rd */
4179 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4180 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4181 #define FLD(f) abuf->fields.sfmt_add.f
4182 int UNUSED written
= 0;
4183 IADDR UNUSED pc
= abuf
->addr
;
4184 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4191 tmp_result0
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4192 tmp_result1
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4193 tmp_result2
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4194 tmp_result3
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4196 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4197 SET_H_GR (FLD (f_dest
), opval
);
4198 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4206 CASE (sem
, INSN_MSUBL
) : /* msub.l $rm, $rn, $rd */
4208 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4209 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4210 #define FLD(f) abuf->fields.sfmt_add.f
4211 int UNUSED written
= 0;
4212 IADDR UNUSED pc
= abuf
->addr
;
4213 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4218 tmp_result0
= SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
4219 tmp_result1
= SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0));
4221 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4222 SET_H_GR (FLD (f_dest
), opval
);
4223 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4231 CASE (sem
, INSN_MSUBW
) : /* msub.w $rm, $rn, $rd */
4233 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4234 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4235 #define FLD(f) abuf->fields.sfmt_add.f
4236 int UNUSED written
= 0;
4237 IADDR UNUSED pc
= abuf
->addr
;
4238 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4245 tmp_result0
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3));
4246 tmp_result1
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2));
4247 tmp_result2
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1));
4248 tmp_result3
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0));
4250 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4251 SET_H_GR (FLD (f_dest
), opval
);
4252 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4260 CASE (sem
, INSN_MSUBSL
) : /* msubs.l $rm, $rn, $rd */
4262 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4263 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4264 #define FLD(f) abuf->fields.sfmt_add.f
4265 int UNUSED written
= 0;
4266 IADDR UNUSED pc
= abuf
->addr
;
4267 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4272 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)))));
4273 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 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4276 SET_H_GR (FLD (f_dest
), opval
);
4277 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4285 CASE (sem
, INSN_MSUBSUB
) : /* msubs.ub $rm, $rn, $rd */
4287 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4288 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4289 #define FLD(f) abuf->fields.sfmt_add.f
4290 int UNUSED written
= 0;
4291 IADDR UNUSED pc
= abuf
->addr
;
4292 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4303 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)))));
4304 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)))));
4305 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)))));
4306 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)))));
4307 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)))));
4308 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)))));
4309 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)))));
4310 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 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
))))))));
4313 SET_H_GR (FLD (f_dest
), opval
);
4314 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4322 CASE (sem
, INSN_MSUBSW
) : /* msubs.w $rm, $rn, $rd */
4324 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4325 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4326 #define FLD(f) abuf->fields.sfmt_add.f
4327 int UNUSED written
= 0;
4328 IADDR UNUSED pc
= abuf
->addr
;
4329 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4340 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)))));
4341 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)))));
4342 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)))));
4343 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)))));
4344 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)))));
4345 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)))));
4346 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)))));
4347 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 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
))))))));
4350 SET_H_GR (FLD (f_dest
), opval
);
4351 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4359 CASE (sem
, INSN_MULSL
) : /* muls.l $rm, $rn, $rd */
4361 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4363 #define FLD(f) abuf->fields.sfmt_add.f
4364 int UNUSED written
= 0;
4365 IADDR UNUSED pc
= abuf
->addr
;
4366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4369 DI opval
= MULDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
4370 SET_H_GR (FLD (f_dest
), opval
);
4371 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4378 CASE (sem
, INSN_MULUL
) : /* mulu.l $rm, $rn, $rd */
4380 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4381 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4382 #define FLD(f) abuf->fields.sfmt_add.f
4383 int UNUSED written
= 0;
4384 IADDR UNUSED pc
= abuf
->addr
;
4385 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4388 DI opval
= MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
4389 SET_H_GR (FLD (f_dest
), opval
);
4390 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4397 CASE (sem
, INSN_NOP
) : /* nop */
4399 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4400 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4401 #define FLD(f) abuf->fields.sfmt_empty.f
4402 int UNUSED written
= 0;
4403 IADDR UNUSED pc
= abuf
->addr
;
4404 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4412 CASE (sem
, INSN_NSB
) : /* nsb $rm, $rd */
4414 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4415 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4416 #define FLD(f) abuf->fields.sfmt_xori.f
4417 int UNUSED written
= 0;
4418 IADDR UNUSED pc
= abuf
->addr
;
4419 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4422 DI opval
= sh64_nsb (current_cpu
, GET_H_GR (FLD (f_left
)));
4423 SET_H_GR (FLD (f_dest
), opval
);
4424 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4431 CASE (sem
, INSN_OCBI
) : /* ocbi $rm, $disp6x32 */
4433 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4434 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4435 #define FLD(f) abuf->fields.sfmt_xori.f
4436 int UNUSED written
= 0;
4437 IADDR UNUSED pc
= abuf
->addr
;
4438 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4442 DI opval
= GET_H_GR (FLD (f_left
));
4443 SET_H_GR (FLD (f_left
), opval
);
4444 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4453 CASE (sem
, INSN_OCBP
) : /* ocbp $rm, $disp6x32 */
4455 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4456 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4457 #define FLD(f) abuf->fields.sfmt_xori.f
4458 int UNUSED written
= 0;
4459 IADDR UNUSED pc
= abuf
->addr
;
4460 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4464 DI opval
= GET_H_GR (FLD (f_left
));
4465 SET_H_GR (FLD (f_left
), opval
);
4466 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4475 CASE (sem
, INSN_OCBWB
) : /* ocbwb $rm, $disp6x32 */
4477 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4478 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4479 #define FLD(f) abuf->fields.sfmt_xori.f
4480 int UNUSED written
= 0;
4481 IADDR UNUSED pc
= abuf
->addr
;
4482 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4486 DI opval
= GET_H_GR (FLD (f_left
));
4487 SET_H_GR (FLD (f_left
), opval
);
4488 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4497 CASE (sem
, INSN_OR
) : /* or $rm, $rn, $rd */
4499 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4500 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4501 #define FLD(f) abuf->fields.sfmt_add.f
4502 int UNUSED written
= 0;
4503 IADDR UNUSED pc
= abuf
->addr
;
4504 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4507 DI opval
= ORDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
4508 SET_H_GR (FLD (f_dest
), opval
);
4509 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4516 CASE (sem
, INSN_ORI
) : /* ori $rm, $imm10, $rd */
4518 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4519 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4520 #define FLD(f) abuf->fields.sfmt_ori.f
4521 int UNUSED written
= 0;
4522 IADDR UNUSED pc
= abuf
->addr
;
4523 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4526 DI opval
= ORDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm10
)));
4527 SET_H_GR (FLD (f_dest
), opval
);
4528 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4535 CASE (sem
, INSN_PREFI
) : /* prefi $rm, $disp6x32 */
4537 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4539 #define FLD(f) abuf->fields.sfmt_xori.f
4540 int UNUSED written
= 0;
4541 IADDR UNUSED pc
= abuf
->addr
;
4542 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4546 DI opval
= GET_H_GR (FLD (f_left
));
4547 SET_H_GR (FLD (f_left
), opval
);
4548 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4557 CASE (sem
, INSN_PTA
) : /* pta$likely $disp16, $tra */
4559 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4560 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4561 #define FLD(f) abuf->fields.sfmt_pta.f
4562 int UNUSED written
= 0;
4563 IADDR UNUSED pc
= abuf
->addr
;
4564 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4569 DI opval
= ADDSI (FLD (f_disp16
), 1);
4570 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4571 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4579 CASE (sem
, INSN_PTABS
) : /* ptabs$likely $rn, $tra */
4581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4582 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4583 #define FLD(f) abuf->fields.sfmt_beq.f
4584 int UNUSED written
= 0;
4585 IADDR UNUSED pc
= abuf
->addr
;
4586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4591 DI opval
= GET_H_GR (FLD (f_right
));
4592 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4593 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4601 CASE (sem
, INSN_PTB
) : /* ptb$likely $disp16, $tra */
4603 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4605 #define FLD(f) abuf->fields.sfmt_pta.f
4606 int UNUSED written
= 0;
4607 IADDR UNUSED pc
= abuf
->addr
;
4608 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4613 DI opval
= FLD (f_disp16
);
4614 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4615 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4623 CASE (sem
, INSN_PTREL
) : /* ptrel$likely $rn, $tra */
4625 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4626 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4627 #define FLD(f) abuf->fields.sfmt_beq.f
4628 int UNUSED written
= 0;
4629 IADDR UNUSED pc
= abuf
->addr
;
4630 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4635 DI opval
= ADDDI (pc
, GET_H_GR (FLD (f_right
)));
4636 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4637 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4645 CASE (sem
, INSN_PUTCFG
) : /* putcfg $rm, $disp6, $rd */
4647 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4648 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4649 #define FLD(f) abuf->fields.sfmt_getcfg.f
4650 int UNUSED written
= 0;
4651 IADDR UNUSED pc
= abuf
->addr
;
4652 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4656 tmp_address
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
4659 SI opval
= GET_H_GR (FLD (f_dest
));
4660 SETMEMSI (current_cpu
, pc
, tmp_address
, opval
);
4661 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4669 CASE (sem
, INSN_PUTCON
) : /* putcon $rm, $crj */
4671 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4672 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4673 #define FLD(f) abuf->fields.sfmt_xori.f
4674 int UNUSED written
= 0;
4675 IADDR UNUSED pc
= abuf
->addr
;
4676 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4679 DI opval
= GET_H_GR (FLD (f_left
));
4680 SET_H_CR (FLD (f_dest
), opval
);
4681 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cr", 'D', opval
);
4688 CASE (sem
, INSN_RTE
) : /* rte */
4690 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4691 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4692 #define FLD(f) abuf->fields.sfmt_empty.f
4693 int UNUSED written
= 0;
4694 IADDR UNUSED pc
= abuf
->addr
;
4695 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4703 CASE (sem
, INSN_SHARD
) : /* shard $rm, $rn, $rd */
4705 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4706 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4707 #define FLD(f) abuf->fields.sfmt_add.f
4708 int UNUSED written
= 0;
4709 IADDR UNUSED pc
= abuf
->addr
;
4710 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4713 DI opval
= SRADI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63));
4714 SET_H_GR (FLD (f_dest
), opval
);
4715 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4722 CASE (sem
, INSN_SHARDL
) : /* shard.l $rm, $rn, $rd */
4724 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4725 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4726 #define FLD(f) abuf->fields.sfmt_add.f
4727 int UNUSED written
= 0;
4728 IADDR UNUSED pc
= abuf
->addr
;
4729 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4732 DI opval
= EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 63)));
4733 SET_H_GR (FLD (f_dest
), opval
);
4734 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4741 CASE (sem
, INSN_SHARI
) : /* shari $rm, $uimm6, $rd */
4743 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4744 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4745 #define FLD(f) abuf->fields.sfmt_shari.f
4746 int UNUSED written
= 0;
4747 IADDR UNUSED pc
= abuf
->addr
;
4748 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4751 DI opval
= SRADI (GET_H_GR (FLD (f_left
)), FLD (f_uimm6
));
4752 SET_H_GR (FLD (f_dest
), opval
);
4753 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4760 CASE (sem
, INSN_SHARIL
) : /* shari.l $rm, $uimm6, $rd */
4762 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4764 #define FLD(f) abuf->fields.sfmt_shari.f
4765 int UNUSED written
= 0;
4766 IADDR UNUSED pc
= abuf
->addr
;
4767 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4770 DI opval
= EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDSI (FLD (f_uimm6
), 63)));
4771 SET_H_GR (FLD (f_dest
), opval
);
4772 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4779 CASE (sem
, INSN_SHLLD
) : /* shlld $rm, $rn, $rd */
4781 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4782 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4783 #define FLD(f) abuf->fields.sfmt_add.f
4784 int UNUSED written
= 0;
4785 IADDR UNUSED pc
= abuf
->addr
;
4786 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4789 DI opval
= SLLDI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63));
4790 SET_H_GR (FLD (f_dest
), opval
);
4791 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4798 CASE (sem
, INSN_SHLLDL
) : /* shlld.l $rm, $rn, $rd */
4800 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4801 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4802 #define FLD(f) abuf->fields.sfmt_add.f
4803 int UNUSED written
= 0;
4804 IADDR UNUSED pc
= abuf
->addr
;
4805 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4808 DI opval
= EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 63)));
4809 SET_H_GR (FLD (f_dest
), opval
);
4810 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4817 CASE (sem
, INSN_SHLLI
) : /* shlli $rm, $uimm6, $rd */
4819 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4820 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4821 #define FLD(f) abuf->fields.sfmt_shari.f
4822 int UNUSED written
= 0;
4823 IADDR UNUSED pc
= abuf
->addr
;
4824 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4827 DI opval
= SLLDI (GET_H_GR (FLD (f_left
)), FLD (f_uimm6
));
4828 SET_H_GR (FLD (f_dest
), opval
);
4829 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4836 CASE (sem
, INSN_SHLLIL
) : /* shlli.l $rm, $uimm6, $rd */
4838 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4839 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4840 #define FLD(f) abuf->fields.sfmt_shari.f
4841 int UNUSED written
= 0;
4842 IADDR UNUSED pc
= abuf
->addr
;
4843 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4846 DI opval
= EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDSI (FLD (f_uimm6
), 63)));
4847 SET_H_GR (FLD (f_dest
), opval
);
4848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4855 CASE (sem
, INSN_SHLRD
) : /* shlrd $rm, $rn, $rd */
4857 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4858 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4859 #define FLD(f) abuf->fields.sfmt_add.f
4860 int UNUSED written
= 0;
4861 IADDR UNUSED pc
= abuf
->addr
;
4862 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4865 DI opval
= SRLDI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63));
4866 SET_H_GR (FLD (f_dest
), opval
);
4867 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4874 CASE (sem
, INSN_SHLRDL
) : /* shlrd.l $rm, $rn, $rd */
4876 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4877 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4878 #define FLD(f) abuf->fields.sfmt_add.f
4879 int UNUSED written
= 0;
4880 IADDR UNUSED pc
= abuf
->addr
;
4881 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4884 DI opval
= EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 63)));
4885 SET_H_GR (FLD (f_dest
), opval
);
4886 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4893 CASE (sem
, INSN_SHLRI
) : /* shlri $rm, $uimm6, $rd */
4895 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4896 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4897 #define FLD(f) abuf->fields.sfmt_shari.f
4898 int UNUSED written
= 0;
4899 IADDR UNUSED pc
= abuf
->addr
;
4900 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4903 DI opval
= SRLDI (GET_H_GR (FLD (f_left
)), FLD (f_uimm6
));
4904 SET_H_GR (FLD (f_dest
), opval
);
4905 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4912 CASE (sem
, INSN_SHLRIL
) : /* shlri.l $rm, $uimm6, $rd */
4914 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4915 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4916 #define FLD(f) abuf->fields.sfmt_shari.f
4917 int UNUSED written
= 0;
4918 IADDR UNUSED pc
= abuf
->addr
;
4919 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4922 DI opval
= EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDSI (FLD (f_uimm6
), 63)));
4923 SET_H_GR (FLD (f_dest
), opval
);
4924 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4931 CASE (sem
, INSN_SHORI
) : /* shori $uimm16, $rd */
4933 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4934 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4935 #define FLD(f) abuf->fields.sfmt_shori.f
4936 int UNUSED written
= 0;
4937 IADDR UNUSED pc
= abuf
->addr
;
4938 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4941 DI opval
= ORDI (SLLDI (GET_H_GR (FLD (f_dest
)), 16), ZEXTSIDI (FLD (f_uimm16
)));
4942 SET_H_GR (FLD (f_dest
), opval
);
4943 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4950 CASE (sem
, INSN_SLEEP
) : /* sleep */
4952 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4953 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4954 #define FLD(f) abuf->fields.sfmt_empty.f
4955 int UNUSED written
= 0;
4956 IADDR UNUSED pc
= abuf
->addr
;
4957 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4965 CASE (sem
, INSN_STB
) : /* st.b $rm, $disp10, $rd */
4967 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4968 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4969 #define FLD(f) abuf->fields.sfmt_addi.f
4970 int UNUSED written
= 0;
4971 IADDR UNUSED pc
= abuf
->addr
;
4972 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4975 UQI opval
= ANDQI (GET_H_GR (FLD (f_dest
)), 255);
4976 SETMEMUQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
))), opval
);
4977 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4984 CASE (sem
, INSN_STL
) : /* st.l $rm, $disp10x4, $rd */
4986 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4987 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4988 #define FLD(f) abuf->fields.sfmt_flds.f
4989 int UNUSED written
= 0;
4990 IADDR UNUSED pc
= abuf
->addr
;
4991 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4994 SI opval
= ANDSI (GET_H_GR (FLD (f_dest
)), 0xffffffff);
4995 SETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x4
))), opval
);
4996 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5003 CASE (sem
, INSN_STQ
) : /* st.q $rm, $disp10x8, $rd */
5005 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5006 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5007 #define FLD(f) abuf->fields.sfmt_fldd.f
5008 int UNUSED written
= 0;
5009 IADDR UNUSED pc
= abuf
->addr
;
5010 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5013 DI opval
= GET_H_GR (FLD (f_dest
));
5014 SETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x8
))), opval
);
5015 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5022 CASE (sem
, INSN_STW
) : /* st.w $rm, $disp10x2, $rd */
5024 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5025 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5026 #define FLD(f) abuf->fields.sfmt_lduw.f
5027 int UNUSED written
= 0;
5028 IADDR UNUSED pc
= abuf
->addr
;
5029 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5032 HI opval
= ANDHI (GET_H_GR (FLD (f_dest
)), 65535);
5033 SETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x2
))), opval
);
5034 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5041 CASE (sem
, INSN_STHIL
) : /* sthi.l $rm, $disp6, $rd */
5043 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5044 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5045 #define FLD(f) abuf->fields.sfmt_getcfg.f
5046 int UNUSED written
= 0;
5047 IADDR UNUSED pc
= abuf
->addr
;
5048 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5054 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5055 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 3), 1);
5056 if (ANDQI (tmp_bytecount
, 4)) {
5058 SI opval
= GET_H_GR (FLD (f_dest
));
5059 SETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5060 written
|= (1 << 5);
5061 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5064 if (GET_H_ENDIAN ()) {
5066 tmp_val
= GET_H_GR (FLD (f_dest
));
5067 if (ANDQI (tmp_bytecount
, 1)) {
5070 UQI opval
= ANDQI (tmp_val
, 255);
5071 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5072 written
|= (1 << 6);
5073 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5075 tmp_val
= SRLDI (tmp_val
, 8);
5078 if (ANDQI (tmp_bytecount
, 2)) {
5081 HI opval
= ANDHI (tmp_val
, 65535);
5082 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5083 written
|= (1 << 4);
5084 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5086 tmp_val
= SRLDI (tmp_val
, 16);
5092 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (32, MULSI (8, tmp_bytecount
)));
5093 if (ANDQI (tmp_bytecount
, 2)) {
5096 HI opval
= ANDHI (tmp_val
, 65535);
5097 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5098 written
|= (1 << 4);
5099 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5101 tmp_val
= SRLDI (tmp_val
, 16);
5104 if (ANDQI (tmp_bytecount
, 1)) {
5107 UQI opval
= ANDQI (tmp_val
, 255);
5108 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5109 written
|= (1 << 6);
5110 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5112 tmp_val
= SRLDI (tmp_val
, 8);
5120 abuf
->written
= written
;
5125 CASE (sem
, INSN_STHIQ
) : /* sthi.q $rm, $disp6, $rd */
5127 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5128 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5129 #define FLD(f) abuf->fields.sfmt_getcfg.f
5130 int UNUSED written
= 0;
5131 IADDR UNUSED pc
= abuf
->addr
;
5132 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5138 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5139 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 7), 1);
5140 if (ANDQI (tmp_bytecount
, 8)) {
5142 DI opval
= GET_H_GR (FLD (f_dest
));
5143 SETMEMDI (current_cpu
, pc
, ANDDI (tmp_addr
, -8), opval
);
5144 written
|= (1 << 4);
5145 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5148 if (GET_H_ENDIAN ()) {
5150 tmp_val
= GET_H_GR (FLD (f_dest
));
5151 if (ANDQI (tmp_bytecount
, 1)) {
5154 UQI opval
= ANDQI (tmp_val
, 255);
5155 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5156 written
|= (1 << 7);
5157 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5159 tmp_val
= SRLDI (tmp_val
, 8);
5162 if (ANDQI (tmp_bytecount
, 2)) {
5165 HI opval
= ANDHI (tmp_val
, 65535);
5166 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5167 written
|= (1 << 5);
5168 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5170 tmp_val
= SRLDI (tmp_val
, 16);
5173 if (ANDQI (tmp_bytecount
, 4)) {
5176 SI opval
= ANDSI (tmp_val
, 0xffffffff);
5177 SETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8), opval
);
5178 written
|= (1 << 6);
5179 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5181 tmp_val
= SRLDI (tmp_val
, 32);
5187 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (64, MULSI (8, tmp_bytecount
)));
5188 if (ANDQI (tmp_bytecount
, 4)) {
5191 SI opval
= ANDSI (tmp_val
, 0xffffffff);
5192 SETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8), opval
);
5193 written
|= (1 << 6);
5194 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5196 tmp_val
= SRLDI (tmp_val
, 32);
5199 if (ANDQI (tmp_bytecount
, 2)) {
5202 HI opval
= ANDHI (tmp_val
, 65535);
5203 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5204 written
|= (1 << 5);
5205 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5207 tmp_val
= SRLDI (tmp_val
, 16);
5210 if (ANDQI (tmp_bytecount
, 1)) {
5213 UQI opval
= ANDQI (tmp_val
, 255);
5214 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5215 written
|= (1 << 7);
5216 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5218 tmp_val
= SRLDI (tmp_val
, 8);
5226 abuf
->written
= written
;
5231 CASE (sem
, INSN_STLOL
) : /* stlo.l $rm, $disp6, $rd */
5233 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5234 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5235 #define FLD(f) abuf->fields.sfmt_getcfg.f
5236 int UNUSED written
= 0;
5237 IADDR UNUSED pc
= abuf
->addr
;
5238 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5244 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5245 tmp_bytecount
= SUBSI (4, ANDDI (tmp_addr
, 3));
5246 if (ANDQI (tmp_bytecount
, 4)) {
5248 USI opval
= GET_H_GR (FLD (f_dest
));
5249 SETMEMUSI (current_cpu
, pc
, tmp_addr
, opval
);
5250 written
|= (1 << 6);
5251 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5254 if (GET_H_ENDIAN ()) {
5256 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (32, MULSI (8, tmp_bytecount
)));
5257 if (ANDQI (tmp_bytecount
, 2)) {
5260 UHI opval
= ANDHI (tmp_val
, 65535);
5261 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5262 written
|= (1 << 4);
5263 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5265 tmp_val
= SRLDI (tmp_val
, 16);
5268 if (ANDQI (tmp_bytecount
, 1)) {
5271 UQI opval
= ANDQI (tmp_val
, 255);
5272 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5273 written
|= (1 << 5);
5274 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5276 tmp_val
= SRLDI (tmp_val
, 8);
5282 tmp_val
= GET_H_GR (FLD (f_dest
));
5283 if (ANDQI (tmp_bytecount
, 1)) {
5286 UQI opval
= ANDQI (tmp_val
, 255);
5287 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5288 written
|= (1 << 5);
5289 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5291 tmp_val
= SRLDI (tmp_val
, 8);
5294 if (ANDQI (tmp_bytecount
, 2)) {
5297 UHI opval
= ANDHI (tmp_val
, 65535);
5298 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5299 written
|= (1 << 4);
5300 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5302 tmp_val
= SRLDI (tmp_val
, 16);
5310 abuf
->written
= written
;
5315 CASE (sem
, INSN_STLOQ
) : /* stlo.q $rm, $disp6, $rd */
5317 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5318 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5319 #define FLD(f) abuf->fields.sfmt_getcfg.f
5320 int UNUSED written
= 0;
5321 IADDR UNUSED pc
= abuf
->addr
;
5322 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5328 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5329 tmp_bytecount
= SUBSI (8, ANDDI (tmp_addr
, 7));
5330 if (ANDQI (tmp_bytecount
, 8)) {
5332 UDI opval
= GET_H_GR (FLD (f_dest
));
5333 SETMEMUDI (current_cpu
, pc
, tmp_addr
, opval
);
5334 written
|= (1 << 4);
5335 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5338 if (GET_H_ENDIAN ()) {
5340 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (64, MULSI (8, tmp_bytecount
)));
5341 if (ANDQI (tmp_bytecount
, 4)) {
5344 USI opval
= ANDSI (tmp_val
, 0xffffffff);
5345 SETMEMUSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4), opval
);
5346 written
|= (1 << 7);
5347 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5349 tmp_val
= SRLDI (tmp_val
, 32);
5352 if (ANDQI (tmp_bytecount
, 2)) {
5355 UHI opval
= ANDHI (tmp_val
, 65535);
5356 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5357 written
|= (1 << 5);
5358 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5360 tmp_val
= SRLDI (tmp_val
, 16);
5363 if (ANDQI (tmp_bytecount
, 1)) {
5366 UQI opval
= ANDQI (tmp_val
, 255);
5367 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5368 written
|= (1 << 6);
5369 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5371 tmp_val
= SRLDI (tmp_val
, 8);
5377 tmp_val
= GET_H_GR (FLD (f_dest
));
5378 if (ANDQI (tmp_bytecount
, 1)) {
5381 UQI opval
= ANDQI (tmp_val
, 255);
5382 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5383 written
|= (1 << 6);
5384 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5386 tmp_val
= SRLDI (tmp_val
, 8);
5389 if (ANDQI (tmp_bytecount
, 2)) {
5392 UHI opval
= ANDHI (tmp_val
, 65535);
5393 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5394 written
|= (1 << 5);
5395 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5397 tmp_val
= SRLDI (tmp_val
, 16);
5400 if (ANDQI (tmp_bytecount
, 4)) {
5403 USI opval
= ANDSI (tmp_val
, 0xffffffff);
5404 SETMEMUSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4), opval
);
5405 written
|= (1 << 7);
5406 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5408 tmp_val
= SRLDI (tmp_val
, 32);
5416 abuf
->written
= written
;
5421 CASE (sem
, INSN_STXB
) : /* stx.b $rm, $rn, $rd */
5423 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5424 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5425 #define FLD(f) abuf->fields.sfmt_add.f
5426 int UNUSED written
= 0;
5427 IADDR UNUSED pc
= abuf
->addr
;
5428 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5431 UQI opval
= SUBWORDDIQI (GET_H_GR (FLD (f_dest
)), 7);
5432 SETMEMUQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5433 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5440 CASE (sem
, INSN_STXL
) : /* stx.l $rm, $rn, $rd */
5442 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5443 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5444 #define FLD(f) abuf->fields.sfmt_add.f
5445 int UNUSED written
= 0;
5446 IADDR UNUSED pc
= abuf
->addr
;
5447 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5450 SI opval
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 1);
5451 SETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5452 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5459 CASE (sem
, INSN_STXQ
) : /* stx.q $rm, $rn, $rd */
5461 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5462 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5463 #define FLD(f) abuf->fields.sfmt_add.f
5464 int UNUSED written
= 0;
5465 IADDR UNUSED pc
= abuf
->addr
;
5466 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5469 DI opval
= GET_H_GR (FLD (f_dest
));
5470 SETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5471 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5478 CASE (sem
, INSN_STXW
) : /* stx.w $rm, $rn, $rd */
5480 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5481 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5482 #define FLD(f) abuf->fields.sfmt_add.f
5483 int UNUSED written
= 0;
5484 IADDR UNUSED pc
= abuf
->addr
;
5485 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5488 HI opval
= SUBWORDDIHI (GET_H_GR (FLD (f_dest
)), 3);
5489 SETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5490 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5497 CASE (sem
, INSN_SUB
) : /* sub $rm, $rn, $rd */
5499 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5500 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5501 #define FLD(f) abuf->fields.sfmt_add.f
5502 int UNUSED written
= 0;
5503 IADDR UNUSED pc
= abuf
->addr
;
5504 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5507 DI opval
= SUBDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
5508 SET_H_GR (FLD (f_dest
), opval
);
5509 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5516 CASE (sem
, INSN_SUBL
) : /* sub.l $rm, $rn, $rd */
5518 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5519 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5520 #define FLD(f) abuf->fields.sfmt_add.f
5521 int UNUSED written
= 0;
5522 IADDR UNUSED pc
= abuf
->addr
;
5523 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5526 DI opval
= EXTSIDI (SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
5527 SET_H_GR (FLD (f_dest
), opval
);
5528 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5535 CASE (sem
, INSN_SWAPQ
) : /* swap.q $rm, $rn, $rd */
5537 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5539 #define FLD(f) abuf->fields.sfmt_add.f
5540 int UNUSED written
= 0;
5541 IADDR UNUSED pc
= abuf
->addr
;
5542 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5547 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
5548 tmp_temp
= GETMEMDI (current_cpu
, pc
, tmp_addr
);
5550 DI opval
= GET_H_GR (FLD (f_dest
));
5551 SETMEMDI (current_cpu
, pc
, tmp_addr
, opval
);
5552 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5555 DI opval
= tmp_temp
;
5556 SET_H_GR (FLD (f_dest
), opval
);
5557 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5565 CASE (sem
, INSN_SYNCI
) : /* synci */
5567 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5568 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5569 #define FLD(f) abuf->fields.sfmt_empty.f
5570 int UNUSED written
= 0;
5571 IADDR UNUSED pc
= abuf
->addr
;
5572 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5580 CASE (sem
, INSN_SYNCO
) : /* synco */
5582 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5583 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5584 #define FLD(f) abuf->fields.sfmt_empty.f
5585 int UNUSED written
= 0;
5586 IADDR UNUSED pc
= abuf
->addr
;
5587 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5595 CASE (sem
, INSN_TRAPA
) : /* trapa $rm */
5597 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5598 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5599 #define FLD(f) abuf->fields.sfmt_xori.f
5600 int UNUSED written
= 0;
5601 IADDR UNUSED pc
= abuf
->addr
;
5602 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5604 sh64_trapa (current_cpu
, GET_H_GR (FLD (f_left
)), pc
);
5610 CASE (sem
, INSN_XOR
) : /* xor $rm, $rn, $rd */
5612 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5613 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5614 #define FLD(f) abuf->fields.sfmt_add.f
5615 int UNUSED written
= 0;
5616 IADDR UNUSED pc
= abuf
->addr
;
5617 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5620 DI opval
= XORDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
5621 SET_H_GR (FLD (f_dest
), opval
);
5622 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5629 CASE (sem
, INSN_XORI
) : /* xori $rm, $imm6, $rd */
5631 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5632 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5633 #define FLD(f) abuf->fields.sfmt_xori.f
5634 int UNUSED written
= 0;
5635 IADDR UNUSED pc
= abuf
->addr
;
5636 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5639 DI opval
= XORDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm6
)));
5640 SET_H_GR (FLD (f_dest
), opval
);
5641 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5650 ENDSWITCH (sem
) /* End of semantic switch. */
5652 /* At this point `vpc' contains the next insn to execute. */
5655 #undef DEFINE_SWITCH
5656 #endif /* DEFINE_SWITCH */