summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar bunnei2018-06-04 22:15:19 -0400
committerGravatar bunnei2018-06-04 22:36:49 -0400
commitc23c30c76f2195beb34fea628ba66dc41e39fcfd (patch)
tree61ce7453cdcfb2057e7ddfd9f8eef68aaff958b8 /src/video_core/engines
parentMerge pull request #519 from bunnei/pred-not-equal (diff)
downloadyuzu-c23c30c76f2195beb34fea628ba66dc41e39fcfd.tar.gz
yuzu-c23c30c76f2195beb34fea628ba66dc41e39fcfd.tar.xz
yuzu-c23c30c76f2195beb34fea628ba66dc41e39fcfd.zip
gl_shader_decompiler: Implement SHL instruction.
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/shader_bytecode.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 8d4ea3401..ef749937e 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -230,22 +230,19 @@ union Instruction {
230 std::memcpy(&result, &imm, sizeof(imm)); 230 std::memcpy(&result, &imm, sizeof(imm));
231 return result; 231 return result;
232 } 232 }
233 } alu;
234
235 union {
236 BitField<39, 5, u64> shift_amount;
237 BitField<20, 19, u64> immediate_low;
238 BitField<56, 1, u64> immediate_high;
239 BitField<48, 1, u64> negate_b;
240 BitField<49, 1, u64> negate_a;
241 233
242 s32 GetImmediate() const { 234 s32 GetSignedImm20_20() const {
243 u32 immediate = static_cast<u32>(immediate_low | (immediate_high << 19)); 235 u32 immediate = static_cast<u32>(imm20_19 | (negate_imm << 19));
244 // Sign extend the 20-bit value. 236 // Sign extend the 20-bit value.
245 u32 mask = 1U << (20 - 1); 237 u32 mask = 1U << (20 - 1);
246 return static_cast<s32>((immediate ^ mask) - mask); 238 return static_cast<s32>((immediate ^ mask) - mask);
247 } 239 }
240 } alu;
248 241
242 union {
243 BitField<39, 5, u64> shift_amount;
244 BitField<48, 1, u64> negate_b;
245 BitField<49, 1, u64> negate_a;
249 } iscadd; 246 } iscadd;
250 247
251 union { 248 union {
@@ -402,6 +399,9 @@ public:
402 MOV_R, 399 MOV_R,
403 MOV_IMM, 400 MOV_IMM,
404 MOV32_IMM, 401 MOV32_IMM,
402 SHL_C,
403 SHL_R,
404 SHL_IMM,
405 SHR_C, 405 SHR_C,
406 SHR_R, 406 SHR_R,
407 SHR_IMM, 407 SHR_IMM,
@@ -424,6 +424,7 @@ public:
424 Trivial, 424 Trivial,
425 Arithmetic, 425 Arithmetic,
426 Logic, 426 Logic,
427 Shift,
427 ScaledAdd, 428 ScaledAdd,
428 Ffma, 429 Ffma,
429 Flow, 430 Flow,
@@ -565,13 +566,16 @@ private:
565 INST("0101110010011---", Id::MOV_R, Type::Arithmetic, "MOV_R"), 566 INST("0101110010011---", Id::MOV_R, Type::Arithmetic, "MOV_R"),
566 INST("0011100-10011---", Id::MOV_IMM, Type::Arithmetic, "MOV_IMM"), 567 INST("0011100-10011---", Id::MOV_IMM, Type::Arithmetic, "MOV_IMM"),
567 INST("000000010000----", Id::MOV32_IMM, Type::Arithmetic, "MOV32_IMM"), 568 INST("000000010000----", Id::MOV32_IMM, Type::Arithmetic, "MOV32_IMM"),
568 INST("0100110000101---", Id::SHR_C, Type::Arithmetic, "SHR_C"),
569 INST("0101110000101---", Id::SHR_R, Type::Arithmetic, "SHR_R"),
570 INST("0011100-00101---", Id::SHR_IMM, Type::Arithmetic, "SHR_IMM"),
571 INST("0100110001100---", Id::FMNMX_C, Type::Arithmetic, "FMNMX_C"), 569 INST("0100110001100---", Id::FMNMX_C, Type::Arithmetic, "FMNMX_C"),
572 INST("0101110001100---", Id::FMNMX_R, Type::Arithmetic, "FMNMX_R"), 570 INST("0101110001100---", Id::FMNMX_R, Type::Arithmetic, "FMNMX_R"),
573 INST("0011100-01100---", Id::FMNMX_IMM, Type::Arithmetic, "FMNMX_IMM"), 571 INST("0011100-01100---", Id::FMNMX_IMM, Type::Arithmetic, "FMNMX_IMM"),
574 INST("000001----------", Id::LOP32I, Type::Logic, "LOP32I"), 572 INST("000001----------", Id::LOP32I, Type::Logic, "LOP32I"),
573 INST("0100110001001---", Id::SHL_C, Type::Shift, "SHL_C"),
574 INST("0101110001001---", Id::SHL_R, Type::Shift, "SHL_R"),
575 INST("0011100-01001---", Id::SHL_IMM, Type::Shift, "SHL_IMM"),
576 INST("0100110000101---", Id::SHR_C, Type::Shift, "SHR_C"),
577 INST("0101110000101---", Id::SHR_R, Type::Shift, "SHR_R"),
578 INST("0011100-00101---", Id::SHR_IMM, Type::Shift, "SHR_IMM"),
575 INST("0100110011100---", Id::I2I_C, Type::Conversion, "I2I_C"), 579 INST("0100110011100---", Id::I2I_C, Type::Conversion, "I2I_C"),
576 INST("0101110011100---", Id::I2I_R, Type::Conversion, "I2I_R"), 580 INST("0101110011100---", Id::I2I_R, Type::Conversion, "I2I_R"),
577 INST("01110001-1000---", Id::I2I_IMM, Type::Conversion, "I2I_IMM"), 581 INST("01110001-1000---", Id::I2I_IMM, Type::Conversion, "I2I_IMM"),