diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | 82 |
1 files changed, 36 insertions, 46 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp index 7b88d6f02..2db05e62d 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | |||
| @@ -87,34 +87,34 @@ void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, ScalarS32 a, ScalarS32 b | |||
| 87 | ctx.Add("XOR.S {}.x,{},{};", inst, a, b); | 87 | ctx.Add("XOR.S {}.x,{},{};", inst, a, b); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 base, | 90 | void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 insert, |
| 91 | [[maybe_unused]] ScalarS32 insert, [[maybe_unused]] ScalarS32 offset, | 91 | ScalarS32 offset, ScalarS32 count) { |
| 92 | [[maybe_unused]] ScalarS32 count) { | 92 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); |
| 93 | throw NotImplementedException("GLASM instruction"); | 93 | ctx.Add("BFI.S {},RC,{},{};", inst, insert, base); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 96 | void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, ScalarS32 base, ScalarS32 offset, |
| 97 | [[maybe_unused]] ScalarS32 base, [[maybe_unused]] ScalarS32 offset, | 97 | ScalarS32 count) { |
| 98 | [[maybe_unused]] ScalarS32 count) { | 98 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); |
| 99 | throw NotImplementedException("GLASM instruction"); | 99 | ctx.Add("BFE.S {},RC,{};", inst, base); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 102 | void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, ScalarU32 base, ScalarU32 offset, |
| 103 | [[maybe_unused]] ScalarU32 base, [[maybe_unused]] ScalarU32 offset, | 103 | ScalarU32 count) { |
| 104 | [[maybe_unused]] ScalarU32 count) { | 104 | ctx.Add("MOV.U RC.x,{};MOV.U RC.y,{};", count, offset); |
| 105 | throw NotImplementedException("GLASM instruction"); | 105 | ctx.Add("BFE.U {},RC,{};", inst, base); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 108 | void EmitBitReverse32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value) { |
| 109 | throw NotImplementedException("GLASM instruction"); | 109 | ctx.Add("BFR {},{};", inst, value); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 112 | void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| 113 | throw NotImplementedException("GLASM instruction"); | 113 | throw NotImplementedException("GLASM instruction"); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 116 | void EmitBitwiseNot32(EmitContext& ctx, IR::Inst& inst, ScalarS32 value) { |
| 117 | throw NotImplementedException("GLASM instruction"); | 117 | ctx.Add("NOT.S {},{};", inst, value); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { | 120 | void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 value) { |
| @@ -157,54 +157,44 @@ void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& | |||
| 157 | throw NotImplementedException("GLASM instruction"); | 157 | throw NotImplementedException("GLASM instruction"); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 160 | void EmitSLessThan(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 161 | [[maybe_unused]] ScalarS32 rhs) { | 161 | ctx.Add("SLT.S {},{},{};", inst, lhs, rhs); |
| 162 | throw NotImplementedException("GLASM instruction"); | ||
| 163 | } | 162 | } |
| 164 | 163 | ||
| 165 | void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 164 | void EmitULessThan(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 166 | [[maybe_unused]] ScalarU32 rhs) { | 165 | ctx.Add("SLT.U {},{},{};", inst, lhs, rhs); |
| 167 | throw NotImplementedException("GLASM instruction"); | ||
| 168 | } | 166 | } |
| 169 | 167 | ||
| 170 | void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 168 | void EmitIEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 171 | [[maybe_unused]] ScalarS32 rhs) { | 169 | ctx.Add("SEQ.S {},{},{};", inst, lhs, rhs); |
| 172 | throw NotImplementedException("GLASM instruction"); | ||
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 172 | void EmitSLessThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 176 | [[maybe_unused]] ScalarS32 rhs) { | 173 | ctx.Add("SLE.S {},{},{};", inst, lhs, rhs); |
| 177 | throw NotImplementedException("GLASM instruction"); | ||
| 178 | } | 174 | } |
| 179 | 175 | ||
| 180 | void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 176 | void EmitULessThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 181 | [[maybe_unused]] ScalarU32 rhs) { | 177 | ctx.Add("SLE.U {},{},{};", inst, lhs, rhs); |
| 182 | throw NotImplementedException("GLASM instruction"); | ||
| 183 | } | 178 | } |
| 184 | 179 | ||
| 185 | void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 180 | void EmitSGreaterThan(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 186 | [[maybe_unused]] ScalarS32 rhs) { | 181 | ctx.Add("SGT.S {},{},{};", inst, lhs, rhs); |
| 187 | throw NotImplementedException("GLASM instruction"); | ||
| 188 | } | 182 | } |
| 189 | 183 | ||
| 190 | void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 184 | void EmitUGreaterThan(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 191 | [[maybe_unused]] ScalarU32 rhs) { | 185 | ctx.Add("SGT.U {},{},{};", inst, lhs, rhs); |
| 192 | throw NotImplementedException("GLASM instruction"); | ||
| 193 | } | 186 | } |
| 194 | 187 | ||
| 195 | void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 188 | void EmitINotEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 196 | [[maybe_unused]] ScalarS32 rhs) { | 189 | ctx.Add("SNE.U {},{},{};", inst, lhs, rhs); |
| 197 | throw NotImplementedException("GLASM instruction"); | ||
| 198 | } | 190 | } |
| 199 | 191 | ||
| 200 | void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 lhs, | 192 | void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarS32 lhs, ScalarS32 rhs) { |
| 201 | [[maybe_unused]] ScalarS32 rhs) { | 193 | ctx.Add("SGE.S {},{},{};", inst, lhs, rhs); |
| 202 | throw NotImplementedException("GLASM instruction"); | ||
| 203 | } | 194 | } |
| 204 | 195 | ||
| 205 | void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 lhs, | 196 | void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, ScalarU32 lhs, ScalarU32 rhs) { |
| 206 | [[maybe_unused]] ScalarU32 rhs) { | 197 | ctx.Add("SGE.U {},{},{};", inst, lhs, rhs); |
| 207 | throw NotImplementedException("GLASM instruction"); | ||
| 208 | } | 198 | } |
| 209 | 199 | ||
| 210 | } // namespace Shader::Backend::GLASM | 200 | } // namespace Shader::Backend::GLASM |