1 /* Simulator instruction semantics for m32rxf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 /* The labels have the case they have because the enum of insn types
28 is all uppercase and in the non-stdc case the insn symbol is built
29 into the enum name. */
35 { M32RXF_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
36 { M32RXF_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
37 { M32RXF_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
38 { M32RXF_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
39 { M32RXF_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
40 { M32RXF_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
41 { M32RXF_INSN_ADD
, && case_sem_INSN_ADD
},
42 { M32RXF_INSN_ADD3
, && case_sem_INSN_ADD3
},
43 { M32RXF_INSN_AND
, && case_sem_INSN_AND
},
44 { M32RXF_INSN_AND3
, && case_sem_INSN_AND3
},
45 { M32RXF_INSN_OR
, && case_sem_INSN_OR
},
46 { M32RXF_INSN_OR3
, && case_sem_INSN_OR3
},
47 { M32RXF_INSN_XOR
, && case_sem_INSN_XOR
},
48 { M32RXF_INSN_XOR3
, && case_sem_INSN_XOR3
},
49 { M32RXF_INSN_ADDI
, && case_sem_INSN_ADDI
},
50 { M32RXF_INSN_ADDV
, && case_sem_INSN_ADDV
},
51 { M32RXF_INSN_ADDV3
, && case_sem_INSN_ADDV3
},
52 { M32RXF_INSN_ADDX
, && case_sem_INSN_ADDX
},
53 { M32RXF_INSN_BC8
, && case_sem_INSN_BC8
},
54 { M32RXF_INSN_BC24
, && case_sem_INSN_BC24
},
55 { M32RXF_INSN_BEQ
, && case_sem_INSN_BEQ
},
56 { M32RXF_INSN_BEQZ
, && case_sem_INSN_BEQZ
},
57 { M32RXF_INSN_BGEZ
, && case_sem_INSN_BGEZ
},
58 { M32RXF_INSN_BGTZ
, && case_sem_INSN_BGTZ
},
59 { M32RXF_INSN_BLEZ
, && case_sem_INSN_BLEZ
},
60 { M32RXF_INSN_BLTZ
, && case_sem_INSN_BLTZ
},
61 { M32RXF_INSN_BNEZ
, && case_sem_INSN_BNEZ
},
62 { M32RXF_INSN_BL8
, && case_sem_INSN_BL8
},
63 { M32RXF_INSN_BL24
, && case_sem_INSN_BL24
},
64 { M32RXF_INSN_BCL8
, && case_sem_INSN_BCL8
},
65 { M32RXF_INSN_BCL24
, && case_sem_INSN_BCL24
},
66 { M32RXF_INSN_BNC8
, && case_sem_INSN_BNC8
},
67 { M32RXF_INSN_BNC24
, && case_sem_INSN_BNC24
},
68 { M32RXF_INSN_BNE
, && case_sem_INSN_BNE
},
69 { M32RXF_INSN_BRA8
, && case_sem_INSN_BRA8
},
70 { M32RXF_INSN_BRA24
, && case_sem_INSN_BRA24
},
71 { M32RXF_INSN_BNCL8
, && case_sem_INSN_BNCL8
},
72 { M32RXF_INSN_BNCL24
, && case_sem_INSN_BNCL24
},
73 { M32RXF_INSN_CMP
, && case_sem_INSN_CMP
},
74 { M32RXF_INSN_CMPI
, && case_sem_INSN_CMPI
},
75 { M32RXF_INSN_CMPU
, && case_sem_INSN_CMPU
},
76 { M32RXF_INSN_CMPUI
, && case_sem_INSN_CMPUI
},
77 { M32RXF_INSN_CMPEQ
, && case_sem_INSN_CMPEQ
},
78 { M32RXF_INSN_CMPZ
, && case_sem_INSN_CMPZ
},
79 { M32RXF_INSN_DIV
, && case_sem_INSN_DIV
},
80 { M32RXF_INSN_DIVU
, && case_sem_INSN_DIVU
},
81 { M32RXF_INSN_REM
, && case_sem_INSN_REM
},
82 { M32RXF_INSN_REMU
, && case_sem_INSN_REMU
},
83 { M32RXF_INSN_DIVH
, && case_sem_INSN_DIVH
},
84 { M32RXF_INSN_JC
, && case_sem_INSN_JC
},
85 { M32RXF_INSN_JNC
, && case_sem_INSN_JNC
},
86 { M32RXF_INSN_JL
, && case_sem_INSN_JL
},
87 { M32RXF_INSN_JMP
, && case_sem_INSN_JMP
},
88 { M32RXF_INSN_LD
, && case_sem_INSN_LD
},
89 { M32RXF_INSN_LD_D
, && case_sem_INSN_LD_D
},
90 { M32RXF_INSN_LDB
, && case_sem_INSN_LDB
},
91 { M32RXF_INSN_LDB_D
, && case_sem_INSN_LDB_D
},
92 { M32RXF_INSN_LDH
, && case_sem_INSN_LDH
},
93 { M32RXF_INSN_LDH_D
, && case_sem_INSN_LDH_D
},
94 { M32RXF_INSN_LDUB
, && case_sem_INSN_LDUB
},
95 { M32RXF_INSN_LDUB_D
, && case_sem_INSN_LDUB_D
},
96 { M32RXF_INSN_LDUH
, && case_sem_INSN_LDUH
},
97 { M32RXF_INSN_LDUH_D
, && case_sem_INSN_LDUH_D
},
98 { M32RXF_INSN_LD_PLUS
, && case_sem_INSN_LD_PLUS
},
99 { M32RXF_INSN_LD24
, && case_sem_INSN_LD24
},
100 { M32RXF_INSN_LDI8
, && case_sem_INSN_LDI8
},
101 { M32RXF_INSN_LDI16
, && case_sem_INSN_LDI16
},
102 { M32RXF_INSN_LOCK
, && case_sem_INSN_LOCK
},
103 { M32RXF_INSN_MACHI_A
, && case_sem_INSN_MACHI_A
},
104 { M32RXF_INSN_MACLO_A
, && case_sem_INSN_MACLO_A
},
105 { M32RXF_INSN_MACWHI_A
, && case_sem_INSN_MACWHI_A
},
106 { M32RXF_INSN_MACWLO_A
, && case_sem_INSN_MACWLO_A
},
107 { M32RXF_INSN_MUL
, && case_sem_INSN_MUL
},
108 { M32RXF_INSN_MULHI_A
, && case_sem_INSN_MULHI_A
},
109 { M32RXF_INSN_MULLO_A
, && case_sem_INSN_MULLO_A
},
110 { M32RXF_INSN_MULWHI_A
, && case_sem_INSN_MULWHI_A
},
111 { M32RXF_INSN_MULWLO_A
, && case_sem_INSN_MULWLO_A
},
112 { M32RXF_INSN_MV
, && case_sem_INSN_MV
},
113 { M32RXF_INSN_MVFACHI_A
, && case_sem_INSN_MVFACHI_A
},
114 { M32RXF_INSN_MVFACLO_A
, && case_sem_INSN_MVFACLO_A
},
115 { M32RXF_INSN_MVFACMI_A
, && case_sem_INSN_MVFACMI_A
},
116 { M32RXF_INSN_MVFC
, && case_sem_INSN_MVFC
},
117 { M32RXF_INSN_MVTACHI_A
, && case_sem_INSN_MVTACHI_A
},
118 { M32RXF_INSN_MVTACLO_A
, && case_sem_INSN_MVTACLO_A
},
119 { M32RXF_INSN_MVTC
, && case_sem_INSN_MVTC
},
120 { M32RXF_INSN_NEG
, && case_sem_INSN_NEG
},
121 { M32RXF_INSN_NOP
, && case_sem_INSN_NOP
},
122 { M32RXF_INSN_NOT
, && case_sem_INSN_NOT
},
123 { M32RXF_INSN_RAC_DSI
, && case_sem_INSN_RAC_DSI
},
124 { M32RXF_INSN_RACH_DSI
, && case_sem_INSN_RACH_DSI
},
125 { M32RXF_INSN_RTE
, && case_sem_INSN_RTE
},
126 { M32RXF_INSN_SETH
, && case_sem_INSN_SETH
},
127 { M32RXF_INSN_SLL
, && case_sem_INSN_SLL
},
128 { M32RXF_INSN_SLL3
, && case_sem_INSN_SLL3
},
129 { M32RXF_INSN_SLLI
, && case_sem_INSN_SLLI
},
130 { M32RXF_INSN_SRA
, && case_sem_INSN_SRA
},
131 { M32RXF_INSN_SRA3
, && case_sem_INSN_SRA3
},
132 { M32RXF_INSN_SRAI
, && case_sem_INSN_SRAI
},
133 { M32RXF_INSN_SRL
, && case_sem_INSN_SRL
},
134 { M32RXF_INSN_SRL3
, && case_sem_INSN_SRL3
},
135 { M32RXF_INSN_SRLI
, && case_sem_INSN_SRLI
},
136 { M32RXF_INSN_ST
, && case_sem_INSN_ST
},
137 { M32RXF_INSN_ST_D
, && case_sem_INSN_ST_D
},
138 { M32RXF_INSN_STB
, && case_sem_INSN_STB
},
139 { M32RXF_INSN_STB_D
, && case_sem_INSN_STB_D
},
140 { M32RXF_INSN_STH
, && case_sem_INSN_STH
},
141 { M32RXF_INSN_STH_D
, && case_sem_INSN_STH_D
},
142 { M32RXF_INSN_ST_PLUS
, && case_sem_INSN_ST_PLUS
},
143 { M32RXF_INSN_STH_PLUS
, && case_sem_INSN_STH_PLUS
},
144 { M32RXF_INSN_STB_PLUS
, && case_sem_INSN_STB_PLUS
},
145 { M32RXF_INSN_ST_MINUS
, && case_sem_INSN_ST_MINUS
},
146 { M32RXF_INSN_SUB
, && case_sem_INSN_SUB
},
147 { M32RXF_INSN_SUBV
, && case_sem_INSN_SUBV
},
148 { M32RXF_INSN_SUBX
, && case_sem_INSN_SUBX
},
149 { M32RXF_INSN_TRAP
, && case_sem_INSN_TRAP
},
150 { M32RXF_INSN_UNLOCK
, && case_sem_INSN_UNLOCK
},
151 { M32RXF_INSN_SATB
, && case_sem_INSN_SATB
},
152 { M32RXF_INSN_SATH
, && case_sem_INSN_SATH
},
153 { M32RXF_INSN_SAT
, && case_sem_INSN_SAT
},
154 { M32RXF_INSN_PCMPBZ
, && case_sem_INSN_PCMPBZ
},
155 { M32RXF_INSN_SADD
, && case_sem_INSN_SADD
},
156 { M32RXF_INSN_MACWU1
, && case_sem_INSN_MACWU1
},
157 { M32RXF_INSN_MSBLO
, && case_sem_INSN_MSBLO
},
158 { M32RXF_INSN_MULWU1
, && case_sem_INSN_MULWU1
},
159 { M32RXF_INSN_MACLH1
, && case_sem_INSN_MACLH1
},
160 { M32RXF_INSN_SC
, && case_sem_INSN_SC
},
161 { M32RXF_INSN_SNC
, && case_sem_INSN_SNC
},
162 { M32RXF_INSN_CLRPSW
, && case_sem_INSN_CLRPSW
},
163 { M32RXF_INSN_SETPSW
, && case_sem_INSN_SETPSW
},
164 { M32RXF_INSN_BSET
, && case_sem_INSN_BSET
},
165 { M32RXF_INSN_BCLR
, && case_sem_INSN_BCLR
},
166 { M32RXF_INSN_BTST
, && case_sem_INSN_BTST
},
167 { M32RXF_INSN_PAR_ADD
, && case_sem_INSN_PAR_ADD
},
168 { M32RXF_INSN_WRITE_ADD
, && case_sem_INSN_WRITE_ADD
},
169 { M32RXF_INSN_PAR_AND
, && case_sem_INSN_PAR_AND
},
170 { M32RXF_INSN_WRITE_AND
, && case_sem_INSN_WRITE_AND
},
171 { M32RXF_INSN_PAR_OR
, && case_sem_INSN_PAR_OR
},
172 { M32RXF_INSN_WRITE_OR
, && case_sem_INSN_WRITE_OR
},
173 { M32RXF_INSN_PAR_XOR
, && case_sem_INSN_PAR_XOR
},
174 { M32RXF_INSN_WRITE_XOR
, && case_sem_INSN_WRITE_XOR
},
175 { M32RXF_INSN_PAR_ADDI
, && case_sem_INSN_PAR_ADDI
},
176 { M32RXF_INSN_WRITE_ADDI
, && case_sem_INSN_WRITE_ADDI
},
177 { M32RXF_INSN_PAR_ADDV
, && case_sem_INSN_PAR_ADDV
},
178 { M32RXF_INSN_WRITE_ADDV
, && case_sem_INSN_WRITE_ADDV
},
179 { M32RXF_INSN_PAR_ADDX
, && case_sem_INSN_PAR_ADDX
},
180 { M32RXF_INSN_WRITE_ADDX
, && case_sem_INSN_WRITE_ADDX
},
181 { M32RXF_INSN_PAR_BC8
, && case_sem_INSN_PAR_BC8
},
182 { M32RXF_INSN_WRITE_BC8
, && case_sem_INSN_WRITE_BC8
},
183 { M32RXF_INSN_PAR_BL8
, && case_sem_INSN_PAR_BL8
},
184 { M32RXF_INSN_WRITE_BL8
, && case_sem_INSN_WRITE_BL8
},
185 { M32RXF_INSN_PAR_BCL8
, && case_sem_INSN_PAR_BCL8
},
186 { M32RXF_INSN_WRITE_BCL8
, && case_sem_INSN_WRITE_BCL8
},
187 { M32RXF_INSN_PAR_BNC8
, && case_sem_INSN_PAR_BNC8
},
188 { M32RXF_INSN_WRITE_BNC8
, && case_sem_INSN_WRITE_BNC8
},
189 { M32RXF_INSN_PAR_BRA8
, && case_sem_INSN_PAR_BRA8
},
190 { M32RXF_INSN_WRITE_BRA8
, && case_sem_INSN_WRITE_BRA8
},
191 { M32RXF_INSN_PAR_BNCL8
, && case_sem_INSN_PAR_BNCL8
},
192 { M32RXF_INSN_WRITE_BNCL8
, && case_sem_INSN_WRITE_BNCL8
},
193 { M32RXF_INSN_PAR_CMP
, && case_sem_INSN_PAR_CMP
},
194 { M32RXF_INSN_WRITE_CMP
, && case_sem_INSN_WRITE_CMP
},
195 { M32RXF_INSN_PAR_CMPU
, && case_sem_INSN_PAR_CMPU
},
196 { M32RXF_INSN_WRITE_CMPU
, && case_sem_INSN_WRITE_CMPU
},
197 { M32RXF_INSN_PAR_CMPEQ
, && case_sem_INSN_PAR_CMPEQ
},
198 { M32RXF_INSN_WRITE_CMPEQ
, && case_sem_INSN_WRITE_CMPEQ
},
199 { M32RXF_INSN_PAR_CMPZ
, && case_sem_INSN_PAR_CMPZ
},
200 { M32RXF_INSN_WRITE_CMPZ
, && case_sem_INSN_WRITE_CMPZ
},
201 { M32RXF_INSN_PAR_JC
, && case_sem_INSN_PAR_JC
},
202 { M32RXF_INSN_WRITE_JC
, && case_sem_INSN_WRITE_JC
},
203 { M32RXF_INSN_PAR_JNC
, && case_sem_INSN_PAR_JNC
},
204 { M32RXF_INSN_WRITE_JNC
, && case_sem_INSN_WRITE_JNC
},
205 { M32RXF_INSN_PAR_JL
, && case_sem_INSN_PAR_JL
},
206 { M32RXF_INSN_WRITE_JL
, && case_sem_INSN_WRITE_JL
},
207 { M32RXF_INSN_PAR_JMP
, && case_sem_INSN_PAR_JMP
},
208 { M32RXF_INSN_WRITE_JMP
, && case_sem_INSN_WRITE_JMP
},
209 { M32RXF_INSN_PAR_LD
, && case_sem_INSN_PAR_LD
},
210 { M32RXF_INSN_WRITE_LD
, && case_sem_INSN_WRITE_LD
},
211 { M32RXF_INSN_PAR_LDB
, && case_sem_INSN_PAR_LDB
},
212 { M32RXF_INSN_WRITE_LDB
, && case_sem_INSN_WRITE_LDB
},
213 { M32RXF_INSN_PAR_LDH
, && case_sem_INSN_PAR_LDH
},
214 { M32RXF_INSN_WRITE_LDH
, && case_sem_INSN_WRITE_LDH
},
215 { M32RXF_INSN_PAR_LDUB
, && case_sem_INSN_PAR_LDUB
},
216 { M32RXF_INSN_WRITE_LDUB
, && case_sem_INSN_WRITE_LDUB
},
217 { M32RXF_INSN_PAR_LDUH
, && case_sem_INSN_PAR_LDUH
},
218 { M32RXF_INSN_WRITE_LDUH
, && case_sem_INSN_WRITE_LDUH
},
219 { M32RXF_INSN_PAR_LD_PLUS
, && case_sem_INSN_PAR_LD_PLUS
},
220 { M32RXF_INSN_WRITE_LD_PLUS
, && case_sem_INSN_WRITE_LD_PLUS
},
221 { M32RXF_INSN_PAR_LDI8
, && case_sem_INSN_PAR_LDI8
},
222 { M32RXF_INSN_WRITE_LDI8
, && case_sem_INSN_WRITE_LDI8
},
223 { M32RXF_INSN_PAR_LOCK
, && case_sem_INSN_PAR_LOCK
},
224 { M32RXF_INSN_WRITE_LOCK
, && case_sem_INSN_WRITE_LOCK
},
225 { M32RXF_INSN_PAR_MACHI_A
, && case_sem_INSN_PAR_MACHI_A
},
226 { M32RXF_INSN_WRITE_MACHI_A
, && case_sem_INSN_WRITE_MACHI_A
},
227 { M32RXF_INSN_PAR_MACLO_A
, && case_sem_INSN_PAR_MACLO_A
},
228 { M32RXF_INSN_WRITE_MACLO_A
, && case_sem_INSN_WRITE_MACLO_A
},
229 { M32RXF_INSN_PAR_MACWHI_A
, && case_sem_INSN_PAR_MACWHI_A
},
230 { M32RXF_INSN_WRITE_MACWHI_A
, && case_sem_INSN_WRITE_MACWHI_A
},
231 { M32RXF_INSN_PAR_MACWLO_A
, && case_sem_INSN_PAR_MACWLO_A
},
232 { M32RXF_INSN_WRITE_MACWLO_A
, && case_sem_INSN_WRITE_MACWLO_A
},
233 { M32RXF_INSN_PAR_MUL
, && case_sem_INSN_PAR_MUL
},
234 { M32RXF_INSN_WRITE_MUL
, && case_sem_INSN_WRITE_MUL
},
235 { M32RXF_INSN_PAR_MULHI_A
, && case_sem_INSN_PAR_MULHI_A
},
236 { M32RXF_INSN_WRITE_MULHI_A
, && case_sem_INSN_WRITE_MULHI_A
},
237 { M32RXF_INSN_PAR_MULLO_A
, && case_sem_INSN_PAR_MULLO_A
},
238 { M32RXF_INSN_WRITE_MULLO_A
, && case_sem_INSN_WRITE_MULLO_A
},
239 { M32RXF_INSN_PAR_MULWHI_A
, && case_sem_INSN_PAR_MULWHI_A
},
240 { M32RXF_INSN_WRITE_MULWHI_A
, && case_sem_INSN_WRITE_MULWHI_A
},
241 { M32RXF_INSN_PAR_MULWLO_A
, && case_sem_INSN_PAR_MULWLO_A
},
242 { M32RXF_INSN_WRITE_MULWLO_A
, && case_sem_INSN_WRITE_MULWLO_A
},
243 { M32RXF_INSN_PAR_MV
, && case_sem_INSN_PAR_MV
},
244 { M32RXF_INSN_WRITE_MV
, && case_sem_INSN_WRITE_MV
},
245 { M32RXF_INSN_PAR_MVFACHI_A
, && case_sem_INSN_PAR_MVFACHI_A
},
246 { M32RXF_INSN_WRITE_MVFACHI_A
, && case_sem_INSN_WRITE_MVFACHI_A
},
247 { M32RXF_INSN_PAR_MVFACLO_A
, && case_sem_INSN_PAR_MVFACLO_A
},
248 { M32RXF_INSN_WRITE_MVFACLO_A
, && case_sem_INSN_WRITE_MVFACLO_A
},
249 { M32RXF_INSN_PAR_MVFACMI_A
, && case_sem_INSN_PAR_MVFACMI_A
},
250 { M32RXF_INSN_WRITE_MVFACMI_A
, && case_sem_INSN_WRITE_MVFACMI_A
},
251 { M32RXF_INSN_PAR_MVFC
, && case_sem_INSN_PAR_MVFC
},
252 { M32RXF_INSN_WRITE_MVFC
, && case_sem_INSN_WRITE_MVFC
},
253 { M32RXF_INSN_PAR_MVTACHI_A
, && case_sem_INSN_PAR_MVTACHI_A
},
254 { M32RXF_INSN_WRITE_MVTACHI_A
, && case_sem_INSN_WRITE_MVTACHI_A
},
255 { M32RXF_INSN_PAR_MVTACLO_A
, && case_sem_INSN_PAR_MVTACLO_A
},
256 { M32RXF_INSN_WRITE_MVTACLO_A
, && case_sem_INSN_WRITE_MVTACLO_A
},
257 { M32RXF_INSN_PAR_MVTC
, && case_sem_INSN_PAR_MVTC
},
258 { M32RXF_INSN_WRITE_MVTC
, && case_sem_INSN_WRITE_MVTC
},
259 { M32RXF_INSN_PAR_NEG
, && case_sem_INSN_PAR_NEG
},
260 { M32RXF_INSN_WRITE_NEG
, && case_sem_INSN_WRITE_NEG
},
261 { M32RXF_INSN_PAR_NOP
, && case_sem_INSN_PAR_NOP
},
262 { M32RXF_INSN_WRITE_NOP
, && case_sem_INSN_WRITE_NOP
},
263 { M32RXF_INSN_PAR_NOT
, && case_sem_INSN_PAR_NOT
},
264 { M32RXF_INSN_WRITE_NOT
, && case_sem_INSN_WRITE_NOT
},
265 { M32RXF_INSN_PAR_RAC_DSI
, && case_sem_INSN_PAR_RAC_DSI
},
266 { M32RXF_INSN_WRITE_RAC_DSI
, && case_sem_INSN_WRITE_RAC_DSI
},
267 { M32RXF_INSN_PAR_RACH_DSI
, && case_sem_INSN_PAR_RACH_DSI
},
268 { M32RXF_INSN_WRITE_RACH_DSI
, && case_sem_INSN_WRITE_RACH_DSI
},
269 { M32RXF_INSN_PAR_RTE
, && case_sem_INSN_PAR_RTE
},
270 { M32RXF_INSN_WRITE_RTE
, && case_sem_INSN_WRITE_RTE
},
271 { M32RXF_INSN_PAR_SLL
, && case_sem_INSN_PAR_SLL
},
272 { M32RXF_INSN_WRITE_SLL
, && case_sem_INSN_WRITE_SLL
},
273 { M32RXF_INSN_PAR_SLLI
, && case_sem_INSN_PAR_SLLI
},
274 { M32RXF_INSN_WRITE_SLLI
, && case_sem_INSN_WRITE_SLLI
},
275 { M32RXF_INSN_PAR_SRA
, && case_sem_INSN_PAR_SRA
},
276 { M32RXF_INSN_WRITE_SRA
, && case_sem_INSN_WRITE_SRA
},
277 { M32RXF_INSN_PAR_SRAI
, && case_sem_INSN_PAR_SRAI
},
278 { M32RXF_INSN_WRITE_SRAI
, && case_sem_INSN_WRITE_SRAI
},
279 { M32RXF_INSN_PAR_SRL
, && case_sem_INSN_PAR_SRL
},
280 { M32RXF_INSN_WRITE_SRL
, && case_sem_INSN_WRITE_SRL
},
281 { M32RXF_INSN_PAR_SRLI
, && case_sem_INSN_PAR_SRLI
},
282 { M32RXF_INSN_WRITE_SRLI
, && case_sem_INSN_WRITE_SRLI
},
283 { M32RXF_INSN_PAR_ST
, && case_sem_INSN_PAR_ST
},
284 { M32RXF_INSN_WRITE_ST
, && case_sem_INSN_WRITE_ST
},
285 { M32RXF_INSN_PAR_STB
, && case_sem_INSN_PAR_STB
},
286 { M32RXF_INSN_WRITE_STB
, && case_sem_INSN_WRITE_STB
},
287 { M32RXF_INSN_PAR_STH
, && case_sem_INSN_PAR_STH
},
288 { M32RXF_INSN_WRITE_STH
, && case_sem_INSN_WRITE_STH
},
289 { M32RXF_INSN_PAR_ST_PLUS
, && case_sem_INSN_PAR_ST_PLUS
},
290 { M32RXF_INSN_WRITE_ST_PLUS
, && case_sem_INSN_WRITE_ST_PLUS
},
291 { M32RXF_INSN_PAR_STH_PLUS
, && case_sem_INSN_PAR_STH_PLUS
},
292 { M32RXF_INSN_WRITE_STH_PLUS
, && case_sem_INSN_WRITE_STH_PLUS
},
293 { M32RXF_INSN_PAR_STB_PLUS
, && case_sem_INSN_PAR_STB_PLUS
},
294 { M32RXF_INSN_WRITE_STB_PLUS
, && case_sem_INSN_WRITE_STB_PLUS
},
295 { M32RXF_INSN_PAR_ST_MINUS
, && case_sem_INSN_PAR_ST_MINUS
},
296 { M32RXF_INSN_WRITE_ST_MINUS
, && case_sem_INSN_WRITE_ST_MINUS
},
297 { M32RXF_INSN_PAR_SUB
, && case_sem_INSN_PAR_SUB
},
298 { M32RXF_INSN_WRITE_SUB
, && case_sem_INSN_WRITE_SUB
},
299 { M32RXF_INSN_PAR_SUBV
, && case_sem_INSN_PAR_SUBV
},
300 { M32RXF_INSN_WRITE_SUBV
, && case_sem_INSN_WRITE_SUBV
},
301 { M32RXF_INSN_PAR_SUBX
, && case_sem_INSN_PAR_SUBX
},
302 { M32RXF_INSN_WRITE_SUBX
, && case_sem_INSN_WRITE_SUBX
},
303 { M32RXF_INSN_PAR_TRAP
, && case_sem_INSN_PAR_TRAP
},
304 { M32RXF_INSN_WRITE_TRAP
, && case_sem_INSN_WRITE_TRAP
},
305 { M32RXF_INSN_PAR_UNLOCK
, && case_sem_INSN_PAR_UNLOCK
},
306 { M32RXF_INSN_WRITE_UNLOCK
, && case_sem_INSN_WRITE_UNLOCK
},
307 { M32RXF_INSN_PAR_PCMPBZ
, && case_sem_INSN_PAR_PCMPBZ
},
308 { M32RXF_INSN_WRITE_PCMPBZ
, && case_sem_INSN_WRITE_PCMPBZ
},
309 { M32RXF_INSN_PAR_SADD
, && case_sem_INSN_PAR_SADD
},
310 { M32RXF_INSN_WRITE_SADD
, && case_sem_INSN_WRITE_SADD
},
311 { M32RXF_INSN_PAR_MACWU1
, && case_sem_INSN_PAR_MACWU1
},
312 { M32RXF_INSN_WRITE_MACWU1
, && case_sem_INSN_WRITE_MACWU1
},
313 { M32RXF_INSN_PAR_MSBLO
, && case_sem_INSN_PAR_MSBLO
},
314 { M32RXF_INSN_WRITE_MSBLO
, && case_sem_INSN_WRITE_MSBLO
},
315 { M32RXF_INSN_PAR_MULWU1
, && case_sem_INSN_PAR_MULWU1
},
316 { M32RXF_INSN_WRITE_MULWU1
, && case_sem_INSN_WRITE_MULWU1
},
317 { M32RXF_INSN_PAR_MACLH1
, && case_sem_INSN_PAR_MACLH1
},
318 { M32RXF_INSN_WRITE_MACLH1
, && case_sem_INSN_WRITE_MACLH1
},
319 { M32RXF_INSN_PAR_SC
, && case_sem_INSN_PAR_SC
},
320 { M32RXF_INSN_WRITE_SC
, && case_sem_INSN_WRITE_SC
},
321 { M32RXF_INSN_PAR_SNC
, && case_sem_INSN_PAR_SNC
},
322 { M32RXF_INSN_WRITE_SNC
, && case_sem_INSN_WRITE_SNC
},
323 { M32RXF_INSN_PAR_CLRPSW
, && case_sem_INSN_PAR_CLRPSW
},
324 { M32RXF_INSN_WRITE_CLRPSW
, && case_sem_INSN_WRITE_CLRPSW
},
325 { M32RXF_INSN_PAR_SETPSW
, && case_sem_INSN_PAR_SETPSW
},
326 { M32RXF_INSN_WRITE_SETPSW
, && case_sem_INSN_WRITE_SETPSW
},
327 { M32RXF_INSN_PAR_BTST
, && case_sem_INSN_PAR_BTST
},
328 { M32RXF_INSN_WRITE_BTST
, && case_sem_INSN_WRITE_BTST
},
333 for (i
= 0; labels
[i
].label
!= 0; ++i
)
336 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
338 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
343 #endif /* DEFINE_LABELS */
347 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
348 off frills like tracing and profiling. */
349 /* FIXME: A better way would be to have TRACE_RESULT check for something
350 that can cause it to be optimized out. Another way would be to emit
351 special handlers into the instruction "stream". */
355 #define TRACE_RESULT(cpu, abuf, name, type, val)
359 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
360 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
362 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
369 /* Branch to next handler without going around main loop. */
370 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
371 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
373 #else /* ! WITH_SCACHE_PBB */
375 #define NEXT(vpc) BREAK (sem)
378 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
380 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
383 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
386 #endif /* ! WITH_SCACHE_PBB */
390 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
392 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
393 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
394 #define FLD(f) abuf->fields.fmt_empty.f
395 int UNUSED written
= 0;
396 IADDR UNUSED pc
= abuf
->addr
;
397 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
400 /* Update the recorded pc in the cpu state struct.
401 Only necessary for WITH_SCACHE case, but to avoid the
402 conditional compilation .... */
404 /* Virtual insns have zero size. Overwrite vpc with address of next insn
405 using the default-insn-bitsize spec. When executing insns in parallel
406 we may want to queue the fault and continue execution. */
407 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
408 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
415 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
417 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
418 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
419 #define FLD(f) abuf->fields.fmt_empty.f
420 int UNUSED written
= 0;
421 IADDR UNUSED pc
= abuf
->addr
;
422 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
425 #if WITH_SCACHE_PBB_M32RXF
426 m32rxf_pbb_after (current_cpu
, sem_arg
);
434 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
436 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
437 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
438 #define FLD(f) abuf->fields.fmt_empty.f
439 int UNUSED written
= 0;
440 IADDR UNUSED pc
= abuf
->addr
;
441 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
444 #if WITH_SCACHE_PBB_M32RXF
445 m32rxf_pbb_before (current_cpu
, sem_arg
);
453 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
455 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
456 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
457 #define FLD(f) abuf->fields.fmt_empty.f
458 int UNUSED written
= 0;
459 IADDR UNUSED pc
= abuf
->addr
;
460 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
463 #if WITH_SCACHE_PBB_M32RXF
465 vpc
= m32rxf_pbb_cti_chain (current_cpu
, sem_arg
,
466 pbb_br_type
, pbb_br_npc
);
469 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
470 vpc
= m32rxf_pbb_cti_chain (current_cpu
, sem_arg
,
471 CPU_PBB_BR_TYPE (current_cpu
),
472 CPU_PBB_BR_NPC (current_cpu
));
481 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
483 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
484 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
485 #define FLD(f) abuf->fields.fmt_empty.f
486 int UNUSED written
= 0;
487 IADDR UNUSED pc
= abuf
->addr
;
488 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
491 #if WITH_SCACHE_PBB_M32RXF
492 vpc
= m32rxf_pbb_chain (current_cpu
, sem_arg
);
503 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
505 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
506 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
507 #define FLD(f) abuf->fields.fmt_empty.f
508 int UNUSED written
= 0;
509 IADDR UNUSED pc
= abuf
->addr
;
510 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
513 #if WITH_SCACHE_PBB_M32RXF
514 #if defined DEFINE_SWITCH || defined FAST_P
515 /* In the switch case FAST_P is a constant, allowing several optimizations
516 in any called inline functions. */
517 vpc
= m32rxf_pbb_begin (current_cpu
, FAST_P
);
519 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
520 vpc
= m32rxf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
522 vpc
= m32rxf_pbb_begin (current_cpu
, 0);
532 CASE (sem
, INSN_ADD
) : /* add $dr,$sr */
534 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
536 #define FLD(f) abuf->fields.sfmt_add.f
537 int UNUSED written
= 0;
538 IADDR UNUSED pc
= abuf
->addr
;
539 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
542 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
543 * FLD (i_dr
) = opval
;
544 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
551 CASE (sem
, INSN_ADD3
) : /* add3 $dr,$sr,$hash$slo16 */
553 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
554 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
555 #define FLD(f) abuf->fields.sfmt_add3.f
556 int UNUSED written
= 0;
557 IADDR UNUSED pc
= abuf
->addr
;
558 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
561 SI opval
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
562 * FLD (i_dr
) = opval
;
563 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
570 CASE (sem
, INSN_AND
) : /* and $dr,$sr */
572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
574 #define FLD(f) abuf->fields.sfmt_add.f
575 int UNUSED written
= 0;
576 IADDR UNUSED pc
= abuf
->addr
;
577 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
580 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
581 * FLD (i_dr
) = opval
;
582 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
589 CASE (sem
, INSN_AND3
) : /* and3 $dr,$sr,$uimm16 */
591 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
592 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
593 #define FLD(f) abuf->fields.sfmt_and3.f
594 int UNUSED written
= 0;
595 IADDR UNUSED pc
= abuf
->addr
;
596 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
599 SI opval
= ANDSI (* FLD (i_sr
), FLD (f_uimm16
));
600 * FLD (i_dr
) = opval
;
601 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
608 CASE (sem
, INSN_OR
) : /* or $dr,$sr */
610 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
611 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
612 #define FLD(f) abuf->fields.sfmt_add.f
613 int UNUSED written
= 0;
614 IADDR UNUSED pc
= abuf
->addr
;
615 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
618 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
619 * FLD (i_dr
) = opval
;
620 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
627 CASE (sem
, INSN_OR3
) : /* or3 $dr,$sr,$hash$ulo16 */
629 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
630 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
631 #define FLD(f) abuf->fields.sfmt_and3.f
632 int UNUSED written
= 0;
633 IADDR UNUSED pc
= abuf
->addr
;
634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
637 SI opval
= ORSI (* FLD (i_sr
), FLD (f_uimm16
));
638 * FLD (i_dr
) = opval
;
639 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
646 CASE (sem
, INSN_XOR
) : /* xor $dr,$sr */
648 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
649 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
650 #define FLD(f) abuf->fields.sfmt_add.f
651 int UNUSED written
= 0;
652 IADDR UNUSED pc
= abuf
->addr
;
653 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
656 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
657 * FLD (i_dr
) = opval
;
658 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
665 CASE (sem
, INSN_XOR3
) : /* xor3 $dr,$sr,$uimm16 */
667 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
668 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
669 #define FLD(f) abuf->fields.sfmt_and3.f
670 int UNUSED written
= 0;
671 IADDR UNUSED pc
= abuf
->addr
;
672 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
675 SI opval
= XORSI (* FLD (i_sr
), FLD (f_uimm16
));
676 * FLD (i_dr
) = opval
;
677 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
684 CASE (sem
, INSN_ADDI
) : /* addi $dr,$simm8 */
686 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
687 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
688 #define FLD(f) abuf->fields.sfmt_addi.f
689 int UNUSED written
= 0;
690 IADDR UNUSED pc
= abuf
->addr
;
691 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
694 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
695 * FLD (i_dr
) = opval
;
696 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
703 CASE (sem
, INSN_ADDV
) : /* addv $dr,$sr */
705 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
706 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
707 #define FLD(f) abuf->fields.sfmt_add.f
708 int UNUSED written
= 0;
709 IADDR UNUSED pc
= abuf
->addr
;
710 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
714 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
715 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
718 * FLD (i_dr
) = opval
;
719 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
723 CPU (h_cond
) = opval
;
724 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
732 CASE (sem
, INSN_ADDV3
) : /* addv3 $dr,$sr,$simm16 */
734 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
735 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
736 #define FLD(f) abuf->fields.sfmt_add3.f
737 int UNUSED written
= 0;
738 IADDR UNUSED pc
= abuf
->addr
;
739 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
743 temp0
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
744 temp1
= ADDOFSI (* FLD (i_sr
), FLD (f_simm16
), 0);
747 * FLD (i_dr
) = opval
;
748 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
752 CPU (h_cond
) = opval
;
753 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
761 CASE (sem
, INSN_ADDX
) : /* addx $dr,$sr */
763 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
764 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
765 #define FLD(f) abuf->fields.sfmt_add.f
766 int UNUSED written
= 0;
767 IADDR UNUSED pc
= abuf
->addr
;
768 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
772 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
773 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
776 * FLD (i_dr
) = opval
;
777 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
781 CPU (h_cond
) = opval
;
782 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
790 CASE (sem
, INSN_BC8
) : /* bc.s $disp8 */
792 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
793 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
794 #define FLD(f) abuf->fields.sfmt_bl8.f
795 int UNUSED written
= 0;
796 IADDR UNUSED pc
= abuf
->addr
;
798 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
802 USI opval
= FLD (i_disp8
);
803 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
805 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
809 abuf
->written
= written
;
810 SEM_BRANCH_FINI (vpc
);
815 CASE (sem
, INSN_BC24
) : /* bc.l $disp24 */
817 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
818 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
819 #define FLD(f) abuf->fields.sfmt_bl24.f
820 int UNUSED written
= 0;
821 IADDR UNUSED pc
= abuf
->addr
;
823 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
827 USI opval
= FLD (i_disp24
);
828 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
830 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
834 abuf
->written
= written
;
835 SEM_BRANCH_FINI (vpc
);
840 CASE (sem
, INSN_BEQ
) : /* beq $src1,$src2,$disp16 */
842 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
843 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
844 #define FLD(f) abuf->fields.sfmt_beq.f
845 int UNUSED written
= 0;
846 IADDR UNUSED pc
= abuf
->addr
;
848 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
850 if (EQSI (* FLD (i_src1
), * FLD (i_src2
))) {
852 USI opval
= FLD (i_disp16
);
853 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
855 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
859 abuf
->written
= written
;
860 SEM_BRANCH_FINI (vpc
);
865 CASE (sem
, INSN_BEQZ
) : /* beqz $src2,$disp16 */
867 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
868 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
869 #define FLD(f) abuf->fields.sfmt_beq.f
870 int UNUSED written
= 0;
871 IADDR UNUSED pc
= abuf
->addr
;
873 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
875 if (EQSI (* FLD (i_src2
), 0)) {
877 USI opval
= FLD (i_disp16
);
878 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
880 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
884 abuf
->written
= written
;
885 SEM_BRANCH_FINI (vpc
);
890 CASE (sem
, INSN_BGEZ
) : /* bgez $src2,$disp16 */
892 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
893 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
894 #define FLD(f) abuf->fields.sfmt_beq.f
895 int UNUSED written
= 0;
896 IADDR UNUSED pc
= abuf
->addr
;
898 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
900 if (GESI (* FLD (i_src2
), 0)) {
902 USI opval
= FLD (i_disp16
);
903 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
905 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
909 abuf
->written
= written
;
910 SEM_BRANCH_FINI (vpc
);
915 CASE (sem
, INSN_BGTZ
) : /* bgtz $src2,$disp16 */
917 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
918 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
919 #define FLD(f) abuf->fields.sfmt_beq.f
920 int UNUSED written
= 0;
921 IADDR UNUSED pc
= abuf
->addr
;
923 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
925 if (GTSI (* FLD (i_src2
), 0)) {
927 USI opval
= FLD (i_disp16
);
928 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
930 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
934 abuf
->written
= written
;
935 SEM_BRANCH_FINI (vpc
);
940 CASE (sem
, INSN_BLEZ
) : /* blez $src2,$disp16 */
942 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
943 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
944 #define FLD(f) abuf->fields.sfmt_beq.f
945 int UNUSED written
= 0;
946 IADDR UNUSED pc
= abuf
->addr
;
948 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
950 if (LESI (* FLD (i_src2
), 0)) {
952 USI opval
= FLD (i_disp16
);
953 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
955 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
959 abuf
->written
= written
;
960 SEM_BRANCH_FINI (vpc
);
965 CASE (sem
, INSN_BLTZ
) : /* bltz $src2,$disp16 */
967 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
968 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
969 #define FLD(f) abuf->fields.sfmt_beq.f
970 int UNUSED written
= 0;
971 IADDR UNUSED pc
= abuf
->addr
;
973 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
975 if (LTSI (* FLD (i_src2
), 0)) {
977 USI opval
= FLD (i_disp16
);
978 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
980 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
984 abuf
->written
= written
;
985 SEM_BRANCH_FINI (vpc
);
990 CASE (sem
, INSN_BNEZ
) : /* bnez $src2,$disp16 */
992 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
993 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
994 #define FLD(f) abuf->fields.sfmt_beq.f
995 int UNUSED written
= 0;
996 IADDR UNUSED pc
= abuf
->addr
;
998 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1000 if (NESI (* FLD (i_src2
), 0)) {
1002 USI opval
= FLD (i_disp16
);
1003 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1004 written
|= (1 << 2);
1005 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1009 abuf
->written
= written
;
1010 SEM_BRANCH_FINI (vpc
);
1015 CASE (sem
, INSN_BL8
) : /* bl.s $disp8 */
1017 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1018 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1019 #define FLD(f) abuf->fields.sfmt_bl8.f
1020 int UNUSED written
= 0;
1021 IADDR UNUSED pc
= abuf
->addr
;
1023 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1027 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
1028 CPU (h_gr
[((UINT
) 14)]) = opval
;
1029 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1032 USI opval
= FLD (i_disp8
);
1033 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1034 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1038 SEM_BRANCH_FINI (vpc
);
1043 CASE (sem
, INSN_BL24
) : /* bl.l $disp24 */
1045 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1046 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1047 #define FLD(f) abuf->fields.sfmt_bl24.f
1048 int UNUSED written
= 0;
1049 IADDR UNUSED pc
= abuf
->addr
;
1051 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1055 SI opval
= ADDSI (pc
, 4);
1056 CPU (h_gr
[((UINT
) 14)]) = opval
;
1057 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1060 USI opval
= FLD (i_disp24
);
1061 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1062 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1066 SEM_BRANCH_FINI (vpc
);
1071 CASE (sem
, INSN_BCL8
) : /* bcl.s $disp8 */
1073 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1074 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1075 #define FLD(f) abuf->fields.sfmt_bl8.f
1076 int UNUSED written
= 0;
1077 IADDR UNUSED pc
= abuf
->addr
;
1079 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1084 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
1085 CPU (h_gr
[((UINT
) 14)]) = opval
;
1086 written
|= (1 << 3);
1087 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1090 USI opval
= FLD (i_disp8
);
1091 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1092 written
|= (1 << 4);
1093 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1098 abuf
->written
= written
;
1099 SEM_BRANCH_FINI (vpc
);
1104 CASE (sem
, INSN_BCL24
) : /* bcl.l $disp24 */
1106 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1108 #define FLD(f) abuf->fields.sfmt_bl24.f
1109 int UNUSED written
= 0;
1110 IADDR UNUSED pc
= abuf
->addr
;
1112 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1117 SI opval
= ADDSI (pc
, 4);
1118 CPU (h_gr
[((UINT
) 14)]) = opval
;
1119 written
|= (1 << 3);
1120 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1123 USI opval
= FLD (i_disp24
);
1124 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1125 written
|= (1 << 4);
1126 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1131 abuf
->written
= written
;
1132 SEM_BRANCH_FINI (vpc
);
1137 CASE (sem
, INSN_BNC8
) : /* bnc.s $disp8 */
1139 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1140 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1141 #define FLD(f) abuf->fields.sfmt_bl8.f
1142 int UNUSED written
= 0;
1143 IADDR UNUSED pc
= abuf
->addr
;
1145 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1147 if (NOTBI (CPU (h_cond
))) {
1149 USI opval
= FLD (i_disp8
);
1150 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1151 written
|= (1 << 2);
1152 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1156 abuf
->written
= written
;
1157 SEM_BRANCH_FINI (vpc
);
1162 CASE (sem
, INSN_BNC24
) : /* bnc.l $disp24 */
1164 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1165 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1166 #define FLD(f) abuf->fields.sfmt_bl24.f
1167 int UNUSED written
= 0;
1168 IADDR UNUSED pc
= abuf
->addr
;
1170 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1172 if (NOTBI (CPU (h_cond
))) {
1174 USI opval
= FLD (i_disp24
);
1175 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1176 written
|= (1 << 2);
1177 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1181 abuf
->written
= written
;
1182 SEM_BRANCH_FINI (vpc
);
1187 CASE (sem
, INSN_BNE
) : /* bne $src1,$src2,$disp16 */
1189 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1190 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1191 #define FLD(f) abuf->fields.sfmt_beq.f
1192 int UNUSED written
= 0;
1193 IADDR UNUSED pc
= abuf
->addr
;
1195 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1197 if (NESI (* FLD (i_src1
), * FLD (i_src2
))) {
1199 USI opval
= FLD (i_disp16
);
1200 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1201 written
|= (1 << 3);
1202 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1206 abuf
->written
= written
;
1207 SEM_BRANCH_FINI (vpc
);
1212 CASE (sem
, INSN_BRA8
) : /* bra.s $disp8 */
1214 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1215 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1216 #define FLD(f) abuf->fields.sfmt_bl8.f
1217 int UNUSED written
= 0;
1218 IADDR UNUSED pc
= abuf
->addr
;
1220 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1223 USI opval
= FLD (i_disp8
);
1224 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1225 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1228 SEM_BRANCH_FINI (vpc
);
1233 CASE (sem
, INSN_BRA24
) : /* bra.l $disp24 */
1235 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1236 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1237 #define FLD(f) abuf->fields.sfmt_bl24.f
1238 int UNUSED written
= 0;
1239 IADDR UNUSED pc
= abuf
->addr
;
1241 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1244 USI opval
= FLD (i_disp24
);
1245 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1246 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1249 SEM_BRANCH_FINI (vpc
);
1254 CASE (sem
, INSN_BNCL8
) : /* bncl.s $disp8 */
1256 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1257 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1258 #define FLD(f) abuf->fields.sfmt_bl8.f
1259 int UNUSED written
= 0;
1260 IADDR UNUSED pc
= abuf
->addr
;
1262 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1264 if (NOTBI (CPU (h_cond
))) {
1267 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
1268 CPU (h_gr
[((UINT
) 14)]) = opval
;
1269 written
|= (1 << 3);
1270 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1273 USI opval
= FLD (i_disp8
);
1274 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1275 written
|= (1 << 4);
1276 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1281 abuf
->written
= written
;
1282 SEM_BRANCH_FINI (vpc
);
1287 CASE (sem
, INSN_BNCL24
) : /* bncl.l $disp24 */
1289 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1290 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1291 #define FLD(f) abuf->fields.sfmt_bl24.f
1292 int UNUSED written
= 0;
1293 IADDR UNUSED pc
= abuf
->addr
;
1295 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1297 if (NOTBI (CPU (h_cond
))) {
1300 SI opval
= ADDSI (pc
, 4);
1301 CPU (h_gr
[((UINT
) 14)]) = opval
;
1302 written
|= (1 << 3);
1303 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1306 USI opval
= FLD (i_disp24
);
1307 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1308 written
|= (1 << 4);
1309 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1314 abuf
->written
= written
;
1315 SEM_BRANCH_FINI (vpc
);
1320 CASE (sem
, INSN_CMP
) : /* cmp $src1,$src2 */
1322 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1323 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1324 #define FLD(f) abuf->fields.sfmt_st_plus.f
1325 int UNUSED written
= 0;
1326 IADDR UNUSED pc
= abuf
->addr
;
1327 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1330 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
1331 CPU (h_cond
) = opval
;
1332 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1339 CASE (sem
, INSN_CMPI
) : /* cmpi $src2,$simm16 */
1341 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1342 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1343 #define FLD(f) abuf->fields.sfmt_st_d.f
1344 int UNUSED written
= 0;
1345 IADDR UNUSED pc
= abuf
->addr
;
1346 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1349 BI opval
= LTSI (* FLD (i_src2
), FLD (f_simm16
));
1350 CPU (h_cond
) = opval
;
1351 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1358 CASE (sem
, INSN_CMPU
) : /* cmpu $src1,$src2 */
1360 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1361 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1362 #define FLD(f) abuf->fields.sfmt_st_plus.f
1363 int UNUSED written
= 0;
1364 IADDR UNUSED pc
= abuf
->addr
;
1365 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1368 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
1369 CPU (h_cond
) = opval
;
1370 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1377 CASE (sem
, INSN_CMPUI
) : /* cmpui $src2,$simm16 */
1379 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1380 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1381 #define FLD(f) abuf->fields.sfmt_st_d.f
1382 int UNUSED written
= 0;
1383 IADDR UNUSED pc
= abuf
->addr
;
1384 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1387 BI opval
= LTUSI (* FLD (i_src2
), FLD (f_simm16
));
1388 CPU (h_cond
) = opval
;
1389 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1396 CASE (sem
, INSN_CMPEQ
) : /* cmpeq $src1,$src2 */
1398 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1399 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1400 #define FLD(f) abuf->fields.sfmt_st_plus.f
1401 int UNUSED written
= 0;
1402 IADDR UNUSED pc
= abuf
->addr
;
1403 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1406 BI opval
= EQSI (* FLD (i_src1
), * FLD (i_src2
));
1407 CPU (h_cond
) = opval
;
1408 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1415 CASE (sem
, INSN_CMPZ
) : /* cmpz $src2 */
1417 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1418 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1419 #define FLD(f) abuf->fields.sfmt_st_plus.f
1420 int UNUSED written
= 0;
1421 IADDR UNUSED pc
= abuf
->addr
;
1422 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1425 BI opval
= EQSI (* FLD (i_src2
), 0);
1426 CPU (h_cond
) = opval
;
1427 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1434 CASE (sem
, INSN_DIV
) : /* div $dr,$sr */
1436 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1437 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1438 #define FLD(f) abuf->fields.sfmt_add.f
1439 int UNUSED written
= 0;
1440 IADDR UNUSED pc
= abuf
->addr
;
1441 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1443 if (NESI (* FLD (i_sr
), 0)) {
1445 SI opval
= DIVSI (* FLD (i_dr
), * FLD (i_sr
));
1446 * FLD (i_dr
) = opval
;
1447 written
|= (1 << 2);
1448 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1452 abuf
->written
= written
;
1457 CASE (sem
, INSN_DIVU
) : /* divu $dr,$sr */
1459 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1460 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1461 #define FLD(f) abuf->fields.sfmt_add.f
1462 int UNUSED written
= 0;
1463 IADDR UNUSED pc
= abuf
->addr
;
1464 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1466 if (NESI (* FLD (i_sr
), 0)) {
1468 SI opval
= UDIVSI (* FLD (i_dr
), * FLD (i_sr
));
1469 * FLD (i_dr
) = opval
;
1470 written
|= (1 << 2);
1471 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1475 abuf
->written
= written
;
1480 CASE (sem
, INSN_REM
) : /* rem $dr,$sr */
1482 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1483 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1484 #define FLD(f) abuf->fields.sfmt_add.f
1485 int UNUSED written
= 0;
1486 IADDR UNUSED pc
= abuf
->addr
;
1487 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1489 if (NESI (* FLD (i_sr
), 0)) {
1491 SI opval
= MODSI (* FLD (i_dr
), * FLD (i_sr
));
1492 * FLD (i_dr
) = opval
;
1493 written
|= (1 << 2);
1494 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1498 abuf
->written
= written
;
1503 CASE (sem
, INSN_REMU
) : /* remu $dr,$sr */
1505 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1506 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1507 #define FLD(f) abuf->fields.sfmt_add.f
1508 int UNUSED written
= 0;
1509 IADDR UNUSED pc
= abuf
->addr
;
1510 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1512 if (NESI (* FLD (i_sr
), 0)) {
1514 SI opval
= UMODSI (* FLD (i_dr
), * FLD (i_sr
));
1515 * FLD (i_dr
) = opval
;
1516 written
|= (1 << 2);
1517 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1521 abuf
->written
= written
;
1526 CASE (sem
, INSN_DIVH
) : /* divh $dr,$sr */
1528 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1529 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1530 #define FLD(f) abuf->fields.sfmt_add.f
1531 int UNUSED written
= 0;
1532 IADDR UNUSED pc
= abuf
->addr
;
1533 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1535 if (NESI (* FLD (i_sr
), 0)) {
1537 SI opval
= DIVSI (EXTHISI (TRUNCSIHI (* FLD (i_dr
))), * FLD (i_sr
));
1538 * FLD (i_dr
) = opval
;
1539 written
|= (1 << 2);
1540 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1544 abuf
->written
= written
;
1549 CASE (sem
, INSN_JC
) : /* jc $sr */
1551 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1552 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1553 #define FLD(f) abuf->fields.sfmt_jl.f
1554 int UNUSED written
= 0;
1555 IADDR UNUSED pc
= abuf
->addr
;
1557 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1561 USI opval
= ANDSI (* FLD (i_sr
), -4);
1562 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1563 written
|= (1 << 2);
1564 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1568 abuf
->written
= written
;
1569 SEM_BRANCH_FINI (vpc
);
1574 CASE (sem
, INSN_JNC
) : /* jnc $sr */
1576 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1577 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1578 #define FLD(f) abuf->fields.sfmt_jl.f
1579 int UNUSED written
= 0;
1580 IADDR UNUSED pc
= abuf
->addr
;
1582 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1584 if (NOTBI (CPU (h_cond
))) {
1586 USI opval
= ANDSI (* FLD (i_sr
), -4);
1587 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1588 written
|= (1 << 2);
1589 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1593 abuf
->written
= written
;
1594 SEM_BRANCH_FINI (vpc
);
1599 CASE (sem
, INSN_JL
) : /* jl $sr */
1601 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1602 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1603 #define FLD(f) abuf->fields.sfmt_jl.f
1604 int UNUSED written
= 0;
1605 IADDR UNUSED pc
= abuf
->addr
;
1607 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1611 temp0
= ADDSI (ANDSI (pc
, -4), 4);
1612 temp1
= ANDSI (* FLD (i_sr
), -4);
1615 CPU (h_gr
[((UINT
) 14)]) = opval
;
1616 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1620 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1621 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1625 SEM_BRANCH_FINI (vpc
);
1630 CASE (sem
, INSN_JMP
) : /* jmp $sr */
1632 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1633 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1634 #define FLD(f) abuf->fields.sfmt_jl.f
1635 int UNUSED written
= 0;
1636 IADDR UNUSED pc
= abuf
->addr
;
1638 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1641 USI opval
= ANDSI (* FLD (i_sr
), -4);
1642 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1643 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1646 SEM_BRANCH_FINI (vpc
);
1651 CASE (sem
, INSN_LD
) : /* ld $dr,@$sr */
1653 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1654 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1655 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1656 int UNUSED written
= 0;
1657 IADDR UNUSED pc
= abuf
->addr
;
1658 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1661 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1662 * FLD (i_dr
) = opval
;
1663 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1670 CASE (sem
, INSN_LD_D
) : /* ld $dr,@($slo16,$sr) */
1672 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1674 #define FLD(f) abuf->fields.sfmt_add3.f
1675 int UNUSED written
= 0;
1676 IADDR UNUSED pc
= abuf
->addr
;
1677 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1680 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)));
1681 * FLD (i_dr
) = opval
;
1682 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1689 CASE (sem
, INSN_LDB
) : /* ldb $dr,@$sr */
1691 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1692 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1693 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1694 int UNUSED written
= 0;
1695 IADDR UNUSED pc
= abuf
->addr
;
1696 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1699 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1700 * FLD (i_dr
) = opval
;
1701 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1708 CASE (sem
, INSN_LDB_D
) : /* ldb $dr,@($slo16,$sr) */
1710 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1711 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1712 #define FLD(f) abuf->fields.sfmt_add3.f
1713 int UNUSED written
= 0;
1714 IADDR UNUSED pc
= abuf
->addr
;
1715 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1718 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1719 * FLD (i_dr
) = opval
;
1720 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1727 CASE (sem
, INSN_LDH
) : /* ldh $dr,@$sr */
1729 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1730 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1731 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1732 int UNUSED written
= 0;
1733 IADDR UNUSED pc
= abuf
->addr
;
1734 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1737 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1738 * FLD (i_dr
) = opval
;
1739 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1746 CASE (sem
, INSN_LDH_D
) : /* ldh $dr,@($slo16,$sr) */
1748 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1749 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1750 #define FLD(f) abuf->fields.sfmt_add3.f
1751 int UNUSED written
= 0;
1752 IADDR UNUSED pc
= abuf
->addr
;
1753 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1756 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1757 * FLD (i_dr
) = opval
;
1758 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1765 CASE (sem
, INSN_LDUB
) : /* ldub $dr,@$sr */
1767 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1768 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1769 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1770 int UNUSED written
= 0;
1771 IADDR UNUSED pc
= abuf
->addr
;
1772 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1775 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1776 * FLD (i_dr
) = opval
;
1777 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1784 CASE (sem
, INSN_LDUB_D
) : /* ldub $dr,@($slo16,$sr) */
1786 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1787 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1788 #define FLD(f) abuf->fields.sfmt_add3.f
1789 int UNUSED written
= 0;
1790 IADDR UNUSED pc
= abuf
->addr
;
1791 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1794 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1795 * FLD (i_dr
) = opval
;
1796 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1803 CASE (sem
, INSN_LDUH
) : /* lduh $dr,@$sr */
1805 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1806 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1807 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1808 int UNUSED written
= 0;
1809 IADDR UNUSED pc
= abuf
->addr
;
1810 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1813 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1814 * FLD (i_dr
) = opval
;
1815 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1822 CASE (sem
, INSN_LDUH_D
) : /* lduh $dr,@($slo16,$sr) */
1824 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1825 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1826 #define FLD(f) abuf->fields.sfmt_add3.f
1827 int UNUSED written
= 0;
1828 IADDR UNUSED pc
= abuf
->addr
;
1829 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1832 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1833 * FLD (i_dr
) = opval
;
1834 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1841 CASE (sem
, INSN_LD_PLUS
) : /* ld $dr,@$sr+ */
1843 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1844 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1845 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1846 int UNUSED written
= 0;
1847 IADDR UNUSED pc
= abuf
->addr
;
1848 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1852 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1853 temp1
= ADDSI (* FLD (i_sr
), 4);
1856 * FLD (i_dr
) = opval
;
1857 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1861 * FLD (i_sr
) = opval
;
1862 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1870 CASE (sem
, INSN_LD24
) : /* ld24 $dr,$uimm24 */
1872 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1873 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1874 #define FLD(f) abuf->fields.sfmt_ld24.f
1875 int UNUSED written
= 0;
1876 IADDR UNUSED pc
= abuf
->addr
;
1877 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1880 SI opval
= FLD (i_uimm24
);
1881 * FLD (i_dr
) = opval
;
1882 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1889 CASE (sem
, INSN_LDI8
) : /* ldi8 $dr,$simm8 */
1891 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1892 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1893 #define FLD(f) abuf->fields.sfmt_addi.f
1894 int UNUSED written
= 0;
1895 IADDR UNUSED pc
= abuf
->addr
;
1896 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1899 SI opval
= FLD (f_simm8
);
1900 * FLD (i_dr
) = opval
;
1901 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1908 CASE (sem
, INSN_LDI16
) : /* ldi16 $dr,$hash$slo16 */
1910 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1911 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1912 #define FLD(f) abuf->fields.sfmt_add3.f
1913 int UNUSED written
= 0;
1914 IADDR UNUSED pc
= abuf
->addr
;
1915 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1918 SI opval
= FLD (f_simm16
);
1919 * FLD (i_dr
) = opval
;
1920 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1927 CASE (sem
, INSN_LOCK
) : /* lock $dr,@$sr */
1929 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1930 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1931 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1932 int UNUSED written
= 0;
1933 IADDR UNUSED pc
= abuf
->addr
;
1934 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1939 CPU (h_lock
) = opval
;
1940 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
1943 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1944 * FLD (i_dr
) = opval
;
1945 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1953 CASE (sem
, INSN_MACHI_A
) : /* machi $src1,$src2,$acc */
1955 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1957 #define FLD(f) abuf->fields.sfmt_machi_a.f
1958 int UNUSED written
= 0;
1959 IADDR UNUSED pc
= abuf
->addr
;
1960 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1963 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1964 SET_H_ACCUMS (FLD (f_acc
), opval
);
1965 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
1972 CASE (sem
, INSN_MACLO_A
) : /* maclo $src1,$src2,$acc */
1974 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1975 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1976 #define FLD(f) abuf->fields.sfmt_machi_a.f
1977 int UNUSED written
= 0;
1978 IADDR UNUSED pc
= abuf
->addr
;
1979 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1982 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1983 SET_H_ACCUMS (FLD (f_acc
), opval
);
1984 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
1991 CASE (sem
, INSN_MACWHI_A
) : /* macwhi $src1,$src2,$acc */
1993 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1994 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1995 #define FLD(f) abuf->fields.sfmt_machi_a.f
1996 int UNUSED written
= 0;
1997 IADDR UNUSED pc
= abuf
->addr
;
1998 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2001 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))));
2002 SET_H_ACCUMS (FLD (f_acc
), opval
);
2003 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2010 CASE (sem
, INSN_MACWLO_A
) : /* macwlo $src1,$src2,$acc */
2012 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2013 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2014 #define FLD(f) abuf->fields.sfmt_machi_a.f
2015 int UNUSED written
= 0;
2016 IADDR UNUSED pc
= abuf
->addr
;
2017 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2020 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))));
2021 SET_H_ACCUMS (FLD (f_acc
), opval
);
2022 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2029 CASE (sem
, INSN_MUL
) : /* mul $dr,$sr */
2031 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2032 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2033 #define FLD(f) abuf->fields.sfmt_add.f
2034 int UNUSED written
= 0;
2035 IADDR UNUSED pc
= abuf
->addr
;
2036 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2039 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
2040 * FLD (i_dr
) = opval
;
2041 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2048 CASE (sem
, INSN_MULHI_A
) : /* mulhi $src1,$src2,$acc */
2050 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2052 #define FLD(f) abuf->fields.sfmt_machi_a.f
2053 int UNUSED written
= 0;
2054 IADDR UNUSED pc
= abuf
->addr
;
2055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2058 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
2059 SET_H_ACCUMS (FLD (f_acc
), opval
);
2060 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2067 CASE (sem
, INSN_MULLO_A
) : /* mullo $src1,$src2,$acc */
2069 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2070 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2071 #define FLD(f) abuf->fields.sfmt_machi_a.f
2072 int UNUSED written
= 0;
2073 IADDR UNUSED pc
= abuf
->addr
;
2074 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2077 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
2078 SET_H_ACCUMS (FLD (f_acc
), opval
);
2079 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2086 CASE (sem
, INSN_MULWHI_A
) : /* mulwhi $src1,$src2,$acc */
2088 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2089 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2090 #define FLD(f) abuf->fields.sfmt_machi_a.f
2091 int UNUSED written
= 0;
2092 IADDR UNUSED pc
= abuf
->addr
;
2093 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2096 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))));
2097 SET_H_ACCUMS (FLD (f_acc
), opval
);
2098 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2105 CASE (sem
, INSN_MULWLO_A
) : /* mulwlo $src1,$src2,$acc */
2107 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2108 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2109 #define FLD(f) abuf->fields.sfmt_machi_a.f
2110 int UNUSED written
= 0;
2111 IADDR UNUSED pc
= abuf
->addr
;
2112 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2115 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))));
2116 SET_H_ACCUMS (FLD (f_acc
), opval
);
2117 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2124 CASE (sem
, INSN_MV
) : /* mv $dr,$sr */
2126 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2127 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2128 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2129 int UNUSED written
= 0;
2130 IADDR UNUSED pc
= abuf
->addr
;
2131 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2134 SI opval
= * FLD (i_sr
);
2135 * FLD (i_dr
) = opval
;
2136 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2143 CASE (sem
, INSN_MVFACHI_A
) : /* mvfachi $dr,$accs */
2145 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2146 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2147 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2148 int UNUSED written
= 0;
2149 IADDR UNUSED pc
= abuf
->addr
;
2150 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2153 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 32));
2154 * FLD (i_dr
) = opval
;
2155 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2162 CASE (sem
, INSN_MVFACLO_A
) : /* mvfaclo $dr,$accs */
2164 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2165 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2166 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2167 int UNUSED written
= 0;
2168 IADDR UNUSED pc
= abuf
->addr
;
2169 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2172 SI opval
= TRUNCDISI (GET_H_ACCUMS (FLD (f_accs
)));
2173 * FLD (i_dr
) = opval
;
2174 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2181 CASE (sem
, INSN_MVFACMI_A
) : /* mvfacmi $dr,$accs */
2183 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2184 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2185 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2186 int UNUSED written
= 0;
2187 IADDR UNUSED pc
= abuf
->addr
;
2188 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2191 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 16));
2192 * FLD (i_dr
) = opval
;
2193 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2200 CASE (sem
, INSN_MVFC
) : /* mvfc $dr,$scr */
2202 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2203 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2204 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2205 int UNUSED written
= 0;
2206 IADDR UNUSED pc
= abuf
->addr
;
2207 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2210 SI opval
= GET_H_CR (FLD (f_r2
));
2211 * FLD (i_dr
) = opval
;
2212 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2219 CASE (sem
, INSN_MVTACHI_A
) : /* mvtachi $src1,$accs */
2221 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2222 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2223 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
2224 int UNUSED written
= 0;
2225 IADDR UNUSED pc
= abuf
->addr
;
2226 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2229 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
2230 SET_H_ACCUMS (FLD (f_accs
), opval
);
2231 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2238 CASE (sem
, INSN_MVTACLO_A
) : /* mvtaclo $src1,$accs */
2240 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2241 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2242 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
2243 int UNUSED written
= 0;
2244 IADDR UNUSED pc
= abuf
->addr
;
2245 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2248 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
2249 SET_H_ACCUMS (FLD (f_accs
), opval
);
2250 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2257 CASE (sem
, INSN_MVTC
) : /* mvtc $sr,$dcr */
2259 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2260 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2261 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2262 int UNUSED written
= 0;
2263 IADDR UNUSED pc
= abuf
->addr
;
2264 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2267 USI opval
= * FLD (i_sr
);
2268 SET_H_CR (FLD (f_r1
), opval
);
2269 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2276 CASE (sem
, INSN_NEG
) : /* neg $dr,$sr */
2278 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2279 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2280 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2281 int UNUSED written
= 0;
2282 IADDR UNUSED pc
= abuf
->addr
;
2283 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2286 SI opval
= NEGSI (* FLD (i_sr
));
2287 * FLD (i_dr
) = opval
;
2288 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2295 CASE (sem
, INSN_NOP
) : /* nop */
2297 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2298 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2299 #define FLD(f) abuf->fields.fmt_empty.f
2300 int UNUSED written
= 0;
2301 IADDR UNUSED pc
= abuf
->addr
;
2302 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2304 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
2310 CASE (sem
, INSN_NOT
) : /* not $dr,$sr */
2312 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2313 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2314 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2315 int UNUSED written
= 0;
2316 IADDR UNUSED pc
= abuf
->addr
;
2317 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2320 SI opval
= INVSI (* FLD (i_sr
));
2321 * FLD (i_dr
) = opval
;
2322 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2329 CASE (sem
, INSN_RAC_DSI
) : /* rac $accd,$accs,$imm1 */
2331 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2332 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2333 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2334 int UNUSED written
= 0;
2335 IADDR UNUSED pc
= abuf
->addr
;
2336 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2340 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
2341 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
2343 DI opval
= (GTDI (tmp_tmp1
, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1
, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1
, MAKEDI (0xffffffff, 0xffff0000)));
2344 SET_H_ACCUMS (FLD (f_accd
), opval
);
2345 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2353 CASE (sem
, INSN_RACH_DSI
) : /* rach $accd,$accs,$imm1 */
2355 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2356 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2357 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2358 int UNUSED written
= 0;
2359 IADDR UNUSED pc
= abuf
->addr
;
2360 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2364 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
2365 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 0x80000000));
2367 DI opval
= (GTDI (tmp_tmp1
, MAKEDI (32767, 0))) ? (MAKEDI (32767, 0)) : (LTDI (tmp_tmp1
, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1
, MAKEDI (0xffffffff, 0)));
2368 SET_H_ACCUMS (FLD (f_accd
), opval
);
2369 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
2377 CASE (sem
, INSN_RTE
) : /* rte */
2379 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2380 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2381 #define FLD(f) abuf->fields.fmt_empty.f
2382 int UNUSED written
= 0;
2383 IADDR UNUSED pc
= abuf
->addr
;
2385 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2389 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
2390 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2391 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2394 USI opval
= GET_H_CR (((UINT
) 14));
2395 SET_H_CR (((UINT
) 6), opval
);
2396 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2399 UQI opval
= CPU (h_bpsw
);
2401 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2404 UQI opval
= CPU (h_bbpsw
);
2405 CPU (h_bpsw
) = opval
;
2406 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2410 SEM_BRANCH_FINI (vpc
);
2415 CASE (sem
, INSN_SETH
) : /* seth $dr,$hash$hi16 */
2417 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2418 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2419 #define FLD(f) abuf->fields.sfmt_seth.f
2420 int UNUSED written
= 0;
2421 IADDR UNUSED pc
= abuf
->addr
;
2422 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2425 SI opval
= SLLSI (FLD (f_hi16
), 16);
2426 * FLD (i_dr
) = opval
;
2427 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2434 CASE (sem
, INSN_SLL
) : /* sll $dr,$sr */
2436 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2437 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2438 #define FLD(f) abuf->fields.sfmt_add.f
2439 int UNUSED written
= 0;
2440 IADDR UNUSED pc
= abuf
->addr
;
2441 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2444 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2445 * FLD (i_dr
) = opval
;
2446 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2453 CASE (sem
, INSN_SLL3
) : /* sll3 $dr,$sr,$simm16 */
2455 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2456 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2457 #define FLD(f) abuf->fields.sfmt_add3.f
2458 int UNUSED written
= 0;
2459 IADDR UNUSED pc
= abuf
->addr
;
2460 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2463 SI opval
= SLLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2464 * FLD (i_dr
) = opval
;
2465 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2472 CASE (sem
, INSN_SLLI
) : /* slli $dr,$uimm5 */
2474 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2475 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2476 #define FLD(f) abuf->fields.sfmt_slli.f
2477 int UNUSED written
= 0;
2478 IADDR UNUSED pc
= abuf
->addr
;
2479 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2482 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
2483 * FLD (i_dr
) = opval
;
2484 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2491 CASE (sem
, INSN_SRA
) : /* sra $dr,$sr */
2493 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2494 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2495 #define FLD(f) abuf->fields.sfmt_add.f
2496 int UNUSED written
= 0;
2497 IADDR UNUSED pc
= abuf
->addr
;
2498 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2501 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2502 * FLD (i_dr
) = opval
;
2503 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2510 CASE (sem
, INSN_SRA3
) : /* sra3 $dr,$sr,$simm16 */
2512 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2513 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2514 #define FLD(f) abuf->fields.sfmt_add3.f
2515 int UNUSED written
= 0;
2516 IADDR UNUSED pc
= abuf
->addr
;
2517 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2520 SI opval
= SRASI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2521 * FLD (i_dr
) = opval
;
2522 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2529 CASE (sem
, INSN_SRAI
) : /* srai $dr,$uimm5 */
2531 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2532 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2533 #define FLD(f) abuf->fields.sfmt_slli.f
2534 int UNUSED written
= 0;
2535 IADDR UNUSED pc
= abuf
->addr
;
2536 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2539 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
2540 * FLD (i_dr
) = opval
;
2541 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2548 CASE (sem
, INSN_SRL
) : /* srl $dr,$sr */
2550 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2551 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2552 #define FLD(f) abuf->fields.sfmt_add.f
2553 int UNUSED written
= 0;
2554 IADDR UNUSED pc
= abuf
->addr
;
2555 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2558 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2559 * FLD (i_dr
) = opval
;
2560 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2567 CASE (sem
, INSN_SRL3
) : /* srl3 $dr,$sr,$simm16 */
2569 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2570 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2571 #define FLD(f) abuf->fields.sfmt_add3.f
2572 int UNUSED written
= 0;
2573 IADDR UNUSED pc
= abuf
->addr
;
2574 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2577 SI opval
= SRLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2578 * FLD (i_dr
) = opval
;
2579 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2586 CASE (sem
, INSN_SRLI
) : /* srli $dr,$uimm5 */
2588 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2589 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2590 #define FLD(f) abuf->fields.sfmt_slli.f
2591 int UNUSED written
= 0;
2592 IADDR UNUSED pc
= abuf
->addr
;
2593 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2596 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
2597 * FLD (i_dr
) = opval
;
2598 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2605 CASE (sem
, INSN_ST
) : /* st $src1,@$src2 */
2607 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2608 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2609 #define FLD(f) abuf->fields.sfmt_st_plus.f
2610 int UNUSED written
= 0;
2611 IADDR UNUSED pc
= abuf
->addr
;
2612 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2615 SI opval
= * FLD (i_src1
);
2616 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2617 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2624 CASE (sem
, INSN_ST_D
) : /* st $src1,@($slo16,$src2) */
2626 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2628 #define FLD(f) abuf->fields.sfmt_st_d.f
2629 int UNUSED written
= 0;
2630 IADDR UNUSED pc
= abuf
->addr
;
2631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2634 SI opval
= * FLD (i_src1
);
2635 SETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2636 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2643 CASE (sem
, INSN_STB
) : /* stb $src1,@$src2 */
2645 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2646 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2647 #define FLD(f) abuf->fields.sfmt_st_plus.f
2648 int UNUSED written
= 0;
2649 IADDR UNUSED pc
= abuf
->addr
;
2650 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2653 QI opval
= * FLD (i_src1
);
2654 SETMEMQI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2655 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2662 CASE (sem
, INSN_STB_D
) : /* stb $src1,@($slo16,$src2) */
2664 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2665 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2666 #define FLD(f) abuf->fields.sfmt_st_d.f
2667 int UNUSED written
= 0;
2668 IADDR UNUSED pc
= abuf
->addr
;
2669 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2672 QI opval
= * FLD (i_src1
);
2673 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2674 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2681 CASE (sem
, INSN_STH
) : /* sth $src1,@$src2 */
2683 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2684 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2685 #define FLD(f) abuf->fields.sfmt_st_plus.f
2686 int UNUSED written
= 0;
2687 IADDR UNUSED pc
= abuf
->addr
;
2688 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2691 HI opval
= * FLD (i_src1
);
2692 SETMEMHI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2693 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2700 CASE (sem
, INSN_STH_D
) : /* sth $src1,@($slo16,$src2) */
2702 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2703 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2704 #define FLD(f) abuf->fields.sfmt_st_d.f
2705 int UNUSED written
= 0;
2706 IADDR UNUSED pc
= abuf
->addr
;
2707 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2710 HI opval
= * FLD (i_src1
);
2711 SETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2712 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2719 CASE (sem
, INSN_ST_PLUS
) : /* st $src1,@+$src2 */
2721 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2722 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2723 #define FLD(f) abuf->fields.sfmt_st_plus.f
2724 int UNUSED written
= 0;
2725 IADDR UNUSED pc
= abuf
->addr
;
2726 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2730 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
2732 SI opval
= * FLD (i_src1
);
2733 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2734 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2737 SI opval
= tmp_new_src2
;
2738 * FLD (i_src2
) = opval
;
2739 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2747 CASE (sem
, INSN_STH_PLUS
) : /* sth $src1,@$src2+ */
2749 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2750 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2751 #define FLD(f) abuf->fields.sfmt_st_plus.f
2752 int UNUSED written
= 0;
2753 IADDR UNUSED pc
= abuf
->addr
;
2754 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2759 HI opval
= * FLD (i_src1
);
2760 SETMEMHI (current_cpu
, pc
, tmp_new_src2
, opval
);
2761 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2763 tmp_new_src2
= ADDSI (* FLD (i_src2
), 2);
2765 SI opval
= tmp_new_src2
;
2766 * FLD (i_src2
) = opval
;
2767 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2775 CASE (sem
, INSN_STB_PLUS
) : /* stb $src1,@$src2+ */
2777 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2778 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2779 #define FLD(f) abuf->fields.sfmt_st_plus.f
2780 int UNUSED written
= 0;
2781 IADDR UNUSED pc
= abuf
->addr
;
2782 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2787 QI opval
= * FLD (i_src1
);
2788 SETMEMQI (current_cpu
, pc
, tmp_new_src2
, opval
);
2789 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2791 tmp_new_src2
= ADDSI (* FLD (i_src2
), 1);
2793 SI opval
= tmp_new_src2
;
2794 * FLD (i_src2
) = opval
;
2795 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2803 CASE (sem
, INSN_ST_MINUS
) : /* st $src1,@-$src2 */
2805 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2806 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2807 #define FLD(f) abuf->fields.sfmt_st_plus.f
2808 int UNUSED written
= 0;
2809 IADDR UNUSED pc
= abuf
->addr
;
2810 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2814 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
2816 SI opval
= * FLD (i_src1
);
2817 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2818 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2821 SI opval
= tmp_new_src2
;
2822 * FLD (i_src2
) = opval
;
2823 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2831 CASE (sem
, INSN_SUB
) : /* sub $dr,$sr */
2833 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2835 #define FLD(f) abuf->fields.sfmt_add.f
2836 int UNUSED written
= 0;
2837 IADDR UNUSED pc
= abuf
->addr
;
2838 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2841 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2842 * FLD (i_dr
) = opval
;
2843 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2850 CASE (sem
, INSN_SUBV
) : /* subv $dr,$sr */
2852 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2854 #define FLD(f) abuf->fields.sfmt_add.f
2855 int UNUSED written
= 0;
2856 IADDR UNUSED pc
= abuf
->addr
;
2857 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2861 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2862 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
2865 * FLD (i_dr
) = opval
;
2866 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2870 CPU (h_cond
) = opval
;
2871 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2879 CASE (sem
, INSN_SUBX
) : /* subx $dr,$sr */
2881 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2882 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2883 #define FLD(f) abuf->fields.sfmt_add.f
2884 int UNUSED written
= 0;
2885 IADDR UNUSED pc
= abuf
->addr
;
2886 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2890 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2891 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2894 * FLD (i_dr
) = opval
;
2895 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2899 CPU (h_cond
) = opval
;
2900 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2908 CASE (sem
, INSN_TRAP
) : /* trap $uimm4 */
2910 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2911 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2912 #define FLD(f) abuf->fields.sfmt_trap.f
2913 int UNUSED written
= 0;
2914 IADDR UNUSED pc
= abuf
->addr
;
2916 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2920 USI opval
= GET_H_CR (((UINT
) 6));
2921 SET_H_CR (((UINT
) 14), opval
);
2922 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2925 USI opval
= ADDSI (pc
, 4);
2926 SET_H_CR (((UINT
) 6), opval
);
2927 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2930 UQI opval
= CPU (h_bpsw
);
2931 CPU (h_bbpsw
) = opval
;
2932 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
2935 UQI opval
= GET_H_PSW ();
2936 CPU (h_bpsw
) = opval
;
2937 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2940 UQI opval
= ANDQI (GET_H_PSW (), 128);
2942 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2945 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
2946 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2947 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2951 SEM_BRANCH_FINI (vpc
);
2956 CASE (sem
, INSN_UNLOCK
) : /* unlock $src1,@$src2 */
2958 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2959 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2960 #define FLD(f) abuf->fields.sfmt_st_plus.f
2961 int UNUSED written
= 0;
2962 IADDR UNUSED pc
= abuf
->addr
;
2963 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2968 SI opval
= * FLD (i_src1
);
2969 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2970 written
|= (1 << 4);
2971 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2976 CPU (h_lock
) = opval
;
2977 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
2981 abuf
->written
= written
;
2986 CASE (sem
, INSN_SATB
) : /* satb $dr,$sr */
2988 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2989 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2990 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2991 int UNUSED written
= 0;
2992 IADDR UNUSED pc
= abuf
->addr
;
2993 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2996 SI opval
= (GESI (* FLD (i_sr
), 127)) ? (127) : (LESI (* FLD (i_sr
), -128)) ? (-128) : (* FLD (i_sr
));
2997 * FLD (i_dr
) = opval
;
2998 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3005 CASE (sem
, INSN_SATH
) : /* sath $dr,$sr */
3007 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3008 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3009 #define FLD(f) abuf->fields.sfmt_ld_plus.f
3010 int UNUSED written
= 0;
3011 IADDR UNUSED pc
= abuf
->addr
;
3012 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3015 SI opval
= (GESI (* FLD (i_sr
), 32767)) ? (32767) : (LESI (* FLD (i_sr
), -32768)) ? (-32768) : (* FLD (i_sr
));
3016 * FLD (i_dr
) = opval
;
3017 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3024 CASE (sem
, INSN_SAT
) : /* sat $dr,$sr */
3026 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3027 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3028 #define FLD(f) abuf->fields.sfmt_ld_plus.f
3029 int UNUSED written
= 0;
3030 IADDR UNUSED pc
= abuf
->addr
;
3031 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3034 SI opval
= ((CPU (h_cond
)) ? (((LTSI (* FLD (i_sr
), 0)) ? (2147483647) : (0x80000000))) : (* FLD (i_sr
)));
3035 * FLD (i_dr
) = opval
;
3036 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3043 CASE (sem
, INSN_PCMPBZ
) : /* pcmpbz $src2 */
3045 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3046 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3047 #define FLD(f) abuf->fields.sfmt_st_plus.f
3048 int UNUSED written
= 0;
3049 IADDR UNUSED pc
= abuf
->addr
;
3050 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3053 BI opval
= (EQSI (ANDSI (* FLD (i_src2
), 255), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2
), 65280), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2
), 16711680), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2
), 0xff000000), 0)) ? (1) : (0);
3054 CPU (h_cond
) = opval
;
3055 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3062 CASE (sem
, INSN_SADD
) : /* sadd */
3064 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3065 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3066 #define FLD(f) abuf->fields.fmt_empty.f
3067 int UNUSED written
= 0;
3068 IADDR UNUSED pc
= abuf
->addr
;
3069 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3072 DI opval
= ADDDI (SRADI (GET_H_ACCUMS (((UINT
) 1)), 16), GET_H_ACCUMS (((UINT
) 0)));
3073 SET_H_ACCUMS (((UINT
) 0), opval
);
3074 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
3081 CASE (sem
, INSN_MACWU1
) : /* macwu1 $src1,$src2 */
3083 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3084 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3085 #define FLD(f) abuf->fields.sfmt_st_plus.f
3086 int UNUSED written
= 0;
3087 IADDR UNUSED pc
= abuf
->addr
;
3088 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3091 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT
) 1)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535)))), 8), 8);
3092 SET_H_ACCUMS (((UINT
) 1), opval
);
3093 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
3100 CASE (sem
, INSN_MSBLO
) : /* msblo $src1,$src2 */
3102 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3103 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3104 #define FLD(f) abuf->fields.sfmt_st_plus.f
3105 int UNUSED written
= 0;
3106 IADDR UNUSED pc
= abuf
->addr
;
3107 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3110 DI opval
= SRADI (SLLDI (SUBDI (GET_H_ACCUM (), SRADI (SLLDI (MULDI (EXTHIDI (TRUNCSIHI (* FLD (i_src1
))), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 32), 16)), 8), 8);
3111 SET_H_ACCUM (opval
);
3112 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
3119 CASE (sem
, INSN_MULWU1
) : /* mulwu1 $src1,$src2 */
3121 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3122 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3123 #define FLD(f) abuf->fields.sfmt_st_plus.f
3124 int UNUSED written
= 0;
3125 IADDR UNUSED pc
= abuf
->addr
;
3126 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3129 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535))), 16), 16);
3130 SET_H_ACCUMS (((UINT
) 1), opval
);
3131 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
3138 CASE (sem
, INSN_MACLH1
) : /* maclh1 $src1,$src2 */
3140 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3141 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3142 #define FLD(f) abuf->fields.sfmt_st_plus.f
3143 int UNUSED written
= 0;
3144 IADDR UNUSED pc
= abuf
->addr
;
3145 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3148 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT
) 1)), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (* FLD (i_src1
))), SRASI (* FLD (i_src2
), 16))), 16)), 8), 8);
3149 SET_H_ACCUMS (((UINT
) 1), opval
);
3150 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
3157 CASE (sem
, INSN_SC
) : /* sc */
3159 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3160 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3161 #define FLD(f) abuf->fields.fmt_empty.f
3162 int UNUSED written
= 0;
3163 IADDR UNUSED pc
= abuf
->addr
;
3164 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3166 if (ZEXTBISI (CPU (h_cond
)))
3167 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
3173 CASE (sem
, INSN_SNC
) : /* snc */
3175 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3176 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3177 #define FLD(f) abuf->fields.fmt_empty.f
3178 int UNUSED written
= 0;
3179 IADDR UNUSED pc
= abuf
->addr
;
3180 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3182 if (ZEXTBISI (NOTBI (CPU (h_cond
))))
3183 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
3189 CASE (sem
, INSN_CLRPSW
) : /* clrpsw $uimm8 */
3191 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3192 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3193 #define FLD(f) abuf->fields.sfmt_clrpsw.f
3194 int UNUSED written
= 0;
3195 IADDR UNUSED pc
= abuf
->addr
;
3196 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3199 SI opval
= ANDSI (GET_H_CR (((UINT
) 0)), ORSI (INVBI (FLD (f_uimm8
)), 65280));
3200 SET_H_CR (((UINT
) 0), opval
);
3201 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
3208 CASE (sem
, INSN_SETPSW
) : /* setpsw $uimm8 */
3210 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3211 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3212 #define FLD(f) abuf->fields.sfmt_clrpsw.f
3213 int UNUSED written
= 0;
3214 IADDR UNUSED pc
= abuf
->addr
;
3215 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3218 SI opval
= FLD (f_uimm8
);
3219 SET_H_CR (((UINT
) 0), opval
);
3220 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
3227 CASE (sem
, INSN_BSET
) : /* bset $uimm3,@($slo16,$sr) */
3229 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3230 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3231 #define FLD(f) abuf->fields.sfmt_bset.f
3232 int UNUSED written
= 0;
3233 IADDR UNUSED pc
= abuf
->addr
;
3234 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3237 QI opval
= ORQI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))), SLLSI (1, SUBSI (7, FLD (f_uimm3
))));
3238 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)), opval
);
3239 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3246 CASE (sem
, INSN_BCLR
) : /* bclr $uimm3,@($slo16,$sr) */
3248 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3249 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3250 #define FLD(f) abuf->fields.sfmt_bset.f
3251 int UNUSED written
= 0;
3252 IADDR UNUSED pc
= abuf
->addr
;
3253 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3256 QI opval
= ANDQI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))), INVQI (SLLSI (1, SUBSI (7, FLD (f_uimm3
)))));
3257 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)), opval
);
3258 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3265 CASE (sem
, INSN_BTST
) : /* btst $uimm3,$sr */
3267 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3269 #define FLD(f) abuf->fields.sfmt_bset.f
3270 int UNUSED written
= 0;
3271 IADDR UNUSED pc
= abuf
->addr
;
3272 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3275 BI opval
= ANDQI (SRLSI (* FLD (i_sr
), SUBSI (7, FLD (f_uimm3
))), 1);
3276 CPU (h_cond
) = opval
;
3277 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3284 CASE (sem
, INSN_PAR_ADD
) : /* add $dr,$sr */
3286 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3287 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3288 #define FLD(f) abuf->fields.sfmt_add.f
3289 #define OPRND(f) par_exec->operands.sfmt_add.f
3290 int UNUSED written
= 0;
3291 IADDR UNUSED pc
= abuf
->addr
;
3292 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3295 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
3297 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3305 CASE (sem
, INSN_WRITE_ADD
) : /* add $dr,$sr */
3307 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3308 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3309 #define FLD(f) abuf->fields.sfmt_add.f
3310 #define OPRND(f) par_exec->operands.sfmt_add.f
3311 int UNUSED written
= abuf
->written
;
3312 IADDR UNUSED pc
= abuf
->addr
;
3313 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3315 * FLD (i_dr
) = OPRND (dr
);
3322 CASE (sem
, INSN_PAR_AND
) : /* and $dr,$sr */
3324 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3325 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3326 #define FLD(f) abuf->fields.sfmt_add.f
3327 #define OPRND(f) par_exec->operands.sfmt_add.f
3328 int UNUSED written
= 0;
3329 IADDR UNUSED pc
= abuf
->addr
;
3330 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3333 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
3335 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3343 CASE (sem
, INSN_WRITE_AND
) : /* and $dr,$sr */
3345 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3346 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3347 #define FLD(f) abuf->fields.sfmt_add.f
3348 #define OPRND(f) par_exec->operands.sfmt_add.f
3349 int UNUSED written
= abuf
->written
;
3350 IADDR UNUSED pc
= abuf
->addr
;
3351 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3353 * FLD (i_dr
) = OPRND (dr
);
3360 CASE (sem
, INSN_PAR_OR
) : /* or $dr,$sr */
3362 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3363 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3364 #define FLD(f) abuf->fields.sfmt_add.f
3365 #define OPRND(f) par_exec->operands.sfmt_add.f
3366 int UNUSED written
= 0;
3367 IADDR UNUSED pc
= abuf
->addr
;
3368 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3371 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
3373 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3381 CASE (sem
, INSN_WRITE_OR
) : /* or $dr,$sr */
3383 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3384 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3385 #define FLD(f) abuf->fields.sfmt_add.f
3386 #define OPRND(f) par_exec->operands.sfmt_add.f
3387 int UNUSED written
= abuf
->written
;
3388 IADDR UNUSED pc
= abuf
->addr
;
3389 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3391 * FLD (i_dr
) = OPRND (dr
);
3398 CASE (sem
, INSN_PAR_XOR
) : /* xor $dr,$sr */
3400 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3401 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3402 #define FLD(f) abuf->fields.sfmt_add.f
3403 #define OPRND(f) par_exec->operands.sfmt_add.f
3404 int UNUSED written
= 0;
3405 IADDR UNUSED pc
= abuf
->addr
;
3406 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3409 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
3411 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3419 CASE (sem
, INSN_WRITE_XOR
) : /* xor $dr,$sr */
3421 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3422 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3423 #define FLD(f) abuf->fields.sfmt_add.f
3424 #define OPRND(f) par_exec->operands.sfmt_add.f
3425 int UNUSED written
= abuf
->written
;
3426 IADDR UNUSED pc
= abuf
->addr
;
3427 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3429 * FLD (i_dr
) = OPRND (dr
);
3436 CASE (sem
, INSN_PAR_ADDI
) : /* addi $dr,$simm8 */
3438 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3439 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3440 #define FLD(f) abuf->fields.sfmt_addi.f
3441 #define OPRND(f) par_exec->operands.sfmt_addi.f
3442 int UNUSED written
= 0;
3443 IADDR UNUSED pc
= abuf
->addr
;
3444 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3447 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
3449 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3457 CASE (sem
, INSN_WRITE_ADDI
) : /* addi $dr,$simm8 */
3459 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3460 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3461 #define FLD(f) abuf->fields.sfmt_addi.f
3462 #define OPRND(f) par_exec->operands.sfmt_addi.f
3463 int UNUSED written
= abuf
->written
;
3464 IADDR UNUSED pc
= abuf
->addr
;
3465 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3467 * FLD (i_dr
) = OPRND (dr
);
3474 CASE (sem
, INSN_PAR_ADDV
) : /* addv $dr,$sr */
3476 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3477 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3478 #define FLD(f) abuf->fields.sfmt_add.f
3479 #define OPRND(f) par_exec->operands.sfmt_addv.f
3480 int UNUSED written
= 0;
3481 IADDR UNUSED pc
= abuf
->addr
;
3482 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3486 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
3487 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
3491 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3495 OPRND (condbit
) = opval
;
3496 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3505 CASE (sem
, INSN_WRITE_ADDV
) : /* addv $dr,$sr */
3507 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3508 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3509 #define FLD(f) abuf->fields.sfmt_add.f
3510 #define OPRND(f) par_exec->operands.sfmt_addv.f
3511 int UNUSED written
= abuf
->written
;
3512 IADDR UNUSED pc
= abuf
->addr
;
3513 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3515 CPU (h_cond
) = OPRND (condbit
);
3516 * FLD (i_dr
) = OPRND (dr
);
3523 CASE (sem
, INSN_PAR_ADDX
) : /* addx $dr,$sr */
3525 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3526 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3527 #define FLD(f) abuf->fields.sfmt_add.f
3528 #define OPRND(f) par_exec->operands.sfmt_addx.f
3529 int UNUSED written
= 0;
3530 IADDR UNUSED pc
= abuf
->addr
;
3531 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3535 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
3536 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
3540 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3544 OPRND (condbit
) = opval
;
3545 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3554 CASE (sem
, INSN_WRITE_ADDX
) : /* addx $dr,$sr */
3556 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3557 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3558 #define FLD(f) abuf->fields.sfmt_add.f
3559 #define OPRND(f) par_exec->operands.sfmt_addx.f
3560 int UNUSED written
= abuf
->written
;
3561 IADDR UNUSED pc
= abuf
->addr
;
3562 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3564 CPU (h_cond
) = OPRND (condbit
);
3565 * FLD (i_dr
) = OPRND (dr
);
3572 CASE (sem
, INSN_PAR_BC8
) : /* bc.s $disp8 */
3574 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3575 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3576 #define FLD(f) abuf->fields.sfmt_bl8.f
3577 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3578 int UNUSED written
= 0;
3579 IADDR UNUSED pc
= abuf
->addr
;
3580 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3584 USI opval
= FLD (i_disp8
);
3586 written
|= (1 << 2);
3587 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3591 abuf
->written
= written
;
3597 CASE (sem
, INSN_WRITE_BC8
) : /* bc.s $disp8 */
3599 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3600 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3601 #define FLD(f) abuf->fields.sfmt_bl8.f
3602 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3603 int UNUSED written
= abuf
->written
;
3604 IADDR UNUSED pc
= abuf
->addr
;
3606 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3608 if (written
& (1 << 2))
3610 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3613 SEM_BRANCH_FINI (vpc
);
3619 CASE (sem
, INSN_PAR_BL8
) : /* bl.s $disp8 */
3621 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3622 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3623 #define FLD(f) abuf->fields.sfmt_bl8.f
3624 #define OPRND(f) par_exec->operands.sfmt_bl8.f
3625 int UNUSED written
= 0;
3626 IADDR UNUSED pc
= abuf
->addr
;
3627 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3631 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
3632 OPRND (h_gr_SI_14
) = opval
;
3633 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3636 USI opval
= FLD (i_disp8
);
3638 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3647 CASE (sem
, INSN_WRITE_BL8
) : /* bl.s $disp8 */
3649 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3650 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3651 #define FLD(f) abuf->fields.sfmt_bl8.f
3652 #define OPRND(f) par_exec->operands.sfmt_bl8.f
3653 int UNUSED written
= abuf
->written
;
3654 IADDR UNUSED pc
= abuf
->addr
;
3656 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3658 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_SI_14
);
3659 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3661 SEM_BRANCH_FINI (vpc
);
3667 CASE (sem
, INSN_PAR_BCL8
) : /* bcl.s $disp8 */
3669 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3670 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3671 #define FLD(f) abuf->fields.sfmt_bl8.f
3672 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3673 int UNUSED written
= 0;
3674 IADDR UNUSED pc
= abuf
->addr
;
3675 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3680 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
3681 OPRND (h_gr_SI_14
) = opval
;
3682 written
|= (1 << 3);
3683 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3686 USI opval
= FLD (i_disp8
);
3688 written
|= (1 << 4);
3689 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3694 abuf
->written
= written
;
3700 CASE (sem
, INSN_WRITE_BCL8
) : /* bcl.s $disp8 */
3702 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3703 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3704 #define FLD(f) abuf->fields.sfmt_bl8.f
3705 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3706 int UNUSED written
= abuf
->written
;
3707 IADDR UNUSED pc
= abuf
->addr
;
3709 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3711 if (written
& (1 << 3))
3713 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_SI_14
);
3715 if (written
& (1 << 4))
3717 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3720 SEM_BRANCH_FINI (vpc
);
3726 CASE (sem
, INSN_PAR_BNC8
) : /* bnc.s $disp8 */
3728 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3730 #define FLD(f) abuf->fields.sfmt_bl8.f
3731 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3732 int UNUSED written
= 0;
3733 IADDR UNUSED pc
= abuf
->addr
;
3734 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3736 if (NOTBI (CPU (h_cond
))) {
3738 USI opval
= FLD (i_disp8
);
3740 written
|= (1 << 2);
3741 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3745 abuf
->written
= written
;
3751 CASE (sem
, INSN_WRITE_BNC8
) : /* bnc.s $disp8 */
3753 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3754 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3755 #define FLD(f) abuf->fields.sfmt_bl8.f
3756 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3757 int UNUSED written
= abuf
->written
;
3758 IADDR UNUSED pc
= abuf
->addr
;
3760 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3762 if (written
& (1 << 2))
3764 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3767 SEM_BRANCH_FINI (vpc
);
3773 CASE (sem
, INSN_PAR_BRA8
) : /* bra.s $disp8 */
3775 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3776 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3777 #define FLD(f) abuf->fields.sfmt_bl8.f
3778 #define OPRND(f) par_exec->operands.sfmt_bra8.f
3779 int UNUSED written
= 0;
3780 IADDR UNUSED pc
= abuf
->addr
;
3781 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3784 USI opval
= FLD (i_disp8
);
3786 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3794 CASE (sem
, INSN_WRITE_BRA8
) : /* bra.s $disp8 */
3796 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3797 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3798 #define FLD(f) abuf->fields.sfmt_bl8.f
3799 #define OPRND(f) par_exec->operands.sfmt_bra8.f
3800 int UNUSED written
= abuf
->written
;
3801 IADDR UNUSED pc
= abuf
->addr
;
3803 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3805 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3807 SEM_BRANCH_FINI (vpc
);
3813 CASE (sem
, INSN_PAR_BNCL8
) : /* bncl.s $disp8 */
3815 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3816 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3817 #define FLD(f) abuf->fields.sfmt_bl8.f
3818 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3819 int UNUSED written
= 0;
3820 IADDR UNUSED pc
= abuf
->addr
;
3821 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3823 if (NOTBI (CPU (h_cond
))) {
3826 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
3827 OPRND (h_gr_SI_14
) = opval
;
3828 written
|= (1 << 3);
3829 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3832 USI opval
= FLD (i_disp8
);
3834 written
|= (1 << 4);
3835 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3840 abuf
->written
= written
;
3846 CASE (sem
, INSN_WRITE_BNCL8
) : /* bncl.s $disp8 */
3848 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3849 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3850 #define FLD(f) abuf->fields.sfmt_bl8.f
3851 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3852 int UNUSED written
= abuf
->written
;
3853 IADDR UNUSED pc
= abuf
->addr
;
3855 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3857 if (written
& (1 << 3))
3859 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_SI_14
);
3861 if (written
& (1 << 4))
3863 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3866 SEM_BRANCH_FINI (vpc
);
3872 CASE (sem
, INSN_PAR_CMP
) : /* cmp $src1,$src2 */
3874 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3875 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3876 #define FLD(f) abuf->fields.sfmt_st_plus.f
3877 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3878 int UNUSED written
= 0;
3879 IADDR UNUSED pc
= abuf
->addr
;
3880 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3883 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
3884 OPRND (condbit
) = opval
;
3885 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3893 CASE (sem
, INSN_WRITE_CMP
) : /* cmp $src1,$src2 */
3895 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3896 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3897 #define FLD(f) abuf->fields.sfmt_st_plus.f
3898 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3899 int UNUSED written
= abuf
->written
;
3900 IADDR UNUSED pc
= abuf
->addr
;
3901 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3903 CPU (h_cond
) = OPRND (condbit
);
3910 CASE (sem
, INSN_PAR_CMPU
) : /* cmpu $src1,$src2 */
3912 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3913 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3914 #define FLD(f) abuf->fields.sfmt_st_plus.f
3915 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3916 int UNUSED written
= 0;
3917 IADDR UNUSED pc
= abuf
->addr
;
3918 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3921 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
3922 OPRND (condbit
) = opval
;
3923 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3931 CASE (sem
, INSN_WRITE_CMPU
) : /* cmpu $src1,$src2 */
3933 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3934 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3935 #define FLD(f) abuf->fields.sfmt_st_plus.f
3936 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3937 int UNUSED written
= abuf
->written
;
3938 IADDR UNUSED pc
= abuf
->addr
;
3939 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3941 CPU (h_cond
) = OPRND (condbit
);
3948 CASE (sem
, INSN_PAR_CMPEQ
) : /* cmpeq $src1,$src2 */
3950 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3951 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3952 #define FLD(f) abuf->fields.sfmt_st_plus.f
3953 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3954 int UNUSED written
= 0;
3955 IADDR UNUSED pc
= abuf
->addr
;
3956 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3959 BI opval
= EQSI (* FLD (i_src1
), * FLD (i_src2
));
3960 OPRND (condbit
) = opval
;
3961 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
3969 CASE (sem
, INSN_WRITE_CMPEQ
) : /* cmpeq $src1,$src2 */
3971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3972 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3973 #define FLD(f) abuf->fields.sfmt_st_plus.f
3974 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3975 int UNUSED written
= abuf
->written
;
3976 IADDR UNUSED pc
= abuf
->addr
;
3977 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3979 CPU (h_cond
) = OPRND (condbit
);
3986 CASE (sem
, INSN_PAR_CMPZ
) : /* cmpz $src2 */
3988 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3989 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3990 #define FLD(f) abuf->fields.sfmt_st_plus.f
3991 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
3992 int UNUSED written
= 0;
3993 IADDR UNUSED pc
= abuf
->addr
;
3994 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3997 BI opval
= EQSI (* FLD (i_src2
), 0);
3998 OPRND (condbit
) = opval
;
3999 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
4007 CASE (sem
, INSN_WRITE_CMPZ
) : /* cmpz $src2 */
4009 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4010 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4011 #define FLD(f) abuf->fields.sfmt_st_plus.f
4012 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
4013 int UNUSED written
= abuf
->written
;
4014 IADDR UNUSED pc
= abuf
->addr
;
4015 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4017 CPU (h_cond
) = OPRND (condbit
);
4024 CASE (sem
, INSN_PAR_JC
) : /* jc $sr */
4026 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4027 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4028 #define FLD(f) abuf->fields.sfmt_jl.f
4029 #define OPRND(f) par_exec->operands.sfmt_jc.f
4030 int UNUSED written
= 0;
4031 IADDR UNUSED pc
= abuf
->addr
;
4032 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4036 USI opval
= ANDSI (* FLD (i_sr
), -4);
4038 written
|= (1 << 2);
4039 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
4043 abuf
->written
= written
;
4049 CASE (sem
, INSN_WRITE_JC
) : /* jc $sr */
4051 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4052 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4053 #define FLD(f) abuf->fields.sfmt_jl.f
4054 #define OPRND(f) par_exec->operands.sfmt_jc.f
4055 int UNUSED written
= abuf
->written
;
4056 IADDR UNUSED pc
= abuf
->addr
;
4058 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4060 if (written
& (1 << 2))
4062 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
4065 SEM_BRANCH_FINI (vpc
);
4071 CASE (sem
, INSN_PAR_JNC
) : /* jnc $sr */
4073 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4074 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4075 #define FLD(f) abuf->fields.sfmt_jl.f
4076 #define OPRND(f) par_exec->operands.sfmt_jc.f
4077 int UNUSED written
= 0;
4078 IADDR UNUSED pc
= abuf
->addr
;
4079 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4081 if (NOTBI (CPU (h_cond
))) {
4083 USI opval
= ANDSI (* FLD (i_sr
), -4);
4085 written
|= (1 << 2);
4086 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
4090 abuf
->written
= written
;
4096 CASE (sem
, INSN_WRITE_JNC
) : /* jnc $sr */
4098 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4099 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4100 #define FLD(f) abuf->fields.sfmt_jl.f
4101 #define OPRND(f) par_exec->operands.sfmt_jc.f
4102 int UNUSED written
= abuf
->written
;
4103 IADDR UNUSED pc
= abuf
->addr
;
4105 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4107 if (written
& (1 << 2))
4109 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
4112 SEM_BRANCH_FINI (vpc
);
4118 CASE (sem
, INSN_PAR_JL
) : /* jl $sr */
4120 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4122 #define FLD(f) abuf->fields.sfmt_jl.f
4123 #define OPRND(f) par_exec->operands.sfmt_jl.f
4124 int UNUSED written
= 0;
4125 IADDR UNUSED pc
= abuf
->addr
;
4126 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4130 temp0
= ADDSI (ANDSI (pc
, -4), 4);
4131 temp1
= ANDSI (* FLD (i_sr
), -4);
4134 OPRND (h_gr_SI_14
) = opval
;
4135 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4140 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
4149 CASE (sem
, INSN_WRITE_JL
) : /* jl $sr */
4151 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4152 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4153 #define FLD(f) abuf->fields.sfmt_jl.f
4154 #define OPRND(f) par_exec->operands.sfmt_jl.f
4155 int UNUSED written
= abuf
->written
;
4156 IADDR UNUSED pc
= abuf
->addr
;
4158 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4160 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_SI_14
);
4161 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
4163 SEM_BRANCH_FINI (vpc
);
4169 CASE (sem
, INSN_PAR_JMP
) : /* jmp $sr */
4171 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4172 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4173 #define FLD(f) abuf->fields.sfmt_jl.f
4174 #define OPRND(f) par_exec->operands.sfmt_jmp.f
4175 int UNUSED written
= 0;
4176 IADDR UNUSED pc
= abuf
->addr
;
4177 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4180 USI opval
= ANDSI (* FLD (i_sr
), -4);
4182 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
4190 CASE (sem
, INSN_WRITE_JMP
) : /* jmp $sr */
4192 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4193 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4194 #define FLD(f) abuf->fields.sfmt_jl.f
4195 #define OPRND(f) par_exec->operands.sfmt_jmp.f
4196 int UNUSED written
= abuf
->written
;
4197 IADDR UNUSED pc
= abuf
->addr
;
4199 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4201 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
4203 SEM_BRANCH_FINI (vpc
);
4209 CASE (sem
, INSN_PAR_LD
) : /* ld $dr,@$sr */
4211 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4212 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4213 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4214 #define OPRND(f) par_exec->operands.sfmt_ld.f
4215 int UNUSED written
= 0;
4216 IADDR UNUSED pc
= abuf
->addr
;
4217 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4220 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
4222 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4230 CASE (sem
, INSN_WRITE_LD
) : /* ld $dr,@$sr */
4232 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4233 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4234 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4235 #define OPRND(f) par_exec->operands.sfmt_ld.f
4236 int UNUSED written
= abuf
->written
;
4237 IADDR UNUSED pc
= abuf
->addr
;
4238 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4240 * FLD (i_dr
) = OPRND (dr
);
4247 CASE (sem
, INSN_PAR_LDB
) : /* ldb $dr,@$sr */
4249 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4250 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4251 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4252 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4253 int UNUSED written
= 0;
4254 IADDR UNUSED pc
= abuf
->addr
;
4255 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4258 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
4260 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4268 CASE (sem
, INSN_WRITE_LDB
) : /* ldb $dr,@$sr */
4270 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4271 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4272 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4273 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4274 int UNUSED written
= abuf
->written
;
4275 IADDR UNUSED pc
= abuf
->addr
;
4276 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4278 * FLD (i_dr
) = OPRND (dr
);
4285 CASE (sem
, INSN_PAR_LDH
) : /* ldh $dr,@$sr */
4287 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4288 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4289 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4290 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4291 int UNUSED written
= 0;
4292 IADDR UNUSED pc
= abuf
->addr
;
4293 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4296 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
4298 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4306 CASE (sem
, INSN_WRITE_LDH
) : /* ldh $dr,@$sr */
4308 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4309 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4310 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4311 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4312 int UNUSED written
= abuf
->written
;
4313 IADDR UNUSED pc
= abuf
->addr
;
4314 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4316 * FLD (i_dr
) = OPRND (dr
);
4323 CASE (sem
, INSN_PAR_LDUB
) : /* ldub $dr,@$sr */
4325 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4326 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4327 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4328 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4329 int UNUSED written
= 0;
4330 IADDR UNUSED pc
= abuf
->addr
;
4331 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4334 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
4336 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4344 CASE (sem
, INSN_WRITE_LDUB
) : /* ldub $dr,@$sr */
4346 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4347 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4348 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4349 #define OPRND(f) par_exec->operands.sfmt_ldb.f
4350 int UNUSED written
= abuf
->written
;
4351 IADDR UNUSED pc
= abuf
->addr
;
4352 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4354 * FLD (i_dr
) = OPRND (dr
);
4361 CASE (sem
, INSN_PAR_LDUH
) : /* lduh $dr,@$sr */
4363 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4364 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4365 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4366 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4367 int UNUSED written
= 0;
4368 IADDR UNUSED pc
= abuf
->addr
;
4369 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4372 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
4374 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4382 CASE (sem
, INSN_WRITE_LDUH
) : /* lduh $dr,@$sr */
4384 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4385 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4386 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4387 #define OPRND(f) par_exec->operands.sfmt_ldh.f
4388 int UNUSED written
= abuf
->written
;
4389 IADDR UNUSED pc
= abuf
->addr
;
4390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4392 * FLD (i_dr
) = OPRND (dr
);
4399 CASE (sem
, INSN_PAR_LD_PLUS
) : /* ld $dr,@$sr+ */
4401 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4403 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4404 #define OPRND(f) par_exec->operands.sfmt_ld_plus.f
4405 int UNUSED written
= 0;
4406 IADDR UNUSED pc
= abuf
->addr
;
4407 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4411 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
4412 temp1
= ADDSI (* FLD (i_sr
), 4);
4416 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4421 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4430 CASE (sem
, INSN_WRITE_LD_PLUS
) : /* ld $dr,@$sr+ */
4432 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4433 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4434 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4435 #define OPRND(f) par_exec->operands.sfmt_ld_plus.f
4436 int UNUSED written
= abuf
->written
;
4437 IADDR UNUSED pc
= abuf
->addr
;
4438 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4440 * FLD (i_dr
) = OPRND (dr
);
4441 * FLD (i_sr
) = OPRND (sr
);
4448 CASE (sem
, INSN_PAR_LDI8
) : /* ldi8 $dr,$simm8 */
4450 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4452 #define FLD(f) abuf->fields.sfmt_addi.f
4453 #define OPRND(f) par_exec->operands.sfmt_ldi8.f
4454 int UNUSED written
= 0;
4455 IADDR UNUSED pc
= abuf
->addr
;
4456 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4459 SI opval
= FLD (f_simm8
);
4461 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4469 CASE (sem
, INSN_WRITE_LDI8
) : /* ldi8 $dr,$simm8 */
4471 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4472 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4473 #define FLD(f) abuf->fields.sfmt_addi.f
4474 #define OPRND(f) par_exec->operands.sfmt_ldi8.f
4475 int UNUSED written
= abuf
->written
;
4476 IADDR UNUSED pc
= abuf
->addr
;
4477 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4479 * FLD (i_dr
) = OPRND (dr
);
4486 CASE (sem
, INSN_PAR_LOCK
) : /* lock $dr,@$sr */
4488 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4489 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4490 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4491 #define OPRND(f) par_exec->operands.sfmt_lock.f
4492 int UNUSED written
= 0;
4493 IADDR UNUSED pc
= abuf
->addr
;
4494 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4499 OPRND (h_lock_BI
) = opval
;
4500 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
4503 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
4505 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4514 CASE (sem
, INSN_WRITE_LOCK
) : /* lock $dr,@$sr */
4516 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4517 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4518 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4519 #define OPRND(f) par_exec->operands.sfmt_lock.f
4520 int UNUSED written
= abuf
->written
;
4521 IADDR UNUSED pc
= abuf
->addr
;
4522 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4524 * FLD (i_dr
) = OPRND (dr
);
4525 CPU (h_lock
) = OPRND (h_lock_BI
);
4532 CASE (sem
, INSN_PAR_MACHI_A
) : /* machi $src1,$src2,$acc */
4534 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4536 #define FLD(f) abuf->fields.sfmt_machi_a.f
4537 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4538 int UNUSED written
= 0;
4539 IADDR UNUSED pc
= abuf
->addr
;
4540 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4543 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
4544 OPRND (acc
) = opval
;
4545 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4553 CASE (sem
, INSN_WRITE_MACHI_A
) : /* machi $src1,$src2,$acc */
4555 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4556 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4557 #define FLD(f) abuf->fields.sfmt_machi_a.f
4558 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4559 int UNUSED written
= abuf
->written
;
4560 IADDR UNUSED pc
= abuf
->addr
;
4561 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4563 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4570 CASE (sem
, INSN_PAR_MACLO_A
) : /* maclo $src1,$src2,$acc */
4572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4574 #define FLD(f) abuf->fields.sfmt_machi_a.f
4575 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4576 int UNUSED written
= 0;
4577 IADDR UNUSED pc
= abuf
->addr
;
4578 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4581 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
4582 OPRND (acc
) = opval
;
4583 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4591 CASE (sem
, INSN_WRITE_MACLO_A
) : /* maclo $src1,$src2,$acc */
4593 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4594 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4595 #define FLD(f) abuf->fields.sfmt_machi_a.f
4596 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4597 int UNUSED written
= abuf
->written
;
4598 IADDR UNUSED pc
= abuf
->addr
;
4599 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4601 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4608 CASE (sem
, INSN_PAR_MACWHI_A
) : /* macwhi $src1,$src2,$acc */
4610 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4611 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4612 #define FLD(f) abuf->fields.sfmt_machi_a.f
4613 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4614 int UNUSED written
= 0;
4615 IADDR UNUSED pc
= abuf
->addr
;
4616 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4619 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))));
4620 OPRND (acc
) = opval
;
4621 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4629 CASE (sem
, INSN_WRITE_MACWHI_A
) : /* macwhi $src1,$src2,$acc */
4631 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4632 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4633 #define FLD(f) abuf->fields.sfmt_machi_a.f
4634 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4635 int UNUSED written
= abuf
->written
;
4636 IADDR UNUSED pc
= abuf
->addr
;
4637 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4639 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4646 CASE (sem
, INSN_PAR_MACWLO_A
) : /* macwlo $src1,$src2,$acc */
4648 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4649 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4650 #define FLD(f) abuf->fields.sfmt_machi_a.f
4651 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4652 int UNUSED written
= 0;
4653 IADDR UNUSED pc
= abuf
->addr
;
4654 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4657 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))));
4658 OPRND (acc
) = opval
;
4659 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4667 CASE (sem
, INSN_WRITE_MACWLO_A
) : /* macwlo $src1,$src2,$acc */
4669 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4670 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4671 #define FLD(f) abuf->fields.sfmt_machi_a.f
4672 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4673 int UNUSED written
= abuf
->written
;
4674 IADDR UNUSED pc
= abuf
->addr
;
4675 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4677 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4684 CASE (sem
, INSN_PAR_MUL
) : /* mul $dr,$sr */
4686 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4687 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4688 #define FLD(f) abuf->fields.sfmt_add.f
4689 #define OPRND(f) par_exec->operands.sfmt_add.f
4690 int UNUSED written
= 0;
4691 IADDR UNUSED pc
= abuf
->addr
;
4692 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4695 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
4697 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4705 CASE (sem
, INSN_WRITE_MUL
) : /* mul $dr,$sr */
4707 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4708 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4709 #define FLD(f) abuf->fields.sfmt_add.f
4710 #define OPRND(f) par_exec->operands.sfmt_add.f
4711 int UNUSED written
= abuf
->written
;
4712 IADDR UNUSED pc
= abuf
->addr
;
4713 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4715 * FLD (i_dr
) = OPRND (dr
);
4722 CASE (sem
, INSN_PAR_MULHI_A
) : /* mulhi $src1,$src2,$acc */
4724 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4725 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4726 #define FLD(f) abuf->fields.sfmt_machi_a.f
4727 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4728 int UNUSED written
= 0;
4729 IADDR UNUSED pc
= abuf
->addr
;
4730 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4733 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
4734 OPRND (acc
) = opval
;
4735 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4743 CASE (sem
, INSN_WRITE_MULHI_A
) : /* mulhi $src1,$src2,$acc */
4745 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4746 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4747 #define FLD(f) abuf->fields.sfmt_machi_a.f
4748 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4749 int UNUSED written
= abuf
->written
;
4750 IADDR UNUSED pc
= abuf
->addr
;
4751 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4753 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4760 CASE (sem
, INSN_PAR_MULLO_A
) : /* mullo $src1,$src2,$acc */
4762 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4764 #define FLD(f) abuf->fields.sfmt_machi_a.f
4765 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4766 int UNUSED written
= 0;
4767 IADDR UNUSED pc
= abuf
->addr
;
4768 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4771 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
4772 OPRND (acc
) = opval
;
4773 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4781 CASE (sem
, INSN_WRITE_MULLO_A
) : /* mullo $src1,$src2,$acc */
4783 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4784 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4785 #define FLD(f) abuf->fields.sfmt_machi_a.f
4786 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4787 int UNUSED written
= abuf
->written
;
4788 IADDR UNUSED pc
= abuf
->addr
;
4789 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4791 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4798 CASE (sem
, INSN_PAR_MULWHI_A
) : /* mulwhi $src1,$src2,$acc */
4800 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4801 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4802 #define FLD(f) abuf->fields.sfmt_machi_a.f
4803 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4804 int UNUSED written
= 0;
4805 IADDR UNUSED pc
= abuf
->addr
;
4806 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4809 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))));
4810 OPRND (acc
) = opval
;
4811 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4819 CASE (sem
, INSN_WRITE_MULWHI_A
) : /* mulwhi $src1,$src2,$acc */
4821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4822 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4823 #define FLD(f) abuf->fields.sfmt_machi_a.f
4824 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4825 int UNUSED written
= abuf
->written
;
4826 IADDR UNUSED pc
= abuf
->addr
;
4827 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4829 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4836 CASE (sem
, INSN_PAR_MULWLO_A
) : /* mulwlo $src1,$src2,$acc */
4838 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4839 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4840 #define FLD(f) abuf->fields.sfmt_machi_a.f
4841 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4842 int UNUSED written
= 0;
4843 IADDR UNUSED pc
= abuf
->addr
;
4844 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4847 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))));
4848 OPRND (acc
) = opval
;
4849 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
4857 CASE (sem
, INSN_WRITE_MULWLO_A
) : /* mulwlo $src1,$src2,$acc */
4859 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4860 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4861 #define FLD(f) abuf->fields.sfmt_machi_a.f
4862 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4863 int UNUSED written
= abuf
->written
;
4864 IADDR UNUSED pc
= abuf
->addr
;
4865 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4867 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4874 CASE (sem
, INSN_PAR_MV
) : /* mv $dr,$sr */
4876 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4877 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4878 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4879 #define OPRND(f) par_exec->operands.sfmt_mv.f
4880 int UNUSED written
= 0;
4881 IADDR UNUSED pc
= abuf
->addr
;
4882 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4885 SI opval
= * FLD (i_sr
);
4887 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4895 CASE (sem
, INSN_WRITE_MV
) : /* mv $dr,$sr */
4897 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4898 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4899 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4900 #define OPRND(f) par_exec->operands.sfmt_mv.f
4901 int UNUSED written
= abuf
->written
;
4902 IADDR UNUSED pc
= abuf
->addr
;
4903 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4905 * FLD (i_dr
) = OPRND (dr
);
4912 CASE (sem
, INSN_PAR_MVFACHI_A
) : /* mvfachi $dr,$accs */
4914 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4915 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4916 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4917 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4918 int UNUSED written
= 0;
4919 IADDR UNUSED pc
= abuf
->addr
;
4920 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4923 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 32));
4925 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4933 CASE (sem
, INSN_WRITE_MVFACHI_A
) : /* mvfachi $dr,$accs */
4935 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4936 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4937 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4938 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4939 int UNUSED written
= abuf
->written
;
4940 IADDR UNUSED pc
= abuf
->addr
;
4941 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4943 * FLD (i_dr
) = OPRND (dr
);
4950 CASE (sem
, INSN_PAR_MVFACLO_A
) : /* mvfaclo $dr,$accs */
4952 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4953 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4954 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4955 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4956 int UNUSED written
= 0;
4957 IADDR UNUSED pc
= abuf
->addr
;
4958 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4961 SI opval
= TRUNCDISI (GET_H_ACCUMS (FLD (f_accs
)));
4963 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
4971 CASE (sem
, INSN_WRITE_MVFACLO_A
) : /* mvfaclo $dr,$accs */
4973 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4974 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4975 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4976 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4977 int UNUSED written
= abuf
->written
;
4978 IADDR UNUSED pc
= abuf
->addr
;
4979 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4981 * FLD (i_dr
) = OPRND (dr
);
4988 CASE (sem
, INSN_PAR_MVFACMI_A
) : /* mvfacmi $dr,$accs */
4990 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4991 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4992 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4993 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4994 int UNUSED written
= 0;
4995 IADDR UNUSED pc
= abuf
->addr
;
4996 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4999 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 16));
5001 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5009 CASE (sem
, INSN_WRITE_MVFACMI_A
) : /* mvfacmi $dr,$accs */
5011 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5012 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5013 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
5014 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
5015 int UNUSED written
= abuf
->written
;
5016 IADDR UNUSED pc
= abuf
->addr
;
5017 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5019 * FLD (i_dr
) = OPRND (dr
);
5026 CASE (sem
, INSN_PAR_MVFC
) : /* mvfc $dr,$scr */
5028 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5029 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5030 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5031 #define OPRND(f) par_exec->operands.sfmt_mvfc.f
5032 int UNUSED written
= 0;
5033 IADDR UNUSED pc
= abuf
->addr
;
5034 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5037 SI opval
= GET_H_CR (FLD (f_r2
));
5039 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5047 CASE (sem
, INSN_WRITE_MVFC
) : /* mvfc $dr,$scr */
5049 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5050 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5051 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5052 #define OPRND(f) par_exec->operands.sfmt_mvfc.f
5053 int UNUSED written
= abuf
->written
;
5054 IADDR UNUSED pc
= abuf
->addr
;
5055 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5057 * FLD (i_dr
) = OPRND (dr
);
5064 CASE (sem
, INSN_PAR_MVTACHI_A
) : /* mvtachi $src1,$accs */
5066 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5067 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5068 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5069 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5070 int UNUSED written
= 0;
5071 IADDR UNUSED pc
= abuf
->addr
;
5072 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5075 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
5076 OPRND (accs
) = opval
;
5077 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
5085 CASE (sem
, INSN_WRITE_MVTACHI_A
) : /* mvtachi $src1,$accs */
5087 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5088 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5089 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5090 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5091 int UNUSED written
= abuf
->written
;
5092 IADDR UNUSED pc
= abuf
->addr
;
5093 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5095 SET_H_ACCUMS (FLD (f_accs
), OPRND (accs
));
5102 CASE (sem
, INSN_PAR_MVTACLO_A
) : /* mvtaclo $src1,$accs */
5104 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5105 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5106 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5107 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5108 int UNUSED written
= 0;
5109 IADDR UNUSED pc
= abuf
->addr
;
5110 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5113 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
5114 OPRND (accs
) = opval
;
5115 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
5123 CASE (sem
, INSN_WRITE_MVTACLO_A
) : /* mvtaclo $src1,$accs */
5125 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5126 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5127 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
5128 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
5129 int UNUSED written
= abuf
->written
;
5130 IADDR UNUSED pc
= abuf
->addr
;
5131 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5133 SET_H_ACCUMS (FLD (f_accs
), OPRND (accs
));
5140 CASE (sem
, INSN_PAR_MVTC
) : /* mvtc $sr,$dcr */
5142 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5143 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5144 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5145 #define OPRND(f) par_exec->operands.sfmt_mvtc.f
5146 int UNUSED written
= 0;
5147 IADDR UNUSED pc
= abuf
->addr
;
5148 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5151 USI opval
= * FLD (i_sr
);
5152 OPRND (dcr
) = opval
;
5153 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
5161 CASE (sem
, INSN_WRITE_MVTC
) : /* mvtc $sr,$dcr */
5163 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5164 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5165 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5166 #define OPRND(f) par_exec->operands.sfmt_mvtc.f
5167 int UNUSED written
= abuf
->written
;
5168 IADDR UNUSED pc
= abuf
->addr
;
5169 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5171 SET_H_CR (FLD (f_r1
), OPRND (dcr
));
5178 CASE (sem
, INSN_PAR_NEG
) : /* neg $dr,$sr */
5180 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5181 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5182 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5183 #define OPRND(f) par_exec->operands.sfmt_mv.f
5184 int UNUSED written
= 0;
5185 IADDR UNUSED pc
= abuf
->addr
;
5186 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5189 SI opval
= NEGSI (* FLD (i_sr
));
5191 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5199 CASE (sem
, INSN_WRITE_NEG
) : /* neg $dr,$sr */
5201 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5202 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5203 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5204 #define OPRND(f) par_exec->operands.sfmt_mv.f
5205 int UNUSED written
= abuf
->written
;
5206 IADDR UNUSED pc
= abuf
->addr
;
5207 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5209 * FLD (i_dr
) = OPRND (dr
);
5216 CASE (sem
, INSN_PAR_NOP
) : /* nop */
5218 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5219 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5220 #define FLD(f) abuf->fields.fmt_empty.f
5221 #define OPRND(f) par_exec->operands.sfmt_nop.f
5222 int UNUSED written
= 0;
5223 IADDR UNUSED pc
= abuf
->addr
;
5224 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5226 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
5233 CASE (sem
, INSN_WRITE_NOP
) : /* nop */
5235 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5236 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5237 #define FLD(f) abuf->fields.fmt_empty.f
5238 #define OPRND(f) par_exec->operands.sfmt_nop.f
5239 int UNUSED written
= abuf
->written
;
5240 IADDR UNUSED pc
= abuf
->addr
;
5241 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5249 CASE (sem
, INSN_PAR_NOT
) : /* not $dr,$sr */
5251 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5252 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5253 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5254 #define OPRND(f) par_exec->operands.sfmt_mv.f
5255 int UNUSED written
= 0;
5256 IADDR UNUSED pc
= abuf
->addr
;
5257 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5260 SI opval
= INVSI (* FLD (i_sr
));
5262 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5270 CASE (sem
, INSN_WRITE_NOT
) : /* not $dr,$sr */
5272 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5273 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5274 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5275 #define OPRND(f) par_exec->operands.sfmt_mv.f
5276 int UNUSED written
= abuf
->written
;
5277 IADDR UNUSED pc
= abuf
->addr
;
5278 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5280 * FLD (i_dr
) = OPRND (dr
);
5287 CASE (sem
, INSN_PAR_RAC_DSI
) : /* rac $accd,$accs,$imm1 */
5289 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5290 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5291 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5292 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5293 int UNUSED written
= 0;
5294 IADDR UNUSED pc
= abuf
->addr
;
5295 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5299 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
5300 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
5302 DI opval
= (GTDI (tmp_tmp1
, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1
, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1
, MAKEDI (0xffffffff, 0xffff0000)));
5303 OPRND (accd
) = opval
;
5304 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
5313 CASE (sem
, INSN_WRITE_RAC_DSI
) : /* rac $accd,$accs,$imm1 */
5315 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5316 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5317 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5318 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5319 int UNUSED written
= abuf
->written
;
5320 IADDR UNUSED pc
= abuf
->addr
;
5321 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5323 SET_H_ACCUMS (FLD (f_accd
), OPRND (accd
));
5330 CASE (sem
, INSN_PAR_RACH_DSI
) : /* rach $accd,$accs,$imm1 */
5332 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5334 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5335 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5336 int UNUSED written
= 0;
5337 IADDR UNUSED pc
= abuf
->addr
;
5338 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5342 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
5343 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 0x80000000));
5345 DI opval
= (GTDI (tmp_tmp1
, MAKEDI (32767, 0))) ? (MAKEDI (32767, 0)) : (LTDI (tmp_tmp1
, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1
, MAKEDI (0xffffffff, 0)));
5346 OPRND (accd
) = opval
;
5347 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
5356 CASE (sem
, INSN_WRITE_RACH_DSI
) : /* rach $accd,$accs,$imm1 */
5358 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5359 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5360 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5361 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5362 int UNUSED written
= abuf
->written
;
5363 IADDR UNUSED pc
= abuf
->addr
;
5364 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5366 SET_H_ACCUMS (FLD (f_accd
), OPRND (accd
));
5373 CASE (sem
, INSN_PAR_RTE
) : /* rte */
5375 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5376 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5377 #define FLD(f) abuf->fields.fmt_empty.f
5378 #define OPRND(f) par_exec->operands.sfmt_rte.f
5379 int UNUSED written
= 0;
5380 IADDR UNUSED pc
= abuf
->addr
;
5381 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5385 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
5387 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
5390 USI opval
= GET_H_CR (((UINT
) 14));
5391 OPRND (h_cr_USI_6
) = opval
;
5392 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
5395 UQI opval
= CPU (h_bpsw
);
5396 OPRND (h_psw_UQI
) = opval
;
5397 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
5400 UQI opval
= CPU (h_bbpsw
);
5401 OPRND (h_bpsw_UQI
) = opval
;
5402 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
5411 CASE (sem
, INSN_WRITE_RTE
) : /* rte */
5413 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5414 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5415 #define FLD(f) abuf->fields.fmt_empty.f
5416 #define OPRND(f) par_exec->operands.sfmt_rte.f
5417 int UNUSED written
= abuf
->written
;
5418 IADDR UNUSED pc
= abuf
->addr
;
5420 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5422 CPU (h_bpsw
) = OPRND (h_bpsw_UQI
);
5423 SET_H_CR (((UINT
) 6), OPRND (h_cr_USI_6
));
5424 SET_H_PSW (OPRND (h_psw_UQI
));
5425 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
5427 SEM_BRANCH_FINI (vpc
);
5433 CASE (sem
, INSN_PAR_SLL
) : /* sll $dr,$sr */
5435 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5436 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5437 #define FLD(f) abuf->fields.sfmt_add.f
5438 #define OPRND(f) par_exec->operands.sfmt_add.f
5439 int UNUSED written
= 0;
5440 IADDR UNUSED pc
= abuf
->addr
;
5441 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5444 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
5446 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5454 CASE (sem
, INSN_WRITE_SLL
) : /* sll $dr,$sr */
5456 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5457 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5458 #define FLD(f) abuf->fields.sfmt_add.f
5459 #define OPRND(f) par_exec->operands.sfmt_add.f
5460 int UNUSED written
= abuf
->written
;
5461 IADDR UNUSED pc
= abuf
->addr
;
5462 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5464 * FLD (i_dr
) = OPRND (dr
);
5471 CASE (sem
, INSN_PAR_SLLI
) : /* slli $dr,$uimm5 */
5473 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5474 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5475 #define FLD(f) abuf->fields.sfmt_slli.f
5476 #define OPRND(f) par_exec->operands.sfmt_slli.f
5477 int UNUSED written
= 0;
5478 IADDR UNUSED pc
= abuf
->addr
;
5479 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5482 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
5484 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5492 CASE (sem
, INSN_WRITE_SLLI
) : /* slli $dr,$uimm5 */
5494 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5495 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5496 #define FLD(f) abuf->fields.sfmt_slli.f
5497 #define OPRND(f) par_exec->operands.sfmt_slli.f
5498 int UNUSED written
= abuf
->written
;
5499 IADDR UNUSED pc
= abuf
->addr
;
5500 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5502 * FLD (i_dr
) = OPRND (dr
);
5509 CASE (sem
, INSN_PAR_SRA
) : /* sra $dr,$sr */
5511 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5512 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5513 #define FLD(f) abuf->fields.sfmt_add.f
5514 #define OPRND(f) par_exec->operands.sfmt_add.f
5515 int UNUSED written
= 0;
5516 IADDR UNUSED pc
= abuf
->addr
;
5517 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5520 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
5522 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5530 CASE (sem
, INSN_WRITE_SRA
) : /* sra $dr,$sr */
5532 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5533 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5534 #define FLD(f) abuf->fields.sfmt_add.f
5535 #define OPRND(f) par_exec->operands.sfmt_add.f
5536 int UNUSED written
= abuf
->written
;
5537 IADDR UNUSED pc
= abuf
->addr
;
5538 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5540 * FLD (i_dr
) = OPRND (dr
);
5547 CASE (sem
, INSN_PAR_SRAI
) : /* srai $dr,$uimm5 */
5549 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5550 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5551 #define FLD(f) abuf->fields.sfmt_slli.f
5552 #define OPRND(f) par_exec->operands.sfmt_slli.f
5553 int UNUSED written
= 0;
5554 IADDR UNUSED pc
= abuf
->addr
;
5555 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5558 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
5560 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5568 CASE (sem
, INSN_WRITE_SRAI
) : /* srai $dr,$uimm5 */
5570 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5571 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5572 #define FLD(f) abuf->fields.sfmt_slli.f
5573 #define OPRND(f) par_exec->operands.sfmt_slli.f
5574 int UNUSED written
= abuf
->written
;
5575 IADDR UNUSED pc
= abuf
->addr
;
5576 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5578 * FLD (i_dr
) = OPRND (dr
);
5585 CASE (sem
, INSN_PAR_SRL
) : /* srl $dr,$sr */
5587 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5588 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5589 #define FLD(f) abuf->fields.sfmt_add.f
5590 #define OPRND(f) par_exec->operands.sfmt_add.f
5591 int UNUSED written
= 0;
5592 IADDR UNUSED pc
= abuf
->addr
;
5593 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5596 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
5598 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5606 CASE (sem
, INSN_WRITE_SRL
) : /* srl $dr,$sr */
5608 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5609 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5610 #define FLD(f) abuf->fields.sfmt_add.f
5611 #define OPRND(f) par_exec->operands.sfmt_add.f
5612 int UNUSED written
= abuf
->written
;
5613 IADDR UNUSED pc
= abuf
->addr
;
5614 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5616 * FLD (i_dr
) = OPRND (dr
);
5623 CASE (sem
, INSN_PAR_SRLI
) : /* srli $dr,$uimm5 */
5625 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5626 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5627 #define FLD(f) abuf->fields.sfmt_slli.f
5628 #define OPRND(f) par_exec->operands.sfmt_slli.f
5629 int UNUSED written
= 0;
5630 IADDR UNUSED pc
= abuf
->addr
;
5631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5634 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
5636 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5644 CASE (sem
, INSN_WRITE_SRLI
) : /* srli $dr,$uimm5 */
5646 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5647 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5648 #define FLD(f) abuf->fields.sfmt_slli.f
5649 #define OPRND(f) par_exec->operands.sfmt_slli.f
5650 int UNUSED written
= abuf
->written
;
5651 IADDR UNUSED pc
= abuf
->addr
;
5652 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5654 * FLD (i_dr
) = OPRND (dr
);
5661 CASE (sem
, INSN_PAR_ST
) : /* st $src1,@$src2 */
5663 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5664 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5665 #define FLD(f) abuf->fields.sfmt_st_plus.f
5666 #define OPRND(f) par_exec->operands.sfmt_st.f
5667 int UNUSED written
= 0;
5668 IADDR UNUSED pc
= abuf
->addr
;
5669 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5672 SI opval
= * FLD (i_src1
);
5673 OPRND (h_memory_SI_src2_idx
) = * FLD (i_src2
);
5674 OPRND (h_memory_SI_src2
) = opval
;
5675 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5683 CASE (sem
, INSN_WRITE_ST
) : /* st $src1,@$src2 */
5685 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5686 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5687 #define FLD(f) abuf->fields.sfmt_st_plus.f
5688 #define OPRND(f) par_exec->operands.sfmt_st.f
5689 int UNUSED written
= abuf
->written
;
5690 IADDR UNUSED pc
= abuf
->addr
;
5691 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5693 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_SI_src2_idx
), OPRND (h_memory_SI_src2
));
5700 CASE (sem
, INSN_PAR_STB
) : /* stb $src1,@$src2 */
5702 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5703 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5704 #define FLD(f) abuf->fields.sfmt_st_plus.f
5705 #define OPRND(f) par_exec->operands.sfmt_stb.f
5706 int UNUSED written
= 0;
5707 IADDR UNUSED pc
= abuf
->addr
;
5708 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5711 QI opval
= * FLD (i_src1
);
5712 OPRND (h_memory_QI_src2_idx
) = * FLD (i_src2
);
5713 OPRND (h_memory_QI_src2
) = opval
;
5714 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5722 CASE (sem
, INSN_WRITE_STB
) : /* stb $src1,@$src2 */
5724 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5725 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5726 #define FLD(f) abuf->fields.sfmt_st_plus.f
5727 #define OPRND(f) par_exec->operands.sfmt_stb.f
5728 int UNUSED written
= abuf
->written
;
5729 IADDR UNUSED pc
= abuf
->addr
;
5730 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5732 SETMEMQI (current_cpu
, pc
, OPRND (h_memory_QI_src2_idx
), OPRND (h_memory_QI_src2
));
5739 CASE (sem
, INSN_PAR_STH
) : /* sth $src1,@$src2 */
5741 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5742 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5743 #define FLD(f) abuf->fields.sfmt_st_plus.f
5744 #define OPRND(f) par_exec->operands.sfmt_sth.f
5745 int UNUSED written
= 0;
5746 IADDR UNUSED pc
= abuf
->addr
;
5747 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5750 HI opval
= * FLD (i_src1
);
5751 OPRND (h_memory_HI_src2_idx
) = * FLD (i_src2
);
5752 OPRND (h_memory_HI_src2
) = opval
;
5753 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5761 CASE (sem
, INSN_WRITE_STH
) : /* sth $src1,@$src2 */
5763 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5764 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5765 #define FLD(f) abuf->fields.sfmt_st_plus.f
5766 #define OPRND(f) par_exec->operands.sfmt_sth.f
5767 int UNUSED written
= abuf
->written
;
5768 IADDR UNUSED pc
= abuf
->addr
;
5769 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5771 SETMEMHI (current_cpu
, pc
, OPRND (h_memory_HI_src2_idx
), OPRND (h_memory_HI_src2
));
5778 CASE (sem
, INSN_PAR_ST_PLUS
) : /* st $src1,@+$src2 */
5780 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5781 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5782 #define FLD(f) abuf->fields.sfmt_st_plus.f
5783 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5784 int UNUSED written
= 0;
5785 IADDR UNUSED pc
= abuf
->addr
;
5786 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5790 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
5792 SI opval
= * FLD (i_src1
);
5793 OPRND (h_memory_SI_new_src2_idx
) = tmp_new_src2
;
5794 OPRND (h_memory_SI_new_src2
) = opval
;
5795 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5798 SI opval
= tmp_new_src2
;
5799 OPRND (src2
) = opval
;
5800 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5809 CASE (sem
, INSN_WRITE_ST_PLUS
) : /* st $src1,@+$src2 */
5811 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5812 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5813 #define FLD(f) abuf->fields.sfmt_st_plus.f
5814 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5815 int UNUSED written
= abuf
->written
;
5816 IADDR UNUSED pc
= abuf
->addr
;
5817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5819 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_SI_new_src2_idx
), OPRND (h_memory_SI_new_src2
));
5820 * FLD (i_src2
) = OPRND (src2
);
5827 CASE (sem
, INSN_PAR_STH_PLUS
) : /* sth $src1,@$src2+ */
5829 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5830 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5831 #define FLD(f) abuf->fields.sfmt_st_plus.f
5832 #define OPRND(f) par_exec->operands.sfmt_sth_plus.f
5833 int UNUSED written
= 0;
5834 IADDR UNUSED pc
= abuf
->addr
;
5835 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5840 HI opval
= * FLD (i_src1
);
5841 OPRND (h_memory_HI_new_src2_idx
) = tmp_new_src2
;
5842 OPRND (h_memory_HI_new_src2
) = opval
;
5843 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5845 tmp_new_src2
= ADDSI (* FLD (i_src2
), 2);
5847 SI opval
= tmp_new_src2
;
5848 OPRND (src2
) = opval
;
5849 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5858 CASE (sem
, INSN_WRITE_STH_PLUS
) : /* sth $src1,@$src2+ */
5860 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5861 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5862 #define FLD(f) abuf->fields.sfmt_st_plus.f
5863 #define OPRND(f) par_exec->operands.sfmt_sth_plus.f
5864 int UNUSED written
= abuf
->written
;
5865 IADDR UNUSED pc
= abuf
->addr
;
5866 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5868 SETMEMHI (current_cpu
, pc
, OPRND (h_memory_HI_new_src2_idx
), OPRND (h_memory_HI_new_src2
));
5869 * FLD (i_src2
) = OPRND (src2
);
5876 CASE (sem
, INSN_PAR_STB_PLUS
) : /* stb $src1,@$src2+ */
5878 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5879 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5880 #define FLD(f) abuf->fields.sfmt_st_plus.f
5881 #define OPRND(f) par_exec->operands.sfmt_stb_plus.f
5882 int UNUSED written
= 0;
5883 IADDR UNUSED pc
= abuf
->addr
;
5884 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5889 QI opval
= * FLD (i_src1
);
5890 OPRND (h_memory_QI_new_src2_idx
) = tmp_new_src2
;
5891 OPRND (h_memory_QI_new_src2
) = opval
;
5892 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5894 tmp_new_src2
= ADDSI (* FLD (i_src2
), 1);
5896 SI opval
= tmp_new_src2
;
5897 OPRND (src2
) = opval
;
5898 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5907 CASE (sem
, INSN_WRITE_STB_PLUS
) : /* stb $src1,@$src2+ */
5909 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5910 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5911 #define FLD(f) abuf->fields.sfmt_st_plus.f
5912 #define OPRND(f) par_exec->operands.sfmt_stb_plus.f
5913 int UNUSED written
= abuf
->written
;
5914 IADDR UNUSED pc
= abuf
->addr
;
5915 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5917 SETMEMQI (current_cpu
, pc
, OPRND (h_memory_QI_new_src2_idx
), OPRND (h_memory_QI_new_src2
));
5918 * FLD (i_src2
) = OPRND (src2
);
5925 CASE (sem
, INSN_PAR_ST_MINUS
) : /* st $src1,@-$src2 */
5927 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5929 #define FLD(f) abuf->fields.sfmt_st_plus.f
5930 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5931 int UNUSED written
= 0;
5932 IADDR UNUSED pc
= abuf
->addr
;
5933 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5937 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
5939 SI opval
= * FLD (i_src1
);
5940 OPRND (h_memory_SI_new_src2_idx
) = tmp_new_src2
;
5941 OPRND (h_memory_SI_new_src2
) = opval
;
5942 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5945 SI opval
= tmp_new_src2
;
5946 OPRND (src2
) = opval
;
5947 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5956 CASE (sem
, INSN_WRITE_ST_MINUS
) : /* st $src1,@-$src2 */
5958 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5959 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5960 #define FLD(f) abuf->fields.sfmt_st_plus.f
5961 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5962 int UNUSED written
= abuf
->written
;
5963 IADDR UNUSED pc
= abuf
->addr
;
5964 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5966 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_SI_new_src2_idx
), OPRND (h_memory_SI_new_src2
));
5967 * FLD (i_src2
) = OPRND (src2
);
5974 CASE (sem
, INSN_PAR_SUB
) : /* sub $dr,$sr */
5976 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5978 #define FLD(f) abuf->fields.sfmt_add.f
5979 #define OPRND(f) par_exec->operands.sfmt_add.f
5980 int UNUSED written
= 0;
5981 IADDR UNUSED pc
= abuf
->addr
;
5982 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5985 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
5987 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
5995 CASE (sem
, INSN_WRITE_SUB
) : /* sub $dr,$sr */
5997 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5998 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5999 #define FLD(f) abuf->fields.sfmt_add.f
6000 #define OPRND(f) par_exec->operands.sfmt_add.f
6001 int UNUSED written
= abuf
->written
;
6002 IADDR UNUSED pc
= abuf
->addr
;
6003 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6005 * FLD (i_dr
) = OPRND (dr
);
6012 CASE (sem
, INSN_PAR_SUBV
) : /* subv $dr,$sr */
6014 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6015 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6016 #define FLD(f) abuf->fields.sfmt_add.f
6017 #define OPRND(f) par_exec->operands.sfmt_addv.f
6018 int UNUSED written
= 0;
6019 IADDR UNUSED pc
= abuf
->addr
;
6020 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6024 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
6025 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
6029 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6033 OPRND (condbit
) = opval
;
6034 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
6043 CASE (sem
, INSN_WRITE_SUBV
) : /* subv $dr,$sr */
6045 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6046 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6047 #define FLD(f) abuf->fields.sfmt_add.f
6048 #define OPRND(f) par_exec->operands.sfmt_addv.f
6049 int UNUSED written
= abuf
->written
;
6050 IADDR UNUSED pc
= abuf
->addr
;
6051 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6053 CPU (h_cond
) = OPRND (condbit
);
6054 * FLD (i_dr
) = OPRND (dr
);
6061 CASE (sem
, INSN_PAR_SUBX
) : /* subx $dr,$sr */
6063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6065 #define FLD(f) abuf->fields.sfmt_add.f
6066 #define OPRND(f) par_exec->operands.sfmt_addx.f
6067 int UNUSED written
= 0;
6068 IADDR UNUSED pc
= abuf
->addr
;
6069 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6073 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
6074 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
6078 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
6082 OPRND (condbit
) = opval
;
6083 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
6092 CASE (sem
, INSN_WRITE_SUBX
) : /* subx $dr,$sr */
6094 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6095 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6096 #define FLD(f) abuf->fields.sfmt_add.f
6097 #define OPRND(f) par_exec->operands.sfmt_addx.f
6098 int UNUSED written
= abuf
->written
;
6099 IADDR UNUSED pc
= abuf
->addr
;
6100 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6102 CPU (h_cond
) = OPRND (condbit
);
6103 * FLD (i_dr
) = OPRND (dr
);
6110 CASE (sem
, INSN_PAR_TRAP
) : /* trap $uimm4 */
6112 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6113 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6114 #define FLD(f) abuf->fields.sfmt_trap.f
6115 #define OPRND(f) par_exec->operands.sfmt_trap.f
6116 int UNUSED written
= 0;
6117 IADDR UNUSED pc
= abuf
->addr
;
6118 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6122 USI opval
= GET_H_CR (((UINT
) 6));
6123 OPRND (h_cr_USI_14
) = opval
;
6124 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
6127 USI opval
= ADDSI (pc
, 4);
6128 OPRND (h_cr_USI_6
) = opval
;
6129 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
6132 UQI opval
= CPU (h_bpsw
);
6133 OPRND (h_bbpsw_UQI
) = opval
;
6134 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
6137 UQI opval
= GET_H_PSW ();
6138 OPRND (h_bpsw_UQI
) = opval
;
6139 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
6142 UQI opval
= ANDQI (GET_H_PSW (), 128);
6143 OPRND (h_psw_UQI
) = opval
;
6144 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
6147 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
6149 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
6158 CASE (sem
, INSN_WRITE_TRAP
) : /* trap $uimm4 */
6160 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6161 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6162 #define FLD(f) abuf->fields.sfmt_trap.f
6163 #define OPRND(f) par_exec->operands.sfmt_trap.f
6164 int UNUSED written
= abuf
->written
;
6165 IADDR UNUSED pc
= abuf
->addr
;
6167 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6169 CPU (h_bbpsw
) = OPRND (h_bbpsw_UQI
);
6170 CPU (h_bpsw
) = OPRND (h_bpsw_UQI
);
6171 SET_H_CR (((UINT
) 14), OPRND (h_cr_USI_14
));
6172 SET_H_CR (((UINT
) 6), OPRND (h_cr_USI_6
));
6173 SET_H_PSW (OPRND (h_psw_UQI
));
6174 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
6176 SEM_BRANCH_FINI (vpc
);
6182 CASE (sem
, INSN_PAR_UNLOCK
) : /* unlock $src1,@$src2 */
6184 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6185 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6186 #define FLD(f) abuf->fields.sfmt_st_plus.f
6187 #define OPRND(f) par_exec->operands.sfmt_unlock.f
6188 int UNUSED written
= 0;
6189 IADDR UNUSED pc
= abuf
->addr
;
6190 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6195 SI opval
= * FLD (i_src1
);
6196 OPRND (h_memory_SI_src2_idx
) = * FLD (i_src2
);
6197 OPRND (h_memory_SI_src2
) = opval
;
6198 written
|= (1 << 4);
6199 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
6204 OPRND (h_lock_BI
) = opval
;
6205 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
6209 abuf
->written
= written
;
6215 CASE (sem
, INSN_WRITE_UNLOCK
) : /* unlock $src1,@$src2 */
6217 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6218 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6219 #define FLD(f) abuf->fields.sfmt_st_plus.f
6220 #define OPRND(f) par_exec->operands.sfmt_unlock.f
6221 int UNUSED written
= abuf
->written
;
6222 IADDR UNUSED pc
= abuf
->addr
;
6223 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6225 CPU (h_lock
) = OPRND (h_lock_BI
);
6226 if (written
& (1 << 4))
6228 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_SI_src2_idx
), OPRND (h_memory_SI_src2
));
6236 CASE (sem
, INSN_PAR_PCMPBZ
) : /* pcmpbz $src2 */
6238 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6239 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6240 #define FLD(f) abuf->fields.sfmt_st_plus.f
6241 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
6242 int UNUSED written
= 0;
6243 IADDR UNUSED pc
= abuf
->addr
;
6244 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6247 BI opval
= (EQSI (ANDSI (* FLD (i_src2
), 255), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2
), 65280), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2
), 16711680), 0)) ? (1) : (EQSI (ANDSI (* FLD (i_src2
), 0xff000000), 0)) ? (1) : (0);
6248 OPRND (condbit
) = opval
;
6249 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
6257 CASE (sem
, INSN_WRITE_PCMPBZ
) : /* pcmpbz $src2 */
6259 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6260 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6261 #define FLD(f) abuf->fields.sfmt_st_plus.f
6262 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
6263 int UNUSED written
= abuf
->written
;
6264 IADDR UNUSED pc
= abuf
->addr
;
6265 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6267 CPU (h_cond
) = OPRND (condbit
);
6274 CASE (sem
, INSN_PAR_SADD
) : /* sadd */
6276 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6277 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6278 #define FLD(f) abuf->fields.fmt_empty.f
6279 #define OPRND(f) par_exec->operands.sfmt_sadd.f
6280 int UNUSED written
= 0;
6281 IADDR UNUSED pc
= abuf
->addr
;
6282 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6285 DI opval
= ADDDI (SRADI (GET_H_ACCUMS (((UINT
) 1)), 16), GET_H_ACCUMS (((UINT
) 0)));
6286 OPRND (h_accums_DI_0
) = opval
;
6287 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
6295 CASE (sem
, INSN_WRITE_SADD
) : /* sadd */
6297 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6298 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6299 #define FLD(f) abuf->fields.fmt_empty.f
6300 #define OPRND(f) par_exec->operands.sfmt_sadd.f
6301 int UNUSED written
= abuf
->written
;
6302 IADDR UNUSED pc
= abuf
->addr
;
6303 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6305 SET_H_ACCUMS (((UINT
) 0), OPRND (h_accums_DI_0
));
6312 CASE (sem
, INSN_PAR_MACWU1
) : /* macwu1 $src1,$src2 */
6314 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6315 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6316 #define FLD(f) abuf->fields.sfmt_st_plus.f
6317 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6318 int UNUSED written
= 0;
6319 IADDR UNUSED pc
= abuf
->addr
;
6320 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6323 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT
) 1)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535)))), 8), 8);
6324 OPRND (h_accums_DI_1
) = opval
;
6325 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
6333 CASE (sem
, INSN_WRITE_MACWU1
) : /* macwu1 $src1,$src2 */
6335 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6336 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6337 #define FLD(f) abuf->fields.sfmt_st_plus.f
6338 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6339 int UNUSED written
= abuf
->written
;
6340 IADDR UNUSED pc
= abuf
->addr
;
6341 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6343 SET_H_ACCUMS (((UINT
) 1), OPRND (h_accums_DI_1
));
6350 CASE (sem
, INSN_PAR_MSBLO
) : /* msblo $src1,$src2 */
6352 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6354 #define FLD(f) abuf->fields.sfmt_st_plus.f
6355 #define OPRND(f) par_exec->operands.sfmt_msblo.f
6356 int UNUSED written
= 0;
6357 IADDR UNUSED pc
= abuf
->addr
;
6358 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6361 DI opval
= SRADI (SLLDI (SUBDI (GET_H_ACCUM (), SRADI (SLLDI (MULDI (EXTHIDI (TRUNCSIHI (* FLD (i_src1
))), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 32), 16)), 8), 8);
6362 OPRND (accum
) = opval
;
6363 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
6371 CASE (sem
, INSN_WRITE_MSBLO
) : /* msblo $src1,$src2 */
6373 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6374 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6375 #define FLD(f) abuf->fields.sfmt_st_plus.f
6376 #define OPRND(f) par_exec->operands.sfmt_msblo.f
6377 int UNUSED written
= abuf
->written
;
6378 IADDR UNUSED pc
= abuf
->addr
;
6379 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6381 SET_H_ACCUM (OPRND (accum
));
6388 CASE (sem
, INSN_PAR_MULWU1
) : /* mulwu1 $src1,$src2 */
6390 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6391 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6392 #define FLD(f) abuf->fields.sfmt_st_plus.f
6393 #define OPRND(f) par_exec->operands.sfmt_mulwu1.f
6394 int UNUSED written
= 0;
6395 IADDR UNUSED pc
= abuf
->addr
;
6396 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6399 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535))), 16), 16);
6400 OPRND (h_accums_DI_1
) = opval
;
6401 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
6409 CASE (sem
, INSN_WRITE_MULWU1
) : /* mulwu1 $src1,$src2 */
6411 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6412 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6413 #define FLD(f) abuf->fields.sfmt_st_plus.f
6414 #define OPRND(f) par_exec->operands.sfmt_mulwu1.f
6415 int UNUSED written
= abuf
->written
;
6416 IADDR UNUSED pc
= abuf
->addr
;
6417 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6419 SET_H_ACCUMS (((UINT
) 1), OPRND (h_accums_DI_1
));
6426 CASE (sem
, INSN_PAR_MACLH1
) : /* maclh1 $src1,$src2 */
6428 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6429 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6430 #define FLD(f) abuf->fields.sfmt_st_plus.f
6431 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6432 int UNUSED written
= 0;
6433 IADDR UNUSED pc
= abuf
->addr
;
6434 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6437 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT
) 1)), SLLDI (EXTSIDI (MULSI (EXTHISI (TRUNCSIHI (* FLD (i_src1
))), SRASI (* FLD (i_src2
), 16))), 16)), 8), 8);
6438 OPRND (h_accums_DI_1
) = opval
;
6439 TRACE_RESULT (current_cpu
, abuf
, "accums", 'D', opval
);
6447 CASE (sem
, INSN_WRITE_MACLH1
) : /* maclh1 $src1,$src2 */
6449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6450 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6451 #define FLD(f) abuf->fields.sfmt_st_plus.f
6452 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6453 int UNUSED written
= abuf
->written
;
6454 IADDR UNUSED pc
= abuf
->addr
;
6455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6457 SET_H_ACCUMS (((UINT
) 1), OPRND (h_accums_DI_1
));
6464 CASE (sem
, INSN_PAR_SC
) : /* sc */
6466 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6467 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6468 #define FLD(f) abuf->fields.fmt_empty.f
6469 #define OPRND(f) par_exec->operands.sfmt_sc.f
6470 int UNUSED written
= 0;
6471 IADDR UNUSED pc
= abuf
->addr
;
6472 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6474 if (ZEXTBISI (CPU (h_cond
)))
6475 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
6482 CASE (sem
, INSN_WRITE_SC
) : /* sc */
6484 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6485 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6486 #define FLD(f) abuf->fields.fmt_empty.f
6487 #define OPRND(f) par_exec->operands.sfmt_sc.f
6488 int UNUSED written
= abuf
->written
;
6489 IADDR UNUSED pc
= abuf
->addr
;
6490 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6498 CASE (sem
, INSN_PAR_SNC
) : /* snc */
6500 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6501 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6502 #define FLD(f) abuf->fields.fmt_empty.f
6503 #define OPRND(f) par_exec->operands.sfmt_sc.f
6504 int UNUSED written
= 0;
6505 IADDR UNUSED pc
= abuf
->addr
;
6506 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6508 if (ZEXTBISI (NOTBI (CPU (h_cond
))))
6509 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
6516 CASE (sem
, INSN_WRITE_SNC
) : /* snc */
6518 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6519 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6520 #define FLD(f) abuf->fields.fmt_empty.f
6521 #define OPRND(f) par_exec->operands.sfmt_sc.f
6522 int UNUSED written
= abuf
->written
;
6523 IADDR UNUSED pc
= abuf
->addr
;
6524 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6532 CASE (sem
, INSN_PAR_CLRPSW
) : /* clrpsw $uimm8 */
6534 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6536 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6537 #define OPRND(f) par_exec->operands.sfmt_clrpsw.f
6538 int UNUSED written
= 0;
6539 IADDR UNUSED pc
= abuf
->addr
;
6540 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6543 SI opval
= ANDSI (GET_H_CR (((UINT
) 0)), ORSI (INVBI (FLD (f_uimm8
)), 65280));
6544 OPRND (h_cr_USI_0
) = opval
;
6545 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
6553 CASE (sem
, INSN_WRITE_CLRPSW
) : /* clrpsw $uimm8 */
6555 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6556 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6557 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6558 #define OPRND(f) par_exec->operands.sfmt_clrpsw.f
6559 int UNUSED written
= abuf
->written
;
6560 IADDR UNUSED pc
= abuf
->addr
;
6561 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6563 SET_H_CR (((UINT
) 0), OPRND (h_cr_USI_0
));
6570 CASE (sem
, INSN_PAR_SETPSW
) : /* setpsw $uimm8 */
6572 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6573 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6574 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6575 #define OPRND(f) par_exec->operands.sfmt_setpsw.f
6576 int UNUSED written
= 0;
6577 IADDR UNUSED pc
= abuf
->addr
;
6578 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6581 SI opval
= FLD (f_uimm8
);
6582 OPRND (h_cr_USI_0
) = opval
;
6583 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
6591 CASE (sem
, INSN_WRITE_SETPSW
) : /* setpsw $uimm8 */
6593 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6594 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6595 #define FLD(f) abuf->fields.sfmt_clrpsw.f
6596 #define OPRND(f) par_exec->operands.sfmt_setpsw.f
6597 int UNUSED written
= abuf
->written
;
6598 IADDR UNUSED pc
= abuf
->addr
;
6599 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6601 SET_H_CR (((UINT
) 0), OPRND (h_cr_USI_0
));
6608 CASE (sem
, INSN_PAR_BTST
) : /* btst $uimm3,$sr */
6610 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6611 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6612 #define FLD(f) abuf->fields.sfmt_bset.f
6613 #define OPRND(f) par_exec->operands.sfmt_btst.f
6614 int UNUSED written
= 0;
6615 IADDR UNUSED pc
= abuf
->addr
;
6616 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6619 BI opval
= ANDQI (SRLSI (* FLD (i_sr
), SUBSI (7, FLD (f_uimm3
))), 1);
6620 OPRND (condbit
) = opval
;
6621 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
6629 CASE (sem
, INSN_WRITE_BTST
) : /* btst $uimm3,$sr */
6631 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6632 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6633 #define FLD(f) abuf->fields.sfmt_bset.f
6634 #define OPRND(f) par_exec->operands.sfmt_btst.f
6635 int UNUSED written
= abuf
->written
;
6636 IADDR UNUSED pc
= abuf
->addr
;
6637 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6639 CPU (h_cond
) = OPRND (condbit
);
6648 ENDSWITCH (sem
) /* End of semantic switch. */
6650 /* At this point `vpc' contains the next insn to execute. */
6653 #undef DEFINE_SWITCH
6654 #endif /* DEFINE_SWITCH */