summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-20 22:23:52 -0400
committerGravatar bunnei2018-04-20 22:30:56 -0400
commite1630c4d438167c795ff237fa3e8f7421f5ffef6 (patch)
tree917e3d26f5baf331d76f1bd99f32630a97dd5a42 /src
parentshader_bytecode: Decode instructions based on bit strings. (diff)
downloadyuzu-e1630c4d438167c795ff237fa3e8f7421f5ffef6.tar.gz
yuzu-e1630c4d438167c795ff237fa3e8f7421f5ffef6.tar.xz
yuzu-e1630c4d438167c795ff237fa3e8f7421f5ffef6.zip
shader_bytecode: Add several more instruction decodings.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h57
1 files changed, 52 insertions, 5 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index f4dfef76a..5a006aee5 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -234,10 +234,12 @@ public:
234 KIL, 234 KIL,
235 LD_A, 235 LD_A,
236 ST_A, 236 ST_A,
237 TEXS, 237 TEXQ, // Texture Query
238 TEXS, // Texture Fetch with scalar/non-vec4 source/destinations
239 TLDS, // Texture Load with scalar/non-vec4 source/destinations
238 EXIT, 240 EXIT,
239 IPA, 241 IPA,
240 FFMA_IMM, 242 FFMA_IMM, // Fused Multiply and Add
241 FFMA_CR, 243 FFMA_CR,
242 FFMA_RC, 244 FFMA_RC,
243 FFMA_RR, 245 FFMA_RR,
@@ -248,10 +250,31 @@ public:
248 FMUL_R, 250 FMUL_R,
249 FMUL_IMM, 251 FMUL_IMM,
250 FMUL32_IMM, 252 FMUL32_IMM,
251 MUFU, 253 MUFU, // Multi-Function Operator
254 RRO, // Range Reduction Operator
255 F2F_C,
256 F2F_R,
257 F2F_IMM,
258 F2I_C,
259 F2I_R,
260 F2I_IMM,
261 I2F_C,
262 I2F_R,
263 I2F_IMM,
264 LOP32I,
265 MOV_C,
266 MOV_R,
267 MOV_IMM,
268 MOV32I,
269 SHR_C,
270 SHR_R,
271 SHR_IMM,
272 FSETP_C, // Set Predicate
252 FSETP_R, 273 FSETP_R,
253 FSETP_C,
254 FSETP_IMM, 274 FSETP_IMM,
275 ISETP_C,
276 ISETP_IMM,
277 ISETP_R,
255 }; 278 };
256 279
257 enum class Type { 280 enum class Type {
@@ -261,6 +284,7 @@ public:
261 Flow, 284 Flow,
262 Memory, 285 Memory,
263 FloatPredicate, 286 FloatPredicate,
287 IntegerPredicate,
264 Unknown, 288 Unknown,
265 }; 289 };
266 290
@@ -358,7 +382,9 @@ private:
358 INST("111000110011----", Id::KIL, Type::Flow, "KIL"), 382 INST("111000110011----", Id::KIL, Type::Flow, "KIL"),
359 INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"), 383 INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"),
360 INST("1110111111110---", Id::ST_A, Type::Memory, "ST_A"), 384 INST("1110111111110---", Id::ST_A, Type::Memory, "ST_A"),
385 INST("1101111101001---", Id::TEXQ, Type::Memory, "TEXQ"),
361 INST("1101100---------", Id::TEXS, Type::Memory, "TEXS"), 386 INST("1101100---------", Id::TEXS, Type::Memory, "TEXS"),
387 INST("1101101---------", Id::TLDS, Type::Memory, "TLDS"),
362 INST("111000110000----", Id::EXIT, Type::Trivial, "EXIT"), 388 INST("111000110000----", Id::EXIT, Type::Trivial, "EXIT"),
363 INST("11100000--------", Id::IPA, Type::Trivial, "IPA"), 389 INST("11100000--------", Id::IPA, Type::Trivial, "IPA"),
364 INST("001100101-------", Id::FFMA_IMM, Type::Ffma, "FFMA_IMM"), 390 INST("001100101-------", Id::FFMA_IMM, Type::Ffma, "FFMA_IMM"),
@@ -373,9 +399,30 @@ private:
373 INST("0011100-01101---", Id::FMUL_IMM, Type::Arithmetic, "FMUL_IMM"), 399 INST("0011100-01101---", Id::FMUL_IMM, Type::Arithmetic, "FMUL_IMM"),
374 INST("00011110--------", Id::FMUL32_IMM, Type::Arithmetic, "FMUL32_IMM"), 400 INST("00011110--------", Id::FMUL32_IMM, Type::Arithmetic, "FMUL32_IMM"),
375 INST("0101000010000---", Id::MUFU, Type::Arithmetic, "MUFU"), 401 INST("0101000010000---", Id::MUFU, Type::Arithmetic, "MUFU"),
376 INST("010110111011----", Id::FSETP_R, Type::FloatPredicate, "FSETP_R"), 402 INST("0101110010010---", Id::RRO, Type::Arithmetic, "RRO"),
403 INST("0100110010101---", Id::F2F_C, Type::Arithmetic, "F2F_C"),
404 INST("0101110010101---", Id::F2F_R, Type::Arithmetic, "F2F_R"),
405 INST("0011100-10101---", Id::F2F_IMM, Type::Arithmetic, "F2F_IMM"),
406 INST("0100110010110---", Id::F2I_C, Type::Arithmetic, "F2I_C"),
407 INST("0101110010110---", Id::F2I_R, Type::Arithmetic, "F2I_R"),
408 INST("0011100-10110---", Id::F2I_IMM, Type::Arithmetic, "F2I_IMM"),
409 INST("0100110010111---", Id::I2F_C, Type::Arithmetic, "I2F_C"),
410 INST("0101110010111---", Id::I2F_R, Type::Arithmetic, "I2F_R"),
411 INST("0011100-10111---", Id::I2F_IMM, Type::Arithmetic, "I2F_IMM"),
412 INST("000001----------", Id::LOP32I, Type::Arithmetic, "LOP32I"),
413 INST("0100110010011---", Id::MOV_C, Type::Arithmetic, "MOV_C"),
414 INST("0101110010011---", Id::MOV_R, Type::Arithmetic, "MOV_R"),
415 INST("0011100-10011---", Id::MOV_IMM, Type::Arithmetic, "MOV_IMM"),
416 INST("000000010000----", Id::MOV32I, Type::Arithmetic, "MOV32I"),
417 INST("0100110000101---", Id::SHR_C, Type::Arithmetic, "SHR_C"),
418 INST("0101110000101---", Id::SHR_R, Type::Arithmetic, "SHR_R"),
419 INST("0011100-00101---", Id::SHR_IMM, Type::Arithmetic, "SHR_IMM"),
377 INST("010010111011----", Id::FSETP_C, Type::FloatPredicate, "FSETP_C"), 420 INST("010010111011----", Id::FSETP_C, Type::FloatPredicate, "FSETP_C"),
421 INST("010110111011----", Id::FSETP_R, Type::FloatPredicate, "FSETP_R"),
378 INST("0011011-1011----", Id::FSETP_IMM, Type::FloatPredicate, "FSETP_IMM"), 422 INST("0011011-1011----", Id::FSETP_IMM, Type::FloatPredicate, "FSETP_IMM"),
423 INST("010010110110----", Id::ISETP_C, Type::IntegerPredicate, "ISETP_C"),
424 INST("010110110110----", Id::ISETP_R, Type::IntegerPredicate, "ISETP_R"),
425 INST("0011011-0110----", Id::ISETP_IMM, Type::IntegerPredicate, "ISETP_IMM"),
379 }; 426 };
380#undef INST 427#undef INST
381 std::stable_sort(table.begin(), table.end(), [](const auto& a, const auto& b) { 428 std::stable_sort(table.begin(), table.end(), [](const auto& a, const auto& b) {