1 /* Simulator instruction semantics for m32rxf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996, 1997, 1998, 1999 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_ST_MINUS
, && case_sem_INSN_ST_MINUS
},
144 { M32RXF_INSN_SUB
, && case_sem_INSN_SUB
},
145 { M32RXF_INSN_SUBV
, && case_sem_INSN_SUBV
},
146 { M32RXF_INSN_SUBX
, && case_sem_INSN_SUBX
},
147 { M32RXF_INSN_TRAP
, && case_sem_INSN_TRAP
},
148 { M32RXF_INSN_UNLOCK
, && case_sem_INSN_UNLOCK
},
149 { M32RXF_INSN_SATB
, && case_sem_INSN_SATB
},
150 { M32RXF_INSN_SATH
, && case_sem_INSN_SATH
},
151 { M32RXF_INSN_SAT
, && case_sem_INSN_SAT
},
152 { M32RXF_INSN_PCMPBZ
, && case_sem_INSN_PCMPBZ
},
153 { M32RXF_INSN_SADD
, && case_sem_INSN_SADD
},
154 { M32RXF_INSN_MACWU1
, && case_sem_INSN_MACWU1
},
155 { M32RXF_INSN_MSBLO
, && case_sem_INSN_MSBLO
},
156 { M32RXF_INSN_MULWU1
, && case_sem_INSN_MULWU1
},
157 { M32RXF_INSN_MACLH1
, && case_sem_INSN_MACLH1
},
158 { M32RXF_INSN_SC
, && case_sem_INSN_SC
},
159 { M32RXF_INSN_SNC
, && case_sem_INSN_SNC
},
160 { M32RXF_INSN_PAR_ADD
, && case_sem_INSN_PAR_ADD
},
161 { M32RXF_INSN_WRITE_ADD
, && case_sem_INSN_WRITE_ADD
},
162 { M32RXF_INSN_PAR_AND
, && case_sem_INSN_PAR_AND
},
163 { M32RXF_INSN_WRITE_AND
, && case_sem_INSN_WRITE_AND
},
164 { M32RXF_INSN_PAR_OR
, && case_sem_INSN_PAR_OR
},
165 { M32RXF_INSN_WRITE_OR
, && case_sem_INSN_WRITE_OR
},
166 { M32RXF_INSN_PAR_XOR
, && case_sem_INSN_PAR_XOR
},
167 { M32RXF_INSN_WRITE_XOR
, && case_sem_INSN_WRITE_XOR
},
168 { M32RXF_INSN_PAR_ADDI
, && case_sem_INSN_PAR_ADDI
},
169 { M32RXF_INSN_WRITE_ADDI
, && case_sem_INSN_WRITE_ADDI
},
170 { M32RXF_INSN_PAR_ADDV
, && case_sem_INSN_PAR_ADDV
},
171 { M32RXF_INSN_WRITE_ADDV
, && case_sem_INSN_WRITE_ADDV
},
172 { M32RXF_INSN_PAR_ADDX
, && case_sem_INSN_PAR_ADDX
},
173 { M32RXF_INSN_WRITE_ADDX
, && case_sem_INSN_WRITE_ADDX
},
174 { M32RXF_INSN_PAR_BC8
, && case_sem_INSN_PAR_BC8
},
175 { M32RXF_INSN_WRITE_BC8
, && case_sem_INSN_WRITE_BC8
},
176 { M32RXF_INSN_PAR_BL8
, && case_sem_INSN_PAR_BL8
},
177 { M32RXF_INSN_WRITE_BL8
, && case_sem_INSN_WRITE_BL8
},
178 { M32RXF_INSN_PAR_BCL8
, && case_sem_INSN_PAR_BCL8
},
179 { M32RXF_INSN_WRITE_BCL8
, && case_sem_INSN_WRITE_BCL8
},
180 { M32RXF_INSN_PAR_BNC8
, && case_sem_INSN_PAR_BNC8
},
181 { M32RXF_INSN_WRITE_BNC8
, && case_sem_INSN_WRITE_BNC8
},
182 { M32RXF_INSN_PAR_BRA8
, && case_sem_INSN_PAR_BRA8
},
183 { M32RXF_INSN_WRITE_BRA8
, && case_sem_INSN_WRITE_BRA8
},
184 { M32RXF_INSN_PAR_BNCL8
, && case_sem_INSN_PAR_BNCL8
},
185 { M32RXF_INSN_WRITE_BNCL8
, && case_sem_INSN_WRITE_BNCL8
},
186 { M32RXF_INSN_PAR_CMP
, && case_sem_INSN_PAR_CMP
},
187 { M32RXF_INSN_WRITE_CMP
, && case_sem_INSN_WRITE_CMP
},
188 { M32RXF_INSN_PAR_CMPU
, && case_sem_INSN_PAR_CMPU
},
189 { M32RXF_INSN_WRITE_CMPU
, && case_sem_INSN_WRITE_CMPU
},
190 { M32RXF_INSN_PAR_CMPEQ
, && case_sem_INSN_PAR_CMPEQ
},
191 { M32RXF_INSN_WRITE_CMPEQ
, && case_sem_INSN_WRITE_CMPEQ
},
192 { M32RXF_INSN_PAR_CMPZ
, && case_sem_INSN_PAR_CMPZ
},
193 { M32RXF_INSN_WRITE_CMPZ
, && case_sem_INSN_WRITE_CMPZ
},
194 { M32RXF_INSN_PAR_JC
, && case_sem_INSN_PAR_JC
},
195 { M32RXF_INSN_WRITE_JC
, && case_sem_INSN_WRITE_JC
},
196 { M32RXF_INSN_PAR_JNC
, && case_sem_INSN_PAR_JNC
},
197 { M32RXF_INSN_WRITE_JNC
, && case_sem_INSN_WRITE_JNC
},
198 { M32RXF_INSN_PAR_JL
, && case_sem_INSN_PAR_JL
},
199 { M32RXF_INSN_WRITE_JL
, && case_sem_INSN_WRITE_JL
},
200 { M32RXF_INSN_PAR_JMP
, && case_sem_INSN_PAR_JMP
},
201 { M32RXF_INSN_WRITE_JMP
, && case_sem_INSN_WRITE_JMP
},
202 { M32RXF_INSN_PAR_LD
, && case_sem_INSN_PAR_LD
},
203 { M32RXF_INSN_WRITE_LD
, && case_sem_INSN_WRITE_LD
},
204 { M32RXF_INSN_PAR_LDB
, && case_sem_INSN_PAR_LDB
},
205 { M32RXF_INSN_WRITE_LDB
, && case_sem_INSN_WRITE_LDB
},
206 { M32RXF_INSN_PAR_LDH
, && case_sem_INSN_PAR_LDH
},
207 { M32RXF_INSN_WRITE_LDH
, && case_sem_INSN_WRITE_LDH
},
208 { M32RXF_INSN_PAR_LDUB
, && case_sem_INSN_PAR_LDUB
},
209 { M32RXF_INSN_WRITE_LDUB
, && case_sem_INSN_WRITE_LDUB
},
210 { M32RXF_INSN_PAR_LDUH
, && case_sem_INSN_PAR_LDUH
},
211 { M32RXF_INSN_WRITE_LDUH
, && case_sem_INSN_WRITE_LDUH
},
212 { M32RXF_INSN_PAR_LD_PLUS
, && case_sem_INSN_PAR_LD_PLUS
},
213 { M32RXF_INSN_WRITE_LD_PLUS
, && case_sem_INSN_WRITE_LD_PLUS
},
214 { M32RXF_INSN_PAR_LDI8
, && case_sem_INSN_PAR_LDI8
},
215 { M32RXF_INSN_WRITE_LDI8
, && case_sem_INSN_WRITE_LDI8
},
216 { M32RXF_INSN_PAR_LOCK
, && case_sem_INSN_PAR_LOCK
},
217 { M32RXF_INSN_WRITE_LOCK
, && case_sem_INSN_WRITE_LOCK
},
218 { M32RXF_INSN_PAR_MACHI_A
, && case_sem_INSN_PAR_MACHI_A
},
219 { M32RXF_INSN_WRITE_MACHI_A
, && case_sem_INSN_WRITE_MACHI_A
},
220 { M32RXF_INSN_PAR_MACLO_A
, && case_sem_INSN_PAR_MACLO_A
},
221 { M32RXF_INSN_WRITE_MACLO_A
, && case_sem_INSN_WRITE_MACLO_A
},
222 { M32RXF_INSN_PAR_MACWHI_A
, && case_sem_INSN_PAR_MACWHI_A
},
223 { M32RXF_INSN_WRITE_MACWHI_A
, && case_sem_INSN_WRITE_MACWHI_A
},
224 { M32RXF_INSN_PAR_MACWLO_A
, && case_sem_INSN_PAR_MACWLO_A
},
225 { M32RXF_INSN_WRITE_MACWLO_A
, && case_sem_INSN_WRITE_MACWLO_A
},
226 { M32RXF_INSN_PAR_MUL
, && case_sem_INSN_PAR_MUL
},
227 { M32RXF_INSN_WRITE_MUL
, && case_sem_INSN_WRITE_MUL
},
228 { M32RXF_INSN_PAR_MULHI_A
, && case_sem_INSN_PAR_MULHI_A
},
229 { M32RXF_INSN_WRITE_MULHI_A
, && case_sem_INSN_WRITE_MULHI_A
},
230 { M32RXF_INSN_PAR_MULLO_A
, && case_sem_INSN_PAR_MULLO_A
},
231 { M32RXF_INSN_WRITE_MULLO_A
, && case_sem_INSN_WRITE_MULLO_A
},
232 { M32RXF_INSN_PAR_MULWHI_A
, && case_sem_INSN_PAR_MULWHI_A
},
233 { M32RXF_INSN_WRITE_MULWHI_A
, && case_sem_INSN_WRITE_MULWHI_A
},
234 { M32RXF_INSN_PAR_MULWLO_A
, && case_sem_INSN_PAR_MULWLO_A
},
235 { M32RXF_INSN_WRITE_MULWLO_A
, && case_sem_INSN_WRITE_MULWLO_A
},
236 { M32RXF_INSN_PAR_MV
, && case_sem_INSN_PAR_MV
},
237 { M32RXF_INSN_WRITE_MV
, && case_sem_INSN_WRITE_MV
},
238 { M32RXF_INSN_PAR_MVFACHI_A
, && case_sem_INSN_PAR_MVFACHI_A
},
239 { M32RXF_INSN_WRITE_MVFACHI_A
, && case_sem_INSN_WRITE_MVFACHI_A
},
240 { M32RXF_INSN_PAR_MVFACLO_A
, && case_sem_INSN_PAR_MVFACLO_A
},
241 { M32RXF_INSN_WRITE_MVFACLO_A
, && case_sem_INSN_WRITE_MVFACLO_A
},
242 { M32RXF_INSN_PAR_MVFACMI_A
, && case_sem_INSN_PAR_MVFACMI_A
},
243 { M32RXF_INSN_WRITE_MVFACMI_A
, && case_sem_INSN_WRITE_MVFACMI_A
},
244 { M32RXF_INSN_PAR_MVFC
, && case_sem_INSN_PAR_MVFC
},
245 { M32RXF_INSN_WRITE_MVFC
, && case_sem_INSN_WRITE_MVFC
},
246 { M32RXF_INSN_PAR_MVTACHI_A
, && case_sem_INSN_PAR_MVTACHI_A
},
247 { M32RXF_INSN_WRITE_MVTACHI_A
, && case_sem_INSN_WRITE_MVTACHI_A
},
248 { M32RXF_INSN_PAR_MVTACLO_A
, && case_sem_INSN_PAR_MVTACLO_A
},
249 { M32RXF_INSN_WRITE_MVTACLO_A
, && case_sem_INSN_WRITE_MVTACLO_A
},
250 { M32RXF_INSN_PAR_MVTC
, && case_sem_INSN_PAR_MVTC
},
251 { M32RXF_INSN_WRITE_MVTC
, && case_sem_INSN_WRITE_MVTC
},
252 { M32RXF_INSN_PAR_NEG
, && case_sem_INSN_PAR_NEG
},
253 { M32RXF_INSN_WRITE_NEG
, && case_sem_INSN_WRITE_NEG
},
254 { M32RXF_INSN_PAR_NOP
, && case_sem_INSN_PAR_NOP
},
255 { M32RXF_INSN_WRITE_NOP
, && case_sem_INSN_WRITE_NOP
},
256 { M32RXF_INSN_PAR_NOT
, && case_sem_INSN_PAR_NOT
},
257 { M32RXF_INSN_WRITE_NOT
, && case_sem_INSN_WRITE_NOT
},
258 { M32RXF_INSN_PAR_RAC_DSI
, && case_sem_INSN_PAR_RAC_DSI
},
259 { M32RXF_INSN_WRITE_RAC_DSI
, && case_sem_INSN_WRITE_RAC_DSI
},
260 { M32RXF_INSN_PAR_RACH_DSI
, && case_sem_INSN_PAR_RACH_DSI
},
261 { M32RXF_INSN_WRITE_RACH_DSI
, && case_sem_INSN_WRITE_RACH_DSI
},
262 { M32RXF_INSN_PAR_RTE
, && case_sem_INSN_PAR_RTE
},
263 { M32RXF_INSN_WRITE_RTE
, && case_sem_INSN_WRITE_RTE
},
264 { M32RXF_INSN_PAR_SLL
, && case_sem_INSN_PAR_SLL
},
265 { M32RXF_INSN_WRITE_SLL
, && case_sem_INSN_WRITE_SLL
},
266 { M32RXF_INSN_PAR_SLLI
, && case_sem_INSN_PAR_SLLI
},
267 { M32RXF_INSN_WRITE_SLLI
, && case_sem_INSN_WRITE_SLLI
},
268 { M32RXF_INSN_PAR_SRA
, && case_sem_INSN_PAR_SRA
},
269 { M32RXF_INSN_WRITE_SRA
, && case_sem_INSN_WRITE_SRA
},
270 { M32RXF_INSN_PAR_SRAI
, && case_sem_INSN_PAR_SRAI
},
271 { M32RXF_INSN_WRITE_SRAI
, && case_sem_INSN_WRITE_SRAI
},
272 { M32RXF_INSN_PAR_SRL
, && case_sem_INSN_PAR_SRL
},
273 { M32RXF_INSN_WRITE_SRL
, && case_sem_INSN_WRITE_SRL
},
274 { M32RXF_INSN_PAR_SRLI
, && case_sem_INSN_PAR_SRLI
},
275 { M32RXF_INSN_WRITE_SRLI
, && case_sem_INSN_WRITE_SRLI
},
276 { M32RXF_INSN_PAR_ST
, && case_sem_INSN_PAR_ST
},
277 { M32RXF_INSN_WRITE_ST
, && case_sem_INSN_WRITE_ST
},
278 { M32RXF_INSN_PAR_STB
, && case_sem_INSN_PAR_STB
},
279 { M32RXF_INSN_WRITE_STB
, && case_sem_INSN_WRITE_STB
},
280 { M32RXF_INSN_PAR_STH
, && case_sem_INSN_PAR_STH
},
281 { M32RXF_INSN_WRITE_STH
, && case_sem_INSN_WRITE_STH
},
282 { M32RXF_INSN_PAR_ST_PLUS
, && case_sem_INSN_PAR_ST_PLUS
},
283 { M32RXF_INSN_WRITE_ST_PLUS
, && case_sem_INSN_WRITE_ST_PLUS
},
284 { M32RXF_INSN_PAR_ST_MINUS
, && case_sem_INSN_PAR_ST_MINUS
},
285 { M32RXF_INSN_WRITE_ST_MINUS
, && case_sem_INSN_WRITE_ST_MINUS
},
286 { M32RXF_INSN_PAR_SUB
, && case_sem_INSN_PAR_SUB
},
287 { M32RXF_INSN_WRITE_SUB
, && case_sem_INSN_WRITE_SUB
},
288 { M32RXF_INSN_PAR_SUBV
, && case_sem_INSN_PAR_SUBV
},
289 { M32RXF_INSN_WRITE_SUBV
, && case_sem_INSN_WRITE_SUBV
},
290 { M32RXF_INSN_PAR_SUBX
, && case_sem_INSN_PAR_SUBX
},
291 { M32RXF_INSN_WRITE_SUBX
, && case_sem_INSN_WRITE_SUBX
},
292 { M32RXF_INSN_PAR_TRAP
, && case_sem_INSN_PAR_TRAP
},
293 { M32RXF_INSN_WRITE_TRAP
, && case_sem_INSN_WRITE_TRAP
},
294 { M32RXF_INSN_PAR_UNLOCK
, && case_sem_INSN_PAR_UNLOCK
},
295 { M32RXF_INSN_WRITE_UNLOCK
, && case_sem_INSN_WRITE_UNLOCK
},
296 { M32RXF_INSN_PAR_PCMPBZ
, && case_sem_INSN_PAR_PCMPBZ
},
297 { M32RXF_INSN_WRITE_PCMPBZ
, && case_sem_INSN_WRITE_PCMPBZ
},
298 { M32RXF_INSN_PAR_SADD
, && case_sem_INSN_PAR_SADD
},
299 { M32RXF_INSN_WRITE_SADD
, && case_sem_INSN_WRITE_SADD
},
300 { M32RXF_INSN_PAR_MACWU1
, && case_sem_INSN_PAR_MACWU1
},
301 { M32RXF_INSN_WRITE_MACWU1
, && case_sem_INSN_WRITE_MACWU1
},
302 { M32RXF_INSN_PAR_MSBLO
, && case_sem_INSN_PAR_MSBLO
},
303 { M32RXF_INSN_WRITE_MSBLO
, && case_sem_INSN_WRITE_MSBLO
},
304 { M32RXF_INSN_PAR_MULWU1
, && case_sem_INSN_PAR_MULWU1
},
305 { M32RXF_INSN_WRITE_MULWU1
, && case_sem_INSN_WRITE_MULWU1
},
306 { M32RXF_INSN_PAR_MACLH1
, && case_sem_INSN_PAR_MACLH1
},
307 { M32RXF_INSN_WRITE_MACLH1
, && case_sem_INSN_WRITE_MACLH1
},
308 { M32RXF_INSN_PAR_SC
, && case_sem_INSN_PAR_SC
},
309 { M32RXF_INSN_WRITE_SC
, && case_sem_INSN_WRITE_SC
},
310 { M32RXF_INSN_PAR_SNC
, && case_sem_INSN_PAR_SNC
},
311 { M32RXF_INSN_WRITE_SNC
, && case_sem_INSN_WRITE_SNC
},
316 for (i
= 0; labels
[i
].label
!= 0; ++i
)
319 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
321 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
326 #endif /* DEFINE_LABELS */
330 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
331 off frills like tracing and profiling. */
332 /* FIXME: A better way would be to have TRACE_RESULT check for something
333 that can cause it to be optimized out. Another way would be to emit
334 special handlers into the instruction "stream". */
338 #define TRACE_RESULT(cpu, abuf, name, type, val)
342 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
348 /* Branch to next handler without going around main loop. */
349 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
350 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
352 #else /* ! WITH_SCACHE_PBB */
354 #define NEXT(vpc) BREAK (sem)
357 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
359 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
362 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
365 #endif /* ! WITH_SCACHE_PBB */
369 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
371 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
372 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
373 #define FLD(f) abuf->fields.fmt_empty.f
374 int UNUSED written
= 0;
375 IADDR UNUSED pc
= abuf
->addr
;
376 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
379 /* Update the recorded pc in the cpu state struct.
380 Only necessary for WITH_SCACHE case, but to avoid the
381 conditional compilation .... */
383 /* Virtual insns have zero size. Overwrite vpc with address of next insn
384 using the default-insn-bitsize spec. When executing insns in parallel
385 we may want to queue the fault and continue execution. */
386 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
387 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
394 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
396 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
398 #define FLD(f) abuf->fields.fmt_empty.f
399 int UNUSED written
= 0;
400 IADDR UNUSED pc
= abuf
->addr
;
401 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
404 #if WITH_SCACHE_PBB_M32RXF
405 m32rxf_pbb_after (current_cpu
, sem_arg
);
413 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
415 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
417 #define FLD(f) abuf->fields.fmt_empty.f
418 int UNUSED written
= 0;
419 IADDR UNUSED pc
= abuf
->addr
;
420 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
423 #if WITH_SCACHE_PBB_M32RXF
424 m32rxf_pbb_before (current_cpu
, sem_arg
);
432 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
434 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
435 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
436 #define FLD(f) abuf->fields.fmt_empty.f
437 int UNUSED written
= 0;
438 IADDR UNUSED pc
= abuf
->addr
;
439 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
442 #if WITH_SCACHE_PBB_M32RXF
444 vpc
= m32rxf_pbb_cti_chain (current_cpu
, sem_arg
,
445 pbb_br_type
, pbb_br_npc
);
448 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
449 vpc
= m32rxf_pbb_cti_chain (current_cpu
, sem_arg
,
450 CPU_PBB_BR_TYPE (current_cpu
),
451 CPU_PBB_BR_NPC (current_cpu
));
460 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
462 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
463 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
464 #define FLD(f) abuf->fields.fmt_empty.f
465 int UNUSED written
= 0;
466 IADDR UNUSED pc
= abuf
->addr
;
467 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
470 #if WITH_SCACHE_PBB_M32RXF
471 vpc
= m32rxf_pbb_chain (current_cpu
, sem_arg
);
482 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
484 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
485 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
486 #define FLD(f) abuf->fields.fmt_empty.f
487 int UNUSED written
= 0;
488 IADDR UNUSED pc
= abuf
->addr
;
489 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
492 #if WITH_SCACHE_PBB_M32RXF
493 #if defined DEFINE_SWITCH || defined FAST_P
494 /* In the switch case FAST_P is a constant, allowing several optimizations
495 in any called inline functions. */
496 vpc
= m32rxf_pbb_begin (current_cpu
, FAST_P
);
498 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
499 vpc
= m32rxf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
501 vpc
= m32rxf_pbb_begin (current_cpu
, 0);
511 CASE (sem
, INSN_ADD
) : /* add $dr,$sr */
513 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
514 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
515 #define FLD(f) abuf->fields.sfmt_add.f
516 int UNUSED written
= 0;
517 IADDR UNUSED pc
= abuf
->addr
;
518 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
521 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
522 * FLD (i_dr
) = opval
;
523 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
530 CASE (sem
, INSN_ADD3
) : /* add3 $dr,$sr,$hash$slo16 */
532 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
533 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
534 #define FLD(f) abuf->fields.sfmt_add3.f
535 int UNUSED written
= 0;
536 IADDR UNUSED pc
= abuf
->addr
;
537 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
540 SI opval
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
541 * FLD (i_dr
) = opval
;
542 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
549 CASE (sem
, INSN_AND
) : /* and $dr,$sr */
551 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
552 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
553 #define FLD(f) abuf->fields.sfmt_add.f
554 int UNUSED written
= 0;
555 IADDR UNUSED pc
= abuf
->addr
;
556 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
559 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
560 * FLD (i_dr
) = opval
;
561 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
568 CASE (sem
, INSN_AND3
) : /* and3 $dr,$sr,$uimm16 */
570 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
571 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
572 #define FLD(f) abuf->fields.sfmt_and3.f
573 int UNUSED written
= 0;
574 IADDR UNUSED pc
= abuf
->addr
;
575 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
578 SI opval
= ANDSI (* FLD (i_sr
), FLD (f_uimm16
));
579 * FLD (i_dr
) = opval
;
580 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
587 CASE (sem
, INSN_OR
) : /* or $dr,$sr */
589 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
590 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
591 #define FLD(f) abuf->fields.sfmt_add.f
592 int UNUSED written
= 0;
593 IADDR UNUSED pc
= abuf
->addr
;
594 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
597 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
598 * FLD (i_dr
) = opval
;
599 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
606 CASE (sem
, INSN_OR3
) : /* or3 $dr,$sr,$hash$ulo16 */
608 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
609 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
610 #define FLD(f) abuf->fields.sfmt_and3.f
611 int UNUSED written
= 0;
612 IADDR UNUSED pc
= abuf
->addr
;
613 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
616 SI opval
= ORSI (* FLD (i_sr
), FLD (f_uimm16
));
617 * FLD (i_dr
) = opval
;
618 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
625 CASE (sem
, INSN_XOR
) : /* xor $dr,$sr */
627 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
628 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
629 #define FLD(f) abuf->fields.sfmt_add.f
630 int UNUSED written
= 0;
631 IADDR UNUSED pc
= abuf
->addr
;
632 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
635 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
636 * FLD (i_dr
) = opval
;
637 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
644 CASE (sem
, INSN_XOR3
) : /* xor3 $dr,$sr,$uimm16 */
646 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
647 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
648 #define FLD(f) abuf->fields.sfmt_and3.f
649 int UNUSED written
= 0;
650 IADDR UNUSED pc
= abuf
->addr
;
651 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
654 SI opval
= XORSI (* FLD (i_sr
), FLD (f_uimm16
));
655 * FLD (i_dr
) = opval
;
656 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
663 CASE (sem
, INSN_ADDI
) : /* addi $dr,$simm8 */
665 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
666 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
667 #define FLD(f) abuf->fields.sfmt_addi.f
668 int UNUSED written
= 0;
669 IADDR UNUSED pc
= abuf
->addr
;
670 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
673 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
674 * FLD (i_dr
) = opval
;
675 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
682 CASE (sem
, INSN_ADDV
) : /* addv $dr,$sr */
684 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
685 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
686 #define FLD(f) abuf->fields.sfmt_add.f
687 int UNUSED written
= 0;
688 IADDR UNUSED pc
= abuf
->addr
;
689 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
693 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
694 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
697 * FLD (i_dr
) = opval
;
698 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
702 CPU (h_cond
) = opval
;
703 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
711 CASE (sem
, INSN_ADDV3
) : /* addv3 $dr,$sr,$simm16 */
713 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
714 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
715 #define FLD(f) abuf->fields.sfmt_add3.f
716 int UNUSED written
= 0;
717 IADDR UNUSED pc
= abuf
->addr
;
718 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
722 temp0
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
723 temp1
= ADDOFSI (* FLD (i_sr
), FLD (f_simm16
), 0);
726 * FLD (i_dr
) = opval
;
727 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
731 CPU (h_cond
) = opval
;
732 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
740 CASE (sem
, INSN_ADDX
) : /* addx $dr,$sr */
742 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
743 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
744 #define FLD(f) abuf->fields.sfmt_add.f
745 int UNUSED written
= 0;
746 IADDR UNUSED pc
= abuf
->addr
;
747 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
751 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
752 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
755 * FLD (i_dr
) = opval
;
756 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
760 CPU (h_cond
) = opval
;
761 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
769 CASE (sem
, INSN_BC8
) : /* bc.s $disp8 */
771 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
772 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
773 #define FLD(f) abuf->fields.sfmt_bl8.f
774 int UNUSED written
= 0;
775 IADDR UNUSED pc
= abuf
->addr
;
777 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
781 USI opval
= FLD (i_disp8
);
782 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
784 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
788 abuf
->written
= written
;
789 SEM_BRANCH_FINI (vpc
);
794 CASE (sem
, INSN_BC24
) : /* bc.l $disp24 */
796 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
797 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
798 #define FLD(f) abuf->fields.sfmt_bl24.f
799 int UNUSED written
= 0;
800 IADDR UNUSED pc
= abuf
->addr
;
802 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
806 USI opval
= FLD (i_disp24
);
807 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
809 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
813 abuf
->written
= written
;
814 SEM_BRANCH_FINI (vpc
);
819 CASE (sem
, INSN_BEQ
) : /* beq $src1,$src2,$disp16 */
821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
823 #define FLD(f) abuf->fields.sfmt_beq.f
824 int UNUSED written
= 0;
825 IADDR UNUSED pc
= abuf
->addr
;
827 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
829 if (EQSI (* FLD (i_src1
), * FLD (i_src2
))) {
831 USI opval
= FLD (i_disp16
);
832 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
834 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
838 abuf
->written
= written
;
839 SEM_BRANCH_FINI (vpc
);
844 CASE (sem
, INSN_BEQZ
) : /* beqz $src2,$disp16 */
846 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
847 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
848 #define FLD(f) abuf->fields.sfmt_beq.f
849 int UNUSED written
= 0;
850 IADDR UNUSED pc
= abuf
->addr
;
852 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
854 if (EQSI (* FLD (i_src2
), 0)) {
856 USI opval
= FLD (i_disp16
);
857 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
859 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
863 abuf
->written
= written
;
864 SEM_BRANCH_FINI (vpc
);
869 CASE (sem
, INSN_BGEZ
) : /* bgez $src2,$disp16 */
871 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
872 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
873 #define FLD(f) abuf->fields.sfmt_beq.f
874 int UNUSED written
= 0;
875 IADDR UNUSED pc
= abuf
->addr
;
877 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
879 if (GESI (* FLD (i_src2
), 0)) {
881 USI opval
= FLD (i_disp16
);
882 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
884 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
888 abuf
->written
= written
;
889 SEM_BRANCH_FINI (vpc
);
894 CASE (sem
, INSN_BGTZ
) : /* bgtz $src2,$disp16 */
896 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
898 #define FLD(f) abuf->fields.sfmt_beq.f
899 int UNUSED written
= 0;
900 IADDR UNUSED pc
= abuf
->addr
;
902 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
904 if (GTSI (* FLD (i_src2
), 0)) {
906 USI opval
= FLD (i_disp16
);
907 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
909 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
913 abuf
->written
= written
;
914 SEM_BRANCH_FINI (vpc
);
919 CASE (sem
, INSN_BLEZ
) : /* blez $src2,$disp16 */
921 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
922 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
923 #define FLD(f) abuf->fields.sfmt_beq.f
924 int UNUSED written
= 0;
925 IADDR UNUSED pc
= abuf
->addr
;
927 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
929 if (LESI (* FLD (i_src2
), 0)) {
931 USI opval
= FLD (i_disp16
);
932 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
934 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
938 abuf
->written
= written
;
939 SEM_BRANCH_FINI (vpc
);
944 CASE (sem
, INSN_BLTZ
) : /* bltz $src2,$disp16 */
946 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
947 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
948 #define FLD(f) abuf->fields.sfmt_beq.f
949 int UNUSED written
= 0;
950 IADDR UNUSED pc
= abuf
->addr
;
952 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
954 if (LTSI (* FLD (i_src2
), 0)) {
956 USI opval
= FLD (i_disp16
);
957 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
959 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
963 abuf
->written
= written
;
964 SEM_BRANCH_FINI (vpc
);
969 CASE (sem
, INSN_BNEZ
) : /* bnez $src2,$disp16 */
971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
972 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
973 #define FLD(f) abuf->fields.sfmt_beq.f
974 int UNUSED written
= 0;
975 IADDR UNUSED pc
= abuf
->addr
;
977 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
979 if (NESI (* FLD (i_src2
), 0)) {
981 USI opval
= FLD (i_disp16
);
982 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
984 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
988 abuf
->written
= written
;
989 SEM_BRANCH_FINI (vpc
);
994 CASE (sem
, INSN_BL8
) : /* bl.s $disp8 */
996 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
997 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
998 #define FLD(f) abuf->fields.sfmt_bl8.f
999 int UNUSED written
= 0;
1000 IADDR UNUSED pc
= abuf
->addr
;
1002 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1006 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
1007 CPU (h_gr
[((UINT
) 14)]) = opval
;
1008 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1011 USI opval
= FLD (i_disp8
);
1012 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1013 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1017 SEM_BRANCH_FINI (vpc
);
1022 CASE (sem
, INSN_BL24
) : /* bl.l $disp24 */
1024 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1025 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1026 #define FLD(f) abuf->fields.sfmt_bl24.f
1027 int UNUSED written
= 0;
1028 IADDR UNUSED pc
= abuf
->addr
;
1030 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1034 SI opval
= ADDSI (pc
, 4);
1035 CPU (h_gr
[((UINT
) 14)]) = opval
;
1036 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1039 USI opval
= FLD (i_disp24
);
1040 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1041 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1045 SEM_BRANCH_FINI (vpc
);
1050 CASE (sem
, INSN_BCL8
) : /* bcl.s $disp8 */
1052 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1053 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1054 #define FLD(f) abuf->fields.sfmt_bl8.f
1055 int UNUSED written
= 0;
1056 IADDR UNUSED pc
= abuf
->addr
;
1058 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1063 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
1064 CPU (h_gr
[((UINT
) 14)]) = opval
;
1065 written
|= (1 << 3);
1066 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1069 USI opval
= FLD (i_disp8
);
1070 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1071 written
|= (1 << 4);
1072 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1077 abuf
->written
= written
;
1078 SEM_BRANCH_FINI (vpc
);
1083 CASE (sem
, INSN_BCL24
) : /* bcl.l $disp24 */
1085 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1086 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1087 #define FLD(f) abuf->fields.sfmt_bl24.f
1088 int UNUSED written
= 0;
1089 IADDR UNUSED pc
= abuf
->addr
;
1091 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1096 SI opval
= ADDSI (pc
, 4);
1097 CPU (h_gr
[((UINT
) 14)]) = opval
;
1098 written
|= (1 << 3);
1099 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1102 USI opval
= FLD (i_disp24
);
1103 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1104 written
|= (1 << 4);
1105 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1110 abuf
->written
= written
;
1111 SEM_BRANCH_FINI (vpc
);
1116 CASE (sem
, INSN_BNC8
) : /* bnc.s $disp8 */
1118 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1119 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1120 #define FLD(f) abuf->fields.sfmt_bl8.f
1121 int UNUSED written
= 0;
1122 IADDR UNUSED pc
= abuf
->addr
;
1124 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1126 if (NOTBI (CPU (h_cond
))) {
1128 USI opval
= FLD (i_disp8
);
1129 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1130 written
|= (1 << 2);
1131 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1135 abuf
->written
= written
;
1136 SEM_BRANCH_FINI (vpc
);
1141 CASE (sem
, INSN_BNC24
) : /* bnc.l $disp24 */
1143 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1144 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1145 #define FLD(f) abuf->fields.sfmt_bl24.f
1146 int UNUSED written
= 0;
1147 IADDR UNUSED pc
= abuf
->addr
;
1149 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1151 if (NOTBI (CPU (h_cond
))) {
1153 USI opval
= FLD (i_disp24
);
1154 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1155 written
|= (1 << 2);
1156 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1160 abuf
->written
= written
;
1161 SEM_BRANCH_FINI (vpc
);
1166 CASE (sem
, INSN_BNE
) : /* bne $src1,$src2,$disp16 */
1168 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1169 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1170 #define FLD(f) abuf->fields.sfmt_beq.f
1171 int UNUSED written
= 0;
1172 IADDR UNUSED pc
= abuf
->addr
;
1174 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1176 if (NESI (* FLD (i_src1
), * FLD (i_src2
))) {
1178 USI opval
= FLD (i_disp16
);
1179 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1180 written
|= (1 << 3);
1181 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1185 abuf
->written
= written
;
1186 SEM_BRANCH_FINI (vpc
);
1191 CASE (sem
, INSN_BRA8
) : /* bra.s $disp8 */
1193 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1194 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1195 #define FLD(f) abuf->fields.sfmt_bl8.f
1196 int UNUSED written
= 0;
1197 IADDR UNUSED pc
= abuf
->addr
;
1199 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1202 USI opval
= FLD (i_disp8
);
1203 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1204 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1207 SEM_BRANCH_FINI (vpc
);
1212 CASE (sem
, INSN_BRA24
) : /* bra.l $disp24 */
1214 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1215 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1216 #define FLD(f) abuf->fields.sfmt_bl24.f
1217 int UNUSED written
= 0;
1218 IADDR UNUSED pc
= abuf
->addr
;
1220 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1223 USI opval
= FLD (i_disp24
);
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_BNCL8
) : /* bncl.s $disp8 */
1235 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1236 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1237 #define FLD(f) abuf->fields.sfmt_bl8.f
1238 int UNUSED written
= 0;
1239 IADDR UNUSED pc
= abuf
->addr
;
1241 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1243 if (NOTBI (CPU (h_cond
))) {
1246 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
1247 CPU (h_gr
[((UINT
) 14)]) = opval
;
1248 written
|= (1 << 3);
1249 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1252 USI opval
= FLD (i_disp8
);
1253 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1254 written
|= (1 << 4);
1255 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1260 abuf
->written
= written
;
1261 SEM_BRANCH_FINI (vpc
);
1266 CASE (sem
, INSN_BNCL24
) : /* bncl.l $disp24 */
1268 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1269 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1270 #define FLD(f) abuf->fields.sfmt_bl24.f
1271 int UNUSED written
= 0;
1272 IADDR UNUSED pc
= abuf
->addr
;
1274 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1276 if (NOTBI (CPU (h_cond
))) {
1279 SI opval
= ADDSI (pc
, 4);
1280 CPU (h_gr
[((UINT
) 14)]) = opval
;
1281 written
|= (1 << 3);
1282 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1285 USI opval
= FLD (i_disp24
);
1286 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1287 written
|= (1 << 4);
1288 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1293 abuf
->written
= written
;
1294 SEM_BRANCH_FINI (vpc
);
1299 CASE (sem
, INSN_CMP
) : /* cmp $src1,$src2 */
1301 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1302 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1303 #define FLD(f) abuf->fields.sfmt_st_plus.f
1304 int UNUSED written
= 0;
1305 IADDR UNUSED pc
= abuf
->addr
;
1306 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1309 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
1310 CPU (h_cond
) = opval
;
1311 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
1318 CASE (sem
, INSN_CMPI
) : /* cmpi $src2,$simm16 */
1320 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1321 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1322 #define FLD(f) abuf->fields.sfmt_st_d.f
1323 int UNUSED written
= 0;
1324 IADDR UNUSED pc
= abuf
->addr
;
1325 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1328 BI opval
= LTSI (* FLD (i_src2
), FLD (f_simm16
));
1329 CPU (h_cond
) = opval
;
1330 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
1337 CASE (sem
, INSN_CMPU
) : /* cmpu $src1,$src2 */
1339 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1340 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1341 #define FLD(f) abuf->fields.sfmt_st_plus.f
1342 int UNUSED written
= 0;
1343 IADDR UNUSED pc
= abuf
->addr
;
1344 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1347 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
1348 CPU (h_cond
) = opval
;
1349 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
1356 CASE (sem
, INSN_CMPUI
) : /* cmpui $src2,$simm16 */
1358 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1359 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1360 #define FLD(f) abuf->fields.sfmt_st_d.f
1361 int UNUSED written
= 0;
1362 IADDR UNUSED pc
= abuf
->addr
;
1363 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1366 BI opval
= LTUSI (* FLD (i_src2
), FLD (f_simm16
));
1367 CPU (h_cond
) = opval
;
1368 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
1375 CASE (sem
, INSN_CMPEQ
) : /* cmpeq $src1,$src2 */
1377 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1378 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1379 #define FLD(f) abuf->fields.sfmt_st_plus.f
1380 int UNUSED written
= 0;
1381 IADDR UNUSED pc
= abuf
->addr
;
1382 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1385 BI opval
= EQSI (* FLD (i_src1
), * FLD (i_src2
));
1386 CPU (h_cond
) = opval
;
1387 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
1394 CASE (sem
, INSN_CMPZ
) : /* cmpz $src2 */
1396 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1398 #define FLD(f) abuf->fields.sfmt_st_plus.f
1399 int UNUSED written
= 0;
1400 IADDR UNUSED pc
= abuf
->addr
;
1401 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1404 BI opval
= EQSI (* FLD (i_src2
), 0);
1405 CPU (h_cond
) = opval
;
1406 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
1413 CASE (sem
, INSN_DIV
) : /* div $dr,$sr */
1415 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1417 #define FLD(f) abuf->fields.sfmt_add.f
1418 int UNUSED written
= 0;
1419 IADDR UNUSED pc
= abuf
->addr
;
1420 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1422 if (NESI (* FLD (i_sr
), 0)) {
1424 SI opval
= DIVSI (* FLD (i_dr
), * FLD (i_sr
));
1425 * FLD (i_dr
) = opval
;
1426 written
|= (1 << 2);
1427 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1431 abuf
->written
= written
;
1436 CASE (sem
, INSN_DIVU
) : /* divu $dr,$sr */
1438 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1439 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1440 #define FLD(f) abuf->fields.sfmt_add.f
1441 int UNUSED written
= 0;
1442 IADDR UNUSED pc
= abuf
->addr
;
1443 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1445 if (NESI (* FLD (i_sr
), 0)) {
1447 SI opval
= UDIVSI (* FLD (i_dr
), * FLD (i_sr
));
1448 * FLD (i_dr
) = opval
;
1449 written
|= (1 << 2);
1450 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1454 abuf
->written
= written
;
1459 CASE (sem
, INSN_REM
) : /* rem $dr,$sr */
1461 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1462 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1463 #define FLD(f) abuf->fields.sfmt_add.f
1464 int UNUSED written
= 0;
1465 IADDR UNUSED pc
= abuf
->addr
;
1466 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1468 if (NESI (* FLD (i_sr
), 0)) {
1470 SI opval
= MODSI (* FLD (i_dr
), * FLD (i_sr
));
1471 * FLD (i_dr
) = opval
;
1472 written
|= (1 << 2);
1473 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1477 abuf
->written
= written
;
1482 CASE (sem
, INSN_REMU
) : /* remu $dr,$sr */
1484 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1485 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1486 #define FLD(f) abuf->fields.sfmt_add.f
1487 int UNUSED written
= 0;
1488 IADDR UNUSED pc
= abuf
->addr
;
1489 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1491 if (NESI (* FLD (i_sr
), 0)) {
1493 SI opval
= UMODSI (* FLD (i_dr
), * FLD (i_sr
));
1494 * FLD (i_dr
) = opval
;
1495 written
|= (1 << 2);
1496 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1500 abuf
->written
= written
;
1505 CASE (sem
, INSN_DIVH
) : /* divh $dr,$sr */
1507 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1508 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1509 #define FLD(f) abuf->fields.sfmt_add.f
1510 int UNUSED written
= 0;
1511 IADDR UNUSED pc
= abuf
->addr
;
1512 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1514 if (NESI (* FLD (i_sr
), 0)) {
1516 SI opval
= DIVSI (EXTHISI (TRUNCSIHI (* FLD (i_dr
))), * FLD (i_sr
));
1517 * FLD (i_dr
) = opval
;
1518 written
|= (1 << 2);
1519 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1523 abuf
->written
= written
;
1528 CASE (sem
, INSN_JC
) : /* jc $sr */
1530 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1531 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1532 #define FLD(f) abuf->fields.sfmt_jl.f
1533 int UNUSED written
= 0;
1534 IADDR UNUSED pc
= abuf
->addr
;
1536 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1540 USI opval
= ANDSI (* FLD (i_sr
), -4);
1541 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1542 written
|= (1 << 2);
1543 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1547 abuf
->written
= written
;
1548 SEM_BRANCH_FINI (vpc
);
1553 CASE (sem
, INSN_JNC
) : /* jnc $sr */
1555 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1556 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1557 #define FLD(f) abuf->fields.sfmt_jl.f
1558 int UNUSED written
= 0;
1559 IADDR UNUSED pc
= abuf
->addr
;
1561 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1563 if (NOTBI (CPU (h_cond
))) {
1565 USI opval
= ANDSI (* FLD (i_sr
), -4);
1566 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1567 written
|= (1 << 2);
1568 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1572 abuf
->written
= written
;
1573 SEM_BRANCH_FINI (vpc
);
1578 CASE (sem
, INSN_JL
) : /* jl $sr */
1580 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1581 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1582 #define FLD(f) abuf->fields.sfmt_jl.f
1583 int UNUSED written
= 0;
1584 IADDR UNUSED pc
= abuf
->addr
;
1586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1590 temp0
= ADDSI (ANDSI (pc
, -4), 4);
1591 temp1
= ANDSI (* FLD (i_sr
), -4);
1594 CPU (h_gr
[((UINT
) 14)]) = opval
;
1595 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1599 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1600 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1604 SEM_BRANCH_FINI (vpc
);
1609 CASE (sem
, INSN_JMP
) : /* jmp $sr */
1611 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1612 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1613 #define FLD(f) abuf->fields.sfmt_jl.f
1614 int UNUSED written
= 0;
1615 IADDR UNUSED pc
= abuf
->addr
;
1617 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1620 USI opval
= ANDSI (* FLD (i_sr
), -4);
1621 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1622 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1625 SEM_BRANCH_FINI (vpc
);
1630 CASE (sem
, INSN_LD
) : /* ld $dr,@$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_ld_plus.f
1635 int UNUSED written
= 0;
1636 IADDR UNUSED pc
= abuf
->addr
;
1637 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1640 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1641 * FLD (i_dr
) = opval
;
1642 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1649 CASE (sem
, INSN_LD_D
) : /* ld $dr,@($slo16,$sr) */
1651 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1652 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1653 #define FLD(f) abuf->fields.sfmt_add3.f
1654 int UNUSED written
= 0;
1655 IADDR UNUSED pc
= abuf
->addr
;
1656 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1659 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)));
1660 * FLD (i_dr
) = opval
;
1661 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1668 CASE (sem
, INSN_LDB
) : /* ldb $dr,@$sr */
1670 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1671 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1672 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1673 int UNUSED written
= 0;
1674 IADDR UNUSED pc
= abuf
->addr
;
1675 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1678 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1679 * FLD (i_dr
) = opval
;
1680 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1687 CASE (sem
, INSN_LDB_D
) : /* ldb $dr,@($slo16,$sr) */
1689 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1690 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1691 #define FLD(f) abuf->fields.sfmt_add3.f
1692 int UNUSED written
= 0;
1693 IADDR UNUSED pc
= abuf
->addr
;
1694 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1697 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1698 * FLD (i_dr
) = opval
;
1699 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1706 CASE (sem
, INSN_LDH
) : /* ldh $dr,@$sr */
1708 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1709 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1710 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1711 int UNUSED written
= 0;
1712 IADDR UNUSED pc
= abuf
->addr
;
1713 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1716 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1717 * FLD (i_dr
) = opval
;
1718 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1725 CASE (sem
, INSN_LDH_D
) : /* ldh $dr,@($slo16,$sr) */
1727 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1728 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1729 #define FLD(f) abuf->fields.sfmt_add3.f
1730 int UNUSED written
= 0;
1731 IADDR UNUSED pc
= abuf
->addr
;
1732 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1735 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1736 * FLD (i_dr
) = opval
;
1737 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1744 CASE (sem
, INSN_LDUB
) : /* ldub $dr,@$sr */
1746 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1747 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1748 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1749 int UNUSED written
= 0;
1750 IADDR UNUSED pc
= abuf
->addr
;
1751 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1754 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1755 * FLD (i_dr
) = opval
;
1756 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1763 CASE (sem
, INSN_LDUB_D
) : /* ldub $dr,@($slo16,$sr) */
1765 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1766 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1767 #define FLD(f) abuf->fields.sfmt_add3.f
1768 int UNUSED written
= 0;
1769 IADDR UNUSED pc
= abuf
->addr
;
1770 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1773 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1774 * FLD (i_dr
) = opval
;
1775 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1782 CASE (sem
, INSN_LDUH
) : /* lduh $dr,@$sr */
1784 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1785 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1786 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1787 int UNUSED written
= 0;
1788 IADDR UNUSED pc
= abuf
->addr
;
1789 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1792 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1793 * FLD (i_dr
) = opval
;
1794 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1801 CASE (sem
, INSN_LDUH_D
) : /* lduh $dr,@($slo16,$sr) */
1803 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1804 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1805 #define FLD(f) abuf->fields.sfmt_add3.f
1806 int UNUSED written
= 0;
1807 IADDR UNUSED pc
= abuf
->addr
;
1808 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1811 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1812 * FLD (i_dr
) = opval
;
1813 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1820 CASE (sem
, INSN_LD_PLUS
) : /* ld $dr,@$sr+ */
1822 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1823 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1824 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1825 int UNUSED written
= 0;
1826 IADDR UNUSED pc
= abuf
->addr
;
1827 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1831 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1832 temp1
= ADDSI (* FLD (i_sr
), 4);
1835 * FLD (i_dr
) = opval
;
1836 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1840 * FLD (i_sr
) = opval
;
1841 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
1849 CASE (sem
, INSN_LD24
) : /* ld24 $dr,$uimm24 */
1851 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1852 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1853 #define FLD(f) abuf->fields.sfmt_ld24.f
1854 int UNUSED written
= 0;
1855 IADDR UNUSED pc
= abuf
->addr
;
1856 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1859 SI opval
= FLD (i_uimm24
);
1860 * FLD (i_dr
) = opval
;
1861 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1868 CASE (sem
, INSN_LDI8
) : /* ldi8 $dr,$simm8 */
1870 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1871 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1872 #define FLD(f) abuf->fields.sfmt_addi.f
1873 int UNUSED written
= 0;
1874 IADDR UNUSED pc
= abuf
->addr
;
1875 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1878 SI opval
= FLD (f_simm8
);
1879 * FLD (i_dr
) = opval
;
1880 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1887 CASE (sem
, INSN_LDI16
) : /* ldi16 $dr,$hash$slo16 */
1889 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1890 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1891 #define FLD(f) abuf->fields.sfmt_add3.f
1892 int UNUSED written
= 0;
1893 IADDR UNUSED pc
= abuf
->addr
;
1894 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1897 SI opval
= FLD (f_simm16
);
1898 * FLD (i_dr
) = opval
;
1899 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1906 CASE (sem
, INSN_LOCK
) : /* lock $dr,@$sr */
1908 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1909 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1910 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1911 int UNUSED written
= 0;
1912 IADDR UNUSED pc
= abuf
->addr
;
1913 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1918 CPU (h_lock
) = opval
;
1919 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
1922 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1923 * FLD (i_dr
) = opval
;
1924 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1932 CASE (sem
, INSN_MACHI_A
) : /* machi $src1,$src2,$acc */
1934 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1936 #define FLD(f) abuf->fields.sfmt_machi_a.f
1937 int UNUSED written
= 0;
1938 IADDR UNUSED pc
= abuf
->addr
;
1939 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1942 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);
1943 SET_H_ACCUMS (FLD (f_acc
), opval
);
1944 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
1951 CASE (sem
, INSN_MACLO_A
) : /* maclo $src1,$src2,$acc */
1953 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1954 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1955 #define FLD(f) abuf->fields.sfmt_machi_a.f
1956 int UNUSED written
= 0;
1957 IADDR UNUSED pc
= abuf
->addr
;
1958 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1961 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);
1962 SET_H_ACCUMS (FLD (f_acc
), opval
);
1963 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
1970 CASE (sem
, INSN_MACWHI_A
) : /* macwhi $src1,$src2,$acc */
1972 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1973 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1974 #define FLD(f) abuf->fields.sfmt_machi_a.f
1975 int UNUSED written
= 0;
1976 IADDR UNUSED pc
= abuf
->addr
;
1977 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1980 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))));
1981 SET_H_ACCUMS (FLD (f_acc
), opval
);
1982 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
1989 CASE (sem
, INSN_MACWLO_A
) : /* macwlo $src1,$src2,$acc */
1991 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1992 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1993 #define FLD(f) abuf->fields.sfmt_machi_a.f
1994 int UNUSED written
= 0;
1995 IADDR UNUSED pc
= abuf
->addr
;
1996 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1999 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))));
2000 SET_H_ACCUMS (FLD (f_acc
), opval
);
2001 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
2008 CASE (sem
, INSN_MUL
) : /* mul $dr,$sr */
2010 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2011 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2012 #define FLD(f) abuf->fields.sfmt_add.f
2013 int UNUSED written
= 0;
2014 IADDR UNUSED pc
= abuf
->addr
;
2015 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2018 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
2019 * FLD (i_dr
) = opval
;
2020 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2027 CASE (sem
, INSN_MULHI_A
) : /* mulhi $src1,$src2,$acc */
2029 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2031 #define FLD(f) abuf->fields.sfmt_machi_a.f
2032 int UNUSED written
= 0;
2033 IADDR UNUSED pc
= abuf
->addr
;
2034 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2037 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
2038 SET_H_ACCUMS (FLD (f_acc
), opval
);
2039 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
2046 CASE (sem
, INSN_MULLO_A
) : /* mullo $src1,$src2,$acc */
2048 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2049 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2050 #define FLD(f) abuf->fields.sfmt_machi_a.f
2051 int UNUSED written
= 0;
2052 IADDR UNUSED pc
= abuf
->addr
;
2053 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2056 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
2057 SET_H_ACCUMS (FLD (f_acc
), opval
);
2058 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
2065 CASE (sem
, INSN_MULWHI_A
) : /* mulwhi $src1,$src2,$acc */
2067 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2068 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2069 #define FLD(f) abuf->fields.sfmt_machi_a.f
2070 int UNUSED written
= 0;
2071 IADDR UNUSED pc
= abuf
->addr
;
2072 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2075 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))));
2076 SET_H_ACCUMS (FLD (f_acc
), opval
);
2077 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
2084 CASE (sem
, INSN_MULWLO_A
) : /* mulwlo $src1,$src2,$acc */
2086 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2087 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2088 #define FLD(f) abuf->fields.sfmt_machi_a.f
2089 int UNUSED written
= 0;
2090 IADDR UNUSED pc
= abuf
->addr
;
2091 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2094 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))));
2095 SET_H_ACCUMS (FLD (f_acc
), opval
);
2096 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
2103 CASE (sem
, INSN_MV
) : /* mv $dr,$sr */
2105 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2106 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2107 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2108 int UNUSED written
= 0;
2109 IADDR UNUSED pc
= abuf
->addr
;
2110 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2113 SI opval
= * FLD (i_sr
);
2114 * FLD (i_dr
) = opval
;
2115 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2122 CASE (sem
, INSN_MVFACHI_A
) : /* mvfachi $dr,$accs */
2124 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2126 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2127 int UNUSED written
= 0;
2128 IADDR UNUSED pc
= abuf
->addr
;
2129 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2132 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 32));
2133 * FLD (i_dr
) = opval
;
2134 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2141 CASE (sem
, INSN_MVFACLO_A
) : /* mvfaclo $dr,$accs */
2143 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2144 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2145 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2146 int UNUSED written
= 0;
2147 IADDR UNUSED pc
= abuf
->addr
;
2148 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2151 SI opval
= TRUNCDISI (GET_H_ACCUMS (FLD (f_accs
)));
2152 * FLD (i_dr
) = opval
;
2153 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2160 CASE (sem
, INSN_MVFACMI_A
) : /* mvfacmi $dr,$accs */
2162 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2163 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2164 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
2165 int UNUSED written
= 0;
2166 IADDR UNUSED pc
= abuf
->addr
;
2167 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2170 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 16));
2171 * FLD (i_dr
) = opval
;
2172 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2179 CASE (sem
, INSN_MVFC
) : /* mvfc $dr,$scr */
2181 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2182 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2183 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2184 int UNUSED written
= 0;
2185 IADDR UNUSED pc
= abuf
->addr
;
2186 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2189 SI opval
= GET_H_CR (FLD (f_r2
));
2190 * FLD (i_dr
) = opval
;
2191 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2198 CASE (sem
, INSN_MVTACHI_A
) : /* mvtachi $src1,$accs */
2200 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2201 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2202 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
2203 int UNUSED written
= 0;
2204 IADDR UNUSED pc
= abuf
->addr
;
2205 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2208 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
2209 SET_H_ACCUMS (FLD (f_accs
), opval
);
2210 TRACE_RESULT (current_cpu
, abuf
, "accs", 'D', opval
);
2217 CASE (sem
, INSN_MVTACLO_A
) : /* mvtaclo $src1,$accs */
2219 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2220 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2221 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
2222 int UNUSED written
= 0;
2223 IADDR UNUSED pc
= abuf
->addr
;
2224 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2227 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
2228 SET_H_ACCUMS (FLD (f_accs
), opval
);
2229 TRACE_RESULT (current_cpu
, abuf
, "accs", 'D', opval
);
2236 CASE (sem
, INSN_MVTC
) : /* mvtc $sr,$dcr */
2238 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2239 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2240 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2241 int UNUSED written
= 0;
2242 IADDR UNUSED pc
= abuf
->addr
;
2243 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2246 USI opval
= * FLD (i_sr
);
2247 SET_H_CR (FLD (f_r1
), opval
);
2248 TRACE_RESULT (current_cpu
, abuf
, "dcr", 'x', opval
);
2255 CASE (sem
, INSN_NEG
) : /* neg $dr,$sr */
2257 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2258 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2259 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2260 int UNUSED written
= 0;
2261 IADDR UNUSED pc
= abuf
->addr
;
2262 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2265 SI opval
= NEGSI (* FLD (i_sr
));
2266 * FLD (i_dr
) = opval
;
2267 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2274 CASE (sem
, INSN_NOP
) : /* nop */
2276 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2277 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2278 #define FLD(f) abuf->fields.fmt_empty.f
2279 int UNUSED written
= 0;
2280 IADDR UNUSED pc
= abuf
->addr
;
2281 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2283 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
2289 CASE (sem
, INSN_NOT
) : /* not $dr,$sr */
2291 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2292 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2293 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2294 int UNUSED written
= 0;
2295 IADDR UNUSED pc
= abuf
->addr
;
2296 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2299 SI opval
= INVSI (* FLD (i_sr
));
2300 * FLD (i_dr
) = opval
;
2301 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2308 CASE (sem
, INSN_RAC_DSI
) : /* rac $accd,$accs,$imm1 */
2310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2312 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2313 int UNUSED written
= 0;
2314 IADDR UNUSED pc
= abuf
->addr
;
2315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2319 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
2320 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
2322 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)));
2323 SET_H_ACCUMS (FLD (f_accd
), opval
);
2324 TRACE_RESULT (current_cpu
, abuf
, "accd", 'D', opval
);
2332 CASE (sem
, INSN_RACH_DSI
) : /* rach $accd,$accs,$imm1 */
2334 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2335 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2336 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
2337 int UNUSED written
= 0;
2338 IADDR UNUSED pc
= abuf
->addr
;
2339 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2343 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
2344 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 0x80000000));
2346 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)));
2347 SET_H_ACCUMS (FLD (f_accd
), opval
);
2348 TRACE_RESULT (current_cpu
, abuf
, "accd", 'D', opval
);
2356 CASE (sem
, INSN_RTE
) : /* rte */
2358 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2359 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2360 #define FLD(f) abuf->fields.fmt_empty.f
2361 int UNUSED written
= 0;
2362 IADDR UNUSED pc
= abuf
->addr
;
2364 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2368 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
2369 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2370 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2373 USI opval
= GET_H_CR (((UINT
) 14));
2374 SET_H_CR (((UINT
) 6), opval
);
2375 TRACE_RESULT (current_cpu
, abuf
, "cr-6", 'x', opval
);
2378 UQI opval
= CPU (h_bpsw
);
2380 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2383 UQI opval
= CPU (h_bbpsw
);
2384 CPU (h_bpsw
) = opval
;
2385 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2389 SEM_BRANCH_FINI (vpc
);
2394 CASE (sem
, INSN_SETH
) : /* seth $dr,$hash$hi16 */
2396 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2398 #define FLD(f) abuf->fields.sfmt_seth.f
2399 int UNUSED written
= 0;
2400 IADDR UNUSED pc
= abuf
->addr
;
2401 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2404 SI opval
= SLLSI (FLD (f_hi16
), 16);
2405 * FLD (i_dr
) = opval
;
2406 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2413 CASE (sem
, INSN_SLL
) : /* sll $dr,$sr */
2415 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2417 #define FLD(f) abuf->fields.sfmt_add.f
2418 int UNUSED written
= 0;
2419 IADDR UNUSED pc
= abuf
->addr
;
2420 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2423 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2424 * FLD (i_dr
) = opval
;
2425 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2432 CASE (sem
, INSN_SLL3
) : /* sll3 $dr,$sr,$simm16 */
2434 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2435 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2436 #define FLD(f) abuf->fields.sfmt_add3.f
2437 int UNUSED written
= 0;
2438 IADDR UNUSED pc
= abuf
->addr
;
2439 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2442 SI opval
= SLLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2443 * FLD (i_dr
) = opval
;
2444 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2451 CASE (sem
, INSN_SLLI
) : /* slli $dr,$uimm5 */
2453 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2454 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2455 #define FLD(f) abuf->fields.sfmt_slli.f
2456 int UNUSED written
= 0;
2457 IADDR UNUSED pc
= abuf
->addr
;
2458 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2461 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
2462 * FLD (i_dr
) = opval
;
2463 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2470 CASE (sem
, INSN_SRA
) : /* sra $dr,$sr */
2472 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2473 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2474 #define FLD(f) abuf->fields.sfmt_add.f
2475 int UNUSED written
= 0;
2476 IADDR UNUSED pc
= abuf
->addr
;
2477 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2480 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2481 * FLD (i_dr
) = opval
;
2482 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2489 CASE (sem
, INSN_SRA3
) : /* sra3 $dr,$sr,$simm16 */
2491 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2492 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2493 #define FLD(f) abuf->fields.sfmt_add3.f
2494 int UNUSED written
= 0;
2495 IADDR UNUSED pc
= abuf
->addr
;
2496 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2499 SI opval
= SRASI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2500 * FLD (i_dr
) = opval
;
2501 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2508 CASE (sem
, INSN_SRAI
) : /* srai $dr,$uimm5 */
2510 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2511 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2512 #define FLD(f) abuf->fields.sfmt_slli.f
2513 int UNUSED written
= 0;
2514 IADDR UNUSED pc
= abuf
->addr
;
2515 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2518 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
2519 * FLD (i_dr
) = opval
;
2520 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2527 CASE (sem
, INSN_SRL
) : /* srl $dr,$sr */
2529 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2530 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2531 #define FLD(f) abuf->fields.sfmt_add.f
2532 int UNUSED written
= 0;
2533 IADDR UNUSED pc
= abuf
->addr
;
2534 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2537 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2538 * FLD (i_dr
) = opval
;
2539 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2546 CASE (sem
, INSN_SRL3
) : /* srl3 $dr,$sr,$simm16 */
2548 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2549 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2550 #define FLD(f) abuf->fields.sfmt_add3.f
2551 int UNUSED written
= 0;
2552 IADDR UNUSED pc
= abuf
->addr
;
2553 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2556 SI opval
= SRLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2557 * FLD (i_dr
) = opval
;
2558 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2565 CASE (sem
, INSN_SRLI
) : /* srli $dr,$uimm5 */
2567 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2568 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2569 #define FLD(f) abuf->fields.sfmt_slli.f
2570 int UNUSED written
= 0;
2571 IADDR UNUSED pc
= abuf
->addr
;
2572 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2575 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
2576 * FLD (i_dr
) = opval
;
2577 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2584 CASE (sem
, INSN_ST
) : /* st $src1,@$src2 */
2586 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2587 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2588 #define FLD(f) abuf->fields.sfmt_st_plus.f
2589 int UNUSED written
= 0;
2590 IADDR UNUSED pc
= abuf
->addr
;
2591 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2594 SI opval
= * FLD (i_src1
);
2595 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2596 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2603 CASE (sem
, INSN_ST_D
) : /* st $src1,@($slo16,$src2) */
2605 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2606 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2607 #define FLD(f) abuf->fields.sfmt_st_d.f
2608 int UNUSED written
= 0;
2609 IADDR UNUSED pc
= abuf
->addr
;
2610 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2613 SI opval
= * FLD (i_src1
);
2614 SETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2615 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2622 CASE (sem
, INSN_STB
) : /* stb $src1,@$src2 */
2624 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2625 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2626 #define FLD(f) abuf->fields.sfmt_st_plus.f
2627 int UNUSED written
= 0;
2628 IADDR UNUSED pc
= abuf
->addr
;
2629 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2632 QI opval
= * FLD (i_src1
);
2633 SETMEMQI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2634 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2641 CASE (sem
, INSN_STB_D
) : /* stb $src1,@($slo16,$src2) */
2643 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2644 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2645 #define FLD(f) abuf->fields.sfmt_st_d.f
2646 int UNUSED written
= 0;
2647 IADDR UNUSED pc
= abuf
->addr
;
2648 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2651 QI opval
= * FLD (i_src1
);
2652 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2653 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2660 CASE (sem
, INSN_STH
) : /* sth $src1,@$src2 */
2662 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2663 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2664 #define FLD(f) abuf->fields.sfmt_st_plus.f
2665 int UNUSED written
= 0;
2666 IADDR UNUSED pc
= abuf
->addr
;
2667 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2670 HI opval
= * FLD (i_src1
);
2671 SETMEMHI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2672 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2679 CASE (sem
, INSN_STH_D
) : /* sth $src1,@($slo16,$src2) */
2681 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2682 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2683 #define FLD(f) abuf->fields.sfmt_st_d.f
2684 int UNUSED written
= 0;
2685 IADDR UNUSED pc
= abuf
->addr
;
2686 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2689 HI opval
= * FLD (i_src1
);
2690 SETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2691 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2698 CASE (sem
, INSN_ST_PLUS
) : /* st $src1,@+$src2 */
2700 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2701 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2702 #define FLD(f) abuf->fields.sfmt_st_plus.f
2703 int UNUSED written
= 0;
2704 IADDR UNUSED pc
= abuf
->addr
;
2705 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2709 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
2711 SI opval
= * FLD (i_src1
);
2712 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2713 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2716 SI opval
= tmp_new_src2
;
2717 * FLD (i_src2
) = opval
;
2718 TRACE_RESULT (current_cpu
, abuf
, "src2", 'x', opval
);
2726 CASE (sem
, INSN_ST_MINUS
) : /* st $src1,@-$src2 */
2728 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2730 #define FLD(f) abuf->fields.sfmt_st_plus.f
2731 int UNUSED written
= 0;
2732 IADDR UNUSED pc
= abuf
->addr
;
2733 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2737 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
2739 SI opval
= * FLD (i_src1
);
2740 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2741 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2744 SI opval
= tmp_new_src2
;
2745 * FLD (i_src2
) = opval
;
2746 TRACE_RESULT (current_cpu
, abuf
, "src2", 'x', opval
);
2754 CASE (sem
, INSN_SUB
) : /* sub $dr,$sr */
2756 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2757 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2758 #define FLD(f) abuf->fields.sfmt_add.f
2759 int UNUSED written
= 0;
2760 IADDR UNUSED pc
= abuf
->addr
;
2761 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2764 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2765 * FLD (i_dr
) = opval
;
2766 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2773 CASE (sem
, INSN_SUBV
) : /* subv $dr,$sr */
2775 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2776 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2777 #define FLD(f) abuf->fields.sfmt_add.f
2778 int UNUSED written
= 0;
2779 IADDR UNUSED pc
= abuf
->addr
;
2780 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2784 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2785 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
2788 * FLD (i_dr
) = opval
;
2789 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2793 CPU (h_cond
) = opval
;
2794 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
2802 CASE (sem
, INSN_SUBX
) : /* subx $dr,$sr */
2804 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2805 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2806 #define FLD(f) abuf->fields.sfmt_add.f
2807 int UNUSED written
= 0;
2808 IADDR UNUSED pc
= abuf
->addr
;
2809 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2813 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2814 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2817 * FLD (i_dr
) = opval
;
2818 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2822 CPU (h_cond
) = opval
;
2823 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
2831 CASE (sem
, INSN_TRAP
) : /* trap $uimm4 */
2833 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2835 #define FLD(f) abuf->fields.sfmt_trap.f
2836 int UNUSED written
= 0;
2837 IADDR UNUSED pc
= abuf
->addr
;
2839 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2843 USI opval
= GET_H_CR (((UINT
) 6));
2844 SET_H_CR (((UINT
) 14), opval
);
2845 TRACE_RESULT (current_cpu
, abuf
, "cr-14", 'x', opval
);
2848 USI opval
= ADDSI (pc
, 4);
2849 SET_H_CR (((UINT
) 6), opval
);
2850 TRACE_RESULT (current_cpu
, abuf
, "cr-6", 'x', opval
);
2853 UQI opval
= CPU (h_bpsw
);
2854 CPU (h_bbpsw
) = opval
;
2855 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
2858 UQI opval
= GET_H_PSW ();
2859 CPU (h_bpsw
) = opval
;
2860 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2863 UQI opval
= ANDQI (GET_H_PSW (), 128);
2865 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2868 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
2869 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2870 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2874 SEM_BRANCH_FINI (vpc
);
2879 CASE (sem
, INSN_UNLOCK
) : /* unlock $src1,@$src2 */
2881 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2882 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2883 #define FLD(f) abuf->fields.sfmt_st_plus.f
2884 int UNUSED written
= 0;
2885 IADDR UNUSED pc
= abuf
->addr
;
2886 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2891 SI opval
= * FLD (i_src1
);
2892 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2893 written
|= (1 << 4);
2894 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2899 CPU (h_lock
) = opval
;
2900 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
2904 abuf
->written
= written
;
2909 CASE (sem
, INSN_SATB
) : /* satb $dr,$sr */
2911 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2912 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2913 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2914 int UNUSED written
= 0;
2915 IADDR UNUSED pc
= abuf
->addr
;
2916 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2919 SI opval
= (GESI (* FLD (i_sr
), 127)) ? (127) : (LESI (* FLD (i_sr
), -128)) ? (-128) : (* FLD (i_sr
));
2920 * FLD (i_dr
) = opval
;
2921 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2928 CASE (sem
, INSN_SATH
) : /* sath $dr,$sr */
2930 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2931 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2932 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2933 int UNUSED written
= 0;
2934 IADDR UNUSED pc
= abuf
->addr
;
2935 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2938 SI opval
= (GESI (* FLD (i_sr
), 32767)) ? (32767) : (LESI (* FLD (i_sr
), -32768)) ? (-32768) : (* FLD (i_sr
));
2939 * FLD (i_dr
) = opval
;
2940 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2947 CASE (sem
, INSN_SAT
) : /* sat $dr,$sr */
2949 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2950 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2951 #define FLD(f) abuf->fields.sfmt_ld_plus.f
2952 int UNUSED written
= 0;
2953 IADDR UNUSED pc
= abuf
->addr
;
2954 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2957 SI opval
= ((CPU (h_cond
)) ? (((LTSI (* FLD (i_sr
), 0)) ? (2147483647) : (0x80000000))) : (* FLD (i_sr
)));
2958 * FLD (i_dr
) = opval
;
2959 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2966 CASE (sem
, INSN_PCMPBZ
) : /* pcmpbz $src2 */
2968 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2969 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2970 #define FLD(f) abuf->fields.sfmt_st_plus.f
2971 int UNUSED written
= 0;
2972 IADDR UNUSED pc
= abuf
->addr
;
2973 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2976 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);
2977 CPU (h_cond
) = opval
;
2978 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
2985 CASE (sem
, INSN_SADD
) : /* sadd */
2987 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2989 #define FLD(f) abuf->fields.fmt_empty.f
2990 int UNUSED written
= 0;
2991 IADDR UNUSED pc
= abuf
->addr
;
2992 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2995 DI opval
= ADDDI (SRADI (GET_H_ACCUMS (((UINT
) 1)), 16), GET_H_ACCUMS (((UINT
) 0)));
2996 SET_H_ACCUMS (((UINT
) 0), opval
);
2997 TRACE_RESULT (current_cpu
, abuf
, "accums-0", 'D', opval
);
3004 CASE (sem
, INSN_MACWU1
) : /* macwu1 $src1,$src2 */
3006 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3007 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3008 #define FLD(f) abuf->fields.sfmt_st_plus.f
3009 int UNUSED written
= 0;
3010 IADDR UNUSED pc
= abuf
->addr
;
3011 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3014 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT
) 1)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535)))), 8), 8);
3015 SET_H_ACCUMS (((UINT
) 1), opval
);
3016 TRACE_RESULT (current_cpu
, abuf
, "accums-1", 'D', opval
);
3023 CASE (sem
, INSN_MSBLO
) : /* msblo $src1,$src2 */
3025 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3026 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3027 #define FLD(f) abuf->fields.sfmt_st_plus.f
3028 int UNUSED written
= 0;
3029 IADDR UNUSED pc
= abuf
->addr
;
3030 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3033 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);
3034 SET_H_ACCUM (opval
);
3035 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
3042 CASE (sem
, INSN_MULWU1
) : /* mulwu1 $src1,$src2 */
3044 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3045 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3046 #define FLD(f) abuf->fields.sfmt_st_plus.f
3047 int UNUSED written
= 0;
3048 IADDR UNUSED pc
= abuf
->addr
;
3049 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3052 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535))), 16), 16);
3053 SET_H_ACCUMS (((UINT
) 1), opval
);
3054 TRACE_RESULT (current_cpu
, abuf
, "accums-1", 'D', opval
);
3061 CASE (sem
, INSN_MACLH1
) : /* maclh1 $src1,$src2 */
3063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3065 #define FLD(f) abuf->fields.sfmt_st_plus.f
3066 int UNUSED written
= 0;
3067 IADDR UNUSED pc
= abuf
->addr
;
3068 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3071 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);
3072 SET_H_ACCUMS (((UINT
) 1), opval
);
3073 TRACE_RESULT (current_cpu
, abuf
, "accums-1", 'D', opval
);
3080 CASE (sem
, INSN_SC
) : /* sc */
3082 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3083 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3084 #define FLD(f) abuf->fields.fmt_empty.f
3085 int UNUSED written
= 0;
3086 IADDR UNUSED pc
= abuf
->addr
;
3087 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3089 if (ZEXTBISI (CPU (h_cond
)))
3090 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
3096 CASE (sem
, INSN_SNC
) : /* snc */
3098 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3099 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3100 #define FLD(f) abuf->fields.fmt_empty.f
3101 int UNUSED written
= 0;
3102 IADDR UNUSED pc
= abuf
->addr
;
3103 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3105 if (ZEXTBISI (NOTBI (CPU (h_cond
))))
3106 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
3112 CASE (sem
, INSN_PAR_ADD
) : /* add $dr,$sr */
3114 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3115 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3116 #define FLD(f) abuf->fields.sfmt_add.f
3117 #define OPRND(f) par_exec->operands.sfmt_add.f
3118 int UNUSED written
= 0;
3119 IADDR UNUSED pc
= abuf
->addr
;
3120 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3123 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
3125 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3133 CASE (sem
, INSN_WRITE_ADD
) : /* add $dr,$sr */
3135 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3136 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3137 #define FLD(f) abuf->fields.sfmt_add.f
3138 #define OPRND(f) par_exec->operands.sfmt_add.f
3139 int UNUSED written
= abuf
->written
;
3140 IADDR UNUSED pc
= abuf
->addr
;
3141 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3143 * FLD (i_dr
) = OPRND (dr
);
3150 CASE (sem
, INSN_PAR_AND
) : /* and $dr,$sr */
3152 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3153 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3154 #define FLD(f) abuf->fields.sfmt_add.f
3155 #define OPRND(f) par_exec->operands.sfmt_add.f
3156 int UNUSED written
= 0;
3157 IADDR UNUSED pc
= abuf
->addr
;
3158 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3161 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
3163 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3171 CASE (sem
, INSN_WRITE_AND
) : /* and $dr,$sr */
3173 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3174 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3175 #define FLD(f) abuf->fields.sfmt_add.f
3176 #define OPRND(f) par_exec->operands.sfmt_add.f
3177 int UNUSED written
= abuf
->written
;
3178 IADDR UNUSED pc
= abuf
->addr
;
3179 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3181 * FLD (i_dr
) = OPRND (dr
);
3188 CASE (sem
, INSN_PAR_OR
) : /* or $dr,$sr */
3190 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3191 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3192 #define FLD(f) abuf->fields.sfmt_add.f
3193 #define OPRND(f) par_exec->operands.sfmt_add.f
3194 int UNUSED written
= 0;
3195 IADDR UNUSED pc
= abuf
->addr
;
3196 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3199 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
3201 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3209 CASE (sem
, INSN_WRITE_OR
) : /* or $dr,$sr */
3211 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3212 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3213 #define FLD(f) abuf->fields.sfmt_add.f
3214 #define OPRND(f) par_exec->operands.sfmt_add.f
3215 int UNUSED written
= abuf
->written
;
3216 IADDR UNUSED pc
= abuf
->addr
;
3217 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3219 * FLD (i_dr
) = OPRND (dr
);
3226 CASE (sem
, INSN_PAR_XOR
) : /* xor $dr,$sr */
3228 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3229 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3230 #define FLD(f) abuf->fields.sfmt_add.f
3231 #define OPRND(f) par_exec->operands.sfmt_add.f
3232 int UNUSED written
= 0;
3233 IADDR UNUSED pc
= abuf
->addr
;
3234 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3237 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
3239 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3247 CASE (sem
, INSN_WRITE_XOR
) : /* xor $dr,$sr */
3249 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3250 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3251 #define FLD(f) abuf->fields.sfmt_add.f
3252 #define OPRND(f) par_exec->operands.sfmt_add.f
3253 int UNUSED written
= abuf
->written
;
3254 IADDR UNUSED pc
= abuf
->addr
;
3255 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3257 * FLD (i_dr
) = OPRND (dr
);
3264 CASE (sem
, INSN_PAR_ADDI
) : /* addi $dr,$simm8 */
3266 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3267 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3268 #define FLD(f) abuf->fields.sfmt_addi.f
3269 #define OPRND(f) par_exec->operands.sfmt_addi.f
3270 int UNUSED written
= 0;
3271 IADDR UNUSED pc
= abuf
->addr
;
3272 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3275 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
3277 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3285 CASE (sem
, INSN_WRITE_ADDI
) : /* addi $dr,$simm8 */
3287 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3288 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3289 #define FLD(f) abuf->fields.sfmt_addi.f
3290 #define OPRND(f) par_exec->operands.sfmt_addi.f
3291 int UNUSED written
= abuf
->written
;
3292 IADDR UNUSED pc
= abuf
->addr
;
3293 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3295 * FLD (i_dr
) = OPRND (dr
);
3302 CASE (sem
, INSN_PAR_ADDV
) : /* addv $dr,$sr */
3304 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3305 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3306 #define FLD(f) abuf->fields.sfmt_add.f
3307 #define OPRND(f) par_exec->operands.sfmt_addv.f
3308 int UNUSED written
= 0;
3309 IADDR UNUSED pc
= abuf
->addr
;
3310 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3314 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
3315 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
3319 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3323 OPRND (condbit
) = opval
;
3324 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
3333 CASE (sem
, INSN_WRITE_ADDV
) : /* addv $dr,$sr */
3335 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3336 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3337 #define FLD(f) abuf->fields.sfmt_add.f
3338 #define OPRND(f) par_exec->operands.sfmt_addv.f
3339 int UNUSED written
= abuf
->written
;
3340 IADDR UNUSED pc
= abuf
->addr
;
3341 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3343 CPU (h_cond
) = OPRND (condbit
);
3344 * FLD (i_dr
) = OPRND (dr
);
3351 CASE (sem
, INSN_PAR_ADDX
) : /* addx $dr,$sr */
3353 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3354 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3355 #define FLD(f) abuf->fields.sfmt_add.f
3356 #define OPRND(f) par_exec->operands.sfmt_addx.f
3357 int UNUSED written
= 0;
3358 IADDR UNUSED pc
= abuf
->addr
;
3359 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3363 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
3364 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
3368 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
3372 OPRND (condbit
) = opval
;
3373 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
3382 CASE (sem
, INSN_WRITE_ADDX
) : /* addx $dr,$sr */
3384 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3385 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3386 #define FLD(f) abuf->fields.sfmt_add.f
3387 #define OPRND(f) par_exec->operands.sfmt_addx.f
3388 int UNUSED written
= abuf
->written
;
3389 IADDR UNUSED pc
= abuf
->addr
;
3390 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3392 CPU (h_cond
) = OPRND (condbit
);
3393 * FLD (i_dr
) = OPRND (dr
);
3400 CASE (sem
, INSN_PAR_BC8
) : /* bc.s $disp8 */
3402 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3403 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3404 #define FLD(f) abuf->fields.sfmt_bl8.f
3405 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3406 int UNUSED written
= 0;
3407 IADDR UNUSED pc
= abuf
->addr
;
3408 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3412 USI opval
= FLD (i_disp8
);
3414 written
|= (1 << 2);
3415 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3419 abuf
->written
= written
;
3425 CASE (sem
, INSN_WRITE_BC8
) : /* bc.s $disp8 */
3427 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3428 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3429 #define FLD(f) abuf->fields.sfmt_bl8.f
3430 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3431 int UNUSED written
= abuf
->written
;
3432 IADDR UNUSED pc
= abuf
->addr
;
3434 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3436 if (written
& (1 << 2))
3438 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3441 SEM_BRANCH_FINI (vpc
);
3447 CASE (sem
, INSN_PAR_BL8
) : /* bl.s $disp8 */
3449 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3450 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3451 #define FLD(f) abuf->fields.sfmt_bl8.f
3452 #define OPRND(f) par_exec->operands.sfmt_bl8.f
3453 int UNUSED written
= 0;
3454 IADDR UNUSED pc
= abuf
->addr
;
3455 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3459 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
3460 OPRND (h_gr_14
) = opval
;
3461 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
3464 USI opval
= FLD (i_disp8
);
3466 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3475 CASE (sem
, INSN_WRITE_BL8
) : /* bl.s $disp8 */
3477 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3478 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3479 #define FLD(f) abuf->fields.sfmt_bl8.f
3480 #define OPRND(f) par_exec->operands.sfmt_bl8.f
3481 int UNUSED written
= abuf
->written
;
3482 IADDR UNUSED pc
= abuf
->addr
;
3484 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3486 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_14
);
3487 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3489 SEM_BRANCH_FINI (vpc
);
3495 CASE (sem
, INSN_PAR_BCL8
) : /* bcl.s $disp8 */
3497 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3498 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3499 #define FLD(f) abuf->fields.sfmt_bl8.f
3500 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3501 int UNUSED written
= 0;
3502 IADDR UNUSED pc
= abuf
->addr
;
3503 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3508 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
3509 OPRND (h_gr_14
) = opval
;
3510 written
|= (1 << 3);
3511 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
3514 USI opval
= FLD (i_disp8
);
3516 written
|= (1 << 4);
3517 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3522 abuf
->written
= written
;
3528 CASE (sem
, INSN_WRITE_BCL8
) : /* bcl.s $disp8 */
3530 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3531 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3532 #define FLD(f) abuf->fields.sfmt_bl8.f
3533 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3534 int UNUSED written
= abuf
->written
;
3535 IADDR UNUSED pc
= abuf
->addr
;
3537 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3539 if (written
& (1 << 3))
3541 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_14
);
3543 if (written
& (1 << 4))
3545 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3548 SEM_BRANCH_FINI (vpc
);
3554 CASE (sem
, INSN_PAR_BNC8
) : /* bnc.s $disp8 */
3556 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3557 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3558 #define FLD(f) abuf->fields.sfmt_bl8.f
3559 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3560 int UNUSED written
= 0;
3561 IADDR UNUSED pc
= abuf
->addr
;
3562 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3564 if (NOTBI (CPU (h_cond
))) {
3566 USI opval
= FLD (i_disp8
);
3568 written
|= (1 << 2);
3569 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3573 abuf
->written
= written
;
3579 CASE (sem
, INSN_WRITE_BNC8
) : /* bnc.s $disp8 */
3581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3582 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3583 #define FLD(f) abuf->fields.sfmt_bl8.f
3584 #define OPRND(f) par_exec->operands.sfmt_bc8.f
3585 int UNUSED written
= abuf
->written
;
3586 IADDR UNUSED pc
= abuf
->addr
;
3588 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3590 if (written
& (1 << 2))
3592 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3595 SEM_BRANCH_FINI (vpc
);
3601 CASE (sem
, INSN_PAR_BRA8
) : /* bra.s $disp8 */
3603 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3605 #define FLD(f) abuf->fields.sfmt_bl8.f
3606 #define OPRND(f) par_exec->operands.sfmt_bra8.f
3607 int UNUSED written
= 0;
3608 IADDR UNUSED pc
= abuf
->addr
;
3609 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3612 USI opval
= FLD (i_disp8
);
3614 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3622 CASE (sem
, INSN_WRITE_BRA8
) : /* bra.s $disp8 */
3624 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3625 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3626 #define FLD(f) abuf->fields.sfmt_bl8.f
3627 #define OPRND(f) par_exec->operands.sfmt_bra8.f
3628 int UNUSED written
= abuf
->written
;
3629 IADDR UNUSED pc
= abuf
->addr
;
3631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3633 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3635 SEM_BRANCH_FINI (vpc
);
3641 CASE (sem
, INSN_PAR_BNCL8
) : /* bncl.s $disp8 */
3643 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3644 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3645 #define FLD(f) abuf->fields.sfmt_bl8.f
3646 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3647 int UNUSED written
= 0;
3648 IADDR UNUSED pc
= abuf
->addr
;
3649 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3651 if (NOTBI (CPU (h_cond
))) {
3654 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
3655 OPRND (h_gr_14
) = opval
;
3656 written
|= (1 << 3);
3657 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
3660 USI opval
= FLD (i_disp8
);
3662 written
|= (1 << 4);
3663 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3668 abuf
->written
= written
;
3674 CASE (sem
, INSN_WRITE_BNCL8
) : /* bncl.s $disp8 */
3676 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3677 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3678 #define FLD(f) abuf->fields.sfmt_bl8.f
3679 #define OPRND(f) par_exec->operands.sfmt_bcl8.f
3680 int UNUSED written
= abuf
->written
;
3681 IADDR UNUSED pc
= abuf
->addr
;
3683 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3685 if (written
& (1 << 3))
3687 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_14
);
3689 if (written
& (1 << 4))
3691 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3694 SEM_BRANCH_FINI (vpc
);
3700 CASE (sem
, INSN_PAR_CMP
) : /* cmp $src1,$src2 */
3702 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3703 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3704 #define FLD(f) abuf->fields.sfmt_st_plus.f
3705 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3706 int UNUSED written
= 0;
3707 IADDR UNUSED pc
= abuf
->addr
;
3708 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3711 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
3712 OPRND (condbit
) = opval
;
3713 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
3721 CASE (sem
, INSN_WRITE_CMP
) : /* cmp $src1,$src2 */
3723 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3724 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3725 #define FLD(f) abuf->fields.sfmt_st_plus.f
3726 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3727 int UNUSED written
= abuf
->written
;
3728 IADDR UNUSED pc
= abuf
->addr
;
3729 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3731 CPU (h_cond
) = OPRND (condbit
);
3738 CASE (sem
, INSN_PAR_CMPU
) : /* cmpu $src1,$src2 */
3740 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3741 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3742 #define FLD(f) abuf->fields.sfmt_st_plus.f
3743 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3744 int UNUSED written
= 0;
3745 IADDR UNUSED pc
= abuf
->addr
;
3746 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3749 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
3750 OPRND (condbit
) = opval
;
3751 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
3759 CASE (sem
, INSN_WRITE_CMPU
) : /* cmpu $src1,$src2 */
3761 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3762 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3763 #define FLD(f) abuf->fields.sfmt_st_plus.f
3764 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3765 int UNUSED written
= abuf
->written
;
3766 IADDR UNUSED pc
= abuf
->addr
;
3767 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3769 CPU (h_cond
) = OPRND (condbit
);
3776 CASE (sem
, INSN_PAR_CMPEQ
) : /* cmpeq $src1,$src2 */
3778 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3779 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3780 #define FLD(f) abuf->fields.sfmt_st_plus.f
3781 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3782 int UNUSED written
= 0;
3783 IADDR UNUSED pc
= abuf
->addr
;
3784 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3787 BI opval
= EQSI (* FLD (i_src1
), * FLD (i_src2
));
3788 OPRND (condbit
) = opval
;
3789 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
3797 CASE (sem
, INSN_WRITE_CMPEQ
) : /* cmpeq $src1,$src2 */
3799 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3800 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3801 #define FLD(f) abuf->fields.sfmt_st_plus.f
3802 #define OPRND(f) par_exec->operands.sfmt_cmp.f
3803 int UNUSED written
= abuf
->written
;
3804 IADDR UNUSED pc
= abuf
->addr
;
3805 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3807 CPU (h_cond
) = OPRND (condbit
);
3814 CASE (sem
, INSN_PAR_CMPZ
) : /* cmpz $src2 */
3816 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3817 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3818 #define FLD(f) abuf->fields.sfmt_st_plus.f
3819 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
3820 int UNUSED written
= 0;
3821 IADDR UNUSED pc
= abuf
->addr
;
3822 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3825 BI opval
= EQSI (* FLD (i_src2
), 0);
3826 OPRND (condbit
) = opval
;
3827 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
3835 CASE (sem
, INSN_WRITE_CMPZ
) : /* cmpz $src2 */
3837 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3838 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3839 #define FLD(f) abuf->fields.sfmt_st_plus.f
3840 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
3841 int UNUSED written
= abuf
->written
;
3842 IADDR UNUSED pc
= abuf
->addr
;
3843 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3845 CPU (h_cond
) = OPRND (condbit
);
3852 CASE (sem
, INSN_PAR_JC
) : /* jc $sr */
3854 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3855 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3856 #define FLD(f) abuf->fields.sfmt_jl.f
3857 #define OPRND(f) par_exec->operands.sfmt_jc.f
3858 int UNUSED written
= 0;
3859 IADDR UNUSED pc
= abuf
->addr
;
3860 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3864 USI opval
= ANDSI (* FLD (i_sr
), -4);
3866 written
|= (1 << 2);
3867 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3871 abuf
->written
= written
;
3877 CASE (sem
, INSN_WRITE_JC
) : /* jc $sr */
3879 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3880 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3881 #define FLD(f) abuf->fields.sfmt_jl.f
3882 #define OPRND(f) par_exec->operands.sfmt_jc.f
3883 int UNUSED written
= abuf
->written
;
3884 IADDR UNUSED pc
= abuf
->addr
;
3886 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3888 if (written
& (1 << 2))
3890 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3893 SEM_BRANCH_FINI (vpc
);
3899 CASE (sem
, INSN_PAR_JNC
) : /* jnc $sr */
3901 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3902 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3903 #define FLD(f) abuf->fields.sfmt_jl.f
3904 #define OPRND(f) par_exec->operands.sfmt_jc.f
3905 int UNUSED written
= 0;
3906 IADDR UNUSED pc
= abuf
->addr
;
3907 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3909 if (NOTBI (CPU (h_cond
))) {
3911 USI opval
= ANDSI (* FLD (i_sr
), -4);
3913 written
|= (1 << 2);
3914 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3918 abuf
->written
= written
;
3924 CASE (sem
, INSN_WRITE_JNC
) : /* jnc $sr */
3926 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3927 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3928 #define FLD(f) abuf->fields.sfmt_jl.f
3929 #define OPRND(f) par_exec->operands.sfmt_jc.f
3930 int UNUSED written
= abuf
->written
;
3931 IADDR UNUSED pc
= abuf
->addr
;
3933 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3935 if (written
& (1 << 2))
3937 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3940 SEM_BRANCH_FINI (vpc
);
3946 CASE (sem
, INSN_PAR_JL
) : /* jl $sr */
3948 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3949 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3950 #define FLD(f) abuf->fields.sfmt_jl.f
3951 #define OPRND(f) par_exec->operands.sfmt_jl.f
3952 int UNUSED written
= 0;
3953 IADDR UNUSED pc
= abuf
->addr
;
3954 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3958 temp0
= ADDSI (ANDSI (pc
, -4), 4);
3959 temp1
= ANDSI (* FLD (i_sr
), -4);
3962 OPRND (h_gr_14
) = opval
;
3963 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
3968 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3977 CASE (sem
, INSN_WRITE_JL
) : /* jl $sr */
3979 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3980 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
3981 #define FLD(f) abuf->fields.sfmt_jl.f
3982 #define OPRND(f) par_exec->operands.sfmt_jl.f
3983 int UNUSED written
= abuf
->written
;
3984 IADDR UNUSED pc
= abuf
->addr
;
3986 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
3988 CPU (h_gr
[((UINT
) 14)]) = OPRND (h_gr_14
);
3989 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
3991 SEM_BRANCH_FINI (vpc
);
3997 CASE (sem
, INSN_PAR_JMP
) : /* jmp $sr */
3999 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4000 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4001 #define FLD(f) abuf->fields.sfmt_jl.f
4002 #define OPRND(f) par_exec->operands.sfmt_jmp.f
4003 int UNUSED written
= 0;
4004 IADDR UNUSED pc
= abuf
->addr
;
4005 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4008 USI opval
= ANDSI (* FLD (i_sr
), -4);
4010 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
4018 CASE (sem
, INSN_WRITE_JMP
) : /* jmp $sr */
4020 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4021 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4022 #define FLD(f) abuf->fields.sfmt_jl.f
4023 #define OPRND(f) par_exec->operands.sfmt_jmp.f
4024 int UNUSED written
= abuf
->written
;
4025 IADDR UNUSED pc
= abuf
->addr
;
4027 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4029 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
4031 SEM_BRANCH_FINI (vpc
);
4037 CASE (sem
, INSN_PAR_LD
) : /* ld $dr,@$sr */
4039 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4040 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4041 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4042 #define OPRND(f) par_exec->operands.sfmt_ld.f
4043 int UNUSED written
= 0;
4044 IADDR UNUSED pc
= abuf
->addr
;
4045 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4048 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
4050 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4058 CASE (sem
, INSN_WRITE_LD
) : /* ld $dr,@$sr */
4060 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4061 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4062 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4063 #define OPRND(f) par_exec->operands.sfmt_ld.f
4064 int UNUSED written
= abuf
->written
;
4065 IADDR UNUSED pc
= abuf
->addr
;
4066 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4068 * FLD (i_dr
) = OPRND (dr
);
4075 CASE (sem
, INSN_PAR_LDB
) : /* ldb $dr,@$sr */
4077 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4078 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4079 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4080 #define OPRND(f) par_exec->operands.sfmt_ld.f
4081 int UNUSED written
= 0;
4082 IADDR UNUSED pc
= abuf
->addr
;
4083 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4086 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
4088 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4096 CASE (sem
, INSN_WRITE_LDB
) : /* ldb $dr,@$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_ld_plus.f
4101 #define OPRND(f) par_exec->operands.sfmt_ld.f
4102 int UNUSED written
= abuf
->written
;
4103 IADDR UNUSED pc
= abuf
->addr
;
4104 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4106 * FLD (i_dr
) = OPRND (dr
);
4113 CASE (sem
, INSN_PAR_LDH
) : /* ldh $dr,@$sr */
4115 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4116 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4117 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4118 #define OPRND(f) par_exec->operands.sfmt_ld.f
4119 int UNUSED written
= 0;
4120 IADDR UNUSED pc
= abuf
->addr
;
4121 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4124 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
4126 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4134 CASE (sem
, INSN_WRITE_LDH
) : /* ldh $dr,@$sr */
4136 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4137 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4138 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4139 #define OPRND(f) par_exec->operands.sfmt_ld.f
4140 int UNUSED written
= abuf
->written
;
4141 IADDR UNUSED pc
= abuf
->addr
;
4142 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4144 * FLD (i_dr
) = OPRND (dr
);
4151 CASE (sem
, INSN_PAR_LDUB
) : /* ldub $dr,@$sr */
4153 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4154 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4155 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4156 #define OPRND(f) par_exec->operands.sfmt_ld.f
4157 int UNUSED written
= 0;
4158 IADDR UNUSED pc
= abuf
->addr
;
4159 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4162 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
4164 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4172 CASE (sem
, INSN_WRITE_LDUB
) : /* ldub $dr,@$sr */
4174 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4175 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4176 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4177 #define OPRND(f) par_exec->operands.sfmt_ld.f
4178 int UNUSED written
= abuf
->written
;
4179 IADDR UNUSED pc
= abuf
->addr
;
4180 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4182 * FLD (i_dr
) = OPRND (dr
);
4189 CASE (sem
, INSN_PAR_LDUH
) : /* lduh $dr,@$sr */
4191 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4192 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4193 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4194 #define OPRND(f) par_exec->operands.sfmt_ld.f
4195 int UNUSED written
= 0;
4196 IADDR UNUSED pc
= abuf
->addr
;
4197 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4200 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
4202 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4210 CASE (sem
, INSN_WRITE_LDUH
) : /* lduh $dr,@$sr */
4212 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4213 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4214 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4215 #define OPRND(f) par_exec->operands.sfmt_ld.f
4216 int UNUSED written
= abuf
->written
;
4217 IADDR UNUSED pc
= abuf
->addr
;
4218 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4220 * FLD (i_dr
) = OPRND (dr
);
4227 CASE (sem
, INSN_PAR_LD_PLUS
) : /* ld $dr,@$sr+ */
4229 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4230 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4231 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4232 #define OPRND(f) par_exec->operands.sfmt_ld_plus.f
4233 int UNUSED written
= 0;
4234 IADDR UNUSED pc
= abuf
->addr
;
4235 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4239 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
4240 temp1
= ADDSI (* FLD (i_sr
), 4);
4244 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4249 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
4258 CASE (sem
, INSN_WRITE_LD_PLUS
) : /* ld $dr,@$sr+ */
4260 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4261 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4262 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4263 #define OPRND(f) par_exec->operands.sfmt_ld_plus.f
4264 int UNUSED written
= abuf
->written
;
4265 IADDR UNUSED pc
= abuf
->addr
;
4266 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4268 * FLD (i_dr
) = OPRND (dr
);
4269 * FLD (i_sr
) = OPRND (sr
);
4276 CASE (sem
, INSN_PAR_LDI8
) : /* ldi8 $dr,$simm8 */
4278 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4279 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4280 #define FLD(f) abuf->fields.sfmt_addi.f
4281 #define OPRND(f) par_exec->operands.sfmt_ldi8.f
4282 int UNUSED written
= 0;
4283 IADDR UNUSED pc
= abuf
->addr
;
4284 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4287 SI opval
= FLD (f_simm8
);
4289 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4297 CASE (sem
, INSN_WRITE_LDI8
) : /* ldi8 $dr,$simm8 */
4299 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4300 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4301 #define FLD(f) abuf->fields.sfmt_addi.f
4302 #define OPRND(f) par_exec->operands.sfmt_ldi8.f
4303 int UNUSED written
= abuf
->written
;
4304 IADDR UNUSED pc
= abuf
->addr
;
4305 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4307 * FLD (i_dr
) = OPRND (dr
);
4314 CASE (sem
, INSN_PAR_LOCK
) : /* lock $dr,@$sr */
4316 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4317 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4318 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4319 #define OPRND(f) par_exec->operands.sfmt_lock.f
4320 int UNUSED written
= 0;
4321 IADDR UNUSED pc
= abuf
->addr
;
4322 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4327 OPRND (h_lock
) = opval
;
4328 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
4331 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
4333 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4342 CASE (sem
, INSN_WRITE_LOCK
) : /* lock $dr,@$sr */
4344 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4345 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4346 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4347 #define OPRND(f) par_exec->operands.sfmt_lock.f
4348 int UNUSED written
= abuf
->written
;
4349 IADDR UNUSED pc
= abuf
->addr
;
4350 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4352 * FLD (i_dr
) = OPRND (dr
);
4353 CPU (h_lock
) = OPRND (h_lock
);
4360 CASE (sem
, INSN_PAR_MACHI_A
) : /* machi $src1,$src2,$acc */
4362 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4363 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4364 #define FLD(f) abuf->fields.sfmt_machi_a.f
4365 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4366 int UNUSED written
= 0;
4367 IADDR UNUSED pc
= abuf
->addr
;
4368 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4371 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);
4372 OPRND (acc
) = opval
;
4373 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4381 CASE (sem
, INSN_WRITE_MACHI_A
) : /* machi $src1,$src2,$acc */
4383 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4384 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4385 #define FLD(f) abuf->fields.sfmt_machi_a.f
4386 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4387 int UNUSED written
= abuf
->written
;
4388 IADDR UNUSED pc
= abuf
->addr
;
4389 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4391 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4398 CASE (sem
, INSN_PAR_MACLO_A
) : /* maclo $src1,$src2,$acc */
4400 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4401 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4402 #define FLD(f) abuf->fields.sfmt_machi_a.f
4403 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4404 int UNUSED written
= 0;
4405 IADDR UNUSED pc
= abuf
->addr
;
4406 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4409 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);
4410 OPRND (acc
) = opval
;
4411 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4419 CASE (sem
, INSN_WRITE_MACLO_A
) : /* maclo $src1,$src2,$acc */
4421 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4422 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4423 #define FLD(f) abuf->fields.sfmt_machi_a.f
4424 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4425 int UNUSED written
= abuf
->written
;
4426 IADDR UNUSED pc
= abuf
->addr
;
4427 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4429 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4436 CASE (sem
, INSN_PAR_MACWHI_A
) : /* macwhi $src1,$src2,$acc */
4438 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4439 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4440 #define FLD(f) abuf->fields.sfmt_machi_a.f
4441 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4442 int UNUSED written
= 0;
4443 IADDR UNUSED pc
= abuf
->addr
;
4444 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4447 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))));
4448 OPRND (acc
) = opval
;
4449 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4457 CASE (sem
, INSN_WRITE_MACWHI_A
) : /* macwhi $src1,$src2,$acc */
4459 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4460 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4461 #define FLD(f) abuf->fields.sfmt_machi_a.f
4462 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4463 int UNUSED written
= abuf
->written
;
4464 IADDR UNUSED pc
= abuf
->addr
;
4465 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4467 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4474 CASE (sem
, INSN_PAR_MACWLO_A
) : /* macwlo $src1,$src2,$acc */
4476 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4477 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4478 #define FLD(f) abuf->fields.sfmt_machi_a.f
4479 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4480 int UNUSED written
= 0;
4481 IADDR UNUSED pc
= abuf
->addr
;
4482 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4485 DI opval
= ADDDI (GET_H_ACCUMS (FLD (f_acc
)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))));
4486 OPRND (acc
) = opval
;
4487 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4495 CASE (sem
, INSN_WRITE_MACWLO_A
) : /* macwlo $src1,$src2,$acc */
4497 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4498 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4499 #define FLD(f) abuf->fields.sfmt_machi_a.f
4500 #define OPRND(f) par_exec->operands.sfmt_machi_a.f
4501 int UNUSED written
= abuf
->written
;
4502 IADDR UNUSED pc
= abuf
->addr
;
4503 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4505 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4512 CASE (sem
, INSN_PAR_MUL
) : /* mul $dr,$sr */
4514 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4515 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4516 #define FLD(f) abuf->fields.sfmt_add.f
4517 #define OPRND(f) par_exec->operands.sfmt_add.f
4518 int UNUSED written
= 0;
4519 IADDR UNUSED pc
= abuf
->addr
;
4520 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4523 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
4525 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4533 CASE (sem
, INSN_WRITE_MUL
) : /* mul $dr,$sr */
4535 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4536 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4537 #define FLD(f) abuf->fields.sfmt_add.f
4538 #define OPRND(f) par_exec->operands.sfmt_add.f
4539 int UNUSED written
= abuf
->written
;
4540 IADDR UNUSED pc
= abuf
->addr
;
4541 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4543 * FLD (i_dr
) = OPRND (dr
);
4550 CASE (sem
, INSN_PAR_MULHI_A
) : /* mulhi $src1,$src2,$acc */
4552 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4553 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4554 #define FLD(f) abuf->fields.sfmt_machi_a.f
4555 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4556 int UNUSED written
= 0;
4557 IADDR UNUSED pc
= abuf
->addr
;
4558 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4561 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
4562 OPRND (acc
) = opval
;
4563 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4571 CASE (sem
, INSN_WRITE_MULHI_A
) : /* mulhi $src1,$src2,$acc */
4573 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4574 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4575 #define FLD(f) abuf->fields.sfmt_machi_a.f
4576 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4577 int UNUSED written
= abuf
->written
;
4578 IADDR UNUSED pc
= abuf
->addr
;
4579 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4581 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4588 CASE (sem
, INSN_PAR_MULLO_A
) : /* mullo $src1,$src2,$acc */
4590 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4591 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4592 #define FLD(f) abuf->fields.sfmt_machi_a.f
4593 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4594 int UNUSED written
= 0;
4595 IADDR UNUSED pc
= abuf
->addr
;
4596 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4599 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
4600 OPRND (acc
) = opval
;
4601 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4609 CASE (sem
, INSN_WRITE_MULLO_A
) : /* mullo $src1,$src2,$acc */
4611 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4612 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4613 #define FLD(f) abuf->fields.sfmt_machi_a.f
4614 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4615 int UNUSED written
= abuf
->written
;
4616 IADDR UNUSED pc
= abuf
->addr
;
4617 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4619 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4626 CASE (sem
, INSN_PAR_MULWHI_A
) : /* mulwhi $src1,$src2,$acc */
4628 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4629 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4630 #define FLD(f) abuf->fields.sfmt_machi_a.f
4631 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4632 int UNUSED written
= 0;
4633 IADDR UNUSED pc
= abuf
->addr
;
4634 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4637 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))));
4638 OPRND (acc
) = opval
;
4639 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4647 CASE (sem
, INSN_WRITE_MULWHI_A
) : /* mulwhi $src1,$src2,$acc */
4649 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4650 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4651 #define FLD(f) abuf->fields.sfmt_machi_a.f
4652 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4653 int UNUSED written
= abuf
->written
;
4654 IADDR UNUSED pc
= abuf
->addr
;
4655 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4657 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4664 CASE (sem
, INSN_PAR_MULWLO_A
) : /* mulwlo $src1,$src2,$acc */
4666 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4667 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4668 #define FLD(f) abuf->fields.sfmt_machi_a.f
4669 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4670 int UNUSED written
= 0;
4671 IADDR UNUSED pc
= abuf
->addr
;
4672 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4675 DI opval
= MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))));
4676 OPRND (acc
) = opval
;
4677 TRACE_RESULT (current_cpu
, abuf
, "acc", 'D', opval
);
4685 CASE (sem
, INSN_WRITE_MULWLO_A
) : /* mulwlo $src1,$src2,$acc */
4687 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4688 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4689 #define FLD(f) abuf->fields.sfmt_machi_a.f
4690 #define OPRND(f) par_exec->operands.sfmt_mulhi_a.f
4691 int UNUSED written
= abuf
->written
;
4692 IADDR UNUSED pc
= abuf
->addr
;
4693 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4695 SET_H_ACCUMS (FLD (f_acc
), OPRND (acc
));
4702 CASE (sem
, INSN_PAR_MV
) : /* mv $dr,$sr */
4704 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4705 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4706 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4707 #define OPRND(f) par_exec->operands.sfmt_mv.f
4708 int UNUSED written
= 0;
4709 IADDR UNUSED pc
= abuf
->addr
;
4710 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4713 SI opval
= * FLD (i_sr
);
4715 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4723 CASE (sem
, INSN_WRITE_MV
) : /* mv $dr,$sr */
4725 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4726 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4727 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4728 #define OPRND(f) par_exec->operands.sfmt_mv.f
4729 int UNUSED written
= abuf
->written
;
4730 IADDR UNUSED pc
= abuf
->addr
;
4731 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4733 * FLD (i_dr
) = OPRND (dr
);
4740 CASE (sem
, INSN_PAR_MVFACHI_A
) : /* mvfachi $dr,$accs */
4742 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4743 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4744 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4745 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4746 int UNUSED written
= 0;
4747 IADDR UNUSED pc
= abuf
->addr
;
4748 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4751 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 32));
4753 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4761 CASE (sem
, INSN_WRITE_MVFACHI_A
) : /* mvfachi $dr,$accs */
4763 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4764 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4765 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4766 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4767 int UNUSED written
= abuf
->written
;
4768 IADDR UNUSED pc
= abuf
->addr
;
4769 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4771 * FLD (i_dr
) = OPRND (dr
);
4778 CASE (sem
, INSN_PAR_MVFACLO_A
) : /* mvfaclo $dr,$accs */
4780 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4781 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4782 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4783 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4784 int UNUSED written
= 0;
4785 IADDR UNUSED pc
= abuf
->addr
;
4786 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4789 SI opval
= TRUNCDISI (GET_H_ACCUMS (FLD (f_accs
)));
4791 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4799 CASE (sem
, INSN_WRITE_MVFACLO_A
) : /* mvfaclo $dr,$accs */
4801 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4802 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4803 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4804 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4805 int UNUSED written
= abuf
->written
;
4806 IADDR UNUSED pc
= abuf
->addr
;
4807 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4809 * FLD (i_dr
) = OPRND (dr
);
4816 CASE (sem
, INSN_PAR_MVFACMI_A
) : /* mvfacmi $dr,$accs */
4818 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4819 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4820 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4821 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4822 int UNUSED written
= 0;
4823 IADDR UNUSED pc
= abuf
->addr
;
4824 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4827 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUMS (FLD (f_accs
)), 16));
4829 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4837 CASE (sem
, INSN_WRITE_MVFACMI_A
) : /* mvfacmi $dr,$accs */
4839 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4840 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4841 #define FLD(f) abuf->fields.sfmt_mvfachi_a.f
4842 #define OPRND(f) par_exec->operands.sfmt_mvfachi_a.f
4843 int UNUSED written
= abuf
->written
;
4844 IADDR UNUSED pc
= abuf
->addr
;
4845 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4847 * FLD (i_dr
) = OPRND (dr
);
4854 CASE (sem
, INSN_PAR_MVFC
) : /* mvfc $dr,$scr */
4856 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4857 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4858 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4859 #define OPRND(f) par_exec->operands.sfmt_mvfc.f
4860 int UNUSED written
= 0;
4861 IADDR UNUSED pc
= abuf
->addr
;
4862 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4865 SI opval
= GET_H_CR (FLD (f_r2
));
4867 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
4875 CASE (sem
, INSN_WRITE_MVFC
) : /* mvfc $dr,$scr */
4877 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4878 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4879 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4880 #define OPRND(f) par_exec->operands.sfmt_mvfc.f
4881 int UNUSED written
= abuf
->written
;
4882 IADDR UNUSED pc
= abuf
->addr
;
4883 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4885 * FLD (i_dr
) = OPRND (dr
);
4892 CASE (sem
, INSN_PAR_MVTACHI_A
) : /* mvtachi $src1,$accs */
4894 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4895 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4896 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
4897 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
4898 int UNUSED written
= 0;
4899 IADDR UNUSED pc
= abuf
->addr
;
4900 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4903 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
4904 OPRND (accs
) = opval
;
4905 TRACE_RESULT (current_cpu
, abuf
, "accs", 'D', opval
);
4913 CASE (sem
, INSN_WRITE_MVTACHI_A
) : /* mvtachi $src1,$accs */
4915 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4916 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4917 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
4918 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
4919 int UNUSED written
= abuf
->written
;
4920 IADDR UNUSED pc
= abuf
->addr
;
4921 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4923 SET_H_ACCUMS (FLD (f_accs
), OPRND (accs
));
4930 CASE (sem
, INSN_PAR_MVTACLO_A
) : /* mvtaclo $src1,$accs */
4932 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4933 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4934 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
4935 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
4936 int UNUSED written
= 0;
4937 IADDR UNUSED pc
= abuf
->addr
;
4938 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4941 DI opval
= ORDI (ANDDI (GET_H_ACCUMS (FLD (f_accs
)), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
4942 OPRND (accs
) = opval
;
4943 TRACE_RESULT (current_cpu
, abuf
, "accs", 'D', opval
);
4951 CASE (sem
, INSN_WRITE_MVTACLO_A
) : /* mvtaclo $src1,$accs */
4953 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4954 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4955 #define FLD(f) abuf->fields.sfmt_mvtachi_a.f
4956 #define OPRND(f) par_exec->operands.sfmt_mvtachi_a.f
4957 int UNUSED written
= abuf
->written
;
4958 IADDR UNUSED pc
= abuf
->addr
;
4959 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4961 SET_H_ACCUMS (FLD (f_accs
), OPRND (accs
));
4968 CASE (sem
, INSN_PAR_MVTC
) : /* mvtc $sr,$dcr */
4970 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4971 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4972 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4973 #define OPRND(f) par_exec->operands.sfmt_mvtc.f
4974 int UNUSED written
= 0;
4975 IADDR UNUSED pc
= abuf
->addr
;
4976 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4979 USI opval
= * FLD (i_sr
);
4980 OPRND (dcr
) = opval
;
4981 TRACE_RESULT (current_cpu
, abuf
, "dcr", 'x', opval
);
4989 CASE (sem
, INSN_WRITE_MVTC
) : /* mvtc $sr,$dcr */
4991 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
4992 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
4993 #define FLD(f) abuf->fields.sfmt_ld_plus.f
4994 #define OPRND(f) par_exec->operands.sfmt_mvtc.f
4995 int UNUSED written
= abuf
->written
;
4996 IADDR UNUSED pc
= abuf
->addr
;
4997 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
4999 SET_H_CR (FLD (f_r1
), OPRND (dcr
));
5006 CASE (sem
, INSN_PAR_NEG
) : /* neg $dr,$sr */
5008 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5009 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5010 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5011 #define OPRND(f) par_exec->operands.sfmt_mv.f
5012 int UNUSED written
= 0;
5013 IADDR UNUSED pc
= abuf
->addr
;
5014 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5017 SI opval
= NEGSI (* FLD (i_sr
));
5019 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5027 CASE (sem
, INSN_WRITE_NEG
) : /* neg $dr,$sr */
5029 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5030 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5031 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5032 #define OPRND(f) par_exec->operands.sfmt_mv.f
5033 int UNUSED written
= abuf
->written
;
5034 IADDR UNUSED pc
= abuf
->addr
;
5035 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5037 * FLD (i_dr
) = OPRND (dr
);
5044 CASE (sem
, INSN_PAR_NOP
) : /* nop */
5046 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5048 #define FLD(f) abuf->fields.fmt_empty.f
5049 #define OPRND(f) par_exec->operands.sfmt_nop.f
5050 int UNUSED written
= 0;
5051 IADDR UNUSED pc
= abuf
->addr
;
5052 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5054 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
5061 CASE (sem
, INSN_WRITE_NOP
) : /* nop */
5063 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5064 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5065 #define FLD(f) abuf->fields.fmt_empty.f
5066 #define OPRND(f) par_exec->operands.sfmt_nop.f
5067 int UNUSED written
= abuf
->written
;
5068 IADDR UNUSED pc
= abuf
->addr
;
5069 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5077 CASE (sem
, INSN_PAR_NOT
) : /* not $dr,$sr */
5079 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5080 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5081 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5082 #define OPRND(f) par_exec->operands.sfmt_mv.f
5083 int UNUSED written
= 0;
5084 IADDR UNUSED pc
= abuf
->addr
;
5085 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5088 SI opval
= INVSI (* FLD (i_sr
));
5090 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5098 CASE (sem
, INSN_WRITE_NOT
) : /* not $dr,$sr */
5100 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5101 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5102 #define FLD(f) abuf->fields.sfmt_ld_plus.f
5103 #define OPRND(f) par_exec->operands.sfmt_mv.f
5104 int UNUSED written
= abuf
->written
;
5105 IADDR UNUSED pc
= abuf
->addr
;
5106 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5108 * FLD (i_dr
) = OPRND (dr
);
5115 CASE (sem
, INSN_PAR_RAC_DSI
) : /* rac $accd,$accs,$imm1 */
5117 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5118 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5119 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5120 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5121 int UNUSED written
= 0;
5122 IADDR UNUSED pc
= abuf
->addr
;
5123 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5127 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
5128 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
5130 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)));
5131 OPRND (accd
) = opval
;
5132 TRACE_RESULT (current_cpu
, abuf
, "accd", 'D', opval
);
5141 CASE (sem
, INSN_WRITE_RAC_DSI
) : /* rac $accd,$accs,$imm1 */
5143 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5144 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5145 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5146 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5147 int UNUSED written
= abuf
->written
;
5148 IADDR UNUSED pc
= abuf
->addr
;
5149 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5151 SET_H_ACCUMS (FLD (f_accd
), OPRND (accd
));
5158 CASE (sem
, INSN_PAR_RACH_DSI
) : /* rach $accd,$accs,$imm1 */
5160 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5161 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5162 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5163 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5164 int UNUSED written
= 0;
5165 IADDR UNUSED pc
= abuf
->addr
;
5166 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5170 tmp_tmp1
= SLLDI (GET_H_ACCUMS (FLD (f_accs
)), FLD (f_imm1
));
5171 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 0x80000000));
5173 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)));
5174 OPRND (accd
) = opval
;
5175 TRACE_RESULT (current_cpu
, abuf
, "accd", 'D', opval
);
5184 CASE (sem
, INSN_WRITE_RACH_DSI
) : /* rach $accd,$accs,$imm1 */
5186 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5187 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5188 #define FLD(f) abuf->fields.sfmt_rac_dsi.f
5189 #define OPRND(f) par_exec->operands.sfmt_rac_dsi.f
5190 int UNUSED written
= abuf
->written
;
5191 IADDR UNUSED pc
= abuf
->addr
;
5192 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5194 SET_H_ACCUMS (FLD (f_accd
), OPRND (accd
));
5201 CASE (sem
, INSN_PAR_RTE
) : /* rte */
5203 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5204 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5205 #define FLD(f) abuf->fields.fmt_empty.f
5206 #define OPRND(f) par_exec->operands.sfmt_rte.f
5207 int UNUSED written
= 0;
5208 IADDR UNUSED pc
= abuf
->addr
;
5209 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5213 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
5215 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
5218 USI opval
= GET_H_CR (((UINT
) 14));
5219 OPRND (h_cr_6
) = opval
;
5220 TRACE_RESULT (current_cpu
, abuf
, "cr-6", 'x', opval
);
5223 UQI opval
= CPU (h_bpsw
);
5224 OPRND (h_psw
) = opval
;
5225 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
5228 UQI opval
= CPU (h_bbpsw
);
5229 OPRND (h_bpsw
) = opval
;
5230 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
5239 CASE (sem
, INSN_WRITE_RTE
) : /* rte */
5241 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5242 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5243 #define FLD(f) abuf->fields.fmt_empty.f
5244 #define OPRND(f) par_exec->operands.sfmt_rte.f
5245 int UNUSED written
= abuf
->written
;
5246 IADDR UNUSED pc
= abuf
->addr
;
5248 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5250 CPU (h_bpsw
) = OPRND (h_bpsw
);
5251 SET_H_CR (((UINT
) 6), OPRND (h_cr_6
));
5252 SET_H_PSW (OPRND (h_psw
));
5253 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
5255 SEM_BRANCH_FINI (vpc
);
5261 CASE (sem
, INSN_PAR_SLL
) : /* sll $dr,$sr */
5263 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5264 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5265 #define FLD(f) abuf->fields.sfmt_add.f
5266 #define OPRND(f) par_exec->operands.sfmt_add.f
5267 int UNUSED written
= 0;
5268 IADDR UNUSED pc
= abuf
->addr
;
5269 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5272 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
5274 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5282 CASE (sem
, INSN_WRITE_SLL
) : /* sll $dr,$sr */
5284 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5285 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5286 #define FLD(f) abuf->fields.sfmt_add.f
5287 #define OPRND(f) par_exec->operands.sfmt_add.f
5288 int UNUSED written
= abuf
->written
;
5289 IADDR UNUSED pc
= abuf
->addr
;
5290 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5292 * FLD (i_dr
) = OPRND (dr
);
5299 CASE (sem
, INSN_PAR_SLLI
) : /* slli $dr,$uimm5 */
5301 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5302 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5303 #define FLD(f) abuf->fields.sfmt_slli.f
5304 #define OPRND(f) par_exec->operands.sfmt_slli.f
5305 int UNUSED written
= 0;
5306 IADDR UNUSED pc
= abuf
->addr
;
5307 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5310 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
5312 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5320 CASE (sem
, INSN_WRITE_SLLI
) : /* slli $dr,$uimm5 */
5322 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5323 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5324 #define FLD(f) abuf->fields.sfmt_slli.f
5325 #define OPRND(f) par_exec->operands.sfmt_slli.f
5326 int UNUSED written
= abuf
->written
;
5327 IADDR UNUSED pc
= abuf
->addr
;
5328 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5330 * FLD (i_dr
) = OPRND (dr
);
5337 CASE (sem
, INSN_PAR_SRA
) : /* sra $dr,$sr */
5339 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5340 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5341 #define FLD(f) abuf->fields.sfmt_add.f
5342 #define OPRND(f) par_exec->operands.sfmt_add.f
5343 int UNUSED written
= 0;
5344 IADDR UNUSED pc
= abuf
->addr
;
5345 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5348 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
5350 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5358 CASE (sem
, INSN_WRITE_SRA
) : /* sra $dr,$sr */
5360 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5361 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5362 #define FLD(f) abuf->fields.sfmt_add.f
5363 #define OPRND(f) par_exec->operands.sfmt_add.f
5364 int UNUSED written
= abuf
->written
;
5365 IADDR UNUSED pc
= abuf
->addr
;
5366 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5368 * FLD (i_dr
) = OPRND (dr
);
5375 CASE (sem
, INSN_PAR_SRAI
) : /* srai $dr,$uimm5 */
5377 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5378 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5379 #define FLD(f) abuf->fields.sfmt_slli.f
5380 #define OPRND(f) par_exec->operands.sfmt_slli.f
5381 int UNUSED written
= 0;
5382 IADDR UNUSED pc
= abuf
->addr
;
5383 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5386 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
5388 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5396 CASE (sem
, INSN_WRITE_SRAI
) : /* srai $dr,$uimm5 */
5398 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5399 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5400 #define FLD(f) abuf->fields.sfmt_slli.f
5401 #define OPRND(f) par_exec->operands.sfmt_slli.f
5402 int UNUSED written
= abuf
->written
;
5403 IADDR UNUSED pc
= abuf
->addr
;
5404 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5406 * FLD (i_dr
) = OPRND (dr
);
5413 CASE (sem
, INSN_PAR_SRL
) : /* srl $dr,$sr */
5415 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5417 #define FLD(f) abuf->fields.sfmt_add.f
5418 #define OPRND(f) par_exec->operands.sfmt_add.f
5419 int UNUSED written
= 0;
5420 IADDR UNUSED pc
= abuf
->addr
;
5421 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5424 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
5426 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5434 CASE (sem
, INSN_WRITE_SRL
) : /* srl $dr,$sr */
5436 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5437 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5438 #define FLD(f) abuf->fields.sfmt_add.f
5439 #define OPRND(f) par_exec->operands.sfmt_add.f
5440 int UNUSED written
= abuf
->written
;
5441 IADDR UNUSED pc
= abuf
->addr
;
5442 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5444 * FLD (i_dr
) = OPRND (dr
);
5451 CASE (sem
, INSN_PAR_SRLI
) : /* srli $dr,$uimm5 */
5453 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5454 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5455 #define FLD(f) abuf->fields.sfmt_slli.f
5456 #define OPRND(f) par_exec->operands.sfmt_slli.f
5457 int UNUSED written
= 0;
5458 IADDR UNUSED pc
= abuf
->addr
;
5459 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5462 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
5464 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5472 CASE (sem
, INSN_WRITE_SRLI
) : /* srli $dr,$uimm5 */
5474 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5475 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5476 #define FLD(f) abuf->fields.sfmt_slli.f
5477 #define OPRND(f) par_exec->operands.sfmt_slli.f
5478 int UNUSED written
= abuf
->written
;
5479 IADDR UNUSED pc
= abuf
->addr
;
5480 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5482 * FLD (i_dr
) = OPRND (dr
);
5489 CASE (sem
, INSN_PAR_ST
) : /* st $src1,@$src2 */
5491 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5492 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5493 #define FLD(f) abuf->fields.sfmt_st_plus.f
5494 #define OPRND(f) par_exec->operands.sfmt_st.f
5495 int UNUSED written
= 0;
5496 IADDR UNUSED pc
= abuf
->addr
;
5497 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5500 SI opval
= * FLD (i_src1
);
5501 OPRND (h_memory_src2_idx
) = * FLD (i_src2
);
5502 OPRND (h_memory_src2
) = opval
;
5503 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5511 CASE (sem
, INSN_WRITE_ST
) : /* st $src1,@$src2 */
5513 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5514 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5515 #define FLD(f) abuf->fields.sfmt_st_plus.f
5516 #define OPRND(f) par_exec->operands.sfmt_st.f
5517 int UNUSED written
= abuf
->written
;
5518 IADDR UNUSED pc
= abuf
->addr
;
5519 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5521 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_src2_idx
), OPRND (h_memory_src2
));
5528 CASE (sem
, INSN_PAR_STB
) : /* stb $src1,@$src2 */
5530 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5531 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5532 #define FLD(f) abuf->fields.sfmt_st_plus.f
5533 #define OPRND(f) par_exec->operands.sfmt_stb.f
5534 int UNUSED written
= 0;
5535 IADDR UNUSED pc
= abuf
->addr
;
5536 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5539 QI opval
= * FLD (i_src1
);
5540 OPRND (h_memory_src2_idx
) = * FLD (i_src2
);
5541 OPRND (h_memory_src2
) = opval
;
5542 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5550 CASE (sem
, INSN_WRITE_STB
) : /* stb $src1,@$src2 */
5552 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5553 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5554 #define FLD(f) abuf->fields.sfmt_st_plus.f
5555 #define OPRND(f) par_exec->operands.sfmt_stb.f
5556 int UNUSED written
= abuf
->written
;
5557 IADDR UNUSED pc
= abuf
->addr
;
5558 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5560 SETMEMQI (current_cpu
, pc
, OPRND (h_memory_src2_idx
), OPRND (h_memory_src2
));
5567 CASE (sem
, INSN_PAR_STH
) : /* sth $src1,@$src2 */
5569 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5570 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5571 #define FLD(f) abuf->fields.sfmt_st_plus.f
5572 #define OPRND(f) par_exec->operands.sfmt_sth.f
5573 int UNUSED written
= 0;
5574 IADDR UNUSED pc
= abuf
->addr
;
5575 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5578 HI opval
= * FLD (i_src1
);
5579 OPRND (h_memory_src2_idx
) = * FLD (i_src2
);
5580 OPRND (h_memory_src2
) = opval
;
5581 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5589 CASE (sem
, INSN_WRITE_STH
) : /* sth $src1,@$src2 */
5591 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5592 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5593 #define FLD(f) abuf->fields.sfmt_st_plus.f
5594 #define OPRND(f) par_exec->operands.sfmt_sth.f
5595 int UNUSED written
= abuf
->written
;
5596 IADDR UNUSED pc
= abuf
->addr
;
5597 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5599 SETMEMHI (current_cpu
, pc
, OPRND (h_memory_src2_idx
), OPRND (h_memory_src2
));
5606 CASE (sem
, INSN_PAR_ST_PLUS
) : /* st $src1,@+$src2 */
5608 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5609 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5610 #define FLD(f) abuf->fields.sfmt_st_plus.f
5611 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5612 int UNUSED written
= 0;
5613 IADDR UNUSED pc
= abuf
->addr
;
5614 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5618 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
5620 SI opval
= * FLD (i_src1
);
5621 OPRND (h_memory_new_src2_idx
) = tmp_new_src2
;
5622 OPRND (h_memory_new_src2
) = opval
;
5623 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5626 SI opval
= tmp_new_src2
;
5627 OPRND (src2
) = opval
;
5628 TRACE_RESULT (current_cpu
, abuf
, "src2", 'x', opval
);
5637 CASE (sem
, INSN_WRITE_ST_PLUS
) : /* st $src1,@+$src2 */
5639 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5640 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5641 #define FLD(f) abuf->fields.sfmt_st_plus.f
5642 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5643 int UNUSED written
= abuf
->written
;
5644 IADDR UNUSED pc
= abuf
->addr
;
5645 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5647 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_new_src2_idx
), OPRND (h_memory_new_src2
));
5648 * FLD (i_src2
) = OPRND (src2
);
5655 CASE (sem
, INSN_PAR_ST_MINUS
) : /* st $src1,@-$src2 */
5657 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5658 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5659 #define FLD(f) abuf->fields.sfmt_st_plus.f
5660 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5661 int UNUSED written
= 0;
5662 IADDR UNUSED pc
= abuf
->addr
;
5663 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5667 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
5669 SI opval
= * FLD (i_src1
);
5670 OPRND (h_memory_new_src2_idx
) = tmp_new_src2
;
5671 OPRND (h_memory_new_src2
) = opval
;
5672 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5675 SI opval
= tmp_new_src2
;
5676 OPRND (src2
) = opval
;
5677 TRACE_RESULT (current_cpu
, abuf
, "src2", 'x', opval
);
5686 CASE (sem
, INSN_WRITE_ST_MINUS
) : /* st $src1,@-$src2 */
5688 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5689 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5690 #define FLD(f) abuf->fields.sfmt_st_plus.f
5691 #define OPRND(f) par_exec->operands.sfmt_st_plus.f
5692 int UNUSED written
= abuf
->written
;
5693 IADDR UNUSED pc
= abuf
->addr
;
5694 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5696 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_new_src2_idx
), OPRND (h_memory_new_src2
));
5697 * FLD (i_src2
) = OPRND (src2
);
5704 CASE (sem
, INSN_PAR_SUB
) : /* sub $dr,$sr */
5706 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5708 #define FLD(f) abuf->fields.sfmt_add.f
5709 #define OPRND(f) par_exec->operands.sfmt_add.f
5710 int UNUSED written
= 0;
5711 IADDR UNUSED pc
= abuf
->addr
;
5712 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5715 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
5717 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5725 CASE (sem
, INSN_WRITE_SUB
) : /* sub $dr,$sr */
5727 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5728 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5729 #define FLD(f) abuf->fields.sfmt_add.f
5730 #define OPRND(f) par_exec->operands.sfmt_add.f
5731 int UNUSED written
= abuf
->written
;
5732 IADDR UNUSED pc
= abuf
->addr
;
5733 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5735 * FLD (i_dr
) = OPRND (dr
);
5742 CASE (sem
, INSN_PAR_SUBV
) : /* subv $dr,$sr */
5744 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5745 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5746 #define FLD(f) abuf->fields.sfmt_add.f
5747 #define OPRND(f) par_exec->operands.sfmt_addv.f
5748 int UNUSED written
= 0;
5749 IADDR UNUSED pc
= abuf
->addr
;
5750 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5754 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
5755 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
5759 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5763 OPRND (condbit
) = opval
;
5764 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
5773 CASE (sem
, INSN_WRITE_SUBV
) : /* subv $dr,$sr */
5775 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5776 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5777 #define FLD(f) abuf->fields.sfmt_add.f
5778 #define OPRND(f) par_exec->operands.sfmt_addv.f
5779 int UNUSED written
= abuf
->written
;
5780 IADDR UNUSED pc
= abuf
->addr
;
5781 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5783 CPU (h_cond
) = OPRND (condbit
);
5784 * FLD (i_dr
) = OPRND (dr
);
5791 CASE (sem
, INSN_PAR_SUBX
) : /* subx $dr,$sr */
5793 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5794 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5795 #define FLD(f) abuf->fields.sfmt_add.f
5796 #define OPRND(f) par_exec->operands.sfmt_addx.f
5797 int UNUSED written
= 0;
5798 IADDR UNUSED pc
= abuf
->addr
;
5799 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5803 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
5804 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
5808 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
5812 OPRND (condbit
) = opval
;
5813 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
5822 CASE (sem
, INSN_WRITE_SUBX
) : /* subx $dr,$sr */
5824 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5825 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5826 #define FLD(f) abuf->fields.sfmt_add.f
5827 #define OPRND(f) par_exec->operands.sfmt_addx.f
5828 int UNUSED written
= abuf
->written
;
5829 IADDR UNUSED pc
= abuf
->addr
;
5830 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5832 CPU (h_cond
) = OPRND (condbit
);
5833 * FLD (i_dr
) = OPRND (dr
);
5840 CASE (sem
, INSN_PAR_TRAP
) : /* trap $uimm4 */
5842 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5843 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5844 #define FLD(f) abuf->fields.sfmt_trap.f
5845 #define OPRND(f) par_exec->operands.sfmt_trap.f
5846 int UNUSED written
= 0;
5847 IADDR UNUSED pc
= abuf
->addr
;
5848 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5852 USI opval
= GET_H_CR (((UINT
) 6));
5853 OPRND (h_cr_14
) = opval
;
5854 TRACE_RESULT (current_cpu
, abuf
, "cr-14", 'x', opval
);
5857 USI opval
= ADDSI (pc
, 4);
5858 OPRND (h_cr_6
) = opval
;
5859 TRACE_RESULT (current_cpu
, abuf
, "cr-6", 'x', opval
);
5862 UQI opval
= CPU (h_bpsw
);
5863 OPRND (h_bbpsw
) = opval
;
5864 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
5867 UQI opval
= GET_H_PSW ();
5868 OPRND (h_bpsw
) = opval
;
5869 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
5872 UQI opval
= ANDQI (GET_H_PSW (), 128);
5873 OPRND (h_psw
) = opval
;
5874 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
5877 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
5879 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
5888 CASE (sem
, INSN_WRITE_TRAP
) : /* trap $uimm4 */
5890 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5891 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5892 #define FLD(f) abuf->fields.sfmt_trap.f
5893 #define OPRND(f) par_exec->operands.sfmt_trap.f
5894 int UNUSED written
= abuf
->written
;
5895 IADDR UNUSED pc
= abuf
->addr
;
5897 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5899 CPU (h_bbpsw
) = OPRND (h_bbpsw
);
5900 CPU (h_bpsw
) = OPRND (h_bpsw
);
5901 SET_H_CR (((UINT
) 14), OPRND (h_cr_14
));
5902 SET_H_CR (((UINT
) 6), OPRND (h_cr_6
));
5903 SET_H_PSW (OPRND (h_psw
));
5904 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, OPRND (pc
), vpc
);
5906 SEM_BRANCH_FINI (vpc
);
5912 CASE (sem
, INSN_PAR_UNLOCK
) : /* unlock $src1,@$src2 */
5914 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5915 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5916 #define FLD(f) abuf->fields.sfmt_st_plus.f
5917 #define OPRND(f) par_exec->operands.sfmt_unlock.f
5918 int UNUSED written
= 0;
5919 IADDR UNUSED pc
= abuf
->addr
;
5920 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5925 SI opval
= * FLD (i_src1
);
5926 OPRND (h_memory_src2_idx
) = * FLD (i_src2
);
5927 OPRND (h_memory_src2
) = opval
;
5928 written
|= (1 << 4);
5929 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5934 OPRND (h_lock
) = opval
;
5935 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
5939 abuf
->written
= written
;
5945 CASE (sem
, INSN_WRITE_UNLOCK
) : /* unlock $src1,@$src2 */
5947 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5948 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5949 #define FLD(f) abuf->fields.sfmt_st_plus.f
5950 #define OPRND(f) par_exec->operands.sfmt_unlock.f
5951 int UNUSED written
= abuf
->written
;
5952 IADDR UNUSED pc
= abuf
->addr
;
5953 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5955 CPU (h_lock
) = OPRND (h_lock
);
5956 if (written
& (1 << 4))
5958 SETMEMSI (current_cpu
, pc
, OPRND (h_memory_src2_idx
), OPRND (h_memory_src2
));
5966 CASE (sem
, INSN_PAR_PCMPBZ
) : /* pcmpbz $src2 */
5968 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5969 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5970 #define FLD(f) abuf->fields.sfmt_st_plus.f
5971 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
5972 int UNUSED written
= 0;
5973 IADDR UNUSED pc
= abuf
->addr
;
5974 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5977 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);
5978 OPRND (condbit
) = opval
;
5979 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
5987 CASE (sem
, INSN_WRITE_PCMPBZ
) : /* pcmpbz $src2 */
5989 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
5990 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
5991 #define FLD(f) abuf->fields.sfmt_st_plus.f
5992 #define OPRND(f) par_exec->operands.sfmt_cmpz.f
5993 int UNUSED written
= abuf
->written
;
5994 IADDR UNUSED pc
= abuf
->addr
;
5995 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
5997 CPU (h_cond
) = OPRND (condbit
);
6004 CASE (sem
, INSN_PAR_SADD
) : /* sadd */
6006 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6007 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6008 #define FLD(f) abuf->fields.fmt_empty.f
6009 #define OPRND(f) par_exec->operands.sfmt_sadd.f
6010 int UNUSED written
= 0;
6011 IADDR UNUSED pc
= abuf
->addr
;
6012 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6015 DI opval
= ADDDI (SRADI (GET_H_ACCUMS (((UINT
) 1)), 16), GET_H_ACCUMS (((UINT
) 0)));
6016 OPRND (h_accums_0
) = opval
;
6017 TRACE_RESULT (current_cpu
, abuf
, "accums-0", 'D', opval
);
6025 CASE (sem
, INSN_WRITE_SADD
) : /* sadd */
6027 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6028 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6029 #define FLD(f) abuf->fields.fmt_empty.f
6030 #define OPRND(f) par_exec->operands.sfmt_sadd.f
6031 int UNUSED written
= abuf
->written
;
6032 IADDR UNUSED pc
= abuf
->addr
;
6033 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6035 SET_H_ACCUMS (((UINT
) 0), OPRND (h_accums_0
));
6042 CASE (sem
, INSN_PAR_MACWU1
) : /* macwu1 $src1,$src2 */
6044 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6045 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6046 #define FLD(f) abuf->fields.sfmt_st_plus.f
6047 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6048 int UNUSED written
= 0;
6049 IADDR UNUSED pc
= abuf
->addr
;
6050 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6053 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUMS (((UINT
) 1)), MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535)))), 8), 8);
6054 OPRND (h_accums_1
) = opval
;
6055 TRACE_RESULT (current_cpu
, abuf
, "accums-1", 'D', opval
);
6063 CASE (sem
, INSN_WRITE_MACWU1
) : /* macwu1 $src1,$src2 */
6065 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6066 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6067 #define FLD(f) abuf->fields.sfmt_st_plus.f
6068 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6069 int UNUSED written
= abuf
->written
;
6070 IADDR UNUSED pc
= abuf
->addr
;
6071 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6073 SET_H_ACCUMS (((UINT
) 1), OPRND (h_accums_1
));
6080 CASE (sem
, INSN_PAR_MSBLO
) : /* msblo $src1,$src2 */
6082 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6083 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6084 #define FLD(f) abuf->fields.sfmt_st_plus.f
6085 #define OPRND(f) par_exec->operands.sfmt_msblo.f
6086 int UNUSED written
= 0;
6087 IADDR UNUSED pc
= abuf
->addr
;
6088 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6091 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);
6092 OPRND (accum
) = opval
;
6093 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
6101 CASE (sem
, INSN_WRITE_MSBLO
) : /* msblo $src1,$src2 */
6103 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6104 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6105 #define FLD(f) abuf->fields.sfmt_st_plus.f
6106 #define OPRND(f) par_exec->operands.sfmt_msblo.f
6107 int UNUSED written
= abuf
->written
;
6108 IADDR UNUSED pc
= abuf
->addr
;
6109 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6111 SET_H_ACCUM (OPRND (accum
));
6118 CASE (sem
, INSN_PAR_MULWU1
) : /* mulwu1 $src1,$src2 */
6120 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6122 #define FLD(f) abuf->fields.sfmt_st_plus.f
6123 #define OPRND(f) par_exec->operands.sfmt_mulwu1.f
6124 int UNUSED written
= 0;
6125 IADDR UNUSED pc
= abuf
->addr
;
6126 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6129 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTSIDI (ANDSI (* FLD (i_src2
), 65535))), 16), 16);
6130 OPRND (h_accums_1
) = opval
;
6131 TRACE_RESULT (current_cpu
, abuf
, "accums-1", 'D', opval
);
6139 CASE (sem
, INSN_WRITE_MULWU1
) : /* mulwu1 $src1,$src2 */
6141 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6142 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6143 #define FLD(f) abuf->fields.sfmt_st_plus.f
6144 #define OPRND(f) par_exec->operands.sfmt_mulwu1.f
6145 int UNUSED written
= abuf
->written
;
6146 IADDR UNUSED pc
= abuf
->addr
;
6147 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6149 SET_H_ACCUMS (((UINT
) 1), OPRND (h_accums_1
));
6156 CASE (sem
, INSN_PAR_MACLH1
) : /* maclh1 $src1,$src2 */
6158 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6159 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6160 #define FLD(f) abuf->fields.sfmt_st_plus.f
6161 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6162 int UNUSED written
= 0;
6163 IADDR UNUSED pc
= abuf
->addr
;
6164 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6167 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);
6168 OPRND (h_accums_1
) = opval
;
6169 TRACE_RESULT (current_cpu
, abuf
, "accums-1", 'D', opval
);
6177 CASE (sem
, INSN_WRITE_MACLH1
) : /* maclh1 $src1,$src2 */
6179 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6180 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6181 #define FLD(f) abuf->fields.sfmt_st_plus.f
6182 #define OPRND(f) par_exec->operands.sfmt_macwu1.f
6183 int UNUSED written
= abuf
->written
;
6184 IADDR UNUSED pc
= abuf
->addr
;
6185 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6187 SET_H_ACCUMS (((UINT
) 1), OPRND (h_accums_1
));
6194 CASE (sem
, INSN_PAR_SC
) : /* sc */
6196 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6197 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6198 #define FLD(f) abuf->fields.fmt_empty.f
6199 #define OPRND(f) par_exec->operands.sfmt_sc.f
6200 int UNUSED written
= 0;
6201 IADDR UNUSED pc
= abuf
->addr
;
6202 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6204 if (ZEXTBISI (CPU (h_cond
)))
6205 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
6212 CASE (sem
, INSN_WRITE_SC
) : /* sc */
6214 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6215 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6216 #define FLD(f) abuf->fields.fmt_empty.f
6217 #define OPRND(f) par_exec->operands.sfmt_sc.f
6218 int UNUSED written
= abuf
->written
;
6219 IADDR UNUSED pc
= abuf
->addr
;
6220 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6228 CASE (sem
, INSN_PAR_SNC
) : /* snc */
6230 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6231 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
6232 #define FLD(f) abuf->fields.fmt_empty.f
6233 #define OPRND(f) par_exec->operands.sfmt_sc.f
6234 int UNUSED written
= 0;
6235 IADDR UNUSED pc
= abuf
->addr
;
6236 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
6238 if (ZEXTBISI (NOTBI (CPU (h_cond
))))
6239 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
6246 CASE (sem
, INSN_WRITE_SNC
) : /* snc */
6248 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
6249 const ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
)->fields
.write
.abuf
;
6250 #define FLD(f) abuf->fields.fmt_empty.f
6251 #define OPRND(f) par_exec->operands.sfmt_sc.f
6252 int UNUSED written
= abuf
->written
;
6253 IADDR UNUSED pc
= abuf
->addr
;
6254 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
6264 ENDSWITCH (sem
) /* End of semantic switch. */
6266 /* At this point `vpc' contains the next insn to execute. */
6269 #undef DEFINE_SWITCH
6270 #endif /* DEFINE_SWITCH */