New Romanian translation for ld
[binutils-gdb.git] / sim / or1k / sem-switch.c
blobb63add8817b73b361479c63ce112d9fe5443f9b5
1 /* Simulator instruction semantics for or1k32bf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996-2023 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifdef DEFINE_LABELS
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. */
31 static struct {
32 int index;
33 void *label;
34 } labels[] = {
35 { OR1K32BF_INSN_X_INVALID, && case_sem_INSN_X_INVALID },
36 { OR1K32BF_INSN_X_AFTER, && case_sem_INSN_X_AFTER },
37 { OR1K32BF_INSN_X_BEFORE, && case_sem_INSN_X_BEFORE },
38 { OR1K32BF_INSN_X_CTI_CHAIN, && case_sem_INSN_X_CTI_CHAIN },
39 { OR1K32BF_INSN_X_CHAIN, && case_sem_INSN_X_CHAIN },
40 { OR1K32BF_INSN_X_BEGIN, && case_sem_INSN_X_BEGIN },
41 { OR1K32BF_INSN_L_J, && case_sem_INSN_L_J },
42 { OR1K32BF_INSN_L_ADRP, && case_sem_INSN_L_ADRP },
43 { OR1K32BF_INSN_L_JAL, && case_sem_INSN_L_JAL },
44 { OR1K32BF_INSN_L_JR, && case_sem_INSN_L_JR },
45 { OR1K32BF_INSN_L_JALR, && case_sem_INSN_L_JALR },
46 { OR1K32BF_INSN_L_BNF, && case_sem_INSN_L_BNF },
47 { OR1K32BF_INSN_L_BF, && case_sem_INSN_L_BF },
48 { OR1K32BF_INSN_L_TRAP, && case_sem_INSN_L_TRAP },
49 { OR1K32BF_INSN_L_SYS, && case_sem_INSN_L_SYS },
50 { OR1K32BF_INSN_L_MSYNC, && case_sem_INSN_L_MSYNC },
51 { OR1K32BF_INSN_L_PSYNC, && case_sem_INSN_L_PSYNC },
52 { OR1K32BF_INSN_L_CSYNC, && case_sem_INSN_L_CSYNC },
53 { OR1K32BF_INSN_L_RFE, && case_sem_INSN_L_RFE },
54 { OR1K32BF_INSN_L_NOP_IMM, && case_sem_INSN_L_NOP_IMM },
55 { OR1K32BF_INSN_L_MOVHI, && case_sem_INSN_L_MOVHI },
56 { OR1K32BF_INSN_L_MACRC, && case_sem_INSN_L_MACRC },
57 { OR1K32BF_INSN_L_MFSPR, && case_sem_INSN_L_MFSPR },
58 { OR1K32BF_INSN_L_MTSPR, && case_sem_INSN_L_MTSPR },
59 { OR1K32BF_INSN_L_LWZ, && case_sem_INSN_L_LWZ },
60 { OR1K32BF_INSN_L_LWS, && case_sem_INSN_L_LWS },
61 { OR1K32BF_INSN_L_LWA, && case_sem_INSN_L_LWA },
62 { OR1K32BF_INSN_L_LBZ, && case_sem_INSN_L_LBZ },
63 { OR1K32BF_INSN_L_LBS, && case_sem_INSN_L_LBS },
64 { OR1K32BF_INSN_L_LHZ, && case_sem_INSN_L_LHZ },
65 { OR1K32BF_INSN_L_LHS, && case_sem_INSN_L_LHS },
66 { OR1K32BF_INSN_L_SW, && case_sem_INSN_L_SW },
67 { OR1K32BF_INSN_L_SB, && case_sem_INSN_L_SB },
68 { OR1K32BF_INSN_L_SH, && case_sem_INSN_L_SH },
69 { OR1K32BF_INSN_L_SWA, && case_sem_INSN_L_SWA },
70 { OR1K32BF_INSN_L_SLL, && case_sem_INSN_L_SLL },
71 { OR1K32BF_INSN_L_SLLI, && case_sem_INSN_L_SLLI },
72 { OR1K32BF_INSN_L_SRL, && case_sem_INSN_L_SRL },
73 { OR1K32BF_INSN_L_SRLI, && case_sem_INSN_L_SRLI },
74 { OR1K32BF_INSN_L_SRA, && case_sem_INSN_L_SRA },
75 { OR1K32BF_INSN_L_SRAI, && case_sem_INSN_L_SRAI },
76 { OR1K32BF_INSN_L_ROR, && case_sem_INSN_L_ROR },
77 { OR1K32BF_INSN_L_RORI, && case_sem_INSN_L_RORI },
78 { OR1K32BF_INSN_L_AND, && case_sem_INSN_L_AND },
79 { OR1K32BF_INSN_L_OR, && case_sem_INSN_L_OR },
80 { OR1K32BF_INSN_L_XOR, && case_sem_INSN_L_XOR },
81 { OR1K32BF_INSN_L_ADD, && case_sem_INSN_L_ADD },
82 { OR1K32BF_INSN_L_SUB, && case_sem_INSN_L_SUB },
83 { OR1K32BF_INSN_L_ADDC, && case_sem_INSN_L_ADDC },
84 { OR1K32BF_INSN_L_MUL, && case_sem_INSN_L_MUL },
85 { OR1K32BF_INSN_L_MULD, && case_sem_INSN_L_MULD },
86 { OR1K32BF_INSN_L_MULU, && case_sem_INSN_L_MULU },
87 { OR1K32BF_INSN_L_MULDU, && case_sem_INSN_L_MULDU },
88 { OR1K32BF_INSN_L_DIV, && case_sem_INSN_L_DIV },
89 { OR1K32BF_INSN_L_DIVU, && case_sem_INSN_L_DIVU },
90 { OR1K32BF_INSN_L_FF1, && case_sem_INSN_L_FF1 },
91 { OR1K32BF_INSN_L_FL1, && case_sem_INSN_L_FL1 },
92 { OR1K32BF_INSN_L_ANDI, && case_sem_INSN_L_ANDI },
93 { OR1K32BF_INSN_L_ORI, && case_sem_INSN_L_ORI },
94 { OR1K32BF_INSN_L_XORI, && case_sem_INSN_L_XORI },
95 { OR1K32BF_INSN_L_ADDI, && case_sem_INSN_L_ADDI },
96 { OR1K32BF_INSN_L_ADDIC, && case_sem_INSN_L_ADDIC },
97 { OR1K32BF_INSN_L_MULI, && case_sem_INSN_L_MULI },
98 { OR1K32BF_INSN_L_EXTHS, && case_sem_INSN_L_EXTHS },
99 { OR1K32BF_INSN_L_EXTBS, && case_sem_INSN_L_EXTBS },
100 { OR1K32BF_INSN_L_EXTHZ, && case_sem_INSN_L_EXTHZ },
101 { OR1K32BF_INSN_L_EXTBZ, && case_sem_INSN_L_EXTBZ },
102 { OR1K32BF_INSN_L_EXTWS, && case_sem_INSN_L_EXTWS },
103 { OR1K32BF_INSN_L_EXTWZ, && case_sem_INSN_L_EXTWZ },
104 { OR1K32BF_INSN_L_CMOV, && case_sem_INSN_L_CMOV },
105 { OR1K32BF_INSN_L_SFGTS, && case_sem_INSN_L_SFGTS },
106 { OR1K32BF_INSN_L_SFGTSI, && case_sem_INSN_L_SFGTSI },
107 { OR1K32BF_INSN_L_SFGTU, && case_sem_INSN_L_SFGTU },
108 { OR1K32BF_INSN_L_SFGTUI, && case_sem_INSN_L_SFGTUI },
109 { OR1K32BF_INSN_L_SFGES, && case_sem_INSN_L_SFGES },
110 { OR1K32BF_INSN_L_SFGESI, && case_sem_INSN_L_SFGESI },
111 { OR1K32BF_INSN_L_SFGEU, && case_sem_INSN_L_SFGEU },
112 { OR1K32BF_INSN_L_SFGEUI, && case_sem_INSN_L_SFGEUI },
113 { OR1K32BF_INSN_L_SFLTS, && case_sem_INSN_L_SFLTS },
114 { OR1K32BF_INSN_L_SFLTSI, && case_sem_INSN_L_SFLTSI },
115 { OR1K32BF_INSN_L_SFLTU, && case_sem_INSN_L_SFLTU },
116 { OR1K32BF_INSN_L_SFLTUI, && case_sem_INSN_L_SFLTUI },
117 { OR1K32BF_INSN_L_SFLES, && case_sem_INSN_L_SFLES },
118 { OR1K32BF_INSN_L_SFLESI, && case_sem_INSN_L_SFLESI },
119 { OR1K32BF_INSN_L_SFLEU, && case_sem_INSN_L_SFLEU },
120 { OR1K32BF_INSN_L_SFLEUI, && case_sem_INSN_L_SFLEUI },
121 { OR1K32BF_INSN_L_SFEQ, && case_sem_INSN_L_SFEQ },
122 { OR1K32BF_INSN_L_SFEQI, && case_sem_INSN_L_SFEQI },
123 { OR1K32BF_INSN_L_SFNE, && case_sem_INSN_L_SFNE },
124 { OR1K32BF_INSN_L_SFNEI, && case_sem_INSN_L_SFNEI },
125 { OR1K32BF_INSN_L_MAC, && case_sem_INSN_L_MAC },
126 { OR1K32BF_INSN_L_MACI, && case_sem_INSN_L_MACI },
127 { OR1K32BF_INSN_L_MACU, && case_sem_INSN_L_MACU },
128 { OR1K32BF_INSN_L_MSB, && case_sem_INSN_L_MSB },
129 { OR1K32BF_INSN_L_MSBU, && case_sem_INSN_L_MSBU },
130 { OR1K32BF_INSN_L_CUST1, && case_sem_INSN_L_CUST1 },
131 { OR1K32BF_INSN_L_CUST2, && case_sem_INSN_L_CUST2 },
132 { OR1K32BF_INSN_L_CUST3, && case_sem_INSN_L_CUST3 },
133 { OR1K32BF_INSN_L_CUST4, && case_sem_INSN_L_CUST4 },
134 { OR1K32BF_INSN_L_CUST5, && case_sem_INSN_L_CUST5 },
135 { OR1K32BF_INSN_L_CUST6, && case_sem_INSN_L_CUST6 },
136 { OR1K32BF_INSN_L_CUST7, && case_sem_INSN_L_CUST7 },
137 { OR1K32BF_INSN_L_CUST8, && case_sem_INSN_L_CUST8 },
138 { OR1K32BF_INSN_LF_ADD_S, && case_sem_INSN_LF_ADD_S },
139 { OR1K32BF_INSN_LF_ADD_D32, && case_sem_INSN_LF_ADD_D32 },
140 { OR1K32BF_INSN_LF_SUB_S, && case_sem_INSN_LF_SUB_S },
141 { OR1K32BF_INSN_LF_SUB_D32, && case_sem_INSN_LF_SUB_D32 },
142 { OR1K32BF_INSN_LF_MUL_S, && case_sem_INSN_LF_MUL_S },
143 { OR1K32BF_INSN_LF_MUL_D32, && case_sem_INSN_LF_MUL_D32 },
144 { OR1K32BF_INSN_LF_DIV_S, && case_sem_INSN_LF_DIV_S },
145 { OR1K32BF_INSN_LF_DIV_D32, && case_sem_INSN_LF_DIV_D32 },
146 { OR1K32BF_INSN_LF_REM_S, && case_sem_INSN_LF_REM_S },
147 { OR1K32BF_INSN_LF_REM_D32, && case_sem_INSN_LF_REM_D32 },
148 { OR1K32BF_INSN_LF_ITOF_S, && case_sem_INSN_LF_ITOF_S },
149 { OR1K32BF_INSN_LF_ITOF_D32, && case_sem_INSN_LF_ITOF_D32 },
150 { OR1K32BF_INSN_LF_FTOI_S, && case_sem_INSN_LF_FTOI_S },
151 { OR1K32BF_INSN_LF_FTOI_D32, && case_sem_INSN_LF_FTOI_D32 },
152 { OR1K32BF_INSN_LF_SFEQ_S, && case_sem_INSN_LF_SFEQ_S },
153 { OR1K32BF_INSN_LF_SFEQ_D32, && case_sem_INSN_LF_SFEQ_D32 },
154 { OR1K32BF_INSN_LF_SFNE_S, && case_sem_INSN_LF_SFNE_S },
155 { OR1K32BF_INSN_LF_SFNE_D32, && case_sem_INSN_LF_SFNE_D32 },
156 { OR1K32BF_INSN_LF_SFGE_S, && case_sem_INSN_LF_SFGE_S },
157 { OR1K32BF_INSN_LF_SFGE_D32, && case_sem_INSN_LF_SFGE_D32 },
158 { OR1K32BF_INSN_LF_SFGT_S, && case_sem_INSN_LF_SFGT_S },
159 { OR1K32BF_INSN_LF_SFGT_D32, && case_sem_INSN_LF_SFGT_D32 },
160 { OR1K32BF_INSN_LF_SFLT_S, && case_sem_INSN_LF_SFLT_S },
161 { OR1K32BF_INSN_LF_SFLT_D32, && case_sem_INSN_LF_SFLT_D32 },
162 { OR1K32BF_INSN_LF_SFLE_S, && case_sem_INSN_LF_SFLE_S },
163 { OR1K32BF_INSN_LF_SFLE_D32, && case_sem_INSN_LF_SFLE_D32 },
164 { OR1K32BF_INSN_LF_SFUEQ_S, && case_sem_INSN_LF_SFUEQ_S },
165 { OR1K32BF_INSN_LF_SFUEQ_D32, && case_sem_INSN_LF_SFUEQ_D32 },
166 { OR1K32BF_INSN_LF_SFUNE_S, && case_sem_INSN_LF_SFUNE_S },
167 { OR1K32BF_INSN_LF_SFUNE_D32, && case_sem_INSN_LF_SFUNE_D32 },
168 { OR1K32BF_INSN_LF_SFUGT_S, && case_sem_INSN_LF_SFUGT_S },
169 { OR1K32BF_INSN_LF_SFUGT_D32, && case_sem_INSN_LF_SFUGT_D32 },
170 { OR1K32BF_INSN_LF_SFUGE_S, && case_sem_INSN_LF_SFUGE_S },
171 { OR1K32BF_INSN_LF_SFUGE_D32, && case_sem_INSN_LF_SFUGE_D32 },
172 { OR1K32BF_INSN_LF_SFULT_S, && case_sem_INSN_LF_SFULT_S },
173 { OR1K32BF_INSN_LF_SFULT_D32, && case_sem_INSN_LF_SFULT_D32 },
174 { OR1K32BF_INSN_LF_SFULE_S, && case_sem_INSN_LF_SFULE_S },
175 { OR1K32BF_INSN_LF_SFULE_D32, && case_sem_INSN_LF_SFULE_D32 },
176 { OR1K32BF_INSN_LF_SFUN_S, && case_sem_INSN_LF_SFUN_S },
177 { OR1K32BF_INSN_LF_SFUN_D32, && case_sem_INSN_LF_SFUN_D32 },
178 { OR1K32BF_INSN_LF_MADD_S, && case_sem_INSN_LF_MADD_S },
179 { OR1K32BF_INSN_LF_MADD_D32, && case_sem_INSN_LF_MADD_D32 },
180 { OR1K32BF_INSN_LF_CUST1_S, && case_sem_INSN_LF_CUST1_S },
181 { OR1K32BF_INSN_LF_CUST1_D32, && case_sem_INSN_LF_CUST1_D32 },
182 { 0, 0 }
184 int i;
186 for (i = 0; labels[i].label != 0; ++i)
188 #if FAST_P
189 CPU_IDESC (current_cpu) [labels[i].index].sem_fast_lab = labels[i].label;
190 #else
191 CPU_IDESC (current_cpu) [labels[i].index].sem_full_lab = labels[i].label;
192 #endif
195 #undef DEFINE_LABELS
196 #endif /* DEFINE_LABELS */
198 #ifdef DEFINE_SWITCH
200 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
201 off frills like tracing and profiling. */
202 /* FIXME: A better way would be to have CGEN_TRACE_RESULT check for something
203 that can cause it to be optimized out. Another way would be to emit
204 special handlers into the instruction "stream". */
206 #if FAST_P
207 #undef CGEN_TRACE_RESULT
208 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
209 #endif
211 #undef GET_ATTR
212 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
216 #if WITH_SCACHE_PBB
218 /* Branch to next handler without going around main loop. */
219 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
220 SWITCH (sem, SEM_ARGBUF (vpc) -> semantic.sem_case)
222 #else /* ! WITH_SCACHE_PBB */
224 #define NEXT(vpc) BREAK (sem)
225 #ifdef __GNUC__
226 #if FAST_P
227 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_fast_lab)
228 #else
229 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->sem_full_lab)
230 #endif
231 #else
232 SWITCH (sem, SEM_ARGBUF (sc) -> idesc->num)
233 #endif
235 #endif /* ! WITH_SCACHE_PBB */
239 CASE (sem, INSN_X_INVALID) : /* --invalid-- */
241 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
242 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
243 #define FLD(f) abuf->fields.sfmt_empty.f
244 int UNUSED written = 0;
245 IADDR UNUSED pc = abuf->addr;
246 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
249 /* Update the recorded pc in the cpu state struct.
250 Only necessary for WITH_SCACHE case, but to avoid the
251 conditional compilation .... */
252 SET_H_PC (pc);
253 /* Virtual insns have zero size. Overwrite vpc with address of next insn
254 using the default-insn-bitsize spec. When executing insns in parallel
255 we may want to queue the fault and continue execution. */
256 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
257 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
260 #undef FLD
262 NEXT (vpc);
264 CASE (sem, INSN_X_AFTER) : /* --after-- */
266 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
267 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
268 #define FLD(f) abuf->fields.sfmt_empty.f
269 int UNUSED written = 0;
270 IADDR UNUSED pc = abuf->addr;
271 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
274 #if WITH_SCACHE_PBB_OR1K32BF
275 or1k32bf_pbb_after (current_cpu, sem_arg);
276 #endif
279 #undef FLD
281 NEXT (vpc);
283 CASE (sem, INSN_X_BEFORE) : /* --before-- */
285 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
286 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
287 #define FLD(f) abuf->fields.sfmt_empty.f
288 int UNUSED written = 0;
289 IADDR UNUSED pc = abuf->addr;
290 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
293 #if WITH_SCACHE_PBB_OR1K32BF
294 or1k32bf_pbb_before (current_cpu, sem_arg);
295 #endif
298 #undef FLD
300 NEXT (vpc);
302 CASE (sem, INSN_X_CTI_CHAIN) : /* --cti-chain-- */
304 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
305 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
306 #define FLD(f) abuf->fields.sfmt_empty.f
307 int UNUSED written = 0;
308 IADDR UNUSED pc = abuf->addr;
309 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
312 #if WITH_SCACHE_PBB_OR1K32BF
313 #ifdef DEFINE_SWITCH
314 vpc = or1k32bf_pbb_cti_chain (current_cpu, sem_arg,
315 pbb_br_type, pbb_br_npc);
316 BREAK (sem);
317 #else
318 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
319 vpc = or1k32bf_pbb_cti_chain (current_cpu, sem_arg,
320 CPU_PBB_BR_TYPE (current_cpu),
321 CPU_PBB_BR_NPC (current_cpu));
322 #endif
323 #endif
326 #undef FLD
328 NEXT (vpc);
330 CASE (sem, INSN_X_CHAIN) : /* --chain-- */
332 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
333 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
334 #define FLD(f) abuf->fields.sfmt_empty.f
335 int UNUSED written = 0;
336 IADDR UNUSED pc = abuf->addr;
337 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
340 #if WITH_SCACHE_PBB_OR1K32BF
341 vpc = or1k32bf_pbb_chain (current_cpu, sem_arg);
342 #ifdef DEFINE_SWITCH
343 BREAK (sem);
344 #endif
345 #endif
348 #undef FLD
350 NEXT (vpc);
352 CASE (sem, INSN_X_BEGIN) : /* --begin-- */
354 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
355 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
356 #define FLD(f) abuf->fields.sfmt_empty.f
357 int UNUSED written = 0;
358 IADDR UNUSED pc = abuf->addr;
359 vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
362 #if WITH_SCACHE_PBB_OR1K32BF
363 #if defined DEFINE_SWITCH || defined FAST_P
364 /* In the switch case FAST_P is a constant, allowing several optimizations
365 in any called inline functions. */
366 vpc = or1k32bf_pbb_begin (current_cpu, FAST_P);
367 #else
368 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
369 vpc = or1k32bf_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
370 #else
371 vpc = or1k32bf_pbb_begin (current_cpu, 0);
372 #endif
373 #endif
374 #endif
377 #undef FLD
379 NEXT (vpc);
381 CASE (sem, INSN_L_J) : /* l.j ${disp26} */
383 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
384 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
385 #define FLD(f) abuf->fields.sfmt_l_j.f
386 int UNUSED written = 0;
387 IADDR UNUSED pc = abuf->addr;
388 SEM_BRANCH_INIT
389 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
394 USI opval = FLD (i_disp26);
395 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
396 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
399 if (GET_H_SYS_CPUCFGR_ND ()) {
400 if (1)
401 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
405 SEM_BRANCH_FINI (vpc);
406 #undef FLD
408 NEXT (vpc);
410 CASE (sem, INSN_L_ADRP) : /* l.adrp $rD,${disp21} */
412 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
413 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
414 #define FLD(f) abuf->fields.sfmt_l_adrp.f
415 int UNUSED written = 0;
416 IADDR UNUSED pc = abuf->addr;
417 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
420 USI opval = FLD (i_disp21);
421 SET_H_GPR (FLD (f_r1), opval);
422 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
425 #undef FLD
427 NEXT (vpc);
429 CASE (sem, INSN_L_JAL) : /* l.jal ${disp26} */
431 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
432 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
433 #define FLD(f) abuf->fields.sfmt_l_j.f
434 int UNUSED written = 0;
435 IADDR UNUSED pc = abuf->addr;
436 SEM_BRANCH_INIT
437 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
441 USI opval = ADDSI (pc, ((GET_H_SYS_CPUCFGR_ND ()) ? (4) : (8)));
442 SET_H_GPR (((UINT) 9), opval);
443 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
448 USI opval = FLD (i_disp26);
449 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
450 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
453 if (GET_H_SYS_CPUCFGR_ND ()) {
454 if (1)
455 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
460 SEM_BRANCH_FINI (vpc);
461 #undef FLD
463 NEXT (vpc);
465 CASE (sem, INSN_L_JR) : /* l.jr $rB */
467 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
468 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
469 #define FLD(f) abuf->fields.sfmt_l_sll.f
470 int UNUSED written = 0;
471 IADDR UNUSED pc = abuf->addr;
472 SEM_BRANCH_INIT
473 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
478 USI opval = GET_H_GPR (FLD (f_r3));
479 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
480 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
483 if (GET_H_SYS_CPUCFGR_ND ()) {
484 if (1)
485 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
489 SEM_BRANCH_FINI (vpc);
490 #undef FLD
492 NEXT (vpc);
494 CASE (sem, INSN_L_JALR) : /* l.jalr $rB */
496 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
497 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
498 #define FLD(f) abuf->fields.sfmt_l_sll.f
499 int UNUSED written = 0;
500 IADDR UNUSED pc = abuf->addr;
501 SEM_BRANCH_INIT
502 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
506 USI opval = ADDSI (pc, ((GET_H_SYS_CPUCFGR_ND ()) ? (4) : (8)));
507 SET_H_GPR (((UINT) 9), opval);
508 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
513 USI opval = GET_H_GPR (FLD (f_r3));
514 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
515 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
518 if (GET_H_SYS_CPUCFGR_ND ()) {
519 if (1)
520 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
525 SEM_BRANCH_FINI (vpc);
526 #undef FLD
528 NEXT (vpc);
530 CASE (sem, INSN_L_BNF) : /* l.bnf ${disp26} */
532 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
533 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
534 #define FLD(f) abuf->fields.sfmt_l_j.f
535 int UNUSED written = 0;
536 IADDR UNUSED pc = abuf->addr;
537 SEM_BRANCH_INIT
538 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
541 if (NOTSI (GET_H_SYS_SR_F ())) {
544 USI opval = FLD (i_disp26);
545 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
546 written |= (1 << 4);
547 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
550 } else {
551 if (GET_H_SYS_CPUCFGR_ND ()) {
554 USI opval = ADDSI (pc, 4);
555 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
556 written |= (1 << 4);
557 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
562 if (GET_H_SYS_CPUCFGR_ND ()) {
563 if (1)
564 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
568 abuf->written = written;
569 SEM_BRANCH_FINI (vpc);
570 #undef FLD
572 NEXT (vpc);
574 CASE (sem, INSN_L_BF) : /* l.bf ${disp26} */
576 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
577 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
578 #define FLD(f) abuf->fields.sfmt_l_j.f
579 int UNUSED written = 0;
580 IADDR UNUSED pc = abuf->addr;
581 SEM_BRANCH_INIT
582 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
585 if (GET_H_SYS_SR_F ()) {
588 USI opval = FLD (i_disp26);
589 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
590 written |= (1 << 4);
591 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
594 } else {
595 if (GET_H_SYS_CPUCFGR_ND ()) {
598 USI opval = ADDSI (pc, 4);
599 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
600 written |= (1 << 4);
601 CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
606 if (GET_H_SYS_CPUCFGR_ND ()) {
607 if (1)
608 SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
612 abuf->written = written;
613 SEM_BRANCH_FINI (vpc);
614 #undef FLD
616 NEXT (vpc);
618 CASE (sem, INSN_L_TRAP) : /* l.trap ${uimm16} */
620 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
621 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
622 #define FLD(f) abuf->fields.sfmt_empty.f
623 int UNUSED written = 0;
624 IADDR UNUSED pc = abuf->addr;
625 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
627 or1k32bf_exception (current_cpu, pc, EXCEPT_TRAP);
629 #undef FLD
631 NEXT (vpc);
633 CASE (sem, INSN_L_SYS) : /* l.sys ${uimm16} */
635 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
636 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
637 #define FLD(f) abuf->fields.sfmt_empty.f
638 int UNUSED written = 0;
639 IADDR UNUSED pc = abuf->addr;
640 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
642 or1k32bf_exception (current_cpu, pc, EXCEPT_SYSCALL);
644 #undef FLD
646 NEXT (vpc);
648 CASE (sem, INSN_L_MSYNC) : /* l.msync */
650 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
651 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
652 #define FLD(f) abuf->fields.sfmt_empty.f
653 int UNUSED written = 0;
654 IADDR UNUSED pc = abuf->addr;
655 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
657 ((void) 0); /*nop*/
659 #undef FLD
661 NEXT (vpc);
663 CASE (sem, INSN_L_PSYNC) : /* l.psync */
665 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
666 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
667 #define FLD(f) abuf->fields.sfmt_empty.f
668 int UNUSED written = 0;
669 IADDR UNUSED pc = abuf->addr;
670 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
672 ((void) 0); /*nop*/
674 #undef FLD
676 NEXT (vpc);
678 CASE (sem, INSN_L_CSYNC) : /* l.csync */
680 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
681 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
682 #define FLD(f) abuf->fields.sfmt_empty.f
683 int UNUSED written = 0;
684 IADDR UNUSED pc = abuf->addr;
685 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
687 ((void) 0); /*nop*/
689 #undef FLD
691 NEXT (vpc);
693 CASE (sem, INSN_L_RFE) : /* l.rfe */
695 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
696 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
697 #define FLD(f) abuf->fields.sfmt_empty.f
698 int UNUSED written = 0;
699 IADDR UNUSED pc = abuf->addr;
700 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
702 or1k32bf_rfe (current_cpu);
704 #undef FLD
706 NEXT (vpc);
708 CASE (sem, INSN_L_NOP_IMM) : /* l.nop ${uimm16} */
710 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
711 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
712 #define FLD(f) abuf->fields.sfmt_l_mfspr.f
713 int UNUSED written = 0;
714 IADDR UNUSED pc = abuf->addr;
715 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
717 or1k32bf_nop (current_cpu, ZEXTSISI (FLD (f_uimm16)));
719 #undef FLD
721 NEXT (vpc);
723 CASE (sem, INSN_L_MOVHI) : /* l.movhi $rD,$uimm16 */
725 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
726 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
727 #define FLD(f) abuf->fields.sfmt_l_mfspr.f
728 int UNUSED written = 0;
729 IADDR UNUSED pc = abuf->addr;
730 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
733 USI opval = SLLSI (ZEXTSISI (FLD (f_uimm16)), 16);
734 SET_H_GPR (FLD (f_r1), opval);
735 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
738 #undef FLD
740 NEXT (vpc);
742 CASE (sem, INSN_L_MACRC) : /* l.macrc $rD */
744 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
745 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
746 #define FLD(f) abuf->fields.sfmt_l_adrp.f
747 int UNUSED written = 0;
748 IADDR UNUSED pc = abuf->addr;
749 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
753 USI opval = GET_H_MAC_MACLO ();
754 SET_H_GPR (FLD (f_r1), opval);
755 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
758 USI opval = 0;
759 SET_H_MAC_MACLO (opval);
760 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
763 USI opval = 0;
764 SET_H_MAC_MACHI (opval);
765 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
769 #undef FLD
771 NEXT (vpc);
773 CASE (sem, INSN_L_MFSPR) : /* l.mfspr $rD,$rA,${uimm16} */
775 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
776 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
777 #define FLD(f) abuf->fields.sfmt_l_mfspr.f
778 int UNUSED written = 0;
779 IADDR UNUSED pc = abuf->addr;
780 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
783 USI opval = or1k32bf_mfspr (current_cpu, ORSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16))));
784 SET_H_GPR (FLD (f_r1), opval);
785 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
788 #undef FLD
790 NEXT (vpc);
792 CASE (sem, INSN_L_MTSPR) : /* l.mtspr $rA,$rB,${uimm16-split} */
794 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
795 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
796 #define FLD(f) abuf->fields.sfmt_l_mtspr.f
797 int UNUSED written = 0;
798 IADDR UNUSED pc = abuf->addr;
799 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
801 or1k32bf_mtspr (current_cpu, ORSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16_split))), GET_H_GPR (FLD (f_r3)));
803 #undef FLD
805 NEXT (vpc);
807 CASE (sem, INSN_L_LWZ) : /* l.lwz $rD,${simm16}($rA) */
809 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
810 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
811 #define FLD(f) abuf->fields.sfmt_l_lwz.f
812 int UNUSED written = 0;
813 IADDR UNUSED pc = abuf->addr;
814 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
817 USI opval = ZEXTSISI (GETMEMUSI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 4)));
818 SET_H_GPR (FLD (f_r1), opval);
819 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
822 #undef FLD
824 NEXT (vpc);
826 CASE (sem, INSN_L_LWS) : /* l.lws $rD,${simm16}($rA) */
828 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
829 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
830 #define FLD(f) abuf->fields.sfmt_l_lwz.f
831 int UNUSED written = 0;
832 IADDR UNUSED pc = abuf->addr;
833 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
836 SI opval = EXTSISI (GETMEMSI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 4)));
837 SET_H_GPR (FLD (f_r1), opval);
838 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
841 #undef FLD
843 NEXT (vpc);
845 CASE (sem, INSN_L_LWA) : /* l.lwa $rD,${simm16}($rA) */
847 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
848 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
849 #define FLD(f) abuf->fields.sfmt_l_lwz.f
850 int UNUSED written = 0;
851 IADDR UNUSED pc = abuf->addr;
852 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
856 USI opval = ZEXTSISI (GETMEMUSI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 4)));
857 SET_H_GPR (FLD (f_r1), opval);
858 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
861 BI opval = 1;
862 CPU (h_atomic_reserve) = opval;
863 CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
866 SI opval = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 4);
867 CPU (h_atomic_address) = opval;
868 CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-address", 'x', opval);
872 #undef FLD
874 NEXT (vpc);
876 CASE (sem, INSN_L_LBZ) : /* l.lbz $rD,${simm16}($rA) */
878 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
879 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
880 #define FLD(f) abuf->fields.sfmt_l_lwz.f
881 int UNUSED written = 0;
882 IADDR UNUSED pc = abuf->addr;
883 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
886 USI opval = ZEXTQISI (GETMEMUQI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 1)));
887 SET_H_GPR (FLD (f_r1), opval);
888 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
891 #undef FLD
893 NEXT (vpc);
895 CASE (sem, INSN_L_LBS) : /* l.lbs $rD,${simm16}($rA) */
897 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
898 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
899 #define FLD(f) abuf->fields.sfmt_l_lwz.f
900 int UNUSED written = 0;
901 IADDR UNUSED pc = abuf->addr;
902 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
905 SI opval = EXTQISI (GETMEMQI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 1)));
906 SET_H_GPR (FLD (f_r1), opval);
907 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
910 #undef FLD
912 NEXT (vpc);
914 CASE (sem, INSN_L_LHZ) : /* l.lhz $rD,${simm16}($rA) */
916 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
917 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
918 #define FLD(f) abuf->fields.sfmt_l_lwz.f
919 int UNUSED written = 0;
920 IADDR UNUSED pc = abuf->addr;
921 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
924 USI opval = ZEXTHISI (GETMEMUHI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 2)));
925 SET_H_GPR (FLD (f_r1), opval);
926 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
929 #undef FLD
931 NEXT (vpc);
933 CASE (sem, INSN_L_LHS) : /* l.lhs $rD,${simm16}($rA) */
935 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
936 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
937 #define FLD(f) abuf->fields.sfmt_l_lwz.f
938 int UNUSED written = 0;
939 IADDR UNUSED pc = abuf->addr;
940 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
943 SI opval = EXTHISI (GETMEMHI (current_cpu, pc, or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 2)));
944 SET_H_GPR (FLD (f_r1), opval);
945 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
948 #undef FLD
950 NEXT (vpc);
952 CASE (sem, INSN_L_SW) : /* l.sw ${simm16-split}($rA),$rB */
954 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
955 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
956 #define FLD(f) abuf->fields.sfmt_l_sw.f
957 int UNUSED written = 0;
958 IADDR UNUSED pc = abuf->addr;
959 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
962 SI tmp_addr;
963 tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 4);
965 USI opval = TRUNCSISI (GET_H_GPR (FLD (f_r3)));
966 SETMEMUSI (current_cpu, pc, tmp_addr, opval);
967 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
969 if (EQSI (ANDSI (tmp_addr, 268435452), CPU (h_atomic_address))) {
971 BI opval = 0;
972 CPU (h_atomic_reserve) = opval;
973 written |= (1 << 4);
974 CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
979 abuf->written = written;
980 #undef FLD
982 NEXT (vpc);
984 CASE (sem, INSN_L_SB) : /* l.sb ${simm16-split}($rA),$rB */
986 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
987 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
988 #define FLD(f) abuf->fields.sfmt_l_sw.f
989 int UNUSED written = 0;
990 IADDR UNUSED pc = abuf->addr;
991 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
994 SI tmp_addr;
995 tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 1);
997 UQI opval = TRUNCSIQI (GET_H_GPR (FLD (f_r3)));
998 SETMEMUQI (current_cpu, pc, tmp_addr, opval);
999 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1001 if (EQSI (ANDSI (tmp_addr, 268435452), CPU (h_atomic_address))) {
1003 BI opval = 0;
1004 CPU (h_atomic_reserve) = opval;
1005 written |= (1 << 4);
1006 CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
1011 abuf->written = written;
1012 #undef FLD
1014 NEXT (vpc);
1016 CASE (sem, INSN_L_SH) : /* l.sh ${simm16-split}($rA),$rB */
1018 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1019 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1020 #define FLD(f) abuf->fields.sfmt_l_sw.f
1021 int UNUSED written = 0;
1022 IADDR UNUSED pc = abuf->addr;
1023 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1026 SI tmp_addr;
1027 tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 2);
1029 UHI opval = TRUNCSIHI (GET_H_GPR (FLD (f_r3)));
1030 SETMEMUHI (current_cpu, pc, tmp_addr, opval);
1031 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1033 if (EQSI (ANDSI (tmp_addr, 268435452), CPU (h_atomic_address))) {
1035 BI opval = 0;
1036 CPU (h_atomic_reserve) = opval;
1037 written |= (1 << 4);
1038 CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
1043 abuf->written = written;
1044 #undef FLD
1046 NEXT (vpc);
1048 CASE (sem, INSN_L_SWA) : /* l.swa ${simm16-split}($rA),$rB */
1050 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1051 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1052 #define FLD(f) abuf->fields.sfmt_l_sw.f
1053 int UNUSED written = 0;
1054 IADDR UNUSED pc = abuf->addr;
1055 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1058 SI tmp_addr;
1059 BI tmp_flag;
1060 tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 4);
1062 USI opval = ANDBI (CPU (h_atomic_reserve), EQSI (tmp_addr, CPU (h_atomic_address)));
1063 SET_H_SYS_SR_F (opval);
1064 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
1066 if (GET_H_SYS_SR_F ()) {
1068 USI opval = TRUNCSISI (GET_H_GPR (FLD (f_r3)));
1069 SETMEMUSI (current_cpu, pc, tmp_addr, opval);
1070 written |= (1 << 7);
1071 CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1075 BI opval = 0;
1076 CPU (h_atomic_reserve) = opval;
1077 CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
1081 abuf->written = written;
1082 #undef FLD
1084 NEXT (vpc);
1086 CASE (sem, INSN_L_SLL) : /* l.sll $rD,$rA,$rB */
1088 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1089 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1090 #define FLD(f) abuf->fields.sfmt_l_sll.f
1091 int UNUSED written = 0;
1092 IADDR UNUSED pc = abuf->addr;
1093 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1096 USI opval = SLLSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1097 SET_H_GPR (FLD (f_r1), opval);
1098 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1101 #undef FLD
1103 NEXT (vpc);
1105 CASE (sem, INSN_L_SLLI) : /* l.slli $rD,$rA,${uimm6} */
1107 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1108 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1109 #define FLD(f) abuf->fields.sfmt_l_slli.f
1110 int UNUSED written = 0;
1111 IADDR UNUSED pc = abuf->addr;
1112 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1115 USI opval = SLLSI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
1116 SET_H_GPR (FLD (f_r1), opval);
1117 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1120 #undef FLD
1122 NEXT (vpc);
1124 CASE (sem, INSN_L_SRL) : /* l.srl $rD,$rA,$rB */
1126 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1127 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1128 #define FLD(f) abuf->fields.sfmt_l_sll.f
1129 int UNUSED written = 0;
1130 IADDR UNUSED pc = abuf->addr;
1131 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1134 USI opval = SRLSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1135 SET_H_GPR (FLD (f_r1), opval);
1136 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1139 #undef FLD
1141 NEXT (vpc);
1143 CASE (sem, INSN_L_SRLI) : /* l.srli $rD,$rA,${uimm6} */
1145 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1146 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1147 #define FLD(f) abuf->fields.sfmt_l_slli.f
1148 int UNUSED written = 0;
1149 IADDR UNUSED pc = abuf->addr;
1150 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1153 USI opval = SRLSI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
1154 SET_H_GPR (FLD (f_r1), opval);
1155 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1158 #undef FLD
1160 NEXT (vpc);
1162 CASE (sem, INSN_L_SRA) : /* l.sra $rD,$rA,$rB */
1164 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1165 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1166 #define FLD(f) abuf->fields.sfmt_l_sll.f
1167 int UNUSED written = 0;
1168 IADDR UNUSED pc = abuf->addr;
1169 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1172 USI opval = SRASI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1173 SET_H_GPR (FLD (f_r1), opval);
1174 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1177 #undef FLD
1179 NEXT (vpc);
1181 CASE (sem, INSN_L_SRAI) : /* l.srai $rD,$rA,${uimm6} */
1183 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1184 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1185 #define FLD(f) abuf->fields.sfmt_l_slli.f
1186 int UNUSED written = 0;
1187 IADDR UNUSED pc = abuf->addr;
1188 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1191 USI opval = SRASI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
1192 SET_H_GPR (FLD (f_r1), opval);
1193 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1196 #undef FLD
1198 NEXT (vpc);
1200 CASE (sem, INSN_L_ROR) : /* l.ror $rD,$rA,$rB */
1202 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1203 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1204 #define FLD(f) abuf->fields.sfmt_l_sll.f
1205 int UNUSED written = 0;
1206 IADDR UNUSED pc = abuf->addr;
1207 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1210 USI opval = RORSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1211 SET_H_GPR (FLD (f_r1), opval);
1212 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1215 #undef FLD
1217 NEXT (vpc);
1219 CASE (sem, INSN_L_RORI) : /* l.rori $rD,$rA,${uimm6} */
1221 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1222 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1223 #define FLD(f) abuf->fields.sfmt_l_slli.f
1224 int UNUSED written = 0;
1225 IADDR UNUSED pc = abuf->addr;
1226 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1229 USI opval = RORSI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
1230 SET_H_GPR (FLD (f_r1), opval);
1231 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1234 #undef FLD
1236 NEXT (vpc);
1238 CASE (sem, INSN_L_AND) : /* l.and $rD,$rA,$rB */
1240 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1241 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1242 #define FLD(f) abuf->fields.sfmt_l_sll.f
1243 int UNUSED written = 0;
1244 IADDR UNUSED pc = abuf->addr;
1245 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1248 USI opval = ANDSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1249 SET_H_GPR (FLD (f_r1), opval);
1250 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1253 #undef FLD
1255 NEXT (vpc);
1257 CASE (sem, INSN_L_OR) : /* l.or $rD,$rA,$rB */
1259 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1260 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1261 #define FLD(f) abuf->fields.sfmt_l_sll.f
1262 int UNUSED written = 0;
1263 IADDR UNUSED pc = abuf->addr;
1264 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1267 USI opval = ORSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1268 SET_H_GPR (FLD (f_r1), opval);
1269 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1272 #undef FLD
1274 NEXT (vpc);
1276 CASE (sem, INSN_L_XOR) : /* l.xor $rD,$rA,$rB */
1278 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1279 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1280 #define FLD(f) abuf->fields.sfmt_l_sll.f
1281 int UNUSED written = 0;
1282 IADDR UNUSED pc = abuf->addr;
1283 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1286 USI opval = XORSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1287 SET_H_GPR (FLD (f_r1), opval);
1288 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1291 #undef FLD
1293 NEXT (vpc);
1295 CASE (sem, INSN_L_ADD) : /* l.add $rD,$rA,$rB */
1297 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1298 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1299 #define FLD(f) abuf->fields.sfmt_l_sll.f
1300 int UNUSED written = 0;
1301 IADDR UNUSED pc = abuf->addr;
1302 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1307 BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
1308 SET_H_SYS_SR_CY (opval);
1309 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1312 BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
1313 SET_H_SYS_SR_OV (opval);
1314 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1317 USI opval = ADDSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1318 SET_H_GPR (FLD (f_r1), opval);
1319 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1322 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1323 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1327 #undef FLD
1329 NEXT (vpc);
1331 CASE (sem, INSN_L_SUB) : /* l.sub $rD,$rA,$rB */
1333 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1334 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1335 #define FLD(f) abuf->fields.sfmt_l_sll.f
1336 int UNUSED written = 0;
1337 IADDR UNUSED pc = abuf->addr;
1338 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1343 BI opval = SUBCFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
1344 SET_H_SYS_SR_CY (opval);
1345 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1348 BI opval = SUBOFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
1349 SET_H_SYS_SR_OV (opval);
1350 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1353 USI opval = SUBSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1354 SET_H_GPR (FLD (f_r1), opval);
1355 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1358 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1359 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1363 #undef FLD
1365 NEXT (vpc);
1367 CASE (sem, INSN_L_ADDC) : /* l.addc $rD,$rA,$rB */
1369 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1370 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1371 #define FLD(f) abuf->fields.sfmt_l_sll.f
1372 int UNUSED written = 0;
1373 IADDR UNUSED pc = abuf->addr;
1374 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1378 BI tmp_tmp_sys_sr_cy;
1379 tmp_tmp_sys_sr_cy = GET_H_SYS_SR_CY ();
1381 BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), tmp_tmp_sys_sr_cy);
1382 SET_H_SYS_SR_CY (opval);
1383 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1386 BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), tmp_tmp_sys_sr_cy);
1387 SET_H_SYS_SR_OV (opval);
1388 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1391 USI opval = ADDCSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), tmp_tmp_sys_sr_cy);
1392 SET_H_GPR (FLD (f_r1), opval);
1393 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1396 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1397 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1401 #undef FLD
1403 NEXT (vpc);
1405 CASE (sem, INSN_L_MUL) : /* l.mul $rD,$rA,$rB */
1407 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1408 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1409 #define FLD(f) abuf->fields.sfmt_l_sll.f
1410 int UNUSED written = 0;
1411 IADDR UNUSED pc = abuf->addr;
1412 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1417 BI opval = MUL2OFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1418 SET_H_SYS_SR_OV (opval);
1419 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1422 USI opval = MULSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1423 SET_H_GPR (FLD (f_r1), opval);
1424 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1427 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1428 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1432 #undef FLD
1434 NEXT (vpc);
1436 CASE (sem, INSN_L_MULD) : /* l.muld $rA,$rB */
1438 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1439 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1440 #define FLD(f) abuf->fields.sfmt_l_sll.f
1441 int UNUSED written = 0;
1442 IADDR UNUSED pc = abuf->addr;
1443 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1446 DI tmp_result;
1447 tmp_result = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (GET_H_GPR (FLD (f_r3))));
1449 SI opval = SUBWORDDISI (tmp_result, 0);
1450 SET_H_MAC_MACHI (opval);
1451 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
1454 SI opval = SUBWORDDISI (tmp_result, 1);
1455 SET_H_MAC_MACLO (opval);
1456 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
1460 #undef FLD
1462 NEXT (vpc);
1464 CASE (sem, INSN_L_MULU) : /* l.mulu $rD,$rA,$rB */
1466 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1467 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1468 #define FLD(f) abuf->fields.sfmt_l_sll.f
1469 int UNUSED written = 0;
1470 IADDR UNUSED pc = abuf->addr;
1471 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1476 BI opval = MUL1OFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1477 SET_H_SYS_SR_CY (opval);
1478 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1481 USI opval = MULSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1482 SET_H_GPR (FLD (f_r1), opval);
1483 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1486 if (ANDIF (GET_H_SYS_SR_CY (), GET_H_SYS_SR_OVE ())) {
1487 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1491 #undef FLD
1493 NEXT (vpc);
1495 CASE (sem, INSN_L_MULDU) : /* l.muldu $rA,$rB */
1497 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1498 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1499 #define FLD(f) abuf->fields.sfmt_l_sll.f
1500 int UNUSED written = 0;
1501 IADDR UNUSED pc = abuf->addr;
1502 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1505 DI tmp_result;
1506 tmp_result = MULDI (ZEXTSIDI (GET_H_GPR (FLD (f_r2))), ZEXTSIDI (GET_H_GPR (FLD (f_r3))));
1508 SI opval = SUBWORDDISI (tmp_result, 0);
1509 SET_H_MAC_MACHI (opval);
1510 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
1513 SI opval = SUBWORDDISI (tmp_result, 1);
1514 SET_H_MAC_MACLO (opval);
1515 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
1519 #undef FLD
1521 NEXT (vpc);
1523 CASE (sem, INSN_L_DIV) : /* l.div $rD,$rA,$rB */
1525 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1526 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1527 #define FLD(f) abuf->fields.sfmt_l_sll.f
1528 int UNUSED written = 0;
1529 IADDR UNUSED pc = abuf->addr;
1530 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1532 if (NESI (GET_H_GPR (FLD (f_r3)), 0)) {
1535 BI opval = 0;
1536 SET_H_SYS_SR_OV (opval);
1537 written |= (1 << 5);
1538 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1541 SI opval = DIVSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1542 SET_H_GPR (FLD (f_r1), opval);
1543 written |= (1 << 4);
1544 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1547 } else {
1550 BI opval = 1;
1551 SET_H_SYS_SR_OV (opval);
1552 written |= (1 << 5);
1553 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1555 if (GET_H_SYS_SR_OVE ()) {
1556 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1561 abuf->written = written;
1562 #undef FLD
1564 NEXT (vpc);
1566 CASE (sem, INSN_L_DIVU) : /* l.divu $rD,$rA,$rB */
1568 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1569 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1570 #define FLD(f) abuf->fields.sfmt_l_sll.f
1571 int UNUSED written = 0;
1572 IADDR UNUSED pc = abuf->addr;
1573 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1575 if (NESI (GET_H_GPR (FLD (f_r3)), 0)) {
1578 BI opval = 0;
1579 SET_H_SYS_SR_CY (opval);
1580 written |= (1 << 5);
1581 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1584 USI opval = UDIVSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1585 SET_H_GPR (FLD (f_r1), opval);
1586 written |= (1 << 4);
1587 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1590 } else {
1593 BI opval = 1;
1594 SET_H_SYS_SR_CY (opval);
1595 written |= (1 << 5);
1596 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1598 if (GET_H_SYS_SR_OVE ()) {
1599 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1604 abuf->written = written;
1605 #undef FLD
1607 NEXT (vpc);
1609 CASE (sem, INSN_L_FF1) : /* l.ff1 $rD,$rA */
1611 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1612 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1613 #define FLD(f) abuf->fields.sfmt_l_slli.f
1614 int UNUSED written = 0;
1615 IADDR UNUSED pc = abuf->addr;
1616 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1619 USI opval = or1k32bf_ff1 (current_cpu, GET_H_GPR (FLD (f_r2)));
1620 SET_H_GPR (FLD (f_r1), opval);
1621 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1624 #undef FLD
1626 NEXT (vpc);
1628 CASE (sem, INSN_L_FL1) : /* l.fl1 $rD,$rA */
1630 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1632 #define FLD(f) abuf->fields.sfmt_l_slli.f
1633 int UNUSED written = 0;
1634 IADDR UNUSED pc = abuf->addr;
1635 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1638 USI opval = or1k32bf_fl1 (current_cpu, GET_H_GPR (FLD (f_r2)));
1639 SET_H_GPR (FLD (f_r1), opval);
1640 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1643 #undef FLD
1645 NEXT (vpc);
1647 CASE (sem, INSN_L_ANDI) : /* l.andi $rD,$rA,$uimm16 */
1649 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1650 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1651 #define FLD(f) abuf->fields.sfmt_l_mfspr.f
1652 int UNUSED written = 0;
1653 IADDR UNUSED pc = abuf->addr;
1654 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1657 USI opval = ANDSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16)));
1658 SET_H_GPR (FLD (f_r1), opval);
1659 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1662 #undef FLD
1664 NEXT (vpc);
1666 CASE (sem, INSN_L_ORI) : /* l.ori $rD,$rA,$uimm16 */
1668 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1669 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1670 #define FLD(f) abuf->fields.sfmt_l_mfspr.f
1671 int UNUSED written = 0;
1672 IADDR UNUSED pc = abuf->addr;
1673 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1676 USI opval = ORSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16)));
1677 SET_H_GPR (FLD (f_r1), opval);
1678 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1681 #undef FLD
1683 NEXT (vpc);
1685 CASE (sem, INSN_L_XORI) : /* l.xori $rD,$rA,$simm16 */
1687 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1688 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1689 #define FLD(f) abuf->fields.sfmt_l_lwz.f
1690 int UNUSED written = 0;
1691 IADDR UNUSED pc = abuf->addr;
1692 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1695 USI opval = XORSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
1696 SET_H_GPR (FLD (f_r1), opval);
1697 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1700 #undef FLD
1702 NEXT (vpc);
1704 CASE (sem, INSN_L_ADDI) : /* l.addi $rD,$rA,$simm16 */
1706 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1707 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1708 #define FLD(f) abuf->fields.sfmt_l_lwz.f
1709 int UNUSED written = 0;
1710 IADDR UNUSED pc = abuf->addr;
1711 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1716 BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 0);
1717 SET_H_SYS_SR_CY (opval);
1718 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1721 BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 0);
1722 SET_H_SYS_SR_OV (opval);
1723 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1726 USI opval = ADDSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
1727 SET_H_GPR (FLD (f_r1), opval);
1728 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1731 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1732 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1736 #undef FLD
1738 NEXT (vpc);
1740 CASE (sem, INSN_L_ADDIC) : /* l.addic $rD,$rA,$simm16 */
1742 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1743 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1744 #define FLD(f) abuf->fields.sfmt_l_lwz.f
1745 int UNUSED written = 0;
1746 IADDR UNUSED pc = abuf->addr;
1747 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1751 BI tmp_tmp_sys_sr_cy;
1752 tmp_tmp_sys_sr_cy = GET_H_SYS_SR_CY ();
1754 BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), tmp_tmp_sys_sr_cy);
1755 SET_H_SYS_SR_CY (opval);
1756 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
1759 BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), tmp_tmp_sys_sr_cy);
1760 SET_H_SYS_SR_OV (opval);
1761 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1764 SI opval = ADDCSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), tmp_tmp_sys_sr_cy);
1765 SET_H_GPR (FLD (f_r1), opval);
1766 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1769 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1770 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1774 #undef FLD
1776 NEXT (vpc);
1778 CASE (sem, INSN_L_MULI) : /* l.muli $rD,$rA,$simm16 */
1780 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1781 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1782 #define FLD(f) abuf->fields.sfmt_l_lwz.f
1783 int UNUSED written = 0;
1784 IADDR UNUSED pc = abuf->addr;
1785 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1790 USI opval = MUL2OFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
1791 SET_H_SYS_SR_OV (opval);
1792 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
1795 USI opval = MULSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
1796 SET_H_GPR (FLD (f_r1), opval);
1797 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1800 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
1801 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
1805 #undef FLD
1807 NEXT (vpc);
1809 CASE (sem, INSN_L_EXTHS) : /* l.exths $rD,$rA */
1811 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1812 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1813 #define FLD(f) abuf->fields.sfmt_l_slli.f
1814 int UNUSED written = 0;
1815 IADDR UNUSED pc = abuf->addr;
1816 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1819 USI opval = EXTHISI (TRUNCSIHI (GET_H_GPR (FLD (f_r2))));
1820 SET_H_GPR (FLD (f_r1), opval);
1821 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1824 #undef FLD
1826 NEXT (vpc);
1828 CASE (sem, INSN_L_EXTBS) : /* l.extbs $rD,$rA */
1830 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1831 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1832 #define FLD(f) abuf->fields.sfmt_l_slli.f
1833 int UNUSED written = 0;
1834 IADDR UNUSED pc = abuf->addr;
1835 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1838 USI opval = EXTQISI (TRUNCSIQI (GET_H_GPR (FLD (f_r2))));
1839 SET_H_GPR (FLD (f_r1), opval);
1840 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1843 #undef FLD
1845 NEXT (vpc);
1847 CASE (sem, INSN_L_EXTHZ) : /* l.exthz $rD,$rA */
1849 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1850 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1851 #define FLD(f) abuf->fields.sfmt_l_slli.f
1852 int UNUSED written = 0;
1853 IADDR UNUSED pc = abuf->addr;
1854 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1857 USI opval = ZEXTHISI (TRUNCSIHI (GET_H_GPR (FLD (f_r2))));
1858 SET_H_GPR (FLD (f_r1), opval);
1859 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1862 #undef FLD
1864 NEXT (vpc);
1866 CASE (sem, INSN_L_EXTBZ) : /* l.extbz $rD,$rA */
1868 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1869 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1870 #define FLD(f) abuf->fields.sfmt_l_slli.f
1871 int UNUSED written = 0;
1872 IADDR UNUSED pc = abuf->addr;
1873 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1876 USI opval = ZEXTQISI (TRUNCSIQI (GET_H_GPR (FLD (f_r2))));
1877 SET_H_GPR (FLD (f_r1), opval);
1878 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1881 #undef FLD
1883 NEXT (vpc);
1885 CASE (sem, INSN_L_EXTWS) : /* l.extws $rD,$rA */
1887 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1888 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1889 #define FLD(f) abuf->fields.sfmt_l_slli.f
1890 int UNUSED written = 0;
1891 IADDR UNUSED pc = abuf->addr;
1892 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1895 USI opval = EXTSISI (TRUNCSISI (GET_H_GPR (FLD (f_r2))));
1896 SET_H_GPR (FLD (f_r1), opval);
1897 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1900 #undef FLD
1902 NEXT (vpc);
1904 CASE (sem, INSN_L_EXTWZ) : /* l.extwz $rD,$rA */
1906 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1907 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1908 #define FLD(f) abuf->fields.sfmt_l_slli.f
1909 int UNUSED written = 0;
1910 IADDR UNUSED pc = abuf->addr;
1911 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1914 USI opval = ZEXTSISI (TRUNCSISI (GET_H_GPR (FLD (f_r2))));
1915 SET_H_GPR (FLD (f_r1), opval);
1916 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1919 #undef FLD
1921 NEXT (vpc);
1923 CASE (sem, INSN_L_CMOV) : /* l.cmov $rD,$rA,$rB */
1925 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1926 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1927 #define FLD(f) abuf->fields.sfmt_l_sll.f
1928 int UNUSED written = 0;
1929 IADDR UNUSED pc = abuf->addr;
1930 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1932 if (GET_H_SYS_SR_F ()) {
1934 USI opval = GET_H_GPR (FLD (f_r2));
1935 SET_H_GPR (FLD (f_r1), opval);
1936 written |= (1 << 3);
1937 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1939 } else {
1941 USI opval = GET_H_GPR (FLD (f_r3));
1942 SET_H_GPR (FLD (f_r1), opval);
1943 written |= (1 << 3);
1944 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
1948 abuf->written = written;
1949 #undef FLD
1951 NEXT (vpc);
1953 CASE (sem, INSN_L_SFGTS) : /* l.sfgts $rA,$rB */
1955 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1956 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1957 #define FLD(f) abuf->fields.sfmt_l_sll.f
1958 int UNUSED written = 0;
1959 IADDR UNUSED pc = abuf->addr;
1960 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1963 USI opval = GTSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
1964 SET_H_SYS_SR_F (opval);
1965 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
1968 #undef FLD
1970 NEXT (vpc);
1972 CASE (sem, INSN_L_SFGTSI) : /* l.sfgtsi $rA,$simm16 */
1974 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1975 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1976 #define FLD(f) abuf->fields.sfmt_l_lwz.f
1977 int UNUSED written = 0;
1978 IADDR UNUSED pc = abuf->addr;
1979 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1982 USI opval = GTSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
1983 SET_H_SYS_SR_F (opval);
1984 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
1987 #undef FLD
1989 NEXT (vpc);
1991 CASE (sem, INSN_L_SFGTU) : /* l.sfgtu $rA,$rB */
1993 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
1994 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1995 #define FLD(f) abuf->fields.sfmt_l_sll.f
1996 int UNUSED written = 0;
1997 IADDR UNUSED pc = abuf->addr;
1998 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2001 USI opval = GTUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2002 SET_H_SYS_SR_F (opval);
2003 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2006 #undef FLD
2008 NEXT (vpc);
2010 CASE (sem, INSN_L_SFGTUI) : /* l.sfgtui $rA,$simm16 */
2012 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2013 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2014 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2015 int UNUSED written = 0;
2016 IADDR UNUSED pc = abuf->addr;
2017 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2020 USI opval = GTUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2021 SET_H_SYS_SR_F (opval);
2022 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2025 #undef FLD
2027 NEXT (vpc);
2029 CASE (sem, INSN_L_SFGES) : /* l.sfges $rA,$rB */
2031 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2032 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2033 #define FLD(f) abuf->fields.sfmt_l_sll.f
2034 int UNUSED written = 0;
2035 IADDR UNUSED pc = abuf->addr;
2036 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2039 USI opval = GESI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2040 SET_H_SYS_SR_F (opval);
2041 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2044 #undef FLD
2046 NEXT (vpc);
2048 CASE (sem, INSN_L_SFGESI) : /* l.sfgesi $rA,$simm16 */
2050 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2051 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2052 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2053 int UNUSED written = 0;
2054 IADDR UNUSED pc = abuf->addr;
2055 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2058 USI opval = GESI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2059 SET_H_SYS_SR_F (opval);
2060 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2063 #undef FLD
2065 NEXT (vpc);
2067 CASE (sem, INSN_L_SFGEU) : /* l.sfgeu $rA,$rB */
2069 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2070 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2071 #define FLD(f) abuf->fields.sfmt_l_sll.f
2072 int UNUSED written = 0;
2073 IADDR UNUSED pc = abuf->addr;
2074 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2077 USI opval = GEUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2078 SET_H_SYS_SR_F (opval);
2079 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2082 #undef FLD
2084 NEXT (vpc);
2086 CASE (sem, INSN_L_SFGEUI) : /* l.sfgeui $rA,$simm16 */
2088 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2089 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2090 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2091 int UNUSED written = 0;
2092 IADDR UNUSED pc = abuf->addr;
2093 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2096 USI opval = GEUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2097 SET_H_SYS_SR_F (opval);
2098 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2101 #undef FLD
2103 NEXT (vpc);
2105 CASE (sem, INSN_L_SFLTS) : /* l.sflts $rA,$rB */
2107 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2108 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2109 #define FLD(f) abuf->fields.sfmt_l_sll.f
2110 int UNUSED written = 0;
2111 IADDR UNUSED pc = abuf->addr;
2112 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2115 USI opval = LTSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2116 SET_H_SYS_SR_F (opval);
2117 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2120 #undef FLD
2122 NEXT (vpc);
2124 CASE (sem, INSN_L_SFLTSI) : /* l.sfltsi $rA,$simm16 */
2126 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2127 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2128 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2129 int UNUSED written = 0;
2130 IADDR UNUSED pc = abuf->addr;
2131 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2134 USI opval = LTSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2135 SET_H_SYS_SR_F (opval);
2136 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2139 #undef FLD
2141 NEXT (vpc);
2143 CASE (sem, INSN_L_SFLTU) : /* l.sfltu $rA,$rB */
2145 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2146 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2147 #define FLD(f) abuf->fields.sfmt_l_sll.f
2148 int UNUSED written = 0;
2149 IADDR UNUSED pc = abuf->addr;
2150 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2153 USI opval = LTUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2154 SET_H_SYS_SR_F (opval);
2155 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2158 #undef FLD
2160 NEXT (vpc);
2162 CASE (sem, INSN_L_SFLTUI) : /* l.sfltui $rA,$simm16 */
2164 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2165 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2166 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2167 int UNUSED written = 0;
2168 IADDR UNUSED pc = abuf->addr;
2169 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2172 USI opval = LTUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2173 SET_H_SYS_SR_F (opval);
2174 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2177 #undef FLD
2179 NEXT (vpc);
2181 CASE (sem, INSN_L_SFLES) : /* l.sfles $rA,$rB */
2183 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2184 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2185 #define FLD(f) abuf->fields.sfmt_l_sll.f
2186 int UNUSED written = 0;
2187 IADDR UNUSED pc = abuf->addr;
2188 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2191 USI opval = LESI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2192 SET_H_SYS_SR_F (opval);
2193 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2196 #undef FLD
2198 NEXT (vpc);
2200 CASE (sem, INSN_L_SFLESI) : /* l.sflesi $rA,$simm16 */
2202 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2203 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2204 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2205 int UNUSED written = 0;
2206 IADDR UNUSED pc = abuf->addr;
2207 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2210 USI opval = LESI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2211 SET_H_SYS_SR_F (opval);
2212 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2215 #undef FLD
2217 NEXT (vpc);
2219 CASE (sem, INSN_L_SFLEU) : /* l.sfleu $rA,$rB */
2221 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2222 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2223 #define FLD(f) abuf->fields.sfmt_l_sll.f
2224 int UNUSED written = 0;
2225 IADDR UNUSED pc = abuf->addr;
2226 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2229 USI opval = LEUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2230 SET_H_SYS_SR_F (opval);
2231 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2234 #undef FLD
2236 NEXT (vpc);
2238 CASE (sem, INSN_L_SFLEUI) : /* l.sfleui $rA,$simm16 */
2240 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2241 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2242 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2243 int UNUSED written = 0;
2244 IADDR UNUSED pc = abuf->addr;
2245 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2248 USI opval = LEUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2249 SET_H_SYS_SR_F (opval);
2250 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2253 #undef FLD
2255 NEXT (vpc);
2257 CASE (sem, INSN_L_SFEQ) : /* l.sfeq $rA,$rB */
2259 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2260 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2261 #define FLD(f) abuf->fields.sfmt_l_sll.f
2262 int UNUSED written = 0;
2263 IADDR UNUSED pc = abuf->addr;
2264 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2267 USI opval = EQSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2268 SET_H_SYS_SR_F (opval);
2269 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2272 #undef FLD
2274 NEXT (vpc);
2276 CASE (sem, INSN_L_SFEQI) : /* l.sfeqi $rA,$simm16 */
2278 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2279 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2280 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2281 int UNUSED written = 0;
2282 IADDR UNUSED pc = abuf->addr;
2283 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2286 USI opval = EQSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2287 SET_H_SYS_SR_F (opval);
2288 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2291 #undef FLD
2293 NEXT (vpc);
2295 CASE (sem, INSN_L_SFNE) : /* l.sfne $rA,$rB */
2297 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2298 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2299 #define FLD(f) abuf->fields.sfmt_l_sll.f
2300 int UNUSED written = 0;
2301 IADDR UNUSED pc = abuf->addr;
2302 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2305 USI opval = NESI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
2306 SET_H_SYS_SR_F (opval);
2307 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2310 #undef FLD
2312 NEXT (vpc);
2314 CASE (sem, INSN_L_SFNEI) : /* l.sfnei $rA,$simm16 */
2316 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2317 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2318 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2319 int UNUSED written = 0;
2320 IADDR UNUSED pc = abuf->addr;
2321 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2324 USI opval = NESI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
2325 SET_H_SYS_SR_F (opval);
2326 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2329 #undef FLD
2331 NEXT (vpc);
2333 CASE (sem, INSN_L_MAC) : /* l.mac $rA,$rB */
2335 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2336 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2337 #define FLD(f) abuf->fields.sfmt_l_sll.f
2338 int UNUSED written = 0;
2339 IADDR UNUSED pc = abuf->addr;
2340 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2344 DI tmp_prod;
2345 DI tmp_mac;
2346 DI tmp_result;
2347 tmp_prod = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (GET_H_GPR (FLD (f_r3))));
2348 tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
2349 tmp_result = ADDDI (tmp_prod, tmp_mac);
2351 SI opval = SUBWORDDISI (tmp_result, 0);
2352 SET_H_MAC_MACHI (opval);
2353 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
2356 SI opval = SUBWORDDISI (tmp_result, 1);
2357 SET_H_MAC_MACLO (opval);
2358 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
2361 BI opval = ADDOFDI (tmp_prod, tmp_mac, 0);
2362 SET_H_SYS_SR_OV (opval);
2363 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
2366 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
2367 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
2371 #undef FLD
2373 NEXT (vpc);
2375 CASE (sem, INSN_L_MACI) : /* l.maci $rA,${simm16} */
2377 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2378 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2379 #define FLD(f) abuf->fields.sfmt_l_lwz.f
2380 int UNUSED written = 0;
2381 IADDR UNUSED pc = abuf->addr;
2382 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2386 DI tmp_prod;
2387 DI tmp_mac;
2388 DI tmp_result;
2389 tmp_prod = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (FLD (f_simm16)));
2390 tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
2391 tmp_result = ADDDI (tmp_mac, tmp_prod);
2393 SI opval = SUBWORDDISI (tmp_result, 0);
2394 SET_H_MAC_MACHI (opval);
2395 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
2398 SI opval = SUBWORDDISI (tmp_result, 1);
2399 SET_H_MAC_MACLO (opval);
2400 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
2403 BI opval = ADDOFDI (tmp_prod, tmp_mac, 0);
2404 SET_H_SYS_SR_OV (opval);
2405 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
2408 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
2409 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
2413 #undef FLD
2415 NEXT (vpc);
2417 CASE (sem, INSN_L_MACU) : /* l.macu $rA,$rB */
2419 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2420 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2421 #define FLD(f) abuf->fields.sfmt_l_sll.f
2422 int UNUSED written = 0;
2423 IADDR UNUSED pc = abuf->addr;
2424 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2428 DI tmp_prod;
2429 DI tmp_mac;
2430 DI tmp_result;
2431 tmp_prod = MULDI (ZEXTSIDI (GET_H_GPR (FLD (f_r2))), ZEXTSIDI (GET_H_GPR (FLD (f_r3))));
2432 tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
2433 tmp_result = ADDDI (tmp_prod, tmp_mac);
2435 SI opval = SUBWORDDISI (tmp_result, 0);
2436 SET_H_MAC_MACHI (opval);
2437 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
2440 SI opval = SUBWORDDISI (tmp_result, 1);
2441 SET_H_MAC_MACLO (opval);
2442 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
2445 BI opval = ADDCFDI (tmp_prod, tmp_mac, 0);
2446 SET_H_SYS_SR_CY (opval);
2447 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
2450 if (ANDIF (GET_H_SYS_SR_CY (), GET_H_SYS_SR_OVE ())) {
2451 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
2455 #undef FLD
2457 NEXT (vpc);
2459 CASE (sem, INSN_L_MSB) : /* l.msb $rA,$rB */
2461 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2462 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2463 #define FLD(f) abuf->fields.sfmt_l_sll.f
2464 int UNUSED written = 0;
2465 IADDR UNUSED pc = abuf->addr;
2466 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2470 DI tmp_prod;
2471 DI tmp_mac;
2472 DI tmp_result;
2473 tmp_prod = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (GET_H_GPR (FLD (f_r3))));
2474 tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
2475 tmp_result = SUBDI (tmp_mac, tmp_prod);
2477 SI opval = SUBWORDDISI (tmp_result, 0);
2478 SET_H_MAC_MACHI (opval);
2479 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
2482 SI opval = SUBWORDDISI (tmp_result, 1);
2483 SET_H_MAC_MACLO (opval);
2484 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
2487 BI opval = SUBOFDI (tmp_mac, tmp_result, 0);
2488 SET_H_SYS_SR_OV (opval);
2489 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
2492 if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
2493 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
2497 #undef FLD
2499 NEXT (vpc);
2501 CASE (sem, INSN_L_MSBU) : /* l.msbu $rA,$rB */
2503 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2504 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2505 #define FLD(f) abuf->fields.sfmt_l_sll.f
2506 int UNUSED written = 0;
2507 IADDR UNUSED pc = abuf->addr;
2508 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2512 DI tmp_prod;
2513 DI tmp_mac;
2514 DI tmp_result;
2515 tmp_prod = MULDI (ZEXTSIDI (GET_H_GPR (FLD (f_r2))), ZEXTSIDI (GET_H_GPR (FLD (f_r3))));
2516 tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
2517 tmp_result = SUBDI (tmp_mac, tmp_prod);
2519 SI opval = SUBWORDDISI (tmp_result, 0);
2520 SET_H_MAC_MACHI (opval);
2521 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
2524 SI opval = SUBWORDDISI (tmp_result, 1);
2525 SET_H_MAC_MACLO (opval);
2526 CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
2529 BI opval = SUBCFDI (tmp_mac, tmp_result, 0);
2530 SET_H_SYS_SR_CY (opval);
2531 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
2534 if (ANDIF (GET_H_SYS_SR_CY (), GET_H_SYS_SR_OVE ())) {
2535 or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
2539 #undef FLD
2541 NEXT (vpc);
2543 CASE (sem, INSN_L_CUST1) : /* l.cust1 */
2545 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2546 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2547 #define FLD(f) abuf->fields.sfmt_empty.f
2548 int UNUSED written = 0;
2549 IADDR UNUSED pc = abuf->addr;
2550 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2552 ((void) 0); /*nop*/
2554 #undef FLD
2556 NEXT (vpc);
2558 CASE (sem, INSN_L_CUST2) : /* l.cust2 */
2560 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2561 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2562 #define FLD(f) abuf->fields.sfmt_empty.f
2563 int UNUSED written = 0;
2564 IADDR UNUSED pc = abuf->addr;
2565 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2567 ((void) 0); /*nop*/
2569 #undef FLD
2571 NEXT (vpc);
2573 CASE (sem, INSN_L_CUST3) : /* l.cust3 */
2575 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2576 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2577 #define FLD(f) abuf->fields.sfmt_empty.f
2578 int UNUSED written = 0;
2579 IADDR UNUSED pc = abuf->addr;
2580 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2582 ((void) 0); /*nop*/
2584 #undef FLD
2586 NEXT (vpc);
2588 CASE (sem, INSN_L_CUST4) : /* l.cust4 */
2590 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2591 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2592 #define FLD(f) abuf->fields.sfmt_empty.f
2593 int UNUSED written = 0;
2594 IADDR UNUSED pc = abuf->addr;
2595 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2597 ((void) 0); /*nop*/
2599 #undef FLD
2601 NEXT (vpc);
2603 CASE (sem, INSN_L_CUST5) : /* l.cust5 */
2605 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2606 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2607 #define FLD(f) abuf->fields.sfmt_empty.f
2608 int UNUSED written = 0;
2609 IADDR UNUSED pc = abuf->addr;
2610 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2612 ((void) 0); /*nop*/
2614 #undef FLD
2616 NEXT (vpc);
2618 CASE (sem, INSN_L_CUST6) : /* l.cust6 */
2620 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2621 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2622 #define FLD(f) abuf->fields.sfmt_empty.f
2623 int UNUSED written = 0;
2624 IADDR UNUSED pc = abuf->addr;
2625 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2627 ((void) 0); /*nop*/
2629 #undef FLD
2631 NEXT (vpc);
2633 CASE (sem, INSN_L_CUST7) : /* l.cust7 */
2635 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2636 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2637 #define FLD(f) abuf->fields.sfmt_empty.f
2638 int UNUSED written = 0;
2639 IADDR UNUSED pc = abuf->addr;
2640 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2642 ((void) 0); /*nop*/
2644 #undef FLD
2646 NEXT (vpc);
2648 CASE (sem, INSN_L_CUST8) : /* l.cust8 */
2650 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2651 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2652 #define FLD(f) abuf->fields.sfmt_empty.f
2653 int UNUSED written = 0;
2654 IADDR UNUSED pc = abuf->addr;
2655 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2657 ((void) 0); /*nop*/
2659 #undef FLD
2661 NEXT (vpc);
2663 CASE (sem, INSN_LF_ADD_S) : /* lf.add.s $rDSF,$rASF,$rBSF */
2665 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2666 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2667 #define FLD(f) abuf->fields.sfmt_l_sll.f
2668 int UNUSED written = 0;
2669 IADDR UNUSED pc = abuf->addr;
2670 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2673 SF opval = CGEN_CPU_FPU (current_cpu)->ops->addsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2674 SET_H_FSR (FLD (f_r1), opval);
2675 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
2678 #undef FLD
2680 NEXT (vpc);
2682 CASE (sem, INSN_LF_ADD_D32) : /* lf.add.d $rDD32F,$rAD32F,$rBD32F */
2684 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2685 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2686 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2687 int UNUSED written = 0;
2688 IADDR UNUSED pc = abuf->addr;
2689 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2692 DF opval = CGEN_CPU_FPU (current_cpu)->ops->adddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2693 SET_H_FD32R (FLD (f_rdd32), opval);
2694 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2697 #undef FLD
2699 NEXT (vpc);
2701 CASE (sem, INSN_LF_SUB_S) : /* lf.sub.s $rDSF,$rASF,$rBSF */
2703 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2704 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2705 #define FLD(f) abuf->fields.sfmt_l_sll.f
2706 int UNUSED written = 0;
2707 IADDR UNUSED pc = abuf->addr;
2708 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2711 SF opval = CGEN_CPU_FPU (current_cpu)->ops->subsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2712 SET_H_FSR (FLD (f_r1), opval);
2713 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
2716 #undef FLD
2718 NEXT (vpc);
2720 CASE (sem, INSN_LF_SUB_D32) : /* lf.sub.d $rDD32F,$rAD32F,$rBD32F */
2722 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2723 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2724 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2725 int UNUSED written = 0;
2726 IADDR UNUSED pc = abuf->addr;
2727 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2730 DF opval = CGEN_CPU_FPU (current_cpu)->ops->subdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2731 SET_H_FD32R (FLD (f_rdd32), opval);
2732 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2735 #undef FLD
2737 NEXT (vpc);
2739 CASE (sem, INSN_LF_MUL_S) : /* lf.mul.s $rDSF,$rASF,$rBSF */
2741 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2742 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2743 #define FLD(f) abuf->fields.sfmt_l_sll.f
2744 int UNUSED written = 0;
2745 IADDR UNUSED pc = abuf->addr;
2746 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2749 SF opval = CGEN_CPU_FPU (current_cpu)->ops->mulsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2750 SET_H_FSR (FLD (f_r1), opval);
2751 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
2754 #undef FLD
2756 NEXT (vpc);
2758 CASE (sem, INSN_LF_MUL_D32) : /* lf.mul.d $rDD32F,$rAD32F,$rBD32F */
2760 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2761 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2762 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2763 int UNUSED written = 0;
2764 IADDR UNUSED pc = abuf->addr;
2765 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2768 DF opval = CGEN_CPU_FPU (current_cpu)->ops->muldf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2769 SET_H_FD32R (FLD (f_rdd32), opval);
2770 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2773 #undef FLD
2775 NEXT (vpc);
2777 CASE (sem, INSN_LF_DIV_S) : /* lf.div.s $rDSF,$rASF,$rBSF */
2779 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2780 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2781 #define FLD(f) abuf->fields.sfmt_l_sll.f
2782 int UNUSED written = 0;
2783 IADDR UNUSED pc = abuf->addr;
2784 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2787 SF opval = CGEN_CPU_FPU (current_cpu)->ops->divsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2788 SET_H_FSR (FLD (f_r1), opval);
2789 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
2792 #undef FLD
2794 NEXT (vpc);
2796 CASE (sem, INSN_LF_DIV_D32) : /* lf.div.d $rDD32F,$rAD32F,$rBD32F */
2798 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2799 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2800 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2801 int UNUSED written = 0;
2802 IADDR UNUSED pc = abuf->addr;
2803 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2806 DF opval = CGEN_CPU_FPU (current_cpu)->ops->divdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2807 SET_H_FD32R (FLD (f_rdd32), opval);
2808 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2811 #undef FLD
2813 NEXT (vpc);
2815 CASE (sem, INSN_LF_REM_S) : /* lf.rem.s $rDSF,$rASF,$rBSF */
2817 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2818 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2819 #define FLD(f) abuf->fields.sfmt_l_sll.f
2820 int UNUSED written = 0;
2821 IADDR UNUSED pc = abuf->addr;
2822 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2825 SF opval = CGEN_CPU_FPU (current_cpu)->ops->remsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2826 SET_H_FSR (FLD (f_r1), opval);
2827 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
2830 #undef FLD
2832 NEXT (vpc);
2834 CASE (sem, INSN_LF_REM_D32) : /* lf.rem.d $rDD32F,$rAD32F,$rBD32F */
2836 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2837 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2838 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2839 int UNUSED written = 0;
2840 IADDR UNUSED pc = abuf->addr;
2841 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2844 DF opval = CGEN_CPU_FPU (current_cpu)->ops->remdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2845 SET_H_FD32R (FLD (f_rdd32), opval);
2846 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2849 #undef FLD
2851 NEXT (vpc);
2853 CASE (sem, INSN_LF_ITOF_S) : /* lf.itof.s $rDSF,$rA */
2855 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2856 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2857 #define FLD(f) abuf->fields.sfmt_l_slli.f
2858 int UNUSED written = 0;
2859 IADDR UNUSED pc = abuf->addr;
2860 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2863 SF opval = CGEN_CPU_FPU (current_cpu)->ops->floatsisf (CGEN_CPU_FPU (current_cpu), (GET_H_SYS_FPCSR_RM () == 0) ? (1) : (GET_H_SYS_FPCSR_RM () == 1) ? (3) : (GET_H_SYS_FPCSR_RM () == 2) ? (4) : (5), TRUNCSISI (GET_H_GPR (FLD (f_r2))));
2864 SET_H_FSR (FLD (f_r1), opval);
2865 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
2868 #undef FLD
2870 NEXT (vpc);
2872 CASE (sem, INSN_LF_ITOF_D32) : /* lf.itof.d $rDD32F,$rADI */
2874 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2875 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2876 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2877 int UNUSED written = 0;
2878 IADDR UNUSED pc = abuf->addr;
2879 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2882 DF opval = CGEN_CPU_FPU (current_cpu)->ops->floatdidf (CGEN_CPU_FPU (current_cpu), (GET_H_SYS_FPCSR_RM () == 0) ? (1) : (GET_H_SYS_FPCSR_RM () == 1) ? (3) : (GET_H_SYS_FPCSR_RM () == 2) ? (4) : (5), GET_H_I64R (FLD (f_rad32)));
2883 SET_H_FD32R (FLD (f_rdd32), opval);
2884 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2887 #undef FLD
2889 NEXT (vpc);
2891 CASE (sem, INSN_LF_FTOI_S) : /* lf.ftoi.s $rD,$rASF */
2893 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2894 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2895 #define FLD(f) abuf->fields.sfmt_l_slli.f
2896 int UNUSED written = 0;
2897 IADDR UNUSED pc = abuf->addr;
2898 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2901 SI opval = EXTSISI (CGEN_CPU_FPU (current_cpu)->ops->fixsfsi (CGEN_CPU_FPU (current_cpu), (GET_H_SYS_FPCSR_RM () == 0) ? (1) : (GET_H_SYS_FPCSR_RM () == 1) ? (3) : (GET_H_SYS_FPCSR_RM () == 2) ? (4) : (5), GET_H_FSR (FLD (f_r2))));
2902 SET_H_GPR (FLD (f_r1), opval);
2903 CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
2906 #undef FLD
2908 NEXT (vpc);
2910 CASE (sem, INSN_LF_FTOI_D32) : /* lf.ftoi.d $rDDI,$rAD32F */
2912 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2913 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2914 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2915 int UNUSED written = 0;
2916 IADDR UNUSED pc = abuf->addr;
2917 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2920 DI opval = CGEN_CPU_FPU (current_cpu)->ops->fixdfdi (CGEN_CPU_FPU (current_cpu), (GET_H_SYS_FPCSR_RM () == 0) ? (1) : (GET_H_SYS_FPCSR_RM () == 1) ? (3) : (GET_H_SYS_FPCSR_RM () == 2) ? (4) : (5), GET_H_FD32R (FLD (f_rad32)));
2921 SET_H_I64R (FLD (f_rdd32), opval);
2922 CGEN_TRACE_RESULT (current_cpu, abuf, "i64r", 'D', opval);
2925 #undef FLD
2927 NEXT (vpc);
2929 CASE (sem, INSN_LF_SFEQ_S) : /* lf.sfeq.s $rASF,$rBSF */
2931 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2932 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2933 #define FLD(f) abuf->fields.sfmt_l_sll.f
2934 int UNUSED written = 0;
2935 IADDR UNUSED pc = abuf->addr;
2936 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2939 BI opval = CGEN_CPU_FPU (current_cpu)->ops->eqsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2940 SET_H_SYS_SR_F (opval);
2941 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2944 #undef FLD
2946 NEXT (vpc);
2948 CASE (sem, INSN_LF_SFEQ_D32) : /* lf.sfeq.d $rAD32F,$rBD32F */
2950 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2951 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2952 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2953 int UNUSED written = 0;
2954 IADDR UNUSED pc = abuf->addr;
2955 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2958 BI opval = CGEN_CPU_FPU (current_cpu)->ops->eqdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2959 SET_H_SYS_SR_F (opval);
2960 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2963 #undef FLD
2965 NEXT (vpc);
2967 CASE (sem, INSN_LF_SFNE_S) : /* lf.sfne.s $rASF,$rBSF */
2969 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2970 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2971 #define FLD(f) abuf->fields.sfmt_l_sll.f
2972 int UNUSED written = 0;
2973 IADDR UNUSED pc = abuf->addr;
2974 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2977 BI opval = CGEN_CPU_FPU (current_cpu)->ops->nesf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
2978 SET_H_SYS_SR_F (opval);
2979 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
2982 #undef FLD
2984 NEXT (vpc);
2986 CASE (sem, INSN_LF_SFNE_D32) : /* lf.sfne.d $rAD32F,$rBD32F */
2988 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
2989 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2990 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2991 int UNUSED written = 0;
2992 IADDR UNUSED pc = abuf->addr;
2993 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2996 BI opval = CGEN_CPU_FPU (current_cpu)->ops->nedf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
2997 SET_H_SYS_SR_F (opval);
2998 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3001 #undef FLD
3003 NEXT (vpc);
3005 CASE (sem, INSN_LF_SFGE_S) : /* lf.sfge.s $rASF,$rBSF */
3007 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3008 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3009 #define FLD(f) abuf->fields.sfmt_l_sll.f
3010 int UNUSED written = 0;
3011 IADDR UNUSED pc = abuf->addr;
3012 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3015 BI opval = CGEN_CPU_FPU (current_cpu)->ops->gesf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
3016 SET_H_SYS_SR_F (opval);
3017 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3020 #undef FLD
3022 NEXT (vpc);
3024 CASE (sem, INSN_LF_SFGE_D32) : /* lf.sfge.d $rAD32F,$rBD32F */
3026 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3027 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3028 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3029 int UNUSED written = 0;
3030 IADDR UNUSED pc = abuf->addr;
3031 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3034 BI opval = CGEN_CPU_FPU (current_cpu)->ops->gedf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
3035 SET_H_SYS_SR_F (opval);
3036 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3039 #undef FLD
3041 NEXT (vpc);
3043 CASE (sem, INSN_LF_SFGT_S) : /* lf.sfgt.s $rASF,$rBSF */
3045 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3046 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3047 #define FLD(f) abuf->fields.sfmt_l_sll.f
3048 int UNUSED written = 0;
3049 IADDR UNUSED pc = abuf->addr;
3050 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3053 BI opval = CGEN_CPU_FPU (current_cpu)->ops->gtsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
3054 SET_H_SYS_SR_F (opval);
3055 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3058 #undef FLD
3060 NEXT (vpc);
3062 CASE (sem, INSN_LF_SFGT_D32) : /* lf.sfgt.d $rAD32F,$rBD32F */
3064 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3065 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3066 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3067 int UNUSED written = 0;
3068 IADDR UNUSED pc = abuf->addr;
3069 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3072 BI opval = CGEN_CPU_FPU (current_cpu)->ops->gtdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
3073 SET_H_SYS_SR_F (opval);
3074 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3077 #undef FLD
3079 NEXT (vpc);
3081 CASE (sem, INSN_LF_SFLT_S) : /* lf.sflt.s $rASF,$rBSF */
3083 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3084 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3085 #define FLD(f) abuf->fields.sfmt_l_sll.f
3086 int UNUSED written = 0;
3087 IADDR UNUSED pc = abuf->addr;
3088 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3091 BI opval = CGEN_CPU_FPU (current_cpu)->ops->ltsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
3092 SET_H_SYS_SR_F (opval);
3093 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3096 #undef FLD
3098 NEXT (vpc);
3100 CASE (sem, INSN_LF_SFLT_D32) : /* lf.sflt.d $rAD32F,$rBD32F */
3102 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3103 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3104 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3105 int UNUSED written = 0;
3106 IADDR UNUSED pc = abuf->addr;
3107 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3110 BI opval = CGEN_CPU_FPU (current_cpu)->ops->ltdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
3111 SET_H_SYS_SR_F (opval);
3112 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3115 #undef FLD
3117 NEXT (vpc);
3119 CASE (sem, INSN_LF_SFLE_S) : /* lf.sfle.s $rASF,$rBSF */
3121 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3122 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3123 #define FLD(f) abuf->fields.sfmt_l_sll.f
3124 int UNUSED written = 0;
3125 IADDR UNUSED pc = abuf->addr;
3126 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3129 BI opval = CGEN_CPU_FPU (current_cpu)->ops->lesf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
3130 SET_H_SYS_SR_F (opval);
3131 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3134 #undef FLD
3136 NEXT (vpc);
3138 CASE (sem, INSN_LF_SFLE_D32) : /* lf.sfle.d $rAD32F,$rBD32F */
3140 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3141 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3142 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3143 int UNUSED written = 0;
3144 IADDR UNUSED pc = abuf->addr;
3145 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3148 BI opval = CGEN_CPU_FPU (current_cpu)->ops->ledf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
3149 SET_H_SYS_SR_F (opval);
3150 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3153 #undef FLD
3155 NEXT (vpc);
3157 CASE (sem, INSN_LF_SFUEQ_S) : /* lf.sfueq.s $rASF,$rBSF */
3159 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3160 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3161 #define FLD(f) abuf->fields.sfmt_l_sll.f
3162 int UNUSED written = 0;
3163 IADDR UNUSED pc = abuf->addr;
3164 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3167 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), CGEN_CPU_FPU (current_cpu)->ops->eqsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))));
3168 SET_H_SYS_SR_F (opval);
3169 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3172 #undef FLD
3174 NEXT (vpc);
3176 CASE (sem, INSN_LF_SFUEQ_D32) : /* lf.sfueq.d $rAD32F,$rBD32F */
3178 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3179 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3180 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3181 int UNUSED written = 0;
3182 IADDR UNUSED pc = abuf->addr;
3183 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3186 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), CGEN_CPU_FPU (current_cpu)->ops->eqdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))));
3187 SET_H_SYS_SR_F (opval);
3188 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3191 #undef FLD
3193 NEXT (vpc);
3195 CASE (sem, INSN_LF_SFUNE_S) : /* lf.sfune.s $rASF,$rBSF */
3197 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3198 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3199 #define FLD(f) abuf->fields.sfmt_l_sll.f
3200 int UNUSED written = 0;
3201 IADDR UNUSED pc = abuf->addr;
3202 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3205 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), CGEN_CPU_FPU (current_cpu)->ops->nesf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))));
3206 SET_H_SYS_SR_F (opval);
3207 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3210 #undef FLD
3212 NEXT (vpc);
3214 CASE (sem, INSN_LF_SFUNE_D32) : /* lf.sfune.d $rAD32F,$rBD32F */
3216 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3217 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3218 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3219 int UNUSED written = 0;
3220 IADDR UNUSED pc = abuf->addr;
3221 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3224 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), CGEN_CPU_FPU (current_cpu)->ops->nedf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))));
3225 SET_H_SYS_SR_F (opval);
3226 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3229 #undef FLD
3231 NEXT (vpc);
3233 CASE (sem, INSN_LF_SFUGT_S) : /* lf.sfugt.s $rASF,$rBSF */
3235 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3236 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3237 #define FLD(f) abuf->fields.sfmt_l_sll.f
3238 int UNUSED written = 0;
3239 IADDR UNUSED pc = abuf->addr;
3240 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3243 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), CGEN_CPU_FPU (current_cpu)->ops->gtsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))));
3244 SET_H_SYS_SR_F (opval);
3245 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3248 #undef FLD
3250 NEXT (vpc);
3252 CASE (sem, INSN_LF_SFUGT_D32) : /* lf.sfugt.d $rAD32F,$rBD32F */
3254 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3255 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3256 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3257 int UNUSED written = 0;
3258 IADDR UNUSED pc = abuf->addr;
3259 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3262 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), CGEN_CPU_FPU (current_cpu)->ops->gtdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))));
3263 SET_H_SYS_SR_F (opval);
3264 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3267 #undef FLD
3269 NEXT (vpc);
3271 CASE (sem, INSN_LF_SFUGE_S) : /* lf.sfuge.s $rASF,$rBSF */
3273 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3274 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3275 #define FLD(f) abuf->fields.sfmt_l_sll.f
3276 int UNUSED written = 0;
3277 IADDR UNUSED pc = abuf->addr;
3278 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3281 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), CGEN_CPU_FPU (current_cpu)->ops->gesf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))));
3282 SET_H_SYS_SR_F (opval);
3283 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3286 #undef FLD
3288 NEXT (vpc);
3290 CASE (sem, INSN_LF_SFUGE_D32) : /* lf.sfuge.d $rAD32F,$rBD32F */
3292 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3293 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3294 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3295 int UNUSED written = 0;
3296 IADDR UNUSED pc = abuf->addr;
3297 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3300 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), CGEN_CPU_FPU (current_cpu)->ops->gedf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))));
3301 SET_H_SYS_SR_F (opval);
3302 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3305 #undef FLD
3307 NEXT (vpc);
3309 CASE (sem, INSN_LF_SFULT_S) : /* lf.sfult.s $rASF,$rBSF */
3311 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3312 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3313 #define FLD(f) abuf->fields.sfmt_l_sll.f
3314 int UNUSED written = 0;
3315 IADDR UNUSED pc = abuf->addr;
3316 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3319 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), CGEN_CPU_FPU (current_cpu)->ops->ltsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))));
3320 SET_H_SYS_SR_F (opval);
3321 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3324 #undef FLD
3326 NEXT (vpc);
3328 CASE (sem, INSN_LF_SFULT_D32) : /* lf.sfult.d $rAD32F,$rBD32F */
3330 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3331 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3332 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3333 int UNUSED written = 0;
3334 IADDR UNUSED pc = abuf->addr;
3335 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3338 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), CGEN_CPU_FPU (current_cpu)->ops->ltdf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))));
3339 SET_H_SYS_SR_F (opval);
3340 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3343 #undef FLD
3345 NEXT (vpc);
3347 CASE (sem, INSN_LF_SFULE_S) : /* lf.sfule.s $rASF,$rBSF */
3349 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3350 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3351 #define FLD(f) abuf->fields.sfmt_l_sll.f
3352 int UNUSED written = 0;
3353 IADDR UNUSED pc = abuf->addr;
3354 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3357 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), CGEN_CPU_FPU (current_cpu)->ops->lesf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))));
3358 SET_H_SYS_SR_F (opval);
3359 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3362 #undef FLD
3364 NEXT (vpc);
3366 CASE (sem, INSN_LF_SFULE_D32) : /* lf.sfule.d $rAD32F,$rBD32F */
3368 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3369 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3370 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3371 int UNUSED written = 0;
3372 IADDR UNUSED pc = abuf->addr;
3373 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3376 BI opval = ORBI (CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), CGEN_CPU_FPU (current_cpu)->ops->ledf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))));
3377 SET_H_SYS_SR_F (opval);
3378 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3381 #undef FLD
3383 NEXT (vpc);
3385 CASE (sem, INSN_LF_SFUN_S) : /* lf.sfun.s $rASF,$rBSF */
3387 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3388 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3389 #define FLD(f) abuf->fields.sfmt_l_sll.f
3390 int UNUSED written = 0;
3391 IADDR UNUSED pc = abuf->addr;
3392 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3395 BI opval = CGEN_CPU_FPU (current_cpu)->ops->unorderedsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3)));
3396 SET_H_SYS_SR_F (opval);
3397 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3400 #undef FLD
3402 NEXT (vpc);
3404 CASE (sem, INSN_LF_SFUN_D32) : /* lf.sfun.d $rAD32F,$rBD32F */
3406 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3407 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3408 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3409 int UNUSED written = 0;
3410 IADDR UNUSED pc = abuf->addr;
3411 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3414 BI opval = CGEN_CPU_FPU (current_cpu)->ops->unordereddf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32)));
3415 SET_H_SYS_SR_F (opval);
3416 CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3419 #undef FLD
3421 NEXT (vpc);
3423 CASE (sem, INSN_LF_MADD_S) : /* lf.madd.s $rDSF,$rASF,$rBSF */
3425 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3426 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3427 #define FLD(f) abuf->fields.sfmt_l_sll.f
3428 int UNUSED written = 0;
3429 IADDR UNUSED pc = abuf->addr;
3430 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3433 SF opval = CGEN_CPU_FPU (current_cpu)->ops->addsf (CGEN_CPU_FPU (current_cpu), CGEN_CPU_FPU (current_cpu)->ops->mulsf (CGEN_CPU_FPU (current_cpu), GET_H_FSR (FLD (f_r2)), GET_H_FSR (FLD (f_r3))), GET_H_FSR (FLD (f_r1)));
3434 SET_H_FSR (FLD (f_r1), opval);
3435 CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
3438 #undef FLD
3440 NEXT (vpc);
3442 CASE (sem, INSN_LF_MADD_D32) : /* lf.madd.d $rDD32F,$rAD32F,$rBD32F */
3444 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3445 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3446 #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3447 int UNUSED written = 0;
3448 IADDR UNUSED pc = abuf->addr;
3449 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3452 DF opval = CGEN_CPU_FPU (current_cpu)->ops->adddf (CGEN_CPU_FPU (current_cpu), CGEN_CPU_FPU (current_cpu)->ops->muldf (CGEN_CPU_FPU (current_cpu), GET_H_FD32R (FLD (f_rad32)), GET_H_FD32R (FLD (f_rbd32))), GET_H_FD32R (FLD (f_rdd32)));
3453 SET_H_FD32R (FLD (f_rdd32), opval);
3454 CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
3457 #undef FLD
3459 NEXT (vpc);
3461 CASE (sem, INSN_LF_CUST1_S) : /* lf.cust1.s $rASF,$rBSF */
3463 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3464 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3465 #define FLD(f) abuf->fields.sfmt_empty.f
3466 int UNUSED written = 0;
3467 IADDR UNUSED pc = abuf->addr;
3468 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3470 ((void) 0); /*nop*/
3472 #undef FLD
3474 NEXT (vpc);
3476 CASE (sem, INSN_LF_CUST1_D32) : /* lf.cust1.d */
3478 SEM_ARG sem_arg = SEM_SEM_ARG (vpc, sc);
3479 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3480 #define FLD(f) abuf->fields.sfmt_empty.f
3481 int UNUSED written = 0;
3482 IADDR UNUSED pc = abuf->addr;
3483 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3485 ((void) 0); /*nop*/
3487 #undef FLD
3489 NEXT (vpc);
3493 ENDSWITCH (sem) /* End of semantic switch. */
3495 /* At this point `vpc' contains the next insn to execute. */
3498 #undef DEFINE_SWITCH
3499 #endif /* DEFINE_SWITCH */