diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-10 08:55:09 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:31 +0200 |
commit | 3b6a632237e2f8388f2591d54fb31bebdc2a0ade (patch) | |
tree | 7c7c1c4ca32f986bae1fc8f23330a21551bf5086 /src/shader_recompiler/frontend/ir/ir_emitter.cpp | |
parent | glasm: Properly clamp Fp64 on GLASM (diff) | |
download | yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.gz yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.bz2 yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.lz yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.xz yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.tar.zst yuzu-3b6a632237e2f8388f2591d54fb31bebdc2a0ade.zip |
Diffstat (limited to 'src/shader_recompiler/frontend/ir/ir_emitter.cpp')
-rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index 354d72c9b..ce6c9af07 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp @@ -1622,84 +1622,86 @@ U32U64 IREmitter::ConvertFToI(size_t bitsize, bool is_signed, const F16F32F64& v return is_signed ? ConvertFToS(bitsize, value) : ConvertFToU(bitsize, value); } -F16F32F64 IREmitter::ConvertSToF(size_t dest_bitsize, size_t src_bitsize, const Value& value) { +F16F32F64 IREmitter::ConvertSToF(size_t dest_bitsize, size_t src_bitsize, const Value& value, + FpControl control) { switch (dest_bitsize) { case 16: switch (src_bitsize) { case 8: - return Inst<F16>(Opcode::ConvertF16S8, value); + return Inst<F16>(Opcode::ConvertF16S8, Flags{control}, value); case 16: - return Inst<F16>(Opcode::ConvertF16S16, value); + return Inst<F16>(Opcode::ConvertF16S16, Flags{control}, value); case 32: - return Inst<F16>(Opcode::ConvertF16S32, value); + return Inst<F16>(Opcode::ConvertF16S32, Flags{control}, value); case 64: - return Inst<F16>(Opcode::ConvertF16S64, value); + return Inst<F16>(Opcode::ConvertF16S64, Flags{control}, value); } break; case 32: switch (src_bitsize) { case 8: - return Inst<F32>(Opcode::ConvertF32S8, value); + return Inst<F32>(Opcode::ConvertF32S8, Flags{control}, value); case 16: - return Inst<F32>(Opcode::ConvertF32S16, value); + return Inst<F32>(Opcode::ConvertF32S16, Flags{control}, value); case 32: - return Inst<F32>(Opcode::ConvertF32S32, value); + return Inst<F32>(Opcode::ConvertF32S32, Flags{control}, value); case 64: - return Inst<F32>(Opcode::ConvertF32S64, value); + return Inst<F32>(Opcode::ConvertF32S64, Flags{control}, value); } break; case 64: switch (src_bitsize) { case 8: - return Inst<F64>(Opcode::ConvertF64S8, value); + return Inst<F64>(Opcode::ConvertF64S8, Flags{control}, value); case 16: - return Inst<F64>(Opcode::ConvertF64S16, value); + return Inst<F64>(Opcode::ConvertF64S16, Flags{control}, value); case 32: - return Inst<F64>(Opcode::ConvertF64S32, value); + return Inst<F64>(Opcode::ConvertF64S32, Flags{control}, value); case 64: - return Inst<F64>(Opcode::ConvertF64S64, value); + return Inst<F64>(Opcode::ConvertF64S64, Flags{control}, value); } break; } throw InvalidArgument("Invalid bit size combination dst={} src={}", dest_bitsize, src_bitsize); } -F16F32F64 IREmitter::ConvertUToF(size_t dest_bitsize, size_t src_bitsize, const Value& value) { +F16F32F64 IREmitter::ConvertUToF(size_t dest_bitsize, size_t src_bitsize, const Value& value, + FpControl control) { switch (dest_bitsize) { case 16: switch (src_bitsize) { case 8: - return Inst<F16>(Opcode::ConvertF16U8, value); + return Inst<F16>(Opcode::ConvertF16U8, Flags{control}, value); case 16: - return Inst<F16>(Opcode::ConvertF16U16, value); + return Inst<F16>(Opcode::ConvertF16U16, Flags{control}, value); case 32: - return Inst<F16>(Opcode::ConvertF16U32, value); + return Inst<F16>(Opcode::ConvertF16U32, Flags{control}, value); case 64: - return Inst<F16>(Opcode::ConvertF16U64, value); + return Inst<F16>(Opcode::ConvertF16U64, Flags{control}, value); } break; case 32: switch (src_bitsize) { case 8: - return Inst<F32>(Opcode::ConvertF32U8, value); + return Inst<F32>(Opcode::ConvertF32U8, Flags{control}, value); case 16: - return Inst<F32>(Opcode::ConvertF32U16, value); + return Inst<F32>(Opcode::ConvertF32U16, Flags{control}, value); case 32: - return Inst<F32>(Opcode::ConvertF32U32, value); + return Inst<F32>(Opcode::ConvertF32U32, Flags{control}, value); case 64: - return Inst<F32>(Opcode::ConvertF32U64, value); + return Inst<F32>(Opcode::ConvertF32U64, Flags{control}, value); } break; case 64: switch (src_bitsize) { case 8: - return Inst<F64>(Opcode::ConvertF64U8, value); + return Inst<F64>(Opcode::ConvertF64U8, Flags{control}, value); case 16: - return Inst<F64>(Opcode::ConvertF64U16, value); + return Inst<F64>(Opcode::ConvertF64U16, Flags{control}, value); case 32: - return Inst<F64>(Opcode::ConvertF64U32, value); + return Inst<F64>(Opcode::ConvertF64U32, Flags{control}, value); case 64: - return Inst<F64>(Opcode::ConvertF64U64, value); + return Inst<F64>(Opcode::ConvertF64U64, Flags{control}, value); } break; } @@ -1707,9 +1709,9 @@ F16F32F64 IREmitter::ConvertUToF(size_t dest_bitsize, size_t src_bitsize, const } F16F32F64 IREmitter::ConvertIToF(size_t dest_bitsize, size_t src_bitsize, bool is_signed, - const Value& value) { - return is_signed ? ConvertSToF(dest_bitsize, src_bitsize, value) - : ConvertUToF(dest_bitsize, src_bitsize, value); + const Value& value, FpControl control) { + return is_signed ? ConvertSToF(dest_bitsize, src_bitsize, value, control) + : ConvertUToF(dest_bitsize, src_bitsize, value, control); } U32U64 IREmitter::UConvert(size_t result_bitsize, const U32U64& value) { |