13aed4a8bSchristos /* Simulator instruction semantics for or1k32bf.
23aed4a8bSchristos
33aed4a8bSchristos THIS FILE IS MACHINE GENERATED WITH CGEN.
43aed4a8bSchristos
5*56bb7041Schristos Copyright (C) 1996-2020 Free Software Foundation, Inc.
63aed4a8bSchristos
73aed4a8bSchristos This file is part of the GNU simulators.
83aed4a8bSchristos
93aed4a8bSchristos This file is free software; you can redistribute it and/or modify
103aed4a8bSchristos it under the terms of the GNU General Public License as published by
113aed4a8bSchristos the Free Software Foundation; either version 3, or (at your option)
123aed4a8bSchristos any later version.
133aed4a8bSchristos
143aed4a8bSchristos It is distributed in the hope that it will be useful, but WITHOUT
153aed4a8bSchristos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
163aed4a8bSchristos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
173aed4a8bSchristos License for more details.
183aed4a8bSchristos
193aed4a8bSchristos You should have received a copy of the GNU General Public License along
203aed4a8bSchristos with this program; if not, write to the Free Software Foundation, Inc.,
213aed4a8bSchristos 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
223aed4a8bSchristos
233aed4a8bSchristos */
243aed4a8bSchristos
253aed4a8bSchristos #define WANT_CPU or1k32bf
263aed4a8bSchristos #define WANT_CPU_OR1K32BF
273aed4a8bSchristos
283aed4a8bSchristos #include "sim-main.h"
293aed4a8bSchristos #include "cgen-mem.h"
303aed4a8bSchristos #include "cgen-ops.h"
313aed4a8bSchristos
323aed4a8bSchristos #undef GET_ATTR
333aed4a8bSchristos #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
343aed4a8bSchristos
353aed4a8bSchristos /* This is used so that we can compile two copies of the semantic code,
363aed4a8bSchristos one with full feature support and one without that runs fast(er).
373aed4a8bSchristos FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
383aed4a8bSchristos #if FAST_P
393aed4a8bSchristos #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
403aed4a8bSchristos #undef CGEN_TRACE_RESULT
413aed4a8bSchristos #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
423aed4a8bSchristos #else
433aed4a8bSchristos #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
443aed4a8bSchristos #endif
453aed4a8bSchristos
463aed4a8bSchristos /* x-invalid: --invalid-- */
473aed4a8bSchristos
483aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,x_invalid)493aed4a8bSchristos SEM_FN_NAME (or1k32bf,x_invalid) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
503aed4a8bSchristos {
513aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
523aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
533aed4a8bSchristos int UNUSED written = 0;
543aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
553aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
563aed4a8bSchristos
573aed4a8bSchristos {
583aed4a8bSchristos /* Update the recorded pc in the cpu state struct.
593aed4a8bSchristos Only necessary for WITH_SCACHE case, but to avoid the
603aed4a8bSchristos conditional compilation .... */
613aed4a8bSchristos SET_H_PC (pc);
623aed4a8bSchristos /* Virtual insns have zero size. Overwrite vpc with address of next insn
633aed4a8bSchristos using the default-insn-bitsize spec. When executing insns in parallel
643aed4a8bSchristos we may want to queue the fault and continue execution. */
653aed4a8bSchristos vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
663aed4a8bSchristos vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
673aed4a8bSchristos }
683aed4a8bSchristos
693aed4a8bSchristos return vpc;
703aed4a8bSchristos #undef FLD
713aed4a8bSchristos }
723aed4a8bSchristos
733aed4a8bSchristos /* x-after: --after-- */
743aed4a8bSchristos
753aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,x_after)763aed4a8bSchristos SEM_FN_NAME (or1k32bf,x_after) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
773aed4a8bSchristos {
783aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
793aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
803aed4a8bSchristos int UNUSED written = 0;
813aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
823aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
833aed4a8bSchristos
843aed4a8bSchristos {
853aed4a8bSchristos #if WITH_SCACHE_PBB_OR1K32BF
863aed4a8bSchristos or1k32bf_pbb_after (current_cpu, sem_arg);
873aed4a8bSchristos #endif
883aed4a8bSchristos }
893aed4a8bSchristos
903aed4a8bSchristos return vpc;
913aed4a8bSchristos #undef FLD
923aed4a8bSchristos }
933aed4a8bSchristos
943aed4a8bSchristos /* x-before: --before-- */
953aed4a8bSchristos
963aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,x_before)973aed4a8bSchristos SEM_FN_NAME (or1k32bf,x_before) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
983aed4a8bSchristos {
993aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
1003aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1013aed4a8bSchristos int UNUSED written = 0;
1023aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
1033aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
1043aed4a8bSchristos
1053aed4a8bSchristos {
1063aed4a8bSchristos #if WITH_SCACHE_PBB_OR1K32BF
1073aed4a8bSchristos or1k32bf_pbb_before (current_cpu, sem_arg);
1083aed4a8bSchristos #endif
1093aed4a8bSchristos }
1103aed4a8bSchristos
1113aed4a8bSchristos return vpc;
1123aed4a8bSchristos #undef FLD
1133aed4a8bSchristos }
1143aed4a8bSchristos
1153aed4a8bSchristos /* x-cti-chain: --cti-chain-- */
1163aed4a8bSchristos
1173aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,x_cti_chain)1183aed4a8bSchristos SEM_FN_NAME (or1k32bf,x_cti_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1193aed4a8bSchristos {
1203aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
1213aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1223aed4a8bSchristos int UNUSED written = 0;
1233aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
1243aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
1253aed4a8bSchristos
1263aed4a8bSchristos {
1273aed4a8bSchristos #if WITH_SCACHE_PBB_OR1K32BF
1283aed4a8bSchristos #ifdef DEFINE_SWITCH
1293aed4a8bSchristos vpc = or1k32bf_pbb_cti_chain (current_cpu, sem_arg,
1303aed4a8bSchristos pbb_br_type, pbb_br_npc);
1313aed4a8bSchristos BREAK (sem);
1323aed4a8bSchristos #else
1333aed4a8bSchristos /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
1343aed4a8bSchristos vpc = or1k32bf_pbb_cti_chain (current_cpu, sem_arg,
1353aed4a8bSchristos CPU_PBB_BR_TYPE (current_cpu),
1363aed4a8bSchristos CPU_PBB_BR_NPC (current_cpu));
1373aed4a8bSchristos #endif
1383aed4a8bSchristos #endif
1393aed4a8bSchristos }
1403aed4a8bSchristos
1413aed4a8bSchristos return vpc;
1423aed4a8bSchristos #undef FLD
1433aed4a8bSchristos }
1443aed4a8bSchristos
1453aed4a8bSchristos /* x-chain: --chain-- */
1463aed4a8bSchristos
1473aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,x_chain)1483aed4a8bSchristos SEM_FN_NAME (or1k32bf,x_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1493aed4a8bSchristos {
1503aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
1513aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1523aed4a8bSchristos int UNUSED written = 0;
1533aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
1543aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
1553aed4a8bSchristos
1563aed4a8bSchristos {
1573aed4a8bSchristos #if WITH_SCACHE_PBB_OR1K32BF
1583aed4a8bSchristos vpc = or1k32bf_pbb_chain (current_cpu, sem_arg);
1593aed4a8bSchristos #ifdef DEFINE_SWITCH
1603aed4a8bSchristos BREAK (sem);
1613aed4a8bSchristos #endif
1623aed4a8bSchristos #endif
1633aed4a8bSchristos }
1643aed4a8bSchristos
1653aed4a8bSchristos return vpc;
1663aed4a8bSchristos #undef FLD
1673aed4a8bSchristos }
1683aed4a8bSchristos
1693aed4a8bSchristos /* x-begin: --begin-- */
1703aed4a8bSchristos
1713aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,x_begin)1723aed4a8bSchristos SEM_FN_NAME (or1k32bf,x_begin) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1733aed4a8bSchristos {
1743aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
1753aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1763aed4a8bSchristos int UNUSED written = 0;
1773aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
1783aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
1793aed4a8bSchristos
1803aed4a8bSchristos {
1813aed4a8bSchristos #if WITH_SCACHE_PBB_OR1K32BF
1823aed4a8bSchristos #if defined DEFINE_SWITCH || defined FAST_P
1833aed4a8bSchristos /* In the switch case FAST_P is a constant, allowing several optimizations
1843aed4a8bSchristos in any called inline functions. */
1853aed4a8bSchristos vpc = or1k32bf_pbb_begin (current_cpu, FAST_P);
1863aed4a8bSchristos #else
1873aed4a8bSchristos #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
1883aed4a8bSchristos vpc = or1k32bf_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
1893aed4a8bSchristos #else
1903aed4a8bSchristos vpc = or1k32bf_pbb_begin (current_cpu, 0);
1913aed4a8bSchristos #endif
1923aed4a8bSchristos #endif
1933aed4a8bSchristos #endif
1943aed4a8bSchristos }
1953aed4a8bSchristos
1963aed4a8bSchristos return vpc;
1973aed4a8bSchristos #undef FLD
1983aed4a8bSchristos }
1993aed4a8bSchristos
2003aed4a8bSchristos /* l-j: l.j ${disp26} */
2013aed4a8bSchristos
2023aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_j)2033aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_j) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2043aed4a8bSchristos {
2053aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_j.f
2063aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2073aed4a8bSchristos int UNUSED written = 0;
2083aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
2093aed4a8bSchristos SEM_BRANCH_INIT
2103aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2113aed4a8bSchristos
2123aed4a8bSchristos {
2133aed4a8bSchristos {
2143aed4a8bSchristos {
2153aed4a8bSchristos USI opval = FLD (i_disp26);
2163aed4a8bSchristos SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
2173aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
2183aed4a8bSchristos }
2193aed4a8bSchristos }
2203aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
2213aed4a8bSchristos if (1)
2223aed4a8bSchristos SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
2233aed4a8bSchristos }
2243aed4a8bSchristos }
2253aed4a8bSchristos
2263aed4a8bSchristos SEM_BRANCH_FINI (vpc);
2273aed4a8bSchristos return vpc;
2283aed4a8bSchristos #undef FLD
2293aed4a8bSchristos }
2303aed4a8bSchristos
2313aed4a8bSchristos /* l-adrp: l.adrp $rD,${disp21} */
2323aed4a8bSchristos
2333aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_adrp)2343aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_adrp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2353aed4a8bSchristos {
2363aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_adrp.f
2373aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2383aed4a8bSchristos int UNUSED written = 0;
2393aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
2403aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2413aed4a8bSchristos
2423aed4a8bSchristos {
2433aed4a8bSchristos USI opval = FLD (i_disp21);
2443aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
2453aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
2463aed4a8bSchristos }
2473aed4a8bSchristos
2483aed4a8bSchristos return vpc;
2493aed4a8bSchristos #undef FLD
2503aed4a8bSchristos }
2513aed4a8bSchristos
2523aed4a8bSchristos /* l-jal: l.jal ${disp26} */
2533aed4a8bSchristos
2543aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_jal)2553aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_jal) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2563aed4a8bSchristos {
2573aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_j.f
2583aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2593aed4a8bSchristos int UNUSED written = 0;
2603aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
2613aed4a8bSchristos SEM_BRANCH_INIT
2623aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2633aed4a8bSchristos
2643aed4a8bSchristos {
2653aed4a8bSchristos {
2663aed4a8bSchristos USI opval = ADDSI (pc, ((GET_H_SYS_CPUCFGR_ND ()) ? (4) : (8)));
2673aed4a8bSchristos SET_H_GPR (((UINT) 9), opval);
2683aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
2693aed4a8bSchristos }
2703aed4a8bSchristos {
2713aed4a8bSchristos {
2723aed4a8bSchristos {
2733aed4a8bSchristos USI opval = FLD (i_disp26);
2743aed4a8bSchristos SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
2753aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
2763aed4a8bSchristos }
2773aed4a8bSchristos }
2783aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
2793aed4a8bSchristos if (1)
2803aed4a8bSchristos SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
2813aed4a8bSchristos }
2823aed4a8bSchristos }
2833aed4a8bSchristos }
2843aed4a8bSchristos
2853aed4a8bSchristos SEM_BRANCH_FINI (vpc);
2863aed4a8bSchristos return vpc;
2873aed4a8bSchristos #undef FLD
2883aed4a8bSchristos }
2893aed4a8bSchristos
2903aed4a8bSchristos /* l-jr: l.jr $rB */
2913aed4a8bSchristos
2923aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_jr)2933aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_jr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2943aed4a8bSchristos {
2953aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
2963aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2973aed4a8bSchristos int UNUSED written = 0;
2983aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
2993aed4a8bSchristos SEM_BRANCH_INIT
3003aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3013aed4a8bSchristos
3023aed4a8bSchristos {
3033aed4a8bSchristos {
3043aed4a8bSchristos {
3053aed4a8bSchristos USI opval = GET_H_GPR (FLD (f_r3));
3063aed4a8bSchristos SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3073aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3083aed4a8bSchristos }
3093aed4a8bSchristos }
3103aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
3113aed4a8bSchristos if (1)
3123aed4a8bSchristos SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
3133aed4a8bSchristos }
3143aed4a8bSchristos }
3153aed4a8bSchristos
3163aed4a8bSchristos SEM_BRANCH_FINI (vpc);
3173aed4a8bSchristos return vpc;
3183aed4a8bSchristos #undef FLD
3193aed4a8bSchristos }
3203aed4a8bSchristos
3213aed4a8bSchristos /* l-jalr: l.jalr $rB */
3223aed4a8bSchristos
3233aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_jalr)3243aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_jalr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3253aed4a8bSchristos {
3263aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3273aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3283aed4a8bSchristos int UNUSED written = 0;
3293aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
3303aed4a8bSchristos SEM_BRANCH_INIT
3313aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3323aed4a8bSchristos
3333aed4a8bSchristos {
3343aed4a8bSchristos {
3353aed4a8bSchristos USI opval = ADDSI (pc, ((GET_H_SYS_CPUCFGR_ND ()) ? (4) : (8)));
3363aed4a8bSchristos SET_H_GPR (((UINT) 9), opval);
3373aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
3383aed4a8bSchristos }
3393aed4a8bSchristos {
3403aed4a8bSchristos {
3413aed4a8bSchristos {
3423aed4a8bSchristos USI opval = GET_H_GPR (FLD (f_r3));
3433aed4a8bSchristos SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3443aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3453aed4a8bSchristos }
3463aed4a8bSchristos }
3473aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
3483aed4a8bSchristos if (1)
3493aed4a8bSchristos SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
3503aed4a8bSchristos }
3513aed4a8bSchristos }
3523aed4a8bSchristos }
3533aed4a8bSchristos
3543aed4a8bSchristos SEM_BRANCH_FINI (vpc);
3553aed4a8bSchristos return vpc;
3563aed4a8bSchristos #undef FLD
3573aed4a8bSchristos }
3583aed4a8bSchristos
3593aed4a8bSchristos /* l-bnf: l.bnf ${disp26} */
3603aed4a8bSchristos
3613aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_bnf)3623aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_bnf) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3633aed4a8bSchristos {
3643aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_j.f
3653aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3663aed4a8bSchristos int UNUSED written = 0;
3673aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
3683aed4a8bSchristos SEM_BRANCH_INIT
3693aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3703aed4a8bSchristos
3713aed4a8bSchristos {
3723aed4a8bSchristos if (NOTSI (GET_H_SYS_SR_F ())) {
3733aed4a8bSchristos {
3743aed4a8bSchristos {
3753aed4a8bSchristos USI opval = FLD (i_disp26);
3763aed4a8bSchristos SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
3773aed4a8bSchristos written |= (1 << 4);
3783aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3793aed4a8bSchristos }
3803aed4a8bSchristos }
3813aed4a8bSchristos } else {
3823aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
3833aed4a8bSchristos {
3843aed4a8bSchristos {
3853aed4a8bSchristos USI opval = ADDSI (pc, 4);
3863aed4a8bSchristos SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3873aed4a8bSchristos written |= (1 << 4);
3883aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3893aed4a8bSchristos }
3903aed4a8bSchristos }
3913aed4a8bSchristos }
3923aed4a8bSchristos }
3933aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
3943aed4a8bSchristos if (1)
3953aed4a8bSchristos SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
3963aed4a8bSchristos }
3973aed4a8bSchristos }
3983aed4a8bSchristos
3993aed4a8bSchristos abuf->written = written;
4003aed4a8bSchristos SEM_BRANCH_FINI (vpc);
4013aed4a8bSchristos return vpc;
4023aed4a8bSchristos #undef FLD
4033aed4a8bSchristos }
4043aed4a8bSchristos
4053aed4a8bSchristos /* l-bf: l.bf ${disp26} */
4063aed4a8bSchristos
4073aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_bf)4083aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_bf) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4093aed4a8bSchristos {
4103aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_j.f
4113aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4123aed4a8bSchristos int UNUSED written = 0;
4133aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
4143aed4a8bSchristos SEM_BRANCH_INIT
4153aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4163aed4a8bSchristos
4173aed4a8bSchristos {
4183aed4a8bSchristos if (GET_H_SYS_SR_F ()) {
4193aed4a8bSchristos {
4203aed4a8bSchristos {
4213aed4a8bSchristos USI opval = FLD (i_disp26);
4223aed4a8bSchristos SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
4233aed4a8bSchristos written |= (1 << 4);
4243aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4253aed4a8bSchristos }
4263aed4a8bSchristos }
4273aed4a8bSchristos } else {
4283aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
4293aed4a8bSchristos {
4303aed4a8bSchristos {
4313aed4a8bSchristos USI opval = ADDSI (pc, 4);
4323aed4a8bSchristos SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
4333aed4a8bSchristos written |= (1 << 4);
4343aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4353aed4a8bSchristos }
4363aed4a8bSchristos }
4373aed4a8bSchristos }
4383aed4a8bSchristos }
4393aed4a8bSchristos if (GET_H_SYS_CPUCFGR_ND ()) {
4403aed4a8bSchristos if (1)
4413aed4a8bSchristos SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
4423aed4a8bSchristos }
4433aed4a8bSchristos }
4443aed4a8bSchristos
4453aed4a8bSchristos abuf->written = written;
4463aed4a8bSchristos SEM_BRANCH_FINI (vpc);
4473aed4a8bSchristos return vpc;
4483aed4a8bSchristos #undef FLD
4493aed4a8bSchristos }
4503aed4a8bSchristos
4513aed4a8bSchristos /* l-trap: l.trap ${uimm16} */
4523aed4a8bSchristos
4533aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_trap)4543aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4553aed4a8bSchristos {
4563aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
4573aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4583aed4a8bSchristos int UNUSED written = 0;
4593aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
4603aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4613aed4a8bSchristos
4623aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_TRAP);
4633aed4a8bSchristos
4643aed4a8bSchristos return vpc;
4653aed4a8bSchristos #undef FLD
4663aed4a8bSchristos }
4673aed4a8bSchristos
4683aed4a8bSchristos /* l-sys: l.sys ${uimm16} */
4693aed4a8bSchristos
4703aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sys)4713aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sys) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4723aed4a8bSchristos {
4733aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
4743aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4753aed4a8bSchristos int UNUSED written = 0;
4763aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
4773aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4783aed4a8bSchristos
4793aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_SYSCALL);
4803aed4a8bSchristos
4813aed4a8bSchristos return vpc;
4823aed4a8bSchristos #undef FLD
4833aed4a8bSchristos }
4843aed4a8bSchristos
4853aed4a8bSchristos /* l-msync: l.msync */
4863aed4a8bSchristos
4873aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_msync)4883aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_msync) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4893aed4a8bSchristos {
4903aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
4913aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4923aed4a8bSchristos int UNUSED written = 0;
4933aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
4943aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4953aed4a8bSchristos
4963aed4a8bSchristos ((void) 0); /*nop*/
4973aed4a8bSchristos
4983aed4a8bSchristos return vpc;
4993aed4a8bSchristos #undef FLD
5003aed4a8bSchristos }
5013aed4a8bSchristos
5023aed4a8bSchristos /* l-psync: l.psync */
5033aed4a8bSchristos
5043aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_psync)5053aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_psync) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5063aed4a8bSchristos {
5073aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
5083aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5093aed4a8bSchristos int UNUSED written = 0;
5103aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
5113aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5123aed4a8bSchristos
5133aed4a8bSchristos ((void) 0); /*nop*/
5143aed4a8bSchristos
5153aed4a8bSchristos return vpc;
5163aed4a8bSchristos #undef FLD
5173aed4a8bSchristos }
5183aed4a8bSchristos
5193aed4a8bSchristos /* l-csync: l.csync */
5203aed4a8bSchristos
5213aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_csync)5223aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_csync) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5233aed4a8bSchristos {
5243aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
5253aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5263aed4a8bSchristos int UNUSED written = 0;
5273aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
5283aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5293aed4a8bSchristos
5303aed4a8bSchristos ((void) 0); /*nop*/
5313aed4a8bSchristos
5323aed4a8bSchristos return vpc;
5333aed4a8bSchristos #undef FLD
5343aed4a8bSchristos }
5353aed4a8bSchristos
5363aed4a8bSchristos /* l-rfe: l.rfe */
5373aed4a8bSchristos
5383aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_rfe)5393aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_rfe) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5403aed4a8bSchristos {
5413aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
5423aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5433aed4a8bSchristos int UNUSED written = 0;
5443aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
5453aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5463aed4a8bSchristos
5473aed4a8bSchristos or1k32bf_rfe (current_cpu);
5483aed4a8bSchristos
5493aed4a8bSchristos return vpc;
5503aed4a8bSchristos #undef FLD
5513aed4a8bSchristos }
5523aed4a8bSchristos
5533aed4a8bSchristos /* l-nop-imm: l.nop ${uimm16} */
5543aed4a8bSchristos
5553aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_nop_imm)5563aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_nop_imm) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5573aed4a8bSchristos {
5583aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_mfspr.f
5593aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5603aed4a8bSchristos int UNUSED written = 0;
5613aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
5623aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5633aed4a8bSchristos
5643aed4a8bSchristos or1k32bf_nop (current_cpu, ZEXTSISI (FLD (f_uimm16)));
5653aed4a8bSchristos
5663aed4a8bSchristos return vpc;
5673aed4a8bSchristos #undef FLD
5683aed4a8bSchristos }
5693aed4a8bSchristos
5703aed4a8bSchristos /* l-movhi: l.movhi $rD,$uimm16 */
5713aed4a8bSchristos
5723aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_movhi)5733aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_movhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5743aed4a8bSchristos {
5753aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_mfspr.f
5763aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5773aed4a8bSchristos int UNUSED written = 0;
5783aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
5793aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
5803aed4a8bSchristos
5813aed4a8bSchristos {
5823aed4a8bSchristos USI opval = SLLSI (ZEXTSISI (FLD (f_uimm16)), 16);
5833aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
5843aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
5853aed4a8bSchristos }
5863aed4a8bSchristos
5873aed4a8bSchristos return vpc;
5883aed4a8bSchristos #undef FLD
5893aed4a8bSchristos }
5903aed4a8bSchristos
5913aed4a8bSchristos /* l-macrc: l.macrc $rD */
5923aed4a8bSchristos
5933aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_macrc)5943aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_macrc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5953aed4a8bSchristos {
5963aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_adrp.f
5973aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5983aed4a8bSchristos int UNUSED written = 0;
5993aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
6003aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6013aed4a8bSchristos
6023aed4a8bSchristos {
6033aed4a8bSchristos {
6043aed4a8bSchristos USI opval = GET_H_MAC_MACLO ();
6053aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
6063aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
6073aed4a8bSchristos }
6083aed4a8bSchristos {
6093aed4a8bSchristos USI opval = 0;
6103aed4a8bSchristos SET_H_MAC_MACLO (opval);
6113aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
6123aed4a8bSchristos }
6133aed4a8bSchristos {
6143aed4a8bSchristos USI opval = 0;
6153aed4a8bSchristos SET_H_MAC_MACHI (opval);
6163aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
6173aed4a8bSchristos }
6183aed4a8bSchristos }
6193aed4a8bSchristos
6203aed4a8bSchristos return vpc;
6213aed4a8bSchristos #undef FLD
6223aed4a8bSchristos }
6233aed4a8bSchristos
6243aed4a8bSchristos /* l-mfspr: l.mfspr $rD,$rA,${uimm16} */
6253aed4a8bSchristos
6263aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_mfspr)6273aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_mfspr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
6283aed4a8bSchristos {
6293aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_mfspr.f
6303aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6313aed4a8bSchristos int UNUSED written = 0;
6323aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
6333aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6343aed4a8bSchristos
6353aed4a8bSchristos {
6363aed4a8bSchristos USI opval = or1k32bf_mfspr (current_cpu, ORSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16))));
6373aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
6383aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
6393aed4a8bSchristos }
6403aed4a8bSchristos
6413aed4a8bSchristos return vpc;
6423aed4a8bSchristos #undef FLD
6433aed4a8bSchristos }
6443aed4a8bSchristos
6453aed4a8bSchristos /* l-mtspr: l.mtspr $rA,$rB,${uimm16-split} */
6463aed4a8bSchristos
6473aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_mtspr)6483aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_mtspr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
6493aed4a8bSchristos {
6503aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_mtspr.f
6513aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6523aed4a8bSchristos int UNUSED written = 0;
6533aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
6543aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6553aed4a8bSchristos
6563aed4a8bSchristos or1k32bf_mtspr (current_cpu, ORSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16_split))), GET_H_GPR (FLD (f_r3)));
6573aed4a8bSchristos
6583aed4a8bSchristos return vpc;
6593aed4a8bSchristos #undef FLD
6603aed4a8bSchristos }
6613aed4a8bSchristos
6623aed4a8bSchristos /* l-lwz: l.lwz $rD,${simm16}($rA) */
6633aed4a8bSchristos
6643aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lwz)6653aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lwz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
6663aed4a8bSchristos {
6673aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
6683aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6693aed4a8bSchristos int UNUSED written = 0;
6703aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
6713aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6723aed4a8bSchristos
6733aed4a8bSchristos {
6743aed4a8bSchristos 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)));
6753aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
6763aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
6773aed4a8bSchristos }
6783aed4a8bSchristos
6793aed4a8bSchristos return vpc;
6803aed4a8bSchristos #undef FLD
6813aed4a8bSchristos }
6823aed4a8bSchristos
6833aed4a8bSchristos /* l-lws: l.lws $rD,${simm16}($rA) */
6843aed4a8bSchristos
6853aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lws)6863aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lws) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
6873aed4a8bSchristos {
6883aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
6893aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
6903aed4a8bSchristos int UNUSED written = 0;
6913aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
6923aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
6933aed4a8bSchristos
6943aed4a8bSchristos {
6953aed4a8bSchristos 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)));
6963aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
6973aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
6983aed4a8bSchristos }
6993aed4a8bSchristos
7003aed4a8bSchristos return vpc;
7013aed4a8bSchristos #undef FLD
7023aed4a8bSchristos }
7033aed4a8bSchristos
7043aed4a8bSchristos /* l-lwa: l.lwa $rD,${simm16}($rA) */
7053aed4a8bSchristos
7063aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lwa)7073aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lwa) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
7083aed4a8bSchristos {
7093aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
7103aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7113aed4a8bSchristos int UNUSED written = 0;
7123aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
7133aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7143aed4a8bSchristos
7153aed4a8bSchristos {
7163aed4a8bSchristos {
7173aed4a8bSchristos 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)));
7183aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
7193aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
7203aed4a8bSchristos }
7213aed4a8bSchristos {
7223aed4a8bSchristos BI opval = 1;
7233aed4a8bSchristos CPU (h_atomic_reserve) = opval;
7243aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
7253aed4a8bSchristos }
7263aed4a8bSchristos {
7273aed4a8bSchristos SI opval = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 4);
7283aed4a8bSchristos CPU (h_atomic_address) = opval;
7293aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-address", 'x', opval);
7303aed4a8bSchristos }
7313aed4a8bSchristos }
7323aed4a8bSchristos
7333aed4a8bSchristos return vpc;
7343aed4a8bSchristos #undef FLD
7353aed4a8bSchristos }
7363aed4a8bSchristos
7373aed4a8bSchristos /* l-lbz: l.lbz $rD,${simm16}($rA) */
7383aed4a8bSchristos
7393aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lbz)7403aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lbz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
7413aed4a8bSchristos {
7423aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
7433aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7443aed4a8bSchristos int UNUSED written = 0;
7453aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
7463aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7473aed4a8bSchristos
7483aed4a8bSchristos {
7493aed4a8bSchristos 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)));
7503aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
7513aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
7523aed4a8bSchristos }
7533aed4a8bSchristos
7543aed4a8bSchristos return vpc;
7553aed4a8bSchristos #undef FLD
7563aed4a8bSchristos }
7573aed4a8bSchristos
7583aed4a8bSchristos /* l-lbs: l.lbs $rD,${simm16}($rA) */
7593aed4a8bSchristos
7603aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lbs)7613aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lbs) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
7623aed4a8bSchristos {
7633aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
7643aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7653aed4a8bSchristos int UNUSED written = 0;
7663aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
7673aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7683aed4a8bSchristos
7693aed4a8bSchristos {
7703aed4a8bSchristos 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)));
7713aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
7723aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
7733aed4a8bSchristos }
7743aed4a8bSchristos
7753aed4a8bSchristos return vpc;
7763aed4a8bSchristos #undef FLD
7773aed4a8bSchristos }
7783aed4a8bSchristos
7793aed4a8bSchristos /* l-lhz: l.lhz $rD,${simm16}($rA) */
7803aed4a8bSchristos
7813aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lhz)7823aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lhz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
7833aed4a8bSchristos {
7843aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
7853aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
7863aed4a8bSchristos int UNUSED written = 0;
7873aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
7883aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
7893aed4a8bSchristos
7903aed4a8bSchristos {
7913aed4a8bSchristos 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)));
7923aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
7933aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
7943aed4a8bSchristos }
7953aed4a8bSchristos
7963aed4a8bSchristos return vpc;
7973aed4a8bSchristos #undef FLD
7983aed4a8bSchristos }
7993aed4a8bSchristos
8003aed4a8bSchristos /* l-lhs: l.lhs $rD,${simm16}($rA) */
8013aed4a8bSchristos
8023aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_lhs)8033aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_lhs) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
8043aed4a8bSchristos {
8053aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
8063aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8073aed4a8bSchristos int UNUSED written = 0;
8083aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
8093aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8103aed4a8bSchristos
8113aed4a8bSchristos {
8123aed4a8bSchristos 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)));
8133aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
8143aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
8153aed4a8bSchristos }
8163aed4a8bSchristos
8173aed4a8bSchristos return vpc;
8183aed4a8bSchristos #undef FLD
8193aed4a8bSchristos }
8203aed4a8bSchristos
8213aed4a8bSchristos /* l-sw: l.sw ${simm16-split}($rA),$rB */
8223aed4a8bSchristos
8233aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sw)8243aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
8253aed4a8bSchristos {
8263aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sw.f
8273aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8283aed4a8bSchristos int UNUSED written = 0;
8293aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
8303aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8313aed4a8bSchristos
8323aed4a8bSchristos {
8333aed4a8bSchristos SI tmp_addr;
8343aed4a8bSchristos tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 4);
8353aed4a8bSchristos {
8363aed4a8bSchristos USI opval = TRUNCSISI (GET_H_GPR (FLD (f_r3)));
8373aed4a8bSchristos SETMEMUSI (current_cpu, pc, tmp_addr, opval);
8383aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
8393aed4a8bSchristos }
8403aed4a8bSchristos if (EQSI (ANDSI (tmp_addr, 268435452), CPU (h_atomic_address))) {
8413aed4a8bSchristos {
8423aed4a8bSchristos BI opval = 0;
8433aed4a8bSchristos CPU (h_atomic_reserve) = opval;
8443aed4a8bSchristos written |= (1 << 4);
8453aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
8463aed4a8bSchristos }
8473aed4a8bSchristos }
8483aed4a8bSchristos }
8493aed4a8bSchristos
8503aed4a8bSchristos abuf->written = written;
8513aed4a8bSchristos return vpc;
8523aed4a8bSchristos #undef FLD
8533aed4a8bSchristos }
8543aed4a8bSchristos
8553aed4a8bSchristos /* l-sb: l.sb ${simm16-split}($rA),$rB */
8563aed4a8bSchristos
8573aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sb)8583aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
8593aed4a8bSchristos {
8603aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sw.f
8613aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8623aed4a8bSchristos int UNUSED written = 0;
8633aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
8643aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8653aed4a8bSchristos
8663aed4a8bSchristos {
8673aed4a8bSchristos SI tmp_addr;
8683aed4a8bSchristos tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 1);
8693aed4a8bSchristos {
8703aed4a8bSchristos UQI opval = TRUNCSIQI (GET_H_GPR (FLD (f_r3)));
8713aed4a8bSchristos SETMEMUQI (current_cpu, pc, tmp_addr, opval);
8723aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
8733aed4a8bSchristos }
8743aed4a8bSchristos if (EQSI (ANDSI (tmp_addr, 268435452), CPU (h_atomic_address))) {
8753aed4a8bSchristos {
8763aed4a8bSchristos BI opval = 0;
8773aed4a8bSchristos CPU (h_atomic_reserve) = opval;
8783aed4a8bSchristos written |= (1 << 4);
8793aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
8803aed4a8bSchristos }
8813aed4a8bSchristos }
8823aed4a8bSchristos }
8833aed4a8bSchristos
8843aed4a8bSchristos abuf->written = written;
8853aed4a8bSchristos return vpc;
8863aed4a8bSchristos #undef FLD
8873aed4a8bSchristos }
8883aed4a8bSchristos
8893aed4a8bSchristos /* l-sh: l.sh ${simm16-split}($rA),$rB */
8903aed4a8bSchristos
8913aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sh)8923aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
8933aed4a8bSchristos {
8943aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sw.f
8953aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
8963aed4a8bSchristos int UNUSED written = 0;
8973aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
8983aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
8993aed4a8bSchristos
9003aed4a8bSchristos {
9013aed4a8bSchristos SI tmp_addr;
9023aed4a8bSchristos tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 2);
9033aed4a8bSchristos {
9043aed4a8bSchristos UHI opval = TRUNCSIHI (GET_H_GPR (FLD (f_r3)));
9053aed4a8bSchristos SETMEMUHI (current_cpu, pc, tmp_addr, opval);
9063aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9073aed4a8bSchristos }
9083aed4a8bSchristos if (EQSI (ANDSI (tmp_addr, 268435452), CPU (h_atomic_address))) {
9093aed4a8bSchristos {
9103aed4a8bSchristos BI opval = 0;
9113aed4a8bSchristos CPU (h_atomic_reserve) = opval;
9123aed4a8bSchristos written |= (1 << 4);
9133aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
9143aed4a8bSchristos }
9153aed4a8bSchristos }
9163aed4a8bSchristos }
9173aed4a8bSchristos
9183aed4a8bSchristos abuf->written = written;
9193aed4a8bSchristos return vpc;
9203aed4a8bSchristos #undef FLD
9213aed4a8bSchristos }
9223aed4a8bSchristos
9233aed4a8bSchristos /* l-swa: l.swa ${simm16-split}($rA),$rB */
9243aed4a8bSchristos
9253aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_swa)9263aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_swa) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
9273aed4a8bSchristos {
9283aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sw.f
9293aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9303aed4a8bSchristos int UNUSED written = 0;
9313aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
9323aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
9333aed4a8bSchristos
9343aed4a8bSchristos {
9353aed4a8bSchristos SI tmp_addr;
9363aed4a8bSchristos BI tmp_flag;
9373aed4a8bSchristos tmp_addr = or1k32bf_make_load_store_addr (current_cpu, GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16_split)), 4);
9383aed4a8bSchristos {
9393aed4a8bSchristos USI opval = ANDBI (CPU (h_atomic_reserve), EQSI (tmp_addr, CPU (h_atomic_address)));
9403aed4a8bSchristos SET_H_SYS_SR_F (opval);
9413aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
9423aed4a8bSchristos }
9433aed4a8bSchristos if (GET_H_SYS_SR_F ()) {
9443aed4a8bSchristos {
9453aed4a8bSchristos USI opval = TRUNCSISI (GET_H_GPR (FLD (f_r3)));
9463aed4a8bSchristos SETMEMUSI (current_cpu, pc, tmp_addr, opval);
9473aed4a8bSchristos written |= (1 << 7);
9483aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
9493aed4a8bSchristos }
9503aed4a8bSchristos }
9513aed4a8bSchristos {
9523aed4a8bSchristos BI opval = 0;
9533aed4a8bSchristos CPU (h_atomic_reserve) = opval;
9543aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "atomic-reserve", 'x', opval);
9553aed4a8bSchristos }
9563aed4a8bSchristos }
9573aed4a8bSchristos
9583aed4a8bSchristos abuf->written = written;
9593aed4a8bSchristos return vpc;
9603aed4a8bSchristos #undef FLD
9613aed4a8bSchristos }
9623aed4a8bSchristos
9633aed4a8bSchristos /* l-sll: l.sll $rD,$rA,$rB */
9643aed4a8bSchristos
9653aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sll)9663aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
9673aed4a8bSchristos {
9683aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
9693aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9703aed4a8bSchristos int UNUSED written = 0;
9713aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
9723aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
9733aed4a8bSchristos
9743aed4a8bSchristos {
9753aed4a8bSchristos USI opval = SLLSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
9763aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
9773aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
9783aed4a8bSchristos }
9793aed4a8bSchristos
9803aed4a8bSchristos return vpc;
9813aed4a8bSchristos #undef FLD
9823aed4a8bSchristos }
9833aed4a8bSchristos
9843aed4a8bSchristos /* l-slli: l.slli $rD,$rA,${uimm6} */
9853aed4a8bSchristos
9863aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_slli)9873aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
9883aed4a8bSchristos {
9893aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
9903aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
9913aed4a8bSchristos int UNUSED written = 0;
9923aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
9933aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
9943aed4a8bSchristos
9953aed4a8bSchristos {
9963aed4a8bSchristos USI opval = SLLSI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
9973aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
9983aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
9993aed4a8bSchristos }
10003aed4a8bSchristos
10013aed4a8bSchristos return vpc;
10023aed4a8bSchristos #undef FLD
10033aed4a8bSchristos }
10043aed4a8bSchristos
10053aed4a8bSchristos /* l-srl: l.srl $rD,$rA,$rB */
10063aed4a8bSchristos
10073aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_srl)10083aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
10093aed4a8bSchristos {
10103aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
10113aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10123aed4a8bSchristos int UNUSED written = 0;
10133aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
10143aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10153aed4a8bSchristos
10163aed4a8bSchristos {
10173aed4a8bSchristos USI opval = SRLSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
10183aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
10193aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
10203aed4a8bSchristos }
10213aed4a8bSchristos
10223aed4a8bSchristos return vpc;
10233aed4a8bSchristos #undef FLD
10243aed4a8bSchristos }
10253aed4a8bSchristos
10263aed4a8bSchristos /* l-srli: l.srli $rD,$rA,${uimm6} */
10273aed4a8bSchristos
10283aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_srli)10293aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
10303aed4a8bSchristos {
10313aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
10323aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10333aed4a8bSchristos int UNUSED written = 0;
10343aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
10353aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10363aed4a8bSchristos
10373aed4a8bSchristos {
10383aed4a8bSchristos USI opval = SRLSI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
10393aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
10403aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
10413aed4a8bSchristos }
10423aed4a8bSchristos
10433aed4a8bSchristos return vpc;
10443aed4a8bSchristos #undef FLD
10453aed4a8bSchristos }
10463aed4a8bSchristos
10473aed4a8bSchristos /* l-sra: l.sra $rD,$rA,$rB */
10483aed4a8bSchristos
10493aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sra)10503aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
10513aed4a8bSchristos {
10523aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
10533aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10543aed4a8bSchristos int UNUSED written = 0;
10553aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
10563aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10573aed4a8bSchristos
10583aed4a8bSchristos {
10593aed4a8bSchristos USI opval = SRASI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
10603aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
10613aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
10623aed4a8bSchristos }
10633aed4a8bSchristos
10643aed4a8bSchristos return vpc;
10653aed4a8bSchristos #undef FLD
10663aed4a8bSchristos }
10673aed4a8bSchristos
10683aed4a8bSchristos /* l-srai: l.srai $rD,$rA,${uimm6} */
10693aed4a8bSchristos
10703aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_srai)10713aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
10723aed4a8bSchristos {
10733aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
10743aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10753aed4a8bSchristos int UNUSED written = 0;
10763aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
10773aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10783aed4a8bSchristos
10793aed4a8bSchristos {
10803aed4a8bSchristos USI opval = SRASI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
10813aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
10823aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
10833aed4a8bSchristos }
10843aed4a8bSchristos
10853aed4a8bSchristos return vpc;
10863aed4a8bSchristos #undef FLD
10873aed4a8bSchristos }
10883aed4a8bSchristos
10893aed4a8bSchristos /* l-ror: l.ror $rD,$rA,$rB */
10903aed4a8bSchristos
10913aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_ror)10923aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_ror) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
10933aed4a8bSchristos {
10943aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
10953aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
10963aed4a8bSchristos int UNUSED written = 0;
10973aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
10983aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
10993aed4a8bSchristos
11003aed4a8bSchristos {
11013aed4a8bSchristos USI opval = RORSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
11023aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
11033aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
11043aed4a8bSchristos }
11053aed4a8bSchristos
11063aed4a8bSchristos return vpc;
11073aed4a8bSchristos #undef FLD
11083aed4a8bSchristos }
11093aed4a8bSchristos
11103aed4a8bSchristos /* l-rori: l.rori $rD,$rA,${uimm6} */
11113aed4a8bSchristos
11123aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_rori)11133aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_rori) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
11143aed4a8bSchristos {
11153aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
11163aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11173aed4a8bSchristos int UNUSED written = 0;
11183aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
11193aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11203aed4a8bSchristos
11213aed4a8bSchristos {
11223aed4a8bSchristos USI opval = RORSI (GET_H_GPR (FLD (f_r2)), FLD (f_uimm6));
11233aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
11243aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
11253aed4a8bSchristos }
11263aed4a8bSchristos
11273aed4a8bSchristos return vpc;
11283aed4a8bSchristos #undef FLD
11293aed4a8bSchristos }
11303aed4a8bSchristos
11313aed4a8bSchristos /* l-and: l.and $rD,$rA,$rB */
11323aed4a8bSchristos
11333aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_and)11343aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_and) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
11353aed4a8bSchristos {
11363aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
11373aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11383aed4a8bSchristos int UNUSED written = 0;
11393aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
11403aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11413aed4a8bSchristos
11423aed4a8bSchristos {
11433aed4a8bSchristos USI opval = ANDSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
11443aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
11453aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
11463aed4a8bSchristos }
11473aed4a8bSchristos
11483aed4a8bSchristos return vpc;
11493aed4a8bSchristos #undef FLD
11503aed4a8bSchristos }
11513aed4a8bSchristos
11523aed4a8bSchristos /* l-or: l.or $rD,$rA,$rB */
11533aed4a8bSchristos
11543aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_or)11553aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_or) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
11563aed4a8bSchristos {
11573aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
11583aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11593aed4a8bSchristos int UNUSED written = 0;
11603aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
11613aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11623aed4a8bSchristos
11633aed4a8bSchristos {
11643aed4a8bSchristos USI opval = ORSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
11653aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
11663aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
11673aed4a8bSchristos }
11683aed4a8bSchristos
11693aed4a8bSchristos return vpc;
11703aed4a8bSchristos #undef FLD
11713aed4a8bSchristos }
11723aed4a8bSchristos
11733aed4a8bSchristos /* l-xor: l.xor $rD,$rA,$rB */
11743aed4a8bSchristos
11753aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_xor)11763aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
11773aed4a8bSchristos {
11783aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
11793aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
11803aed4a8bSchristos int UNUSED written = 0;
11813aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
11823aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
11833aed4a8bSchristos
11843aed4a8bSchristos {
11853aed4a8bSchristos USI opval = XORSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
11863aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
11873aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
11883aed4a8bSchristos }
11893aed4a8bSchristos
11903aed4a8bSchristos return vpc;
11913aed4a8bSchristos #undef FLD
11923aed4a8bSchristos }
11933aed4a8bSchristos
11943aed4a8bSchristos /* l-add: l.add $rD,$rA,$rB */
11953aed4a8bSchristos
11963aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_add)11973aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_add) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
11983aed4a8bSchristos {
11993aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
12003aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12013aed4a8bSchristos int UNUSED written = 0;
12023aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
12033aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12043aed4a8bSchristos
12053aed4a8bSchristos {
12063aed4a8bSchristos {
12073aed4a8bSchristos {
12083aed4a8bSchristos BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
12093aed4a8bSchristos SET_H_SYS_SR_CY (opval);
12103aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
12113aed4a8bSchristos }
12123aed4a8bSchristos {
12133aed4a8bSchristos BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
12143aed4a8bSchristos SET_H_SYS_SR_OV (opval);
12153aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
12163aed4a8bSchristos }
12173aed4a8bSchristos {
12183aed4a8bSchristos USI opval = ADDSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
12193aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
12203aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
12213aed4a8bSchristos }
12223aed4a8bSchristos }
12233aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
12243aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
12253aed4a8bSchristos }
12263aed4a8bSchristos }
12273aed4a8bSchristos
12283aed4a8bSchristos return vpc;
12293aed4a8bSchristos #undef FLD
12303aed4a8bSchristos }
12313aed4a8bSchristos
12323aed4a8bSchristos /* l-sub: l.sub $rD,$rA,$rB */
12333aed4a8bSchristos
12343aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sub)12353aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
12363aed4a8bSchristos {
12373aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
12383aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12393aed4a8bSchristos int UNUSED written = 0;
12403aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
12413aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12423aed4a8bSchristos
12433aed4a8bSchristos {
12443aed4a8bSchristos {
12453aed4a8bSchristos {
12463aed4a8bSchristos BI opval = SUBCFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
12473aed4a8bSchristos SET_H_SYS_SR_CY (opval);
12483aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
12493aed4a8bSchristos }
12503aed4a8bSchristos {
12513aed4a8bSchristos BI opval = SUBOFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), 0);
12523aed4a8bSchristos SET_H_SYS_SR_OV (opval);
12533aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
12543aed4a8bSchristos }
12553aed4a8bSchristos {
12563aed4a8bSchristos USI opval = SUBSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
12573aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
12583aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
12593aed4a8bSchristos }
12603aed4a8bSchristos }
12613aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
12623aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
12633aed4a8bSchristos }
12643aed4a8bSchristos }
12653aed4a8bSchristos
12663aed4a8bSchristos return vpc;
12673aed4a8bSchristos #undef FLD
12683aed4a8bSchristos }
12693aed4a8bSchristos
12703aed4a8bSchristos /* l-addc: l.addc $rD,$rA,$rB */
12713aed4a8bSchristos
12723aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_addc)12733aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_addc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
12743aed4a8bSchristos {
12753aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
12763aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
12773aed4a8bSchristos int UNUSED written = 0;
12783aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
12793aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
12803aed4a8bSchristos
12813aed4a8bSchristos {
12823aed4a8bSchristos {
12833aed4a8bSchristos BI tmp_tmp_sys_sr_cy;
12843aed4a8bSchristos tmp_tmp_sys_sr_cy = GET_H_SYS_SR_CY ();
12853aed4a8bSchristos {
12863aed4a8bSchristos BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), tmp_tmp_sys_sr_cy);
12873aed4a8bSchristos SET_H_SYS_SR_CY (opval);
12883aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
12893aed4a8bSchristos }
12903aed4a8bSchristos {
12913aed4a8bSchristos BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), tmp_tmp_sys_sr_cy);
12923aed4a8bSchristos SET_H_SYS_SR_OV (opval);
12933aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
12943aed4a8bSchristos }
12953aed4a8bSchristos {
12963aed4a8bSchristos USI opval = ADDCSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)), tmp_tmp_sys_sr_cy);
12973aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
12983aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
12993aed4a8bSchristos }
13003aed4a8bSchristos }
13013aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
13023aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
13033aed4a8bSchristos }
13043aed4a8bSchristos }
13053aed4a8bSchristos
13063aed4a8bSchristos return vpc;
13073aed4a8bSchristos #undef FLD
13083aed4a8bSchristos }
13093aed4a8bSchristos
13103aed4a8bSchristos /* l-mul: l.mul $rD,$rA,$rB */
13113aed4a8bSchristos
13123aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_mul)13133aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
13143aed4a8bSchristos {
13153aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
13163aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13173aed4a8bSchristos int UNUSED written = 0;
13183aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
13193aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13203aed4a8bSchristos
13213aed4a8bSchristos {
13223aed4a8bSchristos {
13233aed4a8bSchristos {
13243aed4a8bSchristos BI opval = MUL2OFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
13253aed4a8bSchristos SET_H_SYS_SR_OV (opval);
13263aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
13273aed4a8bSchristos }
13283aed4a8bSchristos {
13293aed4a8bSchristos USI opval = MULSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
13303aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
13313aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
13323aed4a8bSchristos }
13333aed4a8bSchristos }
13343aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
13353aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
13363aed4a8bSchristos }
13373aed4a8bSchristos }
13383aed4a8bSchristos
13393aed4a8bSchristos return vpc;
13403aed4a8bSchristos #undef FLD
13413aed4a8bSchristos }
13423aed4a8bSchristos
13433aed4a8bSchristos /* l-muld: l.muld $rA,$rB */
13443aed4a8bSchristos
13453aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_muld)13463aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_muld) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
13473aed4a8bSchristos {
13483aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
13493aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13503aed4a8bSchristos int UNUSED written = 0;
13513aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
13523aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13533aed4a8bSchristos
13543aed4a8bSchristos {
13553aed4a8bSchristos DI tmp_result;
13563aed4a8bSchristos tmp_result = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (GET_H_GPR (FLD (f_r3))));
13573aed4a8bSchristos {
13583aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
13593aed4a8bSchristos SET_H_MAC_MACHI (opval);
13603aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
13613aed4a8bSchristos }
13623aed4a8bSchristos {
13633aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
13643aed4a8bSchristos SET_H_MAC_MACLO (opval);
13653aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
13663aed4a8bSchristos }
13673aed4a8bSchristos }
13683aed4a8bSchristos
13693aed4a8bSchristos return vpc;
13703aed4a8bSchristos #undef FLD
13713aed4a8bSchristos }
13723aed4a8bSchristos
13733aed4a8bSchristos /* l-mulu: l.mulu $rD,$rA,$rB */
13743aed4a8bSchristos
13753aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_mulu)13763aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_mulu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
13773aed4a8bSchristos {
13783aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
13793aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
13803aed4a8bSchristos int UNUSED written = 0;
13813aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
13823aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
13833aed4a8bSchristos
13843aed4a8bSchristos {
13853aed4a8bSchristos {
13863aed4a8bSchristos {
13873aed4a8bSchristos BI opval = MUL1OFSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
13883aed4a8bSchristos SET_H_SYS_SR_CY (opval);
13893aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
13903aed4a8bSchristos }
13913aed4a8bSchristos {
13923aed4a8bSchristos USI opval = MULSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
13933aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
13943aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
13953aed4a8bSchristos }
13963aed4a8bSchristos }
13973aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_CY (), GET_H_SYS_SR_OVE ())) {
13983aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
13993aed4a8bSchristos }
14003aed4a8bSchristos }
14013aed4a8bSchristos
14023aed4a8bSchristos return vpc;
14033aed4a8bSchristos #undef FLD
14043aed4a8bSchristos }
14053aed4a8bSchristos
14063aed4a8bSchristos /* l-muldu: l.muldu $rA,$rB */
14073aed4a8bSchristos
14083aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_muldu)14093aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_muldu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
14103aed4a8bSchristos {
14113aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
14123aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14133aed4a8bSchristos int UNUSED written = 0;
14143aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
14153aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
14163aed4a8bSchristos
14173aed4a8bSchristos {
14183aed4a8bSchristos DI tmp_result;
14193aed4a8bSchristos tmp_result = MULDI (ZEXTSIDI (GET_H_GPR (FLD (f_r2))), ZEXTSIDI (GET_H_GPR (FLD (f_r3))));
14203aed4a8bSchristos {
14213aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
14223aed4a8bSchristos SET_H_MAC_MACHI (opval);
14233aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
14243aed4a8bSchristos }
14253aed4a8bSchristos {
14263aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
14273aed4a8bSchristos SET_H_MAC_MACLO (opval);
14283aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
14293aed4a8bSchristos }
14303aed4a8bSchristos }
14313aed4a8bSchristos
14323aed4a8bSchristos return vpc;
14333aed4a8bSchristos #undef FLD
14343aed4a8bSchristos }
14353aed4a8bSchristos
14363aed4a8bSchristos /* l-div: l.div $rD,$rA,$rB */
14373aed4a8bSchristos
14383aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_div)14393aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_div) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
14403aed4a8bSchristos {
14413aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
14423aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14433aed4a8bSchristos int UNUSED written = 0;
14443aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
14453aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
14463aed4a8bSchristos
14473aed4a8bSchristos if (NESI (GET_H_GPR (FLD (f_r3)), 0)) {
14483aed4a8bSchristos {
14493aed4a8bSchristos {
14503aed4a8bSchristos BI opval = 0;
14513aed4a8bSchristos SET_H_SYS_SR_OV (opval);
14523aed4a8bSchristos written |= (1 << 5);
14533aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
14543aed4a8bSchristos }
14553aed4a8bSchristos {
14563aed4a8bSchristos SI opval = DIVSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
14573aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
14583aed4a8bSchristos written |= (1 << 4);
14593aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
14603aed4a8bSchristos }
14613aed4a8bSchristos }
14623aed4a8bSchristos } else {
14633aed4a8bSchristos {
14643aed4a8bSchristos {
14653aed4a8bSchristos BI opval = 1;
14663aed4a8bSchristos SET_H_SYS_SR_OV (opval);
14673aed4a8bSchristos written |= (1 << 5);
14683aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
14693aed4a8bSchristos }
14703aed4a8bSchristos if (GET_H_SYS_SR_OVE ()) {
14713aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
14723aed4a8bSchristos }
14733aed4a8bSchristos }
14743aed4a8bSchristos }
14753aed4a8bSchristos
14763aed4a8bSchristos abuf->written = written;
14773aed4a8bSchristos return vpc;
14783aed4a8bSchristos #undef FLD
14793aed4a8bSchristos }
14803aed4a8bSchristos
14813aed4a8bSchristos /* l-divu: l.divu $rD,$rA,$rB */
14823aed4a8bSchristos
14833aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_divu)14843aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_divu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
14853aed4a8bSchristos {
14863aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
14873aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
14883aed4a8bSchristos int UNUSED written = 0;
14893aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
14903aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
14913aed4a8bSchristos
14923aed4a8bSchristos if (NESI (GET_H_GPR (FLD (f_r3)), 0)) {
14933aed4a8bSchristos {
14943aed4a8bSchristos {
14953aed4a8bSchristos BI opval = 0;
14963aed4a8bSchristos SET_H_SYS_SR_CY (opval);
14973aed4a8bSchristos written |= (1 << 5);
14983aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
14993aed4a8bSchristos }
15003aed4a8bSchristos {
15013aed4a8bSchristos USI opval = UDIVSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
15023aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
15033aed4a8bSchristos written |= (1 << 4);
15043aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
15053aed4a8bSchristos }
15063aed4a8bSchristos }
15073aed4a8bSchristos } else {
15083aed4a8bSchristos {
15093aed4a8bSchristos {
15103aed4a8bSchristos BI opval = 1;
15113aed4a8bSchristos SET_H_SYS_SR_CY (opval);
15123aed4a8bSchristos written |= (1 << 5);
15133aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
15143aed4a8bSchristos }
15153aed4a8bSchristos if (GET_H_SYS_SR_OVE ()) {
15163aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
15173aed4a8bSchristos }
15183aed4a8bSchristos }
15193aed4a8bSchristos }
15203aed4a8bSchristos
15213aed4a8bSchristos abuf->written = written;
15223aed4a8bSchristos return vpc;
15233aed4a8bSchristos #undef FLD
15243aed4a8bSchristos }
15253aed4a8bSchristos
15263aed4a8bSchristos /* l-ff1: l.ff1 $rD,$rA */
15273aed4a8bSchristos
15283aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_ff1)15293aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_ff1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
15303aed4a8bSchristos {
15313aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
15323aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
15333aed4a8bSchristos int UNUSED written = 0;
15343aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
15353aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
15363aed4a8bSchristos
15373aed4a8bSchristos {
15383aed4a8bSchristos USI opval = or1k32bf_ff1 (current_cpu, GET_H_GPR (FLD (f_r2)));
15393aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
15403aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
15413aed4a8bSchristos }
15423aed4a8bSchristos
15433aed4a8bSchristos return vpc;
15443aed4a8bSchristos #undef FLD
15453aed4a8bSchristos }
15463aed4a8bSchristos
15473aed4a8bSchristos /* l-fl1: l.fl1 $rD,$rA */
15483aed4a8bSchristos
15493aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_fl1)15503aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_fl1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
15513aed4a8bSchristos {
15523aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
15533aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
15543aed4a8bSchristos int UNUSED written = 0;
15553aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
15563aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
15573aed4a8bSchristos
15583aed4a8bSchristos {
15593aed4a8bSchristos USI opval = or1k32bf_fl1 (current_cpu, GET_H_GPR (FLD (f_r2)));
15603aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
15613aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
15623aed4a8bSchristos }
15633aed4a8bSchristos
15643aed4a8bSchristos return vpc;
15653aed4a8bSchristos #undef FLD
15663aed4a8bSchristos }
15673aed4a8bSchristos
15683aed4a8bSchristos /* l-andi: l.andi $rD,$rA,$uimm16 */
15693aed4a8bSchristos
15703aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_andi)15713aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_andi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
15723aed4a8bSchristos {
15733aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_mfspr.f
15743aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
15753aed4a8bSchristos int UNUSED written = 0;
15763aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
15773aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
15783aed4a8bSchristos
15793aed4a8bSchristos {
15803aed4a8bSchristos USI opval = ANDSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16)));
15813aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
15823aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
15833aed4a8bSchristos }
15843aed4a8bSchristos
15853aed4a8bSchristos return vpc;
15863aed4a8bSchristos #undef FLD
15873aed4a8bSchristos }
15883aed4a8bSchristos
15893aed4a8bSchristos /* l-ori: l.ori $rD,$rA,$uimm16 */
15903aed4a8bSchristos
15913aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_ori)15923aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_ori) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
15933aed4a8bSchristos {
15943aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_mfspr.f
15953aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
15963aed4a8bSchristos int UNUSED written = 0;
15973aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
15983aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
15993aed4a8bSchristos
16003aed4a8bSchristos {
16013aed4a8bSchristos USI opval = ORSI (GET_H_GPR (FLD (f_r2)), ZEXTSISI (FLD (f_uimm16)));
16023aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
16033aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
16043aed4a8bSchristos }
16053aed4a8bSchristos
16063aed4a8bSchristos return vpc;
16073aed4a8bSchristos #undef FLD
16083aed4a8bSchristos }
16093aed4a8bSchristos
16103aed4a8bSchristos /* l-xori: l.xori $rD,$rA,$simm16 */
16113aed4a8bSchristos
16123aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_xori)16133aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_xori) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
16143aed4a8bSchristos {
16153aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
16163aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
16173aed4a8bSchristos int UNUSED written = 0;
16183aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
16193aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
16203aed4a8bSchristos
16213aed4a8bSchristos {
16223aed4a8bSchristos USI opval = XORSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
16233aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
16243aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
16253aed4a8bSchristos }
16263aed4a8bSchristos
16273aed4a8bSchristos return vpc;
16283aed4a8bSchristos #undef FLD
16293aed4a8bSchristos }
16303aed4a8bSchristos
16313aed4a8bSchristos /* l-addi: l.addi $rD,$rA,$simm16 */
16323aed4a8bSchristos
16333aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_addi)16343aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
16353aed4a8bSchristos {
16363aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
16373aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
16383aed4a8bSchristos int UNUSED written = 0;
16393aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
16403aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
16413aed4a8bSchristos
16423aed4a8bSchristos {
16433aed4a8bSchristos {
16443aed4a8bSchristos {
16453aed4a8bSchristos BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 0);
16463aed4a8bSchristos SET_H_SYS_SR_CY (opval);
16473aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
16483aed4a8bSchristos }
16493aed4a8bSchristos {
16503aed4a8bSchristos BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), 0);
16513aed4a8bSchristos SET_H_SYS_SR_OV (opval);
16523aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
16533aed4a8bSchristos }
16543aed4a8bSchristos {
16553aed4a8bSchristos USI opval = ADDSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
16563aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
16573aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
16583aed4a8bSchristos }
16593aed4a8bSchristos }
16603aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
16613aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
16623aed4a8bSchristos }
16633aed4a8bSchristos }
16643aed4a8bSchristos
16653aed4a8bSchristos return vpc;
16663aed4a8bSchristos #undef FLD
16673aed4a8bSchristos }
16683aed4a8bSchristos
16693aed4a8bSchristos /* l-addic: l.addic $rD,$rA,$simm16 */
16703aed4a8bSchristos
16713aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_addic)16723aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_addic) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
16733aed4a8bSchristos {
16743aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
16753aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
16763aed4a8bSchristos int UNUSED written = 0;
16773aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
16783aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
16793aed4a8bSchristos
16803aed4a8bSchristos {
16813aed4a8bSchristos {
16823aed4a8bSchristos BI tmp_tmp_sys_sr_cy;
16833aed4a8bSchristos tmp_tmp_sys_sr_cy = GET_H_SYS_SR_CY ();
16843aed4a8bSchristos {
16853aed4a8bSchristos BI opval = ADDCFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), tmp_tmp_sys_sr_cy);
16863aed4a8bSchristos SET_H_SYS_SR_CY (opval);
16873aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
16883aed4a8bSchristos }
16893aed4a8bSchristos {
16903aed4a8bSchristos BI opval = ADDOFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), tmp_tmp_sys_sr_cy);
16913aed4a8bSchristos SET_H_SYS_SR_OV (opval);
16923aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
16933aed4a8bSchristos }
16943aed4a8bSchristos {
16953aed4a8bSchristos SI opval = ADDCSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)), tmp_tmp_sys_sr_cy);
16963aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
16973aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
16983aed4a8bSchristos }
16993aed4a8bSchristos }
17003aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
17013aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
17023aed4a8bSchristos }
17033aed4a8bSchristos }
17043aed4a8bSchristos
17053aed4a8bSchristos return vpc;
17063aed4a8bSchristos #undef FLD
17073aed4a8bSchristos }
17083aed4a8bSchristos
17093aed4a8bSchristos /* l-muli: l.muli $rD,$rA,$simm16 */
17103aed4a8bSchristos
17113aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_muli)17123aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_muli) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
17133aed4a8bSchristos {
17143aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
17153aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
17163aed4a8bSchristos int UNUSED written = 0;
17173aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
17183aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
17193aed4a8bSchristos
17203aed4a8bSchristos {
17213aed4a8bSchristos {
17223aed4a8bSchristos {
17233aed4a8bSchristos USI opval = MUL2OFSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
17243aed4a8bSchristos SET_H_SYS_SR_OV (opval);
17253aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
17263aed4a8bSchristos }
17273aed4a8bSchristos {
17283aed4a8bSchristos USI opval = MULSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
17293aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
17303aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
17313aed4a8bSchristos }
17323aed4a8bSchristos }
17333aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
17343aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
17353aed4a8bSchristos }
17363aed4a8bSchristos }
17373aed4a8bSchristos
17383aed4a8bSchristos return vpc;
17393aed4a8bSchristos #undef FLD
17403aed4a8bSchristos }
17413aed4a8bSchristos
17423aed4a8bSchristos /* l-exths: l.exths $rD,$rA */
17433aed4a8bSchristos
17443aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_exths)17453aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_exths) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
17463aed4a8bSchristos {
17473aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
17483aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
17493aed4a8bSchristos int UNUSED written = 0;
17503aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
17513aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
17523aed4a8bSchristos
17533aed4a8bSchristos {
17543aed4a8bSchristos USI opval = EXTHISI (TRUNCSIHI (GET_H_GPR (FLD (f_r2))));
17553aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
17563aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
17573aed4a8bSchristos }
17583aed4a8bSchristos
17593aed4a8bSchristos return vpc;
17603aed4a8bSchristos #undef FLD
17613aed4a8bSchristos }
17623aed4a8bSchristos
17633aed4a8bSchristos /* l-extbs: l.extbs $rD,$rA */
17643aed4a8bSchristos
17653aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_extbs)17663aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_extbs) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
17673aed4a8bSchristos {
17683aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
17693aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
17703aed4a8bSchristos int UNUSED written = 0;
17713aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
17723aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
17733aed4a8bSchristos
17743aed4a8bSchristos {
17753aed4a8bSchristos USI opval = EXTQISI (TRUNCSIQI (GET_H_GPR (FLD (f_r2))));
17763aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
17773aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
17783aed4a8bSchristos }
17793aed4a8bSchristos
17803aed4a8bSchristos return vpc;
17813aed4a8bSchristos #undef FLD
17823aed4a8bSchristos }
17833aed4a8bSchristos
17843aed4a8bSchristos /* l-exthz: l.exthz $rD,$rA */
17853aed4a8bSchristos
17863aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_exthz)17873aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_exthz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
17883aed4a8bSchristos {
17893aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
17903aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
17913aed4a8bSchristos int UNUSED written = 0;
17923aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
17933aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
17943aed4a8bSchristos
17953aed4a8bSchristos {
17963aed4a8bSchristos USI opval = ZEXTHISI (TRUNCSIHI (GET_H_GPR (FLD (f_r2))));
17973aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
17983aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
17993aed4a8bSchristos }
18003aed4a8bSchristos
18013aed4a8bSchristos return vpc;
18023aed4a8bSchristos #undef FLD
18033aed4a8bSchristos }
18043aed4a8bSchristos
18053aed4a8bSchristos /* l-extbz: l.extbz $rD,$rA */
18063aed4a8bSchristos
18073aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_extbz)18083aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_extbz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
18093aed4a8bSchristos {
18103aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
18113aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
18123aed4a8bSchristos int UNUSED written = 0;
18133aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
18143aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
18153aed4a8bSchristos
18163aed4a8bSchristos {
18173aed4a8bSchristos USI opval = ZEXTQISI (TRUNCSIQI (GET_H_GPR (FLD (f_r2))));
18183aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
18193aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
18203aed4a8bSchristos }
18213aed4a8bSchristos
18223aed4a8bSchristos return vpc;
18233aed4a8bSchristos #undef FLD
18243aed4a8bSchristos }
18253aed4a8bSchristos
18263aed4a8bSchristos /* l-extws: l.extws $rD,$rA */
18273aed4a8bSchristos
18283aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_extws)18293aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_extws) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
18303aed4a8bSchristos {
18313aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
18323aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
18333aed4a8bSchristos int UNUSED written = 0;
18343aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
18353aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
18363aed4a8bSchristos
18373aed4a8bSchristos {
18383aed4a8bSchristos USI opval = EXTSISI (TRUNCSISI (GET_H_GPR (FLD (f_r2))));
18393aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
18403aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
18413aed4a8bSchristos }
18423aed4a8bSchristos
18433aed4a8bSchristos return vpc;
18443aed4a8bSchristos #undef FLD
18453aed4a8bSchristos }
18463aed4a8bSchristos
18473aed4a8bSchristos /* l-extwz: l.extwz $rD,$rA */
18483aed4a8bSchristos
18493aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_extwz)18503aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_extwz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
18513aed4a8bSchristos {
18523aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
18533aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
18543aed4a8bSchristos int UNUSED written = 0;
18553aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
18563aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
18573aed4a8bSchristos
18583aed4a8bSchristos {
18593aed4a8bSchristos USI opval = ZEXTSISI (TRUNCSISI (GET_H_GPR (FLD (f_r2))));
18603aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
18613aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
18623aed4a8bSchristos }
18633aed4a8bSchristos
18643aed4a8bSchristos return vpc;
18653aed4a8bSchristos #undef FLD
18663aed4a8bSchristos }
18673aed4a8bSchristos
18683aed4a8bSchristos /* l-cmov: l.cmov $rD,$rA,$rB */
18693aed4a8bSchristos
18703aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cmov)18713aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cmov) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
18723aed4a8bSchristos {
18733aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
18743aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
18753aed4a8bSchristos int UNUSED written = 0;
18763aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
18773aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
18783aed4a8bSchristos
18793aed4a8bSchristos if (GET_H_SYS_SR_F ()) {
18803aed4a8bSchristos {
18813aed4a8bSchristos USI opval = GET_H_GPR (FLD (f_r2));
18823aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
18833aed4a8bSchristos written |= (1 << 3);
18843aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
18853aed4a8bSchristos }
18863aed4a8bSchristos } else {
18873aed4a8bSchristos {
18883aed4a8bSchristos USI opval = GET_H_GPR (FLD (f_r3));
18893aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
18903aed4a8bSchristos written |= (1 << 3);
18913aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
18923aed4a8bSchristos }
18933aed4a8bSchristos }
18943aed4a8bSchristos
18953aed4a8bSchristos abuf->written = written;
18963aed4a8bSchristos return vpc;
18973aed4a8bSchristos #undef FLD
18983aed4a8bSchristos }
18993aed4a8bSchristos
19003aed4a8bSchristos /* l-sfgts: l.sfgts $rA,$rB */
19013aed4a8bSchristos
19023aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgts)19033aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgts) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
19043aed4a8bSchristos {
19053aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
19063aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
19073aed4a8bSchristos int UNUSED written = 0;
19083aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
19093aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
19103aed4a8bSchristos
19113aed4a8bSchristos {
19123aed4a8bSchristos USI opval = GTSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
19133aed4a8bSchristos SET_H_SYS_SR_F (opval);
19143aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
19153aed4a8bSchristos }
19163aed4a8bSchristos
19173aed4a8bSchristos return vpc;
19183aed4a8bSchristos #undef FLD
19193aed4a8bSchristos }
19203aed4a8bSchristos
19213aed4a8bSchristos /* l-sfgtsi: l.sfgtsi $rA,$simm16 */
19223aed4a8bSchristos
19233aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgtsi)19243aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgtsi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
19253aed4a8bSchristos {
19263aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
19273aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
19283aed4a8bSchristos int UNUSED written = 0;
19293aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
19303aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
19313aed4a8bSchristos
19323aed4a8bSchristos {
19333aed4a8bSchristos USI opval = GTSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
19343aed4a8bSchristos SET_H_SYS_SR_F (opval);
19353aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
19363aed4a8bSchristos }
19373aed4a8bSchristos
19383aed4a8bSchristos return vpc;
19393aed4a8bSchristos #undef FLD
19403aed4a8bSchristos }
19413aed4a8bSchristos
19423aed4a8bSchristos /* l-sfgtu: l.sfgtu $rA,$rB */
19433aed4a8bSchristos
19443aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgtu)19453aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgtu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
19463aed4a8bSchristos {
19473aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
19483aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
19493aed4a8bSchristos int UNUSED written = 0;
19503aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
19513aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
19523aed4a8bSchristos
19533aed4a8bSchristos {
19543aed4a8bSchristos USI opval = GTUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
19553aed4a8bSchristos SET_H_SYS_SR_F (opval);
19563aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
19573aed4a8bSchristos }
19583aed4a8bSchristos
19593aed4a8bSchristos return vpc;
19603aed4a8bSchristos #undef FLD
19613aed4a8bSchristos }
19623aed4a8bSchristos
19633aed4a8bSchristos /* l-sfgtui: l.sfgtui $rA,$simm16 */
19643aed4a8bSchristos
19653aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgtui)19663aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgtui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
19673aed4a8bSchristos {
19683aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
19693aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
19703aed4a8bSchristos int UNUSED written = 0;
19713aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
19723aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
19733aed4a8bSchristos
19743aed4a8bSchristos {
19753aed4a8bSchristos USI opval = GTUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
19763aed4a8bSchristos SET_H_SYS_SR_F (opval);
19773aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
19783aed4a8bSchristos }
19793aed4a8bSchristos
19803aed4a8bSchristos return vpc;
19813aed4a8bSchristos #undef FLD
19823aed4a8bSchristos }
19833aed4a8bSchristos
19843aed4a8bSchristos /* l-sfges: l.sfges $rA,$rB */
19853aed4a8bSchristos
19863aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfges)19873aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfges) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
19883aed4a8bSchristos {
19893aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
19903aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
19913aed4a8bSchristos int UNUSED written = 0;
19923aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
19933aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
19943aed4a8bSchristos
19953aed4a8bSchristos {
19963aed4a8bSchristos USI opval = GESI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
19973aed4a8bSchristos SET_H_SYS_SR_F (opval);
19983aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
19993aed4a8bSchristos }
20003aed4a8bSchristos
20013aed4a8bSchristos return vpc;
20023aed4a8bSchristos #undef FLD
20033aed4a8bSchristos }
20043aed4a8bSchristos
20053aed4a8bSchristos /* l-sfgesi: l.sfgesi $rA,$simm16 */
20063aed4a8bSchristos
20073aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgesi)20083aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgesi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
20093aed4a8bSchristos {
20103aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
20113aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
20123aed4a8bSchristos int UNUSED written = 0;
20133aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
20143aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
20153aed4a8bSchristos
20163aed4a8bSchristos {
20173aed4a8bSchristos USI opval = GESI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
20183aed4a8bSchristos SET_H_SYS_SR_F (opval);
20193aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
20203aed4a8bSchristos }
20213aed4a8bSchristos
20223aed4a8bSchristos return vpc;
20233aed4a8bSchristos #undef FLD
20243aed4a8bSchristos }
20253aed4a8bSchristos
20263aed4a8bSchristos /* l-sfgeu: l.sfgeu $rA,$rB */
20273aed4a8bSchristos
20283aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgeu)20293aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgeu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
20303aed4a8bSchristos {
20313aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
20323aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
20333aed4a8bSchristos int UNUSED written = 0;
20343aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
20353aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
20363aed4a8bSchristos
20373aed4a8bSchristos {
20383aed4a8bSchristos USI opval = GEUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
20393aed4a8bSchristos SET_H_SYS_SR_F (opval);
20403aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
20413aed4a8bSchristos }
20423aed4a8bSchristos
20433aed4a8bSchristos return vpc;
20443aed4a8bSchristos #undef FLD
20453aed4a8bSchristos }
20463aed4a8bSchristos
20473aed4a8bSchristos /* l-sfgeui: l.sfgeui $rA,$simm16 */
20483aed4a8bSchristos
20493aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfgeui)20503aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfgeui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
20513aed4a8bSchristos {
20523aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
20533aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
20543aed4a8bSchristos int UNUSED written = 0;
20553aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
20563aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
20573aed4a8bSchristos
20583aed4a8bSchristos {
20593aed4a8bSchristos USI opval = GEUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
20603aed4a8bSchristos SET_H_SYS_SR_F (opval);
20613aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
20623aed4a8bSchristos }
20633aed4a8bSchristos
20643aed4a8bSchristos return vpc;
20653aed4a8bSchristos #undef FLD
20663aed4a8bSchristos }
20673aed4a8bSchristos
20683aed4a8bSchristos /* l-sflts: l.sflts $rA,$rB */
20693aed4a8bSchristos
20703aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sflts)20713aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sflts) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
20723aed4a8bSchristos {
20733aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
20743aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
20753aed4a8bSchristos int UNUSED written = 0;
20763aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
20773aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
20783aed4a8bSchristos
20793aed4a8bSchristos {
20803aed4a8bSchristos USI opval = LTSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
20813aed4a8bSchristos SET_H_SYS_SR_F (opval);
20823aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
20833aed4a8bSchristos }
20843aed4a8bSchristos
20853aed4a8bSchristos return vpc;
20863aed4a8bSchristos #undef FLD
20873aed4a8bSchristos }
20883aed4a8bSchristos
20893aed4a8bSchristos /* l-sfltsi: l.sfltsi $rA,$simm16 */
20903aed4a8bSchristos
20913aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfltsi)20923aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfltsi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
20933aed4a8bSchristos {
20943aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
20953aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
20963aed4a8bSchristos int UNUSED written = 0;
20973aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
20983aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
20993aed4a8bSchristos
21003aed4a8bSchristos {
21013aed4a8bSchristos USI opval = LTSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
21023aed4a8bSchristos SET_H_SYS_SR_F (opval);
21033aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
21043aed4a8bSchristos }
21053aed4a8bSchristos
21063aed4a8bSchristos return vpc;
21073aed4a8bSchristos #undef FLD
21083aed4a8bSchristos }
21093aed4a8bSchristos
21103aed4a8bSchristos /* l-sfltu: l.sfltu $rA,$rB */
21113aed4a8bSchristos
21123aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfltu)21133aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfltu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
21143aed4a8bSchristos {
21153aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
21163aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
21173aed4a8bSchristos int UNUSED written = 0;
21183aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
21193aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
21203aed4a8bSchristos
21213aed4a8bSchristos {
21223aed4a8bSchristos USI opval = LTUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
21233aed4a8bSchristos SET_H_SYS_SR_F (opval);
21243aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
21253aed4a8bSchristos }
21263aed4a8bSchristos
21273aed4a8bSchristos return vpc;
21283aed4a8bSchristos #undef FLD
21293aed4a8bSchristos }
21303aed4a8bSchristos
21313aed4a8bSchristos /* l-sfltui: l.sfltui $rA,$simm16 */
21323aed4a8bSchristos
21333aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfltui)21343aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfltui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
21353aed4a8bSchristos {
21363aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
21373aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
21383aed4a8bSchristos int UNUSED written = 0;
21393aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
21403aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
21413aed4a8bSchristos
21423aed4a8bSchristos {
21433aed4a8bSchristos USI opval = LTUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
21443aed4a8bSchristos SET_H_SYS_SR_F (opval);
21453aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
21463aed4a8bSchristos }
21473aed4a8bSchristos
21483aed4a8bSchristos return vpc;
21493aed4a8bSchristos #undef FLD
21503aed4a8bSchristos }
21513aed4a8bSchristos
21523aed4a8bSchristos /* l-sfles: l.sfles $rA,$rB */
21533aed4a8bSchristos
21543aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfles)21553aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfles) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
21563aed4a8bSchristos {
21573aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
21583aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
21593aed4a8bSchristos int UNUSED written = 0;
21603aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
21613aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
21623aed4a8bSchristos
21633aed4a8bSchristos {
21643aed4a8bSchristos USI opval = LESI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
21653aed4a8bSchristos SET_H_SYS_SR_F (opval);
21663aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
21673aed4a8bSchristos }
21683aed4a8bSchristos
21693aed4a8bSchristos return vpc;
21703aed4a8bSchristos #undef FLD
21713aed4a8bSchristos }
21723aed4a8bSchristos
21733aed4a8bSchristos /* l-sflesi: l.sflesi $rA,$simm16 */
21743aed4a8bSchristos
21753aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sflesi)21763aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sflesi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
21773aed4a8bSchristos {
21783aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
21793aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
21803aed4a8bSchristos int UNUSED written = 0;
21813aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
21823aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
21833aed4a8bSchristos
21843aed4a8bSchristos {
21853aed4a8bSchristos USI opval = LESI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
21863aed4a8bSchristos SET_H_SYS_SR_F (opval);
21873aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
21883aed4a8bSchristos }
21893aed4a8bSchristos
21903aed4a8bSchristos return vpc;
21913aed4a8bSchristos #undef FLD
21923aed4a8bSchristos }
21933aed4a8bSchristos
21943aed4a8bSchristos /* l-sfleu: l.sfleu $rA,$rB */
21953aed4a8bSchristos
21963aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfleu)21973aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfleu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
21983aed4a8bSchristos {
21993aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
22003aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
22013aed4a8bSchristos int UNUSED written = 0;
22023aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
22033aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
22043aed4a8bSchristos
22053aed4a8bSchristos {
22063aed4a8bSchristos USI opval = LEUSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
22073aed4a8bSchristos SET_H_SYS_SR_F (opval);
22083aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
22093aed4a8bSchristos }
22103aed4a8bSchristos
22113aed4a8bSchristos return vpc;
22123aed4a8bSchristos #undef FLD
22133aed4a8bSchristos }
22143aed4a8bSchristos
22153aed4a8bSchristos /* l-sfleui: l.sfleui $rA,$simm16 */
22163aed4a8bSchristos
22173aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfleui)22183aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfleui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
22193aed4a8bSchristos {
22203aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
22213aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
22223aed4a8bSchristos int UNUSED written = 0;
22233aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
22243aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
22253aed4a8bSchristos
22263aed4a8bSchristos {
22273aed4a8bSchristos USI opval = LEUSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
22283aed4a8bSchristos SET_H_SYS_SR_F (opval);
22293aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
22303aed4a8bSchristos }
22313aed4a8bSchristos
22323aed4a8bSchristos return vpc;
22333aed4a8bSchristos #undef FLD
22343aed4a8bSchristos }
22353aed4a8bSchristos
22363aed4a8bSchristos /* l-sfeq: l.sfeq $rA,$rB */
22373aed4a8bSchristos
22383aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfeq)22393aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfeq) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
22403aed4a8bSchristos {
22413aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
22423aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
22433aed4a8bSchristos int UNUSED written = 0;
22443aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
22453aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
22463aed4a8bSchristos
22473aed4a8bSchristos {
22483aed4a8bSchristos USI opval = EQSI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
22493aed4a8bSchristos SET_H_SYS_SR_F (opval);
22503aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
22513aed4a8bSchristos }
22523aed4a8bSchristos
22533aed4a8bSchristos return vpc;
22543aed4a8bSchristos #undef FLD
22553aed4a8bSchristos }
22563aed4a8bSchristos
22573aed4a8bSchristos /* l-sfeqi: l.sfeqi $rA,$simm16 */
22583aed4a8bSchristos
22593aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfeqi)22603aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfeqi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
22613aed4a8bSchristos {
22623aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
22633aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
22643aed4a8bSchristos int UNUSED written = 0;
22653aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
22663aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
22673aed4a8bSchristos
22683aed4a8bSchristos {
22693aed4a8bSchristos USI opval = EQSI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
22703aed4a8bSchristos SET_H_SYS_SR_F (opval);
22713aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
22723aed4a8bSchristos }
22733aed4a8bSchristos
22743aed4a8bSchristos return vpc;
22753aed4a8bSchristos #undef FLD
22763aed4a8bSchristos }
22773aed4a8bSchristos
22783aed4a8bSchristos /* l-sfne: l.sfne $rA,$rB */
22793aed4a8bSchristos
22803aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfne)22813aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfne) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
22823aed4a8bSchristos {
22833aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
22843aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
22853aed4a8bSchristos int UNUSED written = 0;
22863aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
22873aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
22883aed4a8bSchristos
22893aed4a8bSchristos {
22903aed4a8bSchristos USI opval = NESI (GET_H_GPR (FLD (f_r2)), GET_H_GPR (FLD (f_r3)));
22913aed4a8bSchristos SET_H_SYS_SR_F (opval);
22923aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
22933aed4a8bSchristos }
22943aed4a8bSchristos
22953aed4a8bSchristos return vpc;
22963aed4a8bSchristos #undef FLD
22973aed4a8bSchristos }
22983aed4a8bSchristos
22993aed4a8bSchristos /* l-sfnei: l.sfnei $rA,$simm16 */
23003aed4a8bSchristos
23013aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_sfnei)23023aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_sfnei) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
23033aed4a8bSchristos {
23043aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
23053aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
23063aed4a8bSchristos int UNUSED written = 0;
23073aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
23083aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
23093aed4a8bSchristos
23103aed4a8bSchristos {
23113aed4a8bSchristos USI opval = NESI (GET_H_GPR (FLD (f_r2)), EXTSISI (FLD (f_simm16)));
23123aed4a8bSchristos SET_H_SYS_SR_F (opval);
23133aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
23143aed4a8bSchristos }
23153aed4a8bSchristos
23163aed4a8bSchristos return vpc;
23173aed4a8bSchristos #undef FLD
23183aed4a8bSchristos }
23193aed4a8bSchristos
23203aed4a8bSchristos /* l-mac: l.mac $rA,$rB */
23213aed4a8bSchristos
23223aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_mac)23233aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_mac) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
23243aed4a8bSchristos {
23253aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
23263aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
23273aed4a8bSchristos int UNUSED written = 0;
23283aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
23293aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
23303aed4a8bSchristos
23313aed4a8bSchristos {
23323aed4a8bSchristos {
23333aed4a8bSchristos DI tmp_prod;
23343aed4a8bSchristos DI tmp_mac;
23353aed4a8bSchristos DI tmp_result;
23363aed4a8bSchristos tmp_prod = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (GET_H_GPR (FLD (f_r3))));
23373aed4a8bSchristos tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
23383aed4a8bSchristos tmp_result = ADDDI (tmp_prod, tmp_mac);
23393aed4a8bSchristos {
23403aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
23413aed4a8bSchristos SET_H_MAC_MACHI (opval);
23423aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
23433aed4a8bSchristos }
23443aed4a8bSchristos {
23453aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
23463aed4a8bSchristos SET_H_MAC_MACLO (opval);
23473aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
23483aed4a8bSchristos }
23493aed4a8bSchristos {
23503aed4a8bSchristos BI opval = ADDOFDI (tmp_prod, tmp_mac, 0);
23513aed4a8bSchristos SET_H_SYS_SR_OV (opval);
23523aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
23533aed4a8bSchristos }
23543aed4a8bSchristos }
23553aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
23563aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
23573aed4a8bSchristos }
23583aed4a8bSchristos }
23593aed4a8bSchristos
23603aed4a8bSchristos return vpc;
23613aed4a8bSchristos #undef FLD
23623aed4a8bSchristos }
23633aed4a8bSchristos
23643aed4a8bSchristos /* l-maci: l.maci $rA,${simm16} */
23653aed4a8bSchristos
23663aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_maci)23673aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_maci) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
23683aed4a8bSchristos {
23693aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_lwz.f
23703aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
23713aed4a8bSchristos int UNUSED written = 0;
23723aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
23733aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
23743aed4a8bSchristos
23753aed4a8bSchristos {
23763aed4a8bSchristos {
23773aed4a8bSchristos DI tmp_prod;
23783aed4a8bSchristos DI tmp_mac;
23793aed4a8bSchristos DI tmp_result;
23803aed4a8bSchristos tmp_prod = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (FLD (f_simm16)));
23813aed4a8bSchristos tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
23823aed4a8bSchristos tmp_result = ADDDI (tmp_mac, tmp_prod);
23833aed4a8bSchristos {
23843aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
23853aed4a8bSchristos SET_H_MAC_MACHI (opval);
23863aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
23873aed4a8bSchristos }
23883aed4a8bSchristos {
23893aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
23903aed4a8bSchristos SET_H_MAC_MACLO (opval);
23913aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
23923aed4a8bSchristos }
23933aed4a8bSchristos {
23943aed4a8bSchristos BI opval = ADDOFDI (tmp_prod, tmp_mac, 0);
23953aed4a8bSchristos SET_H_SYS_SR_OV (opval);
23963aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
23973aed4a8bSchristos }
23983aed4a8bSchristos }
23993aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
24003aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
24013aed4a8bSchristos }
24023aed4a8bSchristos }
24033aed4a8bSchristos
24043aed4a8bSchristos return vpc;
24053aed4a8bSchristos #undef FLD
24063aed4a8bSchristos }
24073aed4a8bSchristos
24083aed4a8bSchristos /* l-macu: l.macu $rA,$rB */
24093aed4a8bSchristos
24103aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_macu)24113aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_macu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
24123aed4a8bSchristos {
24133aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
24143aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
24153aed4a8bSchristos int UNUSED written = 0;
24163aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
24173aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
24183aed4a8bSchristos
24193aed4a8bSchristos {
24203aed4a8bSchristos {
24213aed4a8bSchristos DI tmp_prod;
24223aed4a8bSchristos DI tmp_mac;
24233aed4a8bSchristos DI tmp_result;
24243aed4a8bSchristos tmp_prod = MULDI (ZEXTSIDI (GET_H_GPR (FLD (f_r2))), ZEXTSIDI (GET_H_GPR (FLD (f_r3))));
24253aed4a8bSchristos tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
24263aed4a8bSchristos tmp_result = ADDDI (tmp_prod, tmp_mac);
24273aed4a8bSchristos {
24283aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
24293aed4a8bSchristos SET_H_MAC_MACHI (opval);
24303aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
24313aed4a8bSchristos }
24323aed4a8bSchristos {
24333aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
24343aed4a8bSchristos SET_H_MAC_MACLO (opval);
24353aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
24363aed4a8bSchristos }
24373aed4a8bSchristos {
24383aed4a8bSchristos BI opval = ADDCFDI (tmp_prod, tmp_mac, 0);
24393aed4a8bSchristos SET_H_SYS_SR_CY (opval);
24403aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
24413aed4a8bSchristos }
24423aed4a8bSchristos }
24433aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_CY (), GET_H_SYS_SR_OVE ())) {
24443aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
24453aed4a8bSchristos }
24463aed4a8bSchristos }
24473aed4a8bSchristos
24483aed4a8bSchristos return vpc;
24493aed4a8bSchristos #undef FLD
24503aed4a8bSchristos }
24513aed4a8bSchristos
24523aed4a8bSchristos /* l-msb: l.msb $rA,$rB */
24533aed4a8bSchristos
24543aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_msb)24553aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_msb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
24563aed4a8bSchristos {
24573aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
24583aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
24593aed4a8bSchristos int UNUSED written = 0;
24603aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
24613aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
24623aed4a8bSchristos
24633aed4a8bSchristos {
24643aed4a8bSchristos {
24653aed4a8bSchristos DI tmp_prod;
24663aed4a8bSchristos DI tmp_mac;
24673aed4a8bSchristos DI tmp_result;
24683aed4a8bSchristos tmp_prod = MULDI (EXTSIDI (GET_H_GPR (FLD (f_r2))), EXTSIDI (GET_H_GPR (FLD (f_r3))));
24693aed4a8bSchristos tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
24703aed4a8bSchristos tmp_result = SUBDI (tmp_mac, tmp_prod);
24713aed4a8bSchristos {
24723aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
24733aed4a8bSchristos SET_H_MAC_MACHI (opval);
24743aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
24753aed4a8bSchristos }
24763aed4a8bSchristos {
24773aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
24783aed4a8bSchristos SET_H_MAC_MACLO (opval);
24793aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
24803aed4a8bSchristos }
24813aed4a8bSchristos {
24823aed4a8bSchristos BI opval = SUBOFDI (tmp_mac, tmp_result, 0);
24833aed4a8bSchristos SET_H_SYS_SR_OV (opval);
24843aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-ov", 'x', opval);
24853aed4a8bSchristos }
24863aed4a8bSchristos }
24873aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_OV (), GET_H_SYS_SR_OVE ())) {
24883aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
24893aed4a8bSchristos }
24903aed4a8bSchristos }
24913aed4a8bSchristos
24923aed4a8bSchristos return vpc;
24933aed4a8bSchristos #undef FLD
24943aed4a8bSchristos }
24953aed4a8bSchristos
24963aed4a8bSchristos /* l-msbu: l.msbu $rA,$rB */
24973aed4a8bSchristos
24983aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_msbu)24993aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_msbu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
25003aed4a8bSchristos {
25013aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
25023aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
25033aed4a8bSchristos int UNUSED written = 0;
25043aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
25053aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
25063aed4a8bSchristos
25073aed4a8bSchristos {
25083aed4a8bSchristos {
25093aed4a8bSchristos DI tmp_prod;
25103aed4a8bSchristos DI tmp_mac;
25113aed4a8bSchristos DI tmp_result;
25123aed4a8bSchristos tmp_prod = MULDI (ZEXTSIDI (GET_H_GPR (FLD (f_r2))), ZEXTSIDI (GET_H_GPR (FLD (f_r3))));
25133aed4a8bSchristos tmp_mac = JOINSIDI (GET_H_MAC_MACHI (), GET_H_MAC_MACLO ());
25143aed4a8bSchristos tmp_result = SUBDI (tmp_mac, tmp_prod);
25153aed4a8bSchristos {
25163aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 0);
25173aed4a8bSchristos SET_H_MAC_MACHI (opval);
25183aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-machi", 'x', opval);
25193aed4a8bSchristos }
25203aed4a8bSchristos {
25213aed4a8bSchristos SI opval = SUBWORDDISI (tmp_result, 1);
25223aed4a8bSchristos SET_H_MAC_MACLO (opval);
25233aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "mac-maclo", 'x', opval);
25243aed4a8bSchristos }
25253aed4a8bSchristos {
25263aed4a8bSchristos BI opval = SUBCFDI (tmp_mac, tmp_result, 0);
25273aed4a8bSchristos SET_H_SYS_SR_CY (opval);
25283aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-cy", 'x', opval);
25293aed4a8bSchristos }
25303aed4a8bSchristos }
25313aed4a8bSchristos if (ANDIF (GET_H_SYS_SR_CY (), GET_H_SYS_SR_OVE ())) {
25323aed4a8bSchristos or1k32bf_exception (current_cpu, pc, EXCEPT_RANGE);
25333aed4a8bSchristos }
25343aed4a8bSchristos }
25353aed4a8bSchristos
25363aed4a8bSchristos return vpc;
25373aed4a8bSchristos #undef FLD
25383aed4a8bSchristos }
25393aed4a8bSchristos
25403aed4a8bSchristos /* l-cust1: l.cust1 */
25413aed4a8bSchristos
25423aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust1)25433aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
25443aed4a8bSchristos {
25453aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
25463aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
25473aed4a8bSchristos int UNUSED written = 0;
25483aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
25493aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
25503aed4a8bSchristos
25513aed4a8bSchristos ((void) 0); /*nop*/
25523aed4a8bSchristos
25533aed4a8bSchristos return vpc;
25543aed4a8bSchristos #undef FLD
25553aed4a8bSchristos }
25563aed4a8bSchristos
25573aed4a8bSchristos /* l-cust2: l.cust2 */
25583aed4a8bSchristos
25593aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust2)25603aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
25613aed4a8bSchristos {
25623aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
25633aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
25643aed4a8bSchristos int UNUSED written = 0;
25653aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
25663aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
25673aed4a8bSchristos
25683aed4a8bSchristos ((void) 0); /*nop*/
25693aed4a8bSchristos
25703aed4a8bSchristos return vpc;
25713aed4a8bSchristos #undef FLD
25723aed4a8bSchristos }
25733aed4a8bSchristos
25743aed4a8bSchristos /* l-cust3: l.cust3 */
25753aed4a8bSchristos
25763aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust3)25773aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
25783aed4a8bSchristos {
25793aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
25803aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
25813aed4a8bSchristos int UNUSED written = 0;
25823aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
25833aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
25843aed4a8bSchristos
25853aed4a8bSchristos ((void) 0); /*nop*/
25863aed4a8bSchristos
25873aed4a8bSchristos return vpc;
25883aed4a8bSchristos #undef FLD
25893aed4a8bSchristos }
25903aed4a8bSchristos
25913aed4a8bSchristos /* l-cust4: l.cust4 */
25923aed4a8bSchristos
25933aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust4)25943aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust4) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
25953aed4a8bSchristos {
25963aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
25973aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
25983aed4a8bSchristos int UNUSED written = 0;
25993aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
26003aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
26013aed4a8bSchristos
26023aed4a8bSchristos ((void) 0); /*nop*/
26033aed4a8bSchristos
26043aed4a8bSchristos return vpc;
26053aed4a8bSchristos #undef FLD
26063aed4a8bSchristos }
26073aed4a8bSchristos
26083aed4a8bSchristos /* l-cust5: l.cust5 */
26093aed4a8bSchristos
26103aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust5)26113aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust5) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
26123aed4a8bSchristos {
26133aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
26143aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
26153aed4a8bSchristos int UNUSED written = 0;
26163aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
26173aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
26183aed4a8bSchristos
26193aed4a8bSchristos ((void) 0); /*nop*/
26203aed4a8bSchristos
26213aed4a8bSchristos return vpc;
26223aed4a8bSchristos #undef FLD
26233aed4a8bSchristos }
26243aed4a8bSchristos
26253aed4a8bSchristos /* l-cust6: l.cust6 */
26263aed4a8bSchristos
26273aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust6)26283aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust6) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
26293aed4a8bSchristos {
26303aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
26313aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
26323aed4a8bSchristos int UNUSED written = 0;
26333aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
26343aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
26353aed4a8bSchristos
26363aed4a8bSchristos ((void) 0); /*nop*/
26373aed4a8bSchristos
26383aed4a8bSchristos return vpc;
26393aed4a8bSchristos #undef FLD
26403aed4a8bSchristos }
26413aed4a8bSchristos
26423aed4a8bSchristos /* l-cust7: l.cust7 */
26433aed4a8bSchristos
26443aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust7)26453aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust7) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
26463aed4a8bSchristos {
26473aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
26483aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
26493aed4a8bSchristos int UNUSED written = 0;
26503aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
26513aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
26523aed4a8bSchristos
26533aed4a8bSchristos ((void) 0); /*nop*/
26543aed4a8bSchristos
26553aed4a8bSchristos return vpc;
26563aed4a8bSchristos #undef FLD
26573aed4a8bSchristos }
26583aed4a8bSchristos
26593aed4a8bSchristos /* l-cust8: l.cust8 */
26603aed4a8bSchristos
26613aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,l_cust8)26623aed4a8bSchristos SEM_FN_NAME (or1k32bf,l_cust8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
26633aed4a8bSchristos {
26643aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
26653aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
26663aed4a8bSchristos int UNUSED written = 0;
26673aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
26683aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
26693aed4a8bSchristos
26703aed4a8bSchristos ((void) 0); /*nop*/
26713aed4a8bSchristos
26723aed4a8bSchristos return vpc;
26733aed4a8bSchristos #undef FLD
26743aed4a8bSchristos }
26753aed4a8bSchristos
26763aed4a8bSchristos /* lf-add-s: lf.add.s $rDSF,$rASF,$rBSF */
26773aed4a8bSchristos
26783aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_add_s)26793aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_add_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
26803aed4a8bSchristos {
26813aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
26823aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
26833aed4a8bSchristos int UNUSED written = 0;
26843aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
26853aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
26863aed4a8bSchristos
26873aed4a8bSchristos {
26883aed4a8bSchristos 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)));
26893aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
26903aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
26913aed4a8bSchristos }
26923aed4a8bSchristos
26933aed4a8bSchristos return vpc;
26943aed4a8bSchristos #undef FLD
26953aed4a8bSchristos }
26963aed4a8bSchristos
2697*56bb7041Schristos /* lf-add-d32: lf.add.d $rDD32F,$rAD32F,$rBD32F */
2698*56bb7041Schristos
2699*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_add_d32)2700*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_add_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2701*56bb7041Schristos {
2702*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2703*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2704*56bb7041Schristos int UNUSED written = 0;
2705*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2706*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2707*56bb7041Schristos
2708*56bb7041Schristos {
2709*56bb7041Schristos 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)));
2710*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
2711*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2712*56bb7041Schristos }
2713*56bb7041Schristos
2714*56bb7041Schristos return vpc;
2715*56bb7041Schristos #undef FLD
2716*56bb7041Schristos }
2717*56bb7041Schristos
27183aed4a8bSchristos /* lf-sub-s: lf.sub.s $rDSF,$rASF,$rBSF */
27193aed4a8bSchristos
27203aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sub_s)27213aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_sub_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
27223aed4a8bSchristos {
27233aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
27243aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
27253aed4a8bSchristos int UNUSED written = 0;
27263aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
27273aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
27283aed4a8bSchristos
27293aed4a8bSchristos {
27303aed4a8bSchristos 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)));
27313aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
27323aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
27333aed4a8bSchristos }
27343aed4a8bSchristos
27353aed4a8bSchristos return vpc;
27363aed4a8bSchristos #undef FLD
27373aed4a8bSchristos }
27383aed4a8bSchristos
2739*56bb7041Schristos /* lf-sub-d32: lf.sub.d $rDD32F,$rAD32F,$rBD32F */
2740*56bb7041Schristos
2741*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sub_d32)2742*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sub_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2743*56bb7041Schristos {
2744*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2745*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2746*56bb7041Schristos int UNUSED written = 0;
2747*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2748*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2749*56bb7041Schristos
2750*56bb7041Schristos {
2751*56bb7041Schristos 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)));
2752*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
2753*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2754*56bb7041Schristos }
2755*56bb7041Schristos
2756*56bb7041Schristos return vpc;
2757*56bb7041Schristos #undef FLD
2758*56bb7041Schristos }
2759*56bb7041Schristos
27603aed4a8bSchristos /* lf-mul-s: lf.mul.s $rDSF,$rASF,$rBSF */
27613aed4a8bSchristos
27623aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_mul_s)27633aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_mul_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
27643aed4a8bSchristos {
27653aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
27663aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
27673aed4a8bSchristos int UNUSED written = 0;
27683aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
27693aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
27703aed4a8bSchristos
27713aed4a8bSchristos {
27723aed4a8bSchristos 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)));
27733aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
27743aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
27753aed4a8bSchristos }
27763aed4a8bSchristos
27773aed4a8bSchristos return vpc;
27783aed4a8bSchristos #undef FLD
27793aed4a8bSchristos }
27803aed4a8bSchristos
2781*56bb7041Schristos /* lf-mul-d32: lf.mul.d $rDD32F,$rAD32F,$rBD32F */
2782*56bb7041Schristos
2783*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_mul_d32)2784*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_mul_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2785*56bb7041Schristos {
2786*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2787*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2788*56bb7041Schristos int UNUSED written = 0;
2789*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2790*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2791*56bb7041Schristos
2792*56bb7041Schristos {
2793*56bb7041Schristos 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)));
2794*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
2795*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2796*56bb7041Schristos }
2797*56bb7041Schristos
2798*56bb7041Schristos return vpc;
2799*56bb7041Schristos #undef FLD
2800*56bb7041Schristos }
2801*56bb7041Schristos
28023aed4a8bSchristos /* lf-div-s: lf.div.s $rDSF,$rASF,$rBSF */
28033aed4a8bSchristos
28043aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_div_s)28053aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_div_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
28063aed4a8bSchristos {
28073aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
28083aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
28093aed4a8bSchristos int UNUSED written = 0;
28103aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
28113aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
28123aed4a8bSchristos
28133aed4a8bSchristos {
28143aed4a8bSchristos 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)));
28153aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
28163aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
28173aed4a8bSchristos }
28183aed4a8bSchristos
28193aed4a8bSchristos return vpc;
28203aed4a8bSchristos #undef FLD
28213aed4a8bSchristos }
28223aed4a8bSchristos
2823*56bb7041Schristos /* lf-div-d32: lf.div.d $rDD32F,$rAD32F,$rBD32F */
2824*56bb7041Schristos
2825*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_div_d32)2826*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_div_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2827*56bb7041Schristos {
2828*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2829*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2830*56bb7041Schristos int UNUSED written = 0;
2831*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2832*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2833*56bb7041Schristos
2834*56bb7041Schristos {
2835*56bb7041Schristos 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)));
2836*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
2837*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2838*56bb7041Schristos }
2839*56bb7041Schristos
2840*56bb7041Schristos return vpc;
2841*56bb7041Schristos #undef FLD
2842*56bb7041Schristos }
2843*56bb7041Schristos
28443aed4a8bSchristos /* lf-rem-s: lf.rem.s $rDSF,$rASF,$rBSF */
28453aed4a8bSchristos
28463aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_rem_s)28473aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_rem_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
28483aed4a8bSchristos {
28493aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
28503aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
28513aed4a8bSchristos int UNUSED written = 0;
28523aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
28533aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
28543aed4a8bSchristos
28553aed4a8bSchristos {
28563aed4a8bSchristos 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)));
28573aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
28583aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
28593aed4a8bSchristos }
28603aed4a8bSchristos
28613aed4a8bSchristos return vpc;
28623aed4a8bSchristos #undef FLD
28633aed4a8bSchristos }
28643aed4a8bSchristos
2865*56bb7041Schristos /* lf-rem-d32: lf.rem.d $rDD32F,$rAD32F,$rBD32F */
2866*56bb7041Schristos
2867*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_rem_d32)2868*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_rem_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2869*56bb7041Schristos {
2870*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2871*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2872*56bb7041Schristos int UNUSED written = 0;
2873*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2874*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2875*56bb7041Schristos
2876*56bb7041Schristos {
2877*56bb7041Schristos 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)));
2878*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
2879*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2880*56bb7041Schristos }
2881*56bb7041Schristos
2882*56bb7041Schristos return vpc;
2883*56bb7041Schristos #undef FLD
2884*56bb7041Schristos }
2885*56bb7041Schristos
28863aed4a8bSchristos /* lf-itof-s: lf.itof.s $rDSF,$rA */
28873aed4a8bSchristos
28883aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_itof_s)28893aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_itof_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
28903aed4a8bSchristos {
28913aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
28923aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
28933aed4a8bSchristos int UNUSED written = 0;
28943aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
28953aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
28963aed4a8bSchristos
28973aed4a8bSchristos {
28983aed4a8bSchristos 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))));
28993aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
29003aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
29013aed4a8bSchristos }
29023aed4a8bSchristos
29033aed4a8bSchristos return vpc;
29043aed4a8bSchristos #undef FLD
29053aed4a8bSchristos }
29063aed4a8bSchristos
2907*56bb7041Schristos /* lf-itof-d32: lf.itof.d $rDD32F,$rADI */
2908*56bb7041Schristos
2909*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_itof_d32)2910*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_itof_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2911*56bb7041Schristos {
2912*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2913*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2914*56bb7041Schristos int UNUSED written = 0;
2915*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2916*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2917*56bb7041Schristos
2918*56bb7041Schristos {
2919*56bb7041Schristos 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)));
2920*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
2921*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
2922*56bb7041Schristos }
2923*56bb7041Schristos
2924*56bb7041Schristos return vpc;
2925*56bb7041Schristos #undef FLD
2926*56bb7041Schristos }
2927*56bb7041Schristos
29283aed4a8bSchristos /* lf-ftoi-s: lf.ftoi.s $rD,$rASF */
29293aed4a8bSchristos
29303aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_ftoi_s)29313aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_ftoi_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
29323aed4a8bSchristos {
29333aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_slli.f
29343aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
29353aed4a8bSchristos int UNUSED written = 0;
29363aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
29373aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
29383aed4a8bSchristos
29393aed4a8bSchristos {
29403aed4a8bSchristos 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))));
29413aed4a8bSchristos SET_H_GPR (FLD (f_r1), opval);
29423aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "gpr", 'x', opval);
29433aed4a8bSchristos }
29443aed4a8bSchristos
29453aed4a8bSchristos return vpc;
29463aed4a8bSchristos #undef FLD
29473aed4a8bSchristos }
29483aed4a8bSchristos
2949*56bb7041Schristos /* lf-ftoi-d32: lf.ftoi.d $rDDI,$rAD32F */
29503aed4a8bSchristos
29513aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_ftoi_d32)2952*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_ftoi_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2953*56bb7041Schristos {
2954*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2955*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2956*56bb7041Schristos int UNUSED written = 0;
2957*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
2958*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2959*56bb7041Schristos
2960*56bb7041Schristos {
2961*56bb7041Schristos 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)));
2962*56bb7041Schristos SET_H_I64R (FLD (f_rdd32), opval);
2963*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "i64r", 'D', opval);
2964*56bb7041Schristos }
2965*56bb7041Schristos
2966*56bb7041Schristos return vpc;
2967*56bb7041Schristos #undef FLD
2968*56bb7041Schristos }
2969*56bb7041Schristos
2970*56bb7041Schristos /* lf-sfeq-s: lf.sfeq.s $rASF,$rBSF */
2971*56bb7041Schristos
2972*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfeq_s)2973*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfeq_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
29743aed4a8bSchristos {
29753aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
29763aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
29773aed4a8bSchristos int UNUSED written = 0;
29783aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
29793aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
29803aed4a8bSchristos
29813aed4a8bSchristos {
29823aed4a8bSchristos 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)));
29833aed4a8bSchristos SET_H_SYS_SR_F (opval);
29843aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
29853aed4a8bSchristos }
29863aed4a8bSchristos
29873aed4a8bSchristos return vpc;
29883aed4a8bSchristos #undef FLD
29893aed4a8bSchristos }
29903aed4a8bSchristos
2991*56bb7041Schristos /* lf-sfeq-d32: lf.sfeq.d $rAD32F,$rBD32F */
29923aed4a8bSchristos
29933aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfeq_d32)2994*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfeq_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2995*56bb7041Schristos {
2996*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
2997*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2998*56bb7041Schristos int UNUSED written = 0;
2999*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3000*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3001*56bb7041Schristos
3002*56bb7041Schristos {
3003*56bb7041Schristos 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)));
3004*56bb7041Schristos SET_H_SYS_SR_F (opval);
3005*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3006*56bb7041Schristos }
3007*56bb7041Schristos
3008*56bb7041Schristos return vpc;
3009*56bb7041Schristos #undef FLD
3010*56bb7041Schristos }
3011*56bb7041Schristos
3012*56bb7041Schristos /* lf-sfne-s: lf.sfne.s $rASF,$rBSF */
3013*56bb7041Schristos
3014*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfne_s)3015*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfne_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
30163aed4a8bSchristos {
30173aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
30183aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
30193aed4a8bSchristos int UNUSED written = 0;
30203aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
30213aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
30223aed4a8bSchristos
30233aed4a8bSchristos {
30243aed4a8bSchristos 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)));
30253aed4a8bSchristos SET_H_SYS_SR_F (opval);
30263aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
30273aed4a8bSchristos }
30283aed4a8bSchristos
30293aed4a8bSchristos return vpc;
30303aed4a8bSchristos #undef FLD
30313aed4a8bSchristos }
30323aed4a8bSchristos
3033*56bb7041Schristos /* lf-sfne-d32: lf.sfne.d $rAD32F,$rBD32F */
30343aed4a8bSchristos
30353aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfne_d32)3036*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfne_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3037*56bb7041Schristos {
3038*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3039*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3040*56bb7041Schristos int UNUSED written = 0;
3041*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3042*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3043*56bb7041Schristos
3044*56bb7041Schristos {
3045*56bb7041Schristos 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)));
3046*56bb7041Schristos SET_H_SYS_SR_F (opval);
3047*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3048*56bb7041Schristos }
3049*56bb7041Schristos
3050*56bb7041Schristos return vpc;
3051*56bb7041Schristos #undef FLD
3052*56bb7041Schristos }
3053*56bb7041Schristos
3054*56bb7041Schristos /* lf-sfge-s: lf.sfge.s $rASF,$rBSF */
3055*56bb7041Schristos
3056*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfge_s)3057*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfge_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
30583aed4a8bSchristos {
30593aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
30603aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
30613aed4a8bSchristos int UNUSED written = 0;
30623aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
30633aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
30643aed4a8bSchristos
30653aed4a8bSchristos {
30663aed4a8bSchristos 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)));
30673aed4a8bSchristos SET_H_SYS_SR_F (opval);
30683aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
30693aed4a8bSchristos }
30703aed4a8bSchristos
30713aed4a8bSchristos return vpc;
30723aed4a8bSchristos #undef FLD
30733aed4a8bSchristos }
30743aed4a8bSchristos
3075*56bb7041Schristos /* lf-sfge-d32: lf.sfge.d $rAD32F,$rBD32F */
30763aed4a8bSchristos
30773aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfge_d32)3078*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfge_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3079*56bb7041Schristos {
3080*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3081*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3082*56bb7041Schristos int UNUSED written = 0;
3083*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3084*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3085*56bb7041Schristos
3086*56bb7041Schristos {
3087*56bb7041Schristos 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)));
3088*56bb7041Schristos SET_H_SYS_SR_F (opval);
3089*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3090*56bb7041Schristos }
3091*56bb7041Schristos
3092*56bb7041Schristos return vpc;
3093*56bb7041Schristos #undef FLD
3094*56bb7041Schristos }
3095*56bb7041Schristos
3096*56bb7041Schristos /* lf-sfgt-s: lf.sfgt.s $rASF,$rBSF */
3097*56bb7041Schristos
3098*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfgt_s)3099*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfgt_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
31003aed4a8bSchristos {
31013aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
31023aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
31033aed4a8bSchristos int UNUSED written = 0;
31043aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
31053aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
31063aed4a8bSchristos
31073aed4a8bSchristos {
31083aed4a8bSchristos 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)));
31093aed4a8bSchristos SET_H_SYS_SR_F (opval);
31103aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
31113aed4a8bSchristos }
31123aed4a8bSchristos
31133aed4a8bSchristos return vpc;
31143aed4a8bSchristos #undef FLD
31153aed4a8bSchristos }
31163aed4a8bSchristos
3117*56bb7041Schristos /* lf-sfgt-d32: lf.sfgt.d $rAD32F,$rBD32F */
31183aed4a8bSchristos
31193aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfgt_d32)3120*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfgt_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3121*56bb7041Schristos {
3122*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3123*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3124*56bb7041Schristos int UNUSED written = 0;
3125*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3126*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3127*56bb7041Schristos
3128*56bb7041Schristos {
3129*56bb7041Schristos 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)));
3130*56bb7041Schristos SET_H_SYS_SR_F (opval);
3131*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3132*56bb7041Schristos }
3133*56bb7041Schristos
3134*56bb7041Schristos return vpc;
3135*56bb7041Schristos #undef FLD
3136*56bb7041Schristos }
3137*56bb7041Schristos
3138*56bb7041Schristos /* lf-sflt-s: lf.sflt.s $rASF,$rBSF */
3139*56bb7041Schristos
3140*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sflt_s)3141*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sflt_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
31423aed4a8bSchristos {
31433aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
31443aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
31453aed4a8bSchristos int UNUSED written = 0;
31463aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
31473aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
31483aed4a8bSchristos
31493aed4a8bSchristos {
31503aed4a8bSchristos 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)));
31513aed4a8bSchristos SET_H_SYS_SR_F (opval);
31523aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
31533aed4a8bSchristos }
31543aed4a8bSchristos
31553aed4a8bSchristos return vpc;
31563aed4a8bSchristos #undef FLD
31573aed4a8bSchristos }
31583aed4a8bSchristos
3159*56bb7041Schristos /* lf-sflt-d32: lf.sflt.d $rAD32F,$rBD32F */
31603aed4a8bSchristos
31613aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sflt_d32)3162*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sflt_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3163*56bb7041Schristos {
3164*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3165*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3166*56bb7041Schristos int UNUSED written = 0;
3167*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3168*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3169*56bb7041Schristos
3170*56bb7041Schristos {
3171*56bb7041Schristos 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)));
3172*56bb7041Schristos SET_H_SYS_SR_F (opval);
3173*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3174*56bb7041Schristos }
3175*56bb7041Schristos
3176*56bb7041Schristos return vpc;
3177*56bb7041Schristos #undef FLD
3178*56bb7041Schristos }
3179*56bb7041Schristos
3180*56bb7041Schristos /* lf-sfle-s: lf.sfle.s $rASF,$rBSF */
3181*56bb7041Schristos
3182*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfle_s)3183*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfle_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
31843aed4a8bSchristos {
31853aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
31863aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
31873aed4a8bSchristos int UNUSED written = 0;
31883aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
31893aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
31903aed4a8bSchristos
31913aed4a8bSchristos {
31923aed4a8bSchristos 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)));
31933aed4a8bSchristos SET_H_SYS_SR_F (opval);
31943aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
31953aed4a8bSchristos }
31963aed4a8bSchristos
31973aed4a8bSchristos return vpc;
31983aed4a8bSchristos #undef FLD
31993aed4a8bSchristos }
32003aed4a8bSchristos
3201*56bb7041Schristos /* lf-sfle-d32: lf.sfle.d $rAD32F,$rBD32F */
3202*56bb7041Schristos
3203*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfle_d32)3204*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfle_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3205*56bb7041Schristos {
3206*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3207*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3208*56bb7041Schristos int UNUSED written = 0;
3209*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3210*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3211*56bb7041Schristos
3212*56bb7041Schristos {
3213*56bb7041Schristos 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)));
3214*56bb7041Schristos SET_H_SYS_SR_F (opval);
3215*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3216*56bb7041Schristos }
3217*56bb7041Schristos
3218*56bb7041Schristos return vpc;
3219*56bb7041Schristos #undef FLD
3220*56bb7041Schristos }
3221*56bb7041Schristos
3222*56bb7041Schristos /* lf-sfueq-s: lf.sfueq.s $rASF,$rBSF */
3223*56bb7041Schristos
3224*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfueq_s)3225*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfueq_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3226*56bb7041Schristos {
3227*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3228*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3229*56bb7041Schristos int UNUSED written = 0;
3230*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3231*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3232*56bb7041Schristos
3233*56bb7041Schristos {
3234*56bb7041Schristos 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))));
3235*56bb7041Schristos SET_H_SYS_SR_F (opval);
3236*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3237*56bb7041Schristos }
3238*56bb7041Schristos
3239*56bb7041Schristos return vpc;
3240*56bb7041Schristos #undef FLD
3241*56bb7041Schristos }
3242*56bb7041Schristos
3243*56bb7041Schristos /* lf-sfueq-d32: lf.sfueq.d $rAD32F,$rBD32F */
3244*56bb7041Schristos
3245*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfueq_d32)3246*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfueq_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3247*56bb7041Schristos {
3248*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3249*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3250*56bb7041Schristos int UNUSED written = 0;
3251*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3252*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3253*56bb7041Schristos
3254*56bb7041Schristos {
3255*56bb7041Schristos 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))));
3256*56bb7041Schristos SET_H_SYS_SR_F (opval);
3257*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3258*56bb7041Schristos }
3259*56bb7041Schristos
3260*56bb7041Schristos return vpc;
3261*56bb7041Schristos #undef FLD
3262*56bb7041Schristos }
3263*56bb7041Schristos
3264*56bb7041Schristos /* lf-sfune-s: lf.sfune.s $rASF,$rBSF */
3265*56bb7041Schristos
3266*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfune_s)3267*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfune_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3268*56bb7041Schristos {
3269*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3270*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3271*56bb7041Schristos int UNUSED written = 0;
3272*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3273*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3274*56bb7041Schristos
3275*56bb7041Schristos {
3276*56bb7041Schristos 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))));
3277*56bb7041Schristos SET_H_SYS_SR_F (opval);
3278*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3279*56bb7041Schristos }
3280*56bb7041Schristos
3281*56bb7041Schristos return vpc;
3282*56bb7041Schristos #undef FLD
3283*56bb7041Schristos }
3284*56bb7041Schristos
3285*56bb7041Schristos /* lf-sfune-d32: lf.sfune.d $rAD32F,$rBD32F */
3286*56bb7041Schristos
3287*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfune_d32)3288*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfune_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3289*56bb7041Schristos {
3290*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3291*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3292*56bb7041Schristos int UNUSED written = 0;
3293*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3294*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3295*56bb7041Schristos
3296*56bb7041Schristos {
3297*56bb7041Schristos 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))));
3298*56bb7041Schristos SET_H_SYS_SR_F (opval);
3299*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3300*56bb7041Schristos }
3301*56bb7041Schristos
3302*56bb7041Schristos return vpc;
3303*56bb7041Schristos #undef FLD
3304*56bb7041Schristos }
3305*56bb7041Schristos
3306*56bb7041Schristos /* lf-sfugt-s: lf.sfugt.s $rASF,$rBSF */
3307*56bb7041Schristos
3308*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfugt_s)3309*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfugt_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3310*56bb7041Schristos {
3311*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3312*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3313*56bb7041Schristos int UNUSED written = 0;
3314*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3315*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3316*56bb7041Schristos
3317*56bb7041Schristos {
3318*56bb7041Schristos 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))));
3319*56bb7041Schristos SET_H_SYS_SR_F (opval);
3320*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3321*56bb7041Schristos }
3322*56bb7041Schristos
3323*56bb7041Schristos return vpc;
3324*56bb7041Schristos #undef FLD
3325*56bb7041Schristos }
3326*56bb7041Schristos
3327*56bb7041Schristos /* lf-sfugt-d32: lf.sfugt.d $rAD32F,$rBD32F */
3328*56bb7041Schristos
3329*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfugt_d32)3330*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfugt_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3331*56bb7041Schristos {
3332*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3333*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3334*56bb7041Schristos int UNUSED written = 0;
3335*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3336*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3337*56bb7041Schristos
3338*56bb7041Schristos {
3339*56bb7041Schristos 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))));
3340*56bb7041Schristos SET_H_SYS_SR_F (opval);
3341*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3342*56bb7041Schristos }
3343*56bb7041Schristos
3344*56bb7041Schristos return vpc;
3345*56bb7041Schristos #undef FLD
3346*56bb7041Schristos }
3347*56bb7041Schristos
3348*56bb7041Schristos /* lf-sfuge-s: lf.sfuge.s $rASF,$rBSF */
3349*56bb7041Schristos
3350*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfuge_s)3351*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfuge_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3352*56bb7041Schristos {
3353*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3354*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3355*56bb7041Schristos int UNUSED written = 0;
3356*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3357*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3358*56bb7041Schristos
3359*56bb7041Schristos {
3360*56bb7041Schristos 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))));
3361*56bb7041Schristos SET_H_SYS_SR_F (opval);
3362*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3363*56bb7041Schristos }
3364*56bb7041Schristos
3365*56bb7041Schristos return vpc;
3366*56bb7041Schristos #undef FLD
3367*56bb7041Schristos }
3368*56bb7041Schristos
3369*56bb7041Schristos /* lf-sfuge-d32: lf.sfuge.d $rAD32F,$rBD32F */
3370*56bb7041Schristos
3371*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfuge_d32)3372*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfuge_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3373*56bb7041Schristos {
3374*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3375*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3376*56bb7041Schristos int UNUSED written = 0;
3377*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3378*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3379*56bb7041Schristos
3380*56bb7041Schristos {
3381*56bb7041Schristos 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))));
3382*56bb7041Schristos SET_H_SYS_SR_F (opval);
3383*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3384*56bb7041Schristos }
3385*56bb7041Schristos
3386*56bb7041Schristos return vpc;
3387*56bb7041Schristos #undef FLD
3388*56bb7041Schristos }
3389*56bb7041Schristos
3390*56bb7041Schristos /* lf-sfult-s: lf.sfult.s $rASF,$rBSF */
3391*56bb7041Schristos
3392*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfult_s)3393*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfult_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3394*56bb7041Schristos {
3395*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3396*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3397*56bb7041Schristos int UNUSED written = 0;
3398*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3399*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3400*56bb7041Schristos
3401*56bb7041Schristos {
3402*56bb7041Schristos 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))));
3403*56bb7041Schristos SET_H_SYS_SR_F (opval);
3404*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3405*56bb7041Schristos }
3406*56bb7041Schristos
3407*56bb7041Schristos return vpc;
3408*56bb7041Schristos #undef FLD
3409*56bb7041Schristos }
3410*56bb7041Schristos
3411*56bb7041Schristos /* lf-sfult-d32: lf.sfult.d $rAD32F,$rBD32F */
3412*56bb7041Schristos
3413*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfult_d32)3414*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfult_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3415*56bb7041Schristos {
3416*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3417*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3418*56bb7041Schristos int UNUSED written = 0;
3419*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3420*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3421*56bb7041Schristos
3422*56bb7041Schristos {
3423*56bb7041Schristos 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))));
3424*56bb7041Schristos SET_H_SYS_SR_F (opval);
3425*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3426*56bb7041Schristos }
3427*56bb7041Schristos
3428*56bb7041Schristos return vpc;
3429*56bb7041Schristos #undef FLD
3430*56bb7041Schristos }
3431*56bb7041Schristos
3432*56bb7041Schristos /* lf-sfule-s: lf.sfule.s $rASF,$rBSF */
3433*56bb7041Schristos
3434*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfule_s)3435*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfule_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3436*56bb7041Schristos {
3437*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3438*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3439*56bb7041Schristos int UNUSED written = 0;
3440*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3441*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3442*56bb7041Schristos
3443*56bb7041Schristos {
3444*56bb7041Schristos 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))));
3445*56bb7041Schristos SET_H_SYS_SR_F (opval);
3446*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3447*56bb7041Schristos }
3448*56bb7041Schristos
3449*56bb7041Schristos return vpc;
3450*56bb7041Schristos #undef FLD
3451*56bb7041Schristos }
3452*56bb7041Schristos
3453*56bb7041Schristos /* lf-sfule-d32: lf.sfule.d $rAD32F,$rBD32F */
3454*56bb7041Schristos
3455*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfule_d32)3456*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfule_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3457*56bb7041Schristos {
3458*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3459*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3460*56bb7041Schristos int UNUSED written = 0;
3461*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3462*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3463*56bb7041Schristos
3464*56bb7041Schristos {
3465*56bb7041Schristos 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))));
3466*56bb7041Schristos SET_H_SYS_SR_F (opval);
3467*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3468*56bb7041Schristos }
3469*56bb7041Schristos
3470*56bb7041Schristos return vpc;
3471*56bb7041Schristos #undef FLD
3472*56bb7041Schristos }
3473*56bb7041Schristos
3474*56bb7041Schristos /* lf-sfun-s: lf.sfun.s $rASF,$rBSF */
3475*56bb7041Schristos
3476*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfun_s)3477*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfun_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3478*56bb7041Schristos {
3479*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_l_sll.f
3480*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3481*56bb7041Schristos int UNUSED written = 0;
3482*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3483*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3484*56bb7041Schristos
3485*56bb7041Schristos {
3486*56bb7041Schristos 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)));
3487*56bb7041Schristos SET_H_SYS_SR_F (opval);
3488*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3489*56bb7041Schristos }
3490*56bb7041Schristos
3491*56bb7041Schristos return vpc;
3492*56bb7041Schristos #undef FLD
3493*56bb7041Schristos }
3494*56bb7041Schristos
3495*56bb7041Schristos /* lf-sfun-d32: lf.sfun.d $rAD32F,$rBD32F */
3496*56bb7041Schristos
3497*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_sfun_d32)3498*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_sfun_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3499*56bb7041Schristos {
3500*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3501*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3502*56bb7041Schristos int UNUSED written = 0;
3503*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3504*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3505*56bb7041Schristos
3506*56bb7041Schristos {
3507*56bb7041Schristos 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)));
3508*56bb7041Schristos SET_H_SYS_SR_F (opval);
3509*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "sys-sr-f", 'x', opval);
3510*56bb7041Schristos }
3511*56bb7041Schristos
3512*56bb7041Schristos return vpc;
3513*56bb7041Schristos #undef FLD
3514*56bb7041Schristos }
3515*56bb7041Schristos
35163aed4a8bSchristos /* lf-madd-s: lf.madd.s $rDSF,$rASF,$rBSF */
35173aed4a8bSchristos
35183aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_madd_s)35193aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_madd_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
35203aed4a8bSchristos {
35213aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_l_sll.f
35223aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
35233aed4a8bSchristos int UNUSED written = 0;
35243aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
35253aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
35263aed4a8bSchristos
35273aed4a8bSchristos {
35283aed4a8bSchristos 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)));
35293aed4a8bSchristos SET_H_FSR (FLD (f_r1), opval);
35303aed4a8bSchristos CGEN_TRACE_RESULT (current_cpu, abuf, "fsr", 'f', opval);
35313aed4a8bSchristos }
35323aed4a8bSchristos
35333aed4a8bSchristos return vpc;
35343aed4a8bSchristos #undef FLD
35353aed4a8bSchristos }
35363aed4a8bSchristos
3537*56bb7041Schristos /* lf-madd-d32: lf.madd.d $rDD32F,$rAD32F,$rBD32F */
3538*56bb7041Schristos
3539*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_madd_d32)3540*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_madd_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3541*56bb7041Schristos {
3542*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_lf_add_d32.f
3543*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3544*56bb7041Schristos int UNUSED written = 0;
3545*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3546*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3547*56bb7041Schristos
3548*56bb7041Schristos {
3549*56bb7041Schristos 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)));
3550*56bb7041Schristos SET_H_FD32R (FLD (f_rdd32), opval);
3551*56bb7041Schristos CGEN_TRACE_RESULT (current_cpu, abuf, "fd32r", 'f', opval);
3552*56bb7041Schristos }
3553*56bb7041Schristos
3554*56bb7041Schristos return vpc;
3555*56bb7041Schristos #undef FLD
3556*56bb7041Schristos }
3557*56bb7041Schristos
35583aed4a8bSchristos /* lf-cust1-s: lf.cust1.s $rASF,$rBSF */
35593aed4a8bSchristos
35603aed4a8bSchristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_cust1_s)35613aed4a8bSchristos SEM_FN_NAME (or1k32bf,lf_cust1_s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
35623aed4a8bSchristos {
35633aed4a8bSchristos #define FLD(f) abuf->fields.sfmt_empty.f
35643aed4a8bSchristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
35653aed4a8bSchristos int UNUSED written = 0;
35663aed4a8bSchristos IADDR UNUSED pc = abuf->addr;
35673aed4a8bSchristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
35683aed4a8bSchristos
35693aed4a8bSchristos ((void) 0); /*nop*/
35703aed4a8bSchristos
35713aed4a8bSchristos return vpc;
35723aed4a8bSchristos #undef FLD
35733aed4a8bSchristos }
35743aed4a8bSchristos
3575*56bb7041Schristos /* lf-cust1-d32: lf.cust1.d */
3576*56bb7041Schristos
3577*56bb7041Schristos static SEM_PC
SEM_FN_NAME(or1k32bf,lf_cust1_d32)3578*56bb7041Schristos SEM_FN_NAME (or1k32bf,lf_cust1_d32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3579*56bb7041Schristos {
3580*56bb7041Schristos #define FLD(f) abuf->fields.sfmt_empty.f
3581*56bb7041Schristos ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3582*56bb7041Schristos int UNUSED written = 0;
3583*56bb7041Schristos IADDR UNUSED pc = abuf->addr;
3584*56bb7041Schristos SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3585*56bb7041Schristos
3586*56bb7041Schristos ((void) 0); /*nop*/
3587*56bb7041Schristos
3588*56bb7041Schristos return vpc;
3589*56bb7041Schristos #undef FLD
3590*56bb7041Schristos }
3591*56bb7041Schristos
35923aed4a8bSchristos /* Table of all semantic fns. */
35933aed4a8bSchristos
35943aed4a8bSchristos static const struct sem_fn_desc sem_fns[] = {
35953aed4a8bSchristos { OR1K32BF_INSN_X_INVALID, SEM_FN_NAME (or1k32bf,x_invalid) },
35963aed4a8bSchristos { OR1K32BF_INSN_X_AFTER, SEM_FN_NAME (or1k32bf,x_after) },
35973aed4a8bSchristos { OR1K32BF_INSN_X_BEFORE, SEM_FN_NAME (or1k32bf,x_before) },
35983aed4a8bSchristos { OR1K32BF_INSN_X_CTI_CHAIN, SEM_FN_NAME (or1k32bf,x_cti_chain) },
35993aed4a8bSchristos { OR1K32BF_INSN_X_CHAIN, SEM_FN_NAME (or1k32bf,x_chain) },
36003aed4a8bSchristos { OR1K32BF_INSN_X_BEGIN, SEM_FN_NAME (or1k32bf,x_begin) },
36013aed4a8bSchristos { OR1K32BF_INSN_L_J, SEM_FN_NAME (or1k32bf,l_j) },
36023aed4a8bSchristos { OR1K32BF_INSN_L_ADRP, SEM_FN_NAME (or1k32bf,l_adrp) },
36033aed4a8bSchristos { OR1K32BF_INSN_L_JAL, SEM_FN_NAME (or1k32bf,l_jal) },
36043aed4a8bSchristos { OR1K32BF_INSN_L_JR, SEM_FN_NAME (or1k32bf,l_jr) },
36053aed4a8bSchristos { OR1K32BF_INSN_L_JALR, SEM_FN_NAME (or1k32bf,l_jalr) },
36063aed4a8bSchristos { OR1K32BF_INSN_L_BNF, SEM_FN_NAME (or1k32bf,l_bnf) },
36073aed4a8bSchristos { OR1K32BF_INSN_L_BF, SEM_FN_NAME (or1k32bf,l_bf) },
36083aed4a8bSchristos { OR1K32BF_INSN_L_TRAP, SEM_FN_NAME (or1k32bf,l_trap) },
36093aed4a8bSchristos { OR1K32BF_INSN_L_SYS, SEM_FN_NAME (or1k32bf,l_sys) },
36103aed4a8bSchristos { OR1K32BF_INSN_L_MSYNC, SEM_FN_NAME (or1k32bf,l_msync) },
36113aed4a8bSchristos { OR1K32BF_INSN_L_PSYNC, SEM_FN_NAME (or1k32bf,l_psync) },
36123aed4a8bSchristos { OR1K32BF_INSN_L_CSYNC, SEM_FN_NAME (or1k32bf,l_csync) },
36133aed4a8bSchristos { OR1K32BF_INSN_L_RFE, SEM_FN_NAME (or1k32bf,l_rfe) },
36143aed4a8bSchristos { OR1K32BF_INSN_L_NOP_IMM, SEM_FN_NAME (or1k32bf,l_nop_imm) },
36153aed4a8bSchristos { OR1K32BF_INSN_L_MOVHI, SEM_FN_NAME (or1k32bf,l_movhi) },
36163aed4a8bSchristos { OR1K32BF_INSN_L_MACRC, SEM_FN_NAME (or1k32bf,l_macrc) },
36173aed4a8bSchristos { OR1K32BF_INSN_L_MFSPR, SEM_FN_NAME (or1k32bf,l_mfspr) },
36183aed4a8bSchristos { OR1K32BF_INSN_L_MTSPR, SEM_FN_NAME (or1k32bf,l_mtspr) },
36193aed4a8bSchristos { OR1K32BF_INSN_L_LWZ, SEM_FN_NAME (or1k32bf,l_lwz) },
36203aed4a8bSchristos { OR1K32BF_INSN_L_LWS, SEM_FN_NAME (or1k32bf,l_lws) },
36213aed4a8bSchristos { OR1K32BF_INSN_L_LWA, SEM_FN_NAME (or1k32bf,l_lwa) },
36223aed4a8bSchristos { OR1K32BF_INSN_L_LBZ, SEM_FN_NAME (or1k32bf,l_lbz) },
36233aed4a8bSchristos { OR1K32BF_INSN_L_LBS, SEM_FN_NAME (or1k32bf,l_lbs) },
36243aed4a8bSchristos { OR1K32BF_INSN_L_LHZ, SEM_FN_NAME (or1k32bf,l_lhz) },
36253aed4a8bSchristos { OR1K32BF_INSN_L_LHS, SEM_FN_NAME (or1k32bf,l_lhs) },
36263aed4a8bSchristos { OR1K32BF_INSN_L_SW, SEM_FN_NAME (or1k32bf,l_sw) },
36273aed4a8bSchristos { OR1K32BF_INSN_L_SB, SEM_FN_NAME (or1k32bf,l_sb) },
36283aed4a8bSchristos { OR1K32BF_INSN_L_SH, SEM_FN_NAME (or1k32bf,l_sh) },
36293aed4a8bSchristos { OR1K32BF_INSN_L_SWA, SEM_FN_NAME (or1k32bf,l_swa) },
36303aed4a8bSchristos { OR1K32BF_INSN_L_SLL, SEM_FN_NAME (or1k32bf,l_sll) },
36313aed4a8bSchristos { OR1K32BF_INSN_L_SLLI, SEM_FN_NAME (or1k32bf,l_slli) },
36323aed4a8bSchristos { OR1K32BF_INSN_L_SRL, SEM_FN_NAME (or1k32bf,l_srl) },
36333aed4a8bSchristos { OR1K32BF_INSN_L_SRLI, SEM_FN_NAME (or1k32bf,l_srli) },
36343aed4a8bSchristos { OR1K32BF_INSN_L_SRA, SEM_FN_NAME (or1k32bf,l_sra) },
36353aed4a8bSchristos { OR1K32BF_INSN_L_SRAI, SEM_FN_NAME (or1k32bf,l_srai) },
36363aed4a8bSchristos { OR1K32BF_INSN_L_ROR, SEM_FN_NAME (or1k32bf,l_ror) },
36373aed4a8bSchristos { OR1K32BF_INSN_L_RORI, SEM_FN_NAME (or1k32bf,l_rori) },
36383aed4a8bSchristos { OR1K32BF_INSN_L_AND, SEM_FN_NAME (or1k32bf,l_and) },
36393aed4a8bSchristos { OR1K32BF_INSN_L_OR, SEM_FN_NAME (or1k32bf,l_or) },
36403aed4a8bSchristos { OR1K32BF_INSN_L_XOR, SEM_FN_NAME (or1k32bf,l_xor) },
36413aed4a8bSchristos { OR1K32BF_INSN_L_ADD, SEM_FN_NAME (or1k32bf,l_add) },
36423aed4a8bSchristos { OR1K32BF_INSN_L_SUB, SEM_FN_NAME (or1k32bf,l_sub) },
36433aed4a8bSchristos { OR1K32BF_INSN_L_ADDC, SEM_FN_NAME (or1k32bf,l_addc) },
36443aed4a8bSchristos { OR1K32BF_INSN_L_MUL, SEM_FN_NAME (or1k32bf,l_mul) },
36453aed4a8bSchristos { OR1K32BF_INSN_L_MULD, SEM_FN_NAME (or1k32bf,l_muld) },
36463aed4a8bSchristos { OR1K32BF_INSN_L_MULU, SEM_FN_NAME (or1k32bf,l_mulu) },
36473aed4a8bSchristos { OR1K32BF_INSN_L_MULDU, SEM_FN_NAME (or1k32bf,l_muldu) },
36483aed4a8bSchristos { OR1K32BF_INSN_L_DIV, SEM_FN_NAME (or1k32bf,l_div) },
36493aed4a8bSchristos { OR1K32BF_INSN_L_DIVU, SEM_FN_NAME (or1k32bf,l_divu) },
36503aed4a8bSchristos { OR1K32BF_INSN_L_FF1, SEM_FN_NAME (or1k32bf,l_ff1) },
36513aed4a8bSchristos { OR1K32BF_INSN_L_FL1, SEM_FN_NAME (or1k32bf,l_fl1) },
36523aed4a8bSchristos { OR1K32BF_INSN_L_ANDI, SEM_FN_NAME (or1k32bf,l_andi) },
36533aed4a8bSchristos { OR1K32BF_INSN_L_ORI, SEM_FN_NAME (or1k32bf,l_ori) },
36543aed4a8bSchristos { OR1K32BF_INSN_L_XORI, SEM_FN_NAME (or1k32bf,l_xori) },
36553aed4a8bSchristos { OR1K32BF_INSN_L_ADDI, SEM_FN_NAME (or1k32bf,l_addi) },
36563aed4a8bSchristos { OR1K32BF_INSN_L_ADDIC, SEM_FN_NAME (or1k32bf,l_addic) },
36573aed4a8bSchristos { OR1K32BF_INSN_L_MULI, SEM_FN_NAME (or1k32bf,l_muli) },
36583aed4a8bSchristos { OR1K32BF_INSN_L_EXTHS, SEM_FN_NAME (or1k32bf,l_exths) },
36593aed4a8bSchristos { OR1K32BF_INSN_L_EXTBS, SEM_FN_NAME (or1k32bf,l_extbs) },
36603aed4a8bSchristos { OR1K32BF_INSN_L_EXTHZ, SEM_FN_NAME (or1k32bf,l_exthz) },
36613aed4a8bSchristos { OR1K32BF_INSN_L_EXTBZ, SEM_FN_NAME (or1k32bf,l_extbz) },
36623aed4a8bSchristos { OR1K32BF_INSN_L_EXTWS, SEM_FN_NAME (or1k32bf,l_extws) },
36633aed4a8bSchristos { OR1K32BF_INSN_L_EXTWZ, SEM_FN_NAME (or1k32bf,l_extwz) },
36643aed4a8bSchristos { OR1K32BF_INSN_L_CMOV, SEM_FN_NAME (or1k32bf,l_cmov) },
36653aed4a8bSchristos { OR1K32BF_INSN_L_SFGTS, SEM_FN_NAME (or1k32bf,l_sfgts) },
36663aed4a8bSchristos { OR1K32BF_INSN_L_SFGTSI, SEM_FN_NAME (or1k32bf,l_sfgtsi) },
36673aed4a8bSchristos { OR1K32BF_INSN_L_SFGTU, SEM_FN_NAME (or1k32bf,l_sfgtu) },
36683aed4a8bSchristos { OR1K32BF_INSN_L_SFGTUI, SEM_FN_NAME (or1k32bf,l_sfgtui) },
36693aed4a8bSchristos { OR1K32BF_INSN_L_SFGES, SEM_FN_NAME (or1k32bf,l_sfges) },
36703aed4a8bSchristos { OR1K32BF_INSN_L_SFGESI, SEM_FN_NAME (or1k32bf,l_sfgesi) },
36713aed4a8bSchristos { OR1K32BF_INSN_L_SFGEU, SEM_FN_NAME (or1k32bf,l_sfgeu) },
36723aed4a8bSchristos { OR1K32BF_INSN_L_SFGEUI, SEM_FN_NAME (or1k32bf,l_sfgeui) },
36733aed4a8bSchristos { OR1K32BF_INSN_L_SFLTS, SEM_FN_NAME (or1k32bf,l_sflts) },
36743aed4a8bSchristos { OR1K32BF_INSN_L_SFLTSI, SEM_FN_NAME (or1k32bf,l_sfltsi) },
36753aed4a8bSchristos { OR1K32BF_INSN_L_SFLTU, SEM_FN_NAME (or1k32bf,l_sfltu) },
36763aed4a8bSchristos { OR1K32BF_INSN_L_SFLTUI, SEM_FN_NAME (or1k32bf,l_sfltui) },
36773aed4a8bSchristos { OR1K32BF_INSN_L_SFLES, SEM_FN_NAME (or1k32bf,l_sfles) },
36783aed4a8bSchristos { OR1K32BF_INSN_L_SFLESI, SEM_FN_NAME (or1k32bf,l_sflesi) },
36793aed4a8bSchristos { OR1K32BF_INSN_L_SFLEU, SEM_FN_NAME (or1k32bf,l_sfleu) },
36803aed4a8bSchristos { OR1K32BF_INSN_L_SFLEUI, SEM_FN_NAME (or1k32bf,l_sfleui) },
36813aed4a8bSchristos { OR1K32BF_INSN_L_SFEQ, SEM_FN_NAME (or1k32bf,l_sfeq) },
36823aed4a8bSchristos { OR1K32BF_INSN_L_SFEQI, SEM_FN_NAME (or1k32bf,l_sfeqi) },
36833aed4a8bSchristos { OR1K32BF_INSN_L_SFNE, SEM_FN_NAME (or1k32bf,l_sfne) },
36843aed4a8bSchristos { OR1K32BF_INSN_L_SFNEI, SEM_FN_NAME (or1k32bf,l_sfnei) },
36853aed4a8bSchristos { OR1K32BF_INSN_L_MAC, SEM_FN_NAME (or1k32bf,l_mac) },
36863aed4a8bSchristos { OR1K32BF_INSN_L_MACI, SEM_FN_NAME (or1k32bf,l_maci) },
36873aed4a8bSchristos { OR1K32BF_INSN_L_MACU, SEM_FN_NAME (or1k32bf,l_macu) },
36883aed4a8bSchristos { OR1K32BF_INSN_L_MSB, SEM_FN_NAME (or1k32bf,l_msb) },
36893aed4a8bSchristos { OR1K32BF_INSN_L_MSBU, SEM_FN_NAME (or1k32bf,l_msbu) },
36903aed4a8bSchristos { OR1K32BF_INSN_L_CUST1, SEM_FN_NAME (or1k32bf,l_cust1) },
36913aed4a8bSchristos { OR1K32BF_INSN_L_CUST2, SEM_FN_NAME (or1k32bf,l_cust2) },
36923aed4a8bSchristos { OR1K32BF_INSN_L_CUST3, SEM_FN_NAME (or1k32bf,l_cust3) },
36933aed4a8bSchristos { OR1K32BF_INSN_L_CUST4, SEM_FN_NAME (or1k32bf,l_cust4) },
36943aed4a8bSchristos { OR1K32BF_INSN_L_CUST5, SEM_FN_NAME (or1k32bf,l_cust5) },
36953aed4a8bSchristos { OR1K32BF_INSN_L_CUST6, SEM_FN_NAME (or1k32bf,l_cust6) },
36963aed4a8bSchristos { OR1K32BF_INSN_L_CUST7, SEM_FN_NAME (or1k32bf,l_cust7) },
36973aed4a8bSchristos { OR1K32BF_INSN_L_CUST8, SEM_FN_NAME (or1k32bf,l_cust8) },
36983aed4a8bSchristos { OR1K32BF_INSN_LF_ADD_S, SEM_FN_NAME (or1k32bf,lf_add_s) },
3699*56bb7041Schristos { OR1K32BF_INSN_LF_ADD_D32, SEM_FN_NAME (or1k32bf,lf_add_d32) },
37003aed4a8bSchristos { OR1K32BF_INSN_LF_SUB_S, SEM_FN_NAME (or1k32bf,lf_sub_s) },
3701*56bb7041Schristos { OR1K32BF_INSN_LF_SUB_D32, SEM_FN_NAME (or1k32bf,lf_sub_d32) },
37023aed4a8bSchristos { OR1K32BF_INSN_LF_MUL_S, SEM_FN_NAME (or1k32bf,lf_mul_s) },
3703*56bb7041Schristos { OR1K32BF_INSN_LF_MUL_D32, SEM_FN_NAME (or1k32bf,lf_mul_d32) },
37043aed4a8bSchristos { OR1K32BF_INSN_LF_DIV_S, SEM_FN_NAME (or1k32bf,lf_div_s) },
3705*56bb7041Schristos { OR1K32BF_INSN_LF_DIV_D32, SEM_FN_NAME (or1k32bf,lf_div_d32) },
37063aed4a8bSchristos { OR1K32BF_INSN_LF_REM_S, SEM_FN_NAME (or1k32bf,lf_rem_s) },
3707*56bb7041Schristos { OR1K32BF_INSN_LF_REM_D32, SEM_FN_NAME (or1k32bf,lf_rem_d32) },
37083aed4a8bSchristos { OR1K32BF_INSN_LF_ITOF_S, SEM_FN_NAME (or1k32bf,lf_itof_s) },
3709*56bb7041Schristos { OR1K32BF_INSN_LF_ITOF_D32, SEM_FN_NAME (or1k32bf,lf_itof_d32) },
37103aed4a8bSchristos { OR1K32BF_INSN_LF_FTOI_S, SEM_FN_NAME (or1k32bf,lf_ftoi_s) },
3711*56bb7041Schristos { OR1K32BF_INSN_LF_FTOI_D32, SEM_FN_NAME (or1k32bf,lf_ftoi_d32) },
3712*56bb7041Schristos { OR1K32BF_INSN_LF_SFEQ_S, SEM_FN_NAME (or1k32bf,lf_sfeq_s) },
3713*56bb7041Schristos { OR1K32BF_INSN_LF_SFEQ_D32, SEM_FN_NAME (or1k32bf,lf_sfeq_d32) },
3714*56bb7041Schristos { OR1K32BF_INSN_LF_SFNE_S, SEM_FN_NAME (or1k32bf,lf_sfne_s) },
3715*56bb7041Schristos { OR1K32BF_INSN_LF_SFNE_D32, SEM_FN_NAME (or1k32bf,lf_sfne_d32) },
3716*56bb7041Schristos { OR1K32BF_INSN_LF_SFGE_S, SEM_FN_NAME (or1k32bf,lf_sfge_s) },
3717*56bb7041Schristos { OR1K32BF_INSN_LF_SFGE_D32, SEM_FN_NAME (or1k32bf,lf_sfge_d32) },
3718*56bb7041Schristos { OR1K32BF_INSN_LF_SFGT_S, SEM_FN_NAME (or1k32bf,lf_sfgt_s) },
3719*56bb7041Schristos { OR1K32BF_INSN_LF_SFGT_D32, SEM_FN_NAME (or1k32bf,lf_sfgt_d32) },
3720*56bb7041Schristos { OR1K32BF_INSN_LF_SFLT_S, SEM_FN_NAME (or1k32bf,lf_sflt_s) },
3721*56bb7041Schristos { OR1K32BF_INSN_LF_SFLT_D32, SEM_FN_NAME (or1k32bf,lf_sflt_d32) },
3722*56bb7041Schristos { OR1K32BF_INSN_LF_SFLE_S, SEM_FN_NAME (or1k32bf,lf_sfle_s) },
3723*56bb7041Schristos { OR1K32BF_INSN_LF_SFLE_D32, SEM_FN_NAME (or1k32bf,lf_sfle_d32) },
3724*56bb7041Schristos { OR1K32BF_INSN_LF_SFUEQ_S, SEM_FN_NAME (or1k32bf,lf_sfueq_s) },
3725*56bb7041Schristos { OR1K32BF_INSN_LF_SFUEQ_D32, SEM_FN_NAME (or1k32bf,lf_sfueq_d32) },
3726*56bb7041Schristos { OR1K32BF_INSN_LF_SFUNE_S, SEM_FN_NAME (or1k32bf,lf_sfune_s) },
3727*56bb7041Schristos { OR1K32BF_INSN_LF_SFUNE_D32, SEM_FN_NAME (or1k32bf,lf_sfune_d32) },
3728*56bb7041Schristos { OR1K32BF_INSN_LF_SFUGT_S, SEM_FN_NAME (or1k32bf,lf_sfugt_s) },
3729*56bb7041Schristos { OR1K32BF_INSN_LF_SFUGT_D32, SEM_FN_NAME (or1k32bf,lf_sfugt_d32) },
3730*56bb7041Schristos { OR1K32BF_INSN_LF_SFUGE_S, SEM_FN_NAME (or1k32bf,lf_sfuge_s) },
3731*56bb7041Schristos { OR1K32BF_INSN_LF_SFUGE_D32, SEM_FN_NAME (or1k32bf,lf_sfuge_d32) },
3732*56bb7041Schristos { OR1K32BF_INSN_LF_SFULT_S, SEM_FN_NAME (or1k32bf,lf_sfult_s) },
3733*56bb7041Schristos { OR1K32BF_INSN_LF_SFULT_D32, SEM_FN_NAME (or1k32bf,lf_sfult_d32) },
3734*56bb7041Schristos { OR1K32BF_INSN_LF_SFULE_S, SEM_FN_NAME (or1k32bf,lf_sfule_s) },
3735*56bb7041Schristos { OR1K32BF_INSN_LF_SFULE_D32, SEM_FN_NAME (or1k32bf,lf_sfule_d32) },
3736*56bb7041Schristos { OR1K32BF_INSN_LF_SFUN_S, SEM_FN_NAME (or1k32bf,lf_sfun_s) },
3737*56bb7041Schristos { OR1K32BF_INSN_LF_SFUN_D32, SEM_FN_NAME (or1k32bf,lf_sfun_d32) },
37383aed4a8bSchristos { OR1K32BF_INSN_LF_MADD_S, SEM_FN_NAME (or1k32bf,lf_madd_s) },
3739*56bb7041Schristos { OR1K32BF_INSN_LF_MADD_D32, SEM_FN_NAME (or1k32bf,lf_madd_d32) },
37403aed4a8bSchristos { OR1K32BF_INSN_LF_CUST1_S, SEM_FN_NAME (or1k32bf,lf_cust1_s) },
3741*56bb7041Schristos { OR1K32BF_INSN_LF_CUST1_D32, SEM_FN_NAME (or1k32bf,lf_cust1_d32) },
37423aed4a8bSchristos { 0, 0 }
37433aed4a8bSchristos };
37443aed4a8bSchristos
37453aed4a8bSchristos /* Add the semantic fns to IDESC_TABLE. */
37463aed4a8bSchristos
37473aed4a8bSchristos void
SEM_FN_NAME(or1k32bf,init_idesc_table)37483aed4a8bSchristos SEM_FN_NAME (or1k32bf,init_idesc_table) (SIM_CPU *current_cpu)
37493aed4a8bSchristos {
37503aed4a8bSchristos IDESC *idesc_table = CPU_IDESC (current_cpu);
37513aed4a8bSchristos const struct sem_fn_desc *sf;
37523aed4a8bSchristos int mach_num = MACH_NUM (CPU_MACH (current_cpu));
37533aed4a8bSchristos
37543aed4a8bSchristos for (sf = &sem_fns[0]; sf->fn != 0; ++sf)
37553aed4a8bSchristos {
37563aed4a8bSchristos const CGEN_INSN *insn = idesc_table[sf->index].idata;
37573aed4a8bSchristos int valid_p = (CGEN_INSN_VIRTUAL_P (insn)
37583aed4a8bSchristos || CGEN_INSN_MACH_HAS_P (insn, mach_num));
37593aed4a8bSchristos #if FAST_P
37603aed4a8bSchristos if (valid_p)
37613aed4a8bSchristos idesc_table[sf->index].sem_fast = sf->fn;
37623aed4a8bSchristos else
37633aed4a8bSchristos idesc_table[sf->index].sem_fast = SEM_FN_NAME (or1k32bf,x_invalid);
37643aed4a8bSchristos #else
37653aed4a8bSchristos if (valid_p)
37663aed4a8bSchristos idesc_table[sf->index].sem_full = sf->fn;
37673aed4a8bSchristos else
37683aed4a8bSchristos idesc_table[sf->index].sem_full = SEM_FN_NAME (or1k32bf,x_invalid);
37693aed4a8bSchristos #endif
37703aed4a8bSchristos }
37713aed4a8bSchristos }
37723aed4a8bSchristos
3773