shader: Implement SMBO instruction

This commit is contained in:
Macdu
2023-12-29 11:23:13 +01:00
parent 2c98370a48
commit 6d0393b5e7
4 changed files with 71 additions and 1 deletions
+27
View File
@@ -1447,6 +1447,33 @@ SMLSI:
- src2_inc:
offset: 0
size: 8
SMBO:
description: SMBO control instruction
members:
- op1: '11111'
- op2:
size: 3
offset: 56
match: '011'
- opcat:
match: '01'
size: 2
offset: 52
- nosched:
offset: 50
size: 1
- dest_offset:
offset: 36
size: 12
- src0_offset:
offset: 24
size: 12
- src1_offset:
offset: 12
size: 12
- src2_offset:
offset: 0
size: 12
KILL:
description: Kill program
members:
@@ -759,6 +759,12 @@ public:
Imm8 src1_inc,
Imm8 src2_inc);
bool smbo(Imm1 nosched,
Imm12 dest_offset,
Imm12 src0_offset,
Imm12 src1_offset,
Imm12 src2_offset);
bool kill(ShortPredicate pred);
bool limm(bool skipinv,
+22
View File
@@ -148,6 +148,28 @@ bool USSETranslatorVisitor::smlsi(
return true;
}
bool USSETranslatorVisitor::smbo(Imm1 nosched,
Imm12 dest_offset,
Imm12 src0_offset,
Imm12 src1_offset,
Imm12 src2_offset) {
LOG_DISASM("{:016x}: SMBO {}, {}, {}, {}", m_instr, dest_offset, src0_offset, src1_offset, src2_offset);
m_b.setLine(m_recompiler.cur_pc);
auto parse_offset = [&](const int idx, Imm12 offset) {
for (int i = 0; i < 17; i++) {
repeat_increase[idx][i] = i + offset;
}
};
parse_offset(3, dest_offset);
parse_offset(0, src0_offset);
parse_offset(1, src1_offset);
parse_offset(2, src2_offset);
return true;
}
bool USSETranslatorVisitor::kill(
ShortPredicate pred) {
LOG_DISASM("{:016x}: KILL {}", m_instr, disasm::s_predicate_str(pred));
+16 -1
View File
@@ -35,7 +35,7 @@ using USSEMatcher = shader::decoder::Matcher<Visitor, uint64_t>;
template <typename V>
static std::optional<const USSEMatcher<V>> DecodeUSSE(uint64_t instruction) {
static const std::array<USSEMatcher<V>, 34> table = {
static const std::array<USSEMatcher<V>, 35> table = {
#define INST(fn, name, bitstring) shader::decoder::detail::detail<USSEMatcher<V>>::GetMatcher(fn, name, bitstring)
// clang-format off
// Vector multiply-add (Normal version)
@@ -744,6 +744,21 @@ static std::optional<const USSEMatcher<V>> DecodeUSSE(uint64_t instruction) {
ffffffff = src2_inc (8 bits)
*/
INST(&V::smlsi, "SMLSI ()", "11111010--01-n--ttttppppssssdrcieeeeeeeeaaaaaaaabbbbbbbbffffffff"),
// SMBO control instruction
/*
11111 = op1
011 = op2
-- = don't care
01 = opcat
- = don't care
n = nosched (1 bit)
-- = don't care
dddddddddddd = dest_offset (12 bits)
ssssssssssss = src0_offset (12 bits)
rrrrrrrrrrrr = src1_offset (12 bits)
cccccccccccc = src2_offset (12 bits)
*/
INST(&V::smbo, "SMBO ()", "11111011--01-n--ddddddddddddssssssssssssrrrrrrrrrrrrcccccccccccc"),
// Kill program
/*
11111 = op1