summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2024-12-31 22:54:55 +1000
committerZephyron <zephyron@citron-emu.org>2024-12-31 22:54:55 +1000
commit2b5082b30d72dcf79409fa7850a5b0873dfa8815 (patch)
treecff25e6b309474ce13c98ddbcc529c78861e0ce4 /src
parent6f160628c084cbc30679af1142ec25e4b9e70bcf (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
index cb8971551..c89d53ea3 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp
@@ -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);