mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-07-22 13:07:15 +00:00
Use bitwise operations for fabs/fnabs/fneg.
This commit is contained in:
@@ -408,7 +408,7 @@ bool Recompiler::Recompile(const Function& fn, uint32_t base, const ppc_insn& in
|
|||||||
|
|
||||||
case PPC_INST_FABS:
|
case PPC_INST_FABS:
|
||||||
println("\tctx.fpscr.setFlushMode(false);");
|
println("\tctx.fpscr.setFlushMode(false);");
|
||||||
println("\tctx.f{}.f64 = fabs(ctx.f{}.f64);", insn.operands[0], insn.operands[1]);
|
println("\tctx.f{}.u64 = ctx.f{}.u64 & ~0x8000000000000000;", insn.operands[0], insn.operands[1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPC_INST_FADD:
|
case PPC_INST_FADD:
|
||||||
@@ -493,12 +493,12 @@ bool Recompiler::Recompile(const Function& fn, uint32_t base, const ppc_insn& in
|
|||||||
|
|
||||||
case PPC_INST_FNABS:
|
case PPC_INST_FNABS:
|
||||||
println("\tctx.fpscr.setFlushMode(false);");
|
println("\tctx.fpscr.setFlushMode(false);");
|
||||||
println("\tctx.f{}.f64 = -fabs(ctx.f{}.f64);", insn.operands[0], insn.operands[1]);
|
println("\tctx.f{}.u64 = ctx.f{}.u64 | 0x8000000000000000;", insn.operands[0], insn.operands[1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPC_INST_FNEG:
|
case PPC_INST_FNEG:
|
||||||
println("\tctx.fpscr.setFlushMode(false);");
|
println("\tctx.fpscr.setFlushMode(false);");
|
||||||
println("\tctx.f{}.f64 = -ctx.f{}.f64;", insn.operands[0], insn.operands[1]);
|
println("\tctx.f{}.u64 = ctx.f{}.u64 ^ 0x8000000000000000;", insn.operands[0], insn.operands[1]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPC_INST_FNMADDS:
|
case PPC_INST_FNMADDS:
|
||||||
|
Reference in New Issue
Block a user