diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp index a7cc2cf4..46cf1c45 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-decode.cpp @@ -568,6 +568,12 @@ const powerpc_cpu::instr_info_t powerpc_cpu::powerpc_ii_table[] = { PPC_I(FRSP), X_form, 63, 12, CFLOW_NORMAL }, + { "fsel", + EXECUTE_FP_ARITH(double, fsel, RD, RA, RC, RB, RC_BIT_G, false), + NULL, + PPC_I(FSEL), + A_form, 63, 23, CFLOW_NORMAL + }, { "fsub", EXECUTE_FP_ARITH(double, fsub, RD, RA, RB, NONE, RC_BIT_G, true), NULL, diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp index effc819e..c42b61d1 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-instructions.hpp @@ -100,6 +100,7 @@ enum powerpc_instruction { PPC_I(FNMSUB), PPC_I(FNMSUBS), PPC_I(FRSP), + PPC_I(FSEL), PPC_I(FSUB), PPC_I(FSUBS), PPC_I(ICBI), diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-operations.hpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-operations.hpp index 303b0e84..e1d2b409 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-operations.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-operations.hpp @@ -141,6 +141,7 @@ DEFINE_OP1(fneg, double, -x); DEFINE_OP3(fnmadd, double, -((x * y) + z)); DEFINE_OP3(fnmsub, double, -((x * y) - z)); DEFINE_OP2(fsub, double, x - y); +DEFINE_OP3(fsel, double, (x >= 0.0) ? y : z); DEFINE_OP1(fnops, float, x); DEFINE_OP1(fabss, float, fabs(x));