diff options
| author | 2021-03-14 01:23:56 -0500 | |
|---|---|---|
| committer | 2021-07-22 21:51:23 -0400 | |
| commit | 8d470c2e63c2dac334ccff2bcda9a0607ce76377 (patch) | |
| tree | e97594278b6f4877a2350550be4727b8c4934248 /src/shader_recompiler/frontend/ir | |
| parent | shader: Fix rebase issue (diff) | |
| download | yuzu-8d470c2e63c2dac334ccff2bcda9a0607ce76377.tar.gz yuzu-8d470c2e63c2dac334ccff2bcda9a0607ce76377.tar.xz yuzu-8d470c2e63c2dac334ccff2bcda9a0607ce76377.zip | |
shader: Implement FMNMX
And add a const in FCMP
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.cpp | 28 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.cpp b/src/shader_recompiler/frontend/ir/ir_emitter.cpp index 5d475207e..556961fa4 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.cpp +++ b/src/shader_recompiler/frontend/ir/ir_emitter.cpp | |||
| @@ -831,6 +831,34 @@ U1 IREmitter::FPUnordered(const F32& lhs, const F32& rhs) { | |||
| 831 | return LogicalOr(FPIsNan(lhs), FPIsNan(rhs)); | 831 | return LogicalOr(FPIsNan(lhs), FPIsNan(rhs)); |
| 832 | } | 832 | } |
| 833 | 833 | ||
| 834 | F32F64 IREmitter::FPMax(const F32F64& lhs, const F32F64& rhs, FpControl control) { | ||
| 835 | if (lhs.Type() != rhs.Type()) { | ||
| 836 | throw InvalidArgument("Mismatching types {} and {}", lhs.Type(), rhs.Type()); | ||
| 837 | } | ||
| 838 | switch (lhs.Type()) { | ||
| 839 | case Type::F32: | ||
| 840 | return Inst<F32>(Opcode::FPMax32, Flags{control}, lhs, rhs); | ||
| 841 | case Type::F64: | ||
| 842 | return Inst<F64>(Opcode::FPMax64, Flags{control}, lhs, rhs); | ||
| 843 | default: | ||
| 844 | ThrowInvalidType(lhs.Type()); | ||
| 845 | } | ||
| 846 | } | ||
| 847 | |||
| 848 | F32F64 IREmitter::FPMin(const F32F64& lhs, const F32F64& rhs, FpControl control) { | ||
| 849 | if (lhs.Type() != rhs.Type()) { | ||
| 850 | throw InvalidArgument("Mismatching types {} and {}", lhs.Type(), rhs.Type()); | ||
| 851 | } | ||
| 852 | switch (lhs.Type()) { | ||
| 853 | case Type::F32: | ||
| 854 | return Inst<F32>(Opcode::FPMin32, Flags{control}, lhs, rhs); | ||
| 855 | case Type::F64: | ||
| 856 | return Inst<F64>(Opcode::FPMin64, Flags{control}, lhs, rhs); | ||
| 857 | default: | ||
| 858 | ThrowInvalidType(lhs.Type()); | ||
| 859 | } | ||
| 860 | } | ||
| 861 | |||
| 834 | U32U64 IREmitter::IAdd(const U32U64& a, const U32U64& b) { | 862 | U32U64 IREmitter::IAdd(const U32U64& a, const U32U64& b) { |
| 835 | if (a.Type() != b.Type()) { | 863 | if (a.Type() != b.Type()) { |
| 836 | throw InvalidArgument("Mismatching types {} and {}", a.Type(), b.Type()); | 864 | throw InvalidArgument("Mismatching types {} and {}", a.Type(), b.Type()); |
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index 5cfe1a54a..74fb3dbcb 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -155,6 +155,8 @@ public: | |||
| 155 | [[nodiscard]] U1 FPIsNan(const F32& value); | 155 | [[nodiscard]] U1 FPIsNan(const F32& value); |
| 156 | [[nodiscard]] U1 FPOrdered(const F32& lhs, const F32& rhs); | 156 | [[nodiscard]] U1 FPOrdered(const F32& lhs, const F32& rhs); |
| 157 | [[nodiscard]] U1 FPUnordered(const F32& lhs, const F32& rhs); | 157 | [[nodiscard]] U1 FPUnordered(const F32& lhs, const F32& rhs); |
| 158 | [[nodiscard]] F32F64 FPMax(const F32F64& lhs, const F32F64& rhs, FpControl control = {}); | ||
| 159 | [[nodiscard]] F32F64 FPMin(const F32F64& lhs, const F32F64& rhs, FpControl control = {}); | ||
| 158 | 160 | ||
| 159 | [[nodiscard]] U32U64 IAdd(const U32U64& a, const U32U64& b); | 161 | [[nodiscard]] U32U64 IAdd(const U32U64& a, const U32U64& b); |
| 160 | [[nodiscard]] U32U64 ISub(const U32U64& a, const U32U64& b); | 162 | [[nodiscard]] U32U64 ISub(const U32U64& a, const U32U64& b); |