mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
refactor(shader): read f64 operands through readF64Bits and record the v_fma_f64 subnormal gap
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,19 +5,8 @@
|
||||
namespace ShaderRecompiler {
|
||||
|
||||
IrU64 TranslationContext::readF64(const RdnaOperand& operand) {
|
||||
std::array<IrU32, 2> 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<IrU32, 2> bits = readF64Bits(operand);
|
||||
return IrU64(ir.ConstructU64(bits[0].Value(), bits[1].Value()));
|
||||
}
|
||||
|
||||
bool TranslationContext::float64Operation(const RdnaInstruction& inst, IrOpcode opcode) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user