mirror of
https://git.citron-emu.org/Citron/Citron.git
synced 2025-03-15 05:34:49 +00:00
shader_recompiler: Use FPRecip in FSWZADD implementation
Simplifies the negative reciprocal calculation in FSWZADD by using the dedicated FPRecip operation instead of manually constructing a division. This change: - Replaces FPDiv(Imm32(f32(1.0f)), src_b) with FPRecip(src_b) - Results in more efficient code for calculating 1.0/x - Fixes build errors from undefined IR emitter methods
This commit is contained in:
parent
6f160628c0
commit
2b5082b30d
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ void TranslatorVisitor::FSWZADD(u64 insn) {
|
|||
|
||||
IR::F32 result;
|
||||
if (fswzadd.ndv != 0) {
|
||||
const IR::F32 neg_recip = ir.FPNeg(ir.FPDiv(ir.Imm32(ir.f32(1.0f)), src_b));
|
||||
const IR::F32 neg_recip = ir.FPNeg(ir.FPRecip(src_b));
|
||||
result = ir.FSwizzleAdd(src_a, neg_recip, swizzle, fp_control);
|
||||
} else {
|
||||
result = ir.FSwizzleAdd(src_a, src_b, swizzle, fp_control);
|
||||
|
|
Loading…
Add table
Reference in a new issue