summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-10 08:47:57 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:31 +0200
commit3f00a2ad3f4d5c89599929080b1f6efaf394b62f (patch)
tree7e872f548d165101e838e0a8e21dab1d3b23abd1 /src
parentglasm: Fix register allocation when moving immediate on GLASM (diff)
downloadyuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.tar
yuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.tar.gz
yuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.tar.bz2
yuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.tar.lz
yuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.tar.xz
yuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.tar.zst
yuzu-3f00a2ad3f4d5c89599929080b1f6efaf394b62f.zip
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp
index 2e1c7d55f..84028e01a 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_floating_point.cpp
@@ -36,11 +36,11 @@ void Compare(EmitContext& ctx, IR::Inst& inst, InputType lhs, InputType rhs, std
template <typename InputType>
void Clamp(EmitContext& ctx, Register ret, InputType value, InputType min_value,
- InputType max_value) {
+ InputType max_value, std::string_view type) {
// Call MAX first to properly clamp nan to min_value instead
- ctx.Add("MAX.F {}.x,{},{};"
- "MIN.F {}.x,{},{};",
- ret, min_value, value, ret, ret, max_value);
+ ctx.Add("MAX.{} {}.x,{},{};"
+ "MIN.{} {}.x,{}.x,{};",
+ type, ret, min_value, value, type, ret, ret, max_value);
}
} // Anonymous namespace
@@ -180,12 +180,12 @@ void EmitFPClamp16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register
void EmitFPClamp32(EmitContext& ctx, IR::Inst& inst, ScalarF32 value, ScalarF32 min_value,
ScalarF32 max_value) {
- Clamp(ctx, ctx.reg_alloc.Define(inst), value, min_value, max_value);
+ Clamp(ctx, ctx.reg_alloc.Define(inst), value, min_value, max_value, "F");
}
void EmitFPClamp64(EmitContext& ctx, IR::Inst& inst, ScalarF64 value, ScalarF64 min_value,
ScalarF64 max_value) {
- Clamp(ctx, ctx.reg_alloc.LongDefine(inst), value, min_value, max_value);
+ Clamp(ctx, ctx.reg_alloc.LongDefine(inst), value, min_value, max_value, "F64");
}
void EmitFPRoundEven16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] Register value) {