diff --git a/core/shader/recompiler/Translation/src/Float64Instructions.cpp b/core/shader/recompiler/Translation/src/Float64Instructions.cpp index a2a338252..9df840a8a 100644 --- a/core/shader/recompiler/Translation/src/Float64Instructions.cpp +++ b/core/shader/recompiler/Translation/src/Float64Instructions.cpp @@ -5,19 +5,8 @@ namespace ShaderRecompiler { IrU64 TranslationContext::readF64(const RdnaOperand& operand) { - std::array pair{IrU32(ir.Constant(0u)), readRawU32(operand)}; - if (operand.kind == RdnaOperandKind::FloatInlineConstant && operand.value == 0x3e22f983u) { - pair = {IrU32(ir.Constant(0x6dc9c882u)), IrU32(ir.Constant(0x3fc45f30u))}; - } else if (operand.kind != RdnaOperandKind::LiteralConstant) { - pair = readU32Pair(plainOperand(operand)); - } - if (operand.absolute) { - pair[1] = IrU32(ir.BitwiseAnd(pair[1].Value(), ir.Constant(0x7fffffffu))); - } - if (operand.negate) { - pair[1] = IrU32(ir.BitwiseXor(pair[1].Value(), ir.Constant(0x80000000u))); - } - return IrU64(ir.ConstructU64(pair[0].Value(), pair[1].Value())); + const std::array bits = readF64Bits(operand); + return IrU64(ir.ConstructU64(bits[0].Value(), bits[1].Value())); } bool TranslationContext::float64Operation(const RdnaInstruction& inst, IrOpcode opcode) { diff --git a/docs/dev/TechnicalDebt.md b/docs/dev/TechnicalDebt.md index 3c905fda0..a66170e1c 100644 --- a/docs/dev/TechnicalDebt.md +++ b/docs/dev/TechnicalDebt.md @@ -52,6 +52,7 @@ Throughout the project, every function at every stage either **does exactly what ### Functional - [Shader recompilation](../../core/shader/recompiler/Recompiler.cpp) currently occurs right before it was transferred to Vulkan with caching, but should be moved to the [relinker](../../core/relinker/main.cpp) stage. For this purpose, [shader/recompiler](../../core/shader/recompiler) was written completely independently from [libs/prx](../../core/libs/prx). +- [v_fma_f64](../../core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterFloat64.cpp) is fused exactly only for normal inputs: with a subnormal input it is a separate multiply and add, which rounds twice. - The executable file that [relinker](../../core/relinker/elfpatcher/src/windows/WindowsPeWriter.cpp) generates opens the console when launched, which is inconvenient for playability. - [libSceJpegEnc](../../core/libs/prx/libSceJpegEnc/Export.cpp) encodes 4:2:2 sampling requests with 4:2:0 chroma subsampling, and grayscale requests as a 3-component JPEG with neutral chroma instead of a single-component one: the [JPEG encoder](../../core/Decoder/Jpeg/src/Jpeg.cpp) (stb) only produces 3-component 4:2:0 and 4:4:4 images. - `--to-intel` does not lower RDPRU/MCOMMIT; the [matcher](../../core/relinker/codegen/src/x86/Amd64OnlyInstructionMatcher.cpp) fails the relink instead. SHA-1 instructions with a memory operand and SHA-256 instructions with a RIP-relative operand fail the relink.