mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-06-06 18:31:03 +00:00
Use bitwise operations for fabs/fnabs/fneg.
This commit is contained in:
parent
989ed13d04
commit
7f43723ff0
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user