mirror of
https://github.com/Vita3K/Vita3K.git
synced 2026-07-11 01:34:23 +02:00
shader: Implement SMBO instruction
This commit is contained in:
@@ -1447,6 +1447,33 @@ SMLSI:
|
|||||||
- src2_inc:
|
- src2_inc:
|
||||||
offset: 0
|
offset: 0
|
||||||
size: 8
|
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:
|
KILL:
|
||||||
description: Kill program
|
description: Kill program
|
||||||
members:
|
members:
|
||||||
|
|||||||
@@ -759,6 +759,12 @@ public:
|
|||||||
Imm8 src1_inc,
|
Imm8 src1_inc,
|
||||||
Imm8 src2_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 kill(ShortPredicate pred);
|
||||||
|
|
||||||
bool limm(bool skipinv,
|
bool limm(bool skipinv,
|
||||||
|
|||||||
@@ -148,6 +148,28 @@ bool USSETranslatorVisitor::smlsi(
|
|||||||
return true;
|
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(
|
bool USSETranslatorVisitor::kill(
|
||||||
ShortPredicate pred) {
|
ShortPredicate pred) {
|
||||||
LOG_DISASM("{:016x}: KILL {}", m_instr, disasm::s_predicate_str(pred));
|
LOG_DISASM("{:016x}: KILL {}", m_instr, disasm::s_predicate_str(pred));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ using USSEMatcher = shader::decoder::Matcher<Visitor, uint64_t>;
|
|||||||
|
|
||||||
template <typename V>
|
template <typename V>
|
||||||
static std::optional<const USSEMatcher<V>> DecodeUSSE(uint64_t instruction) {
|
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)
|
#define INST(fn, name, bitstring) shader::decoder::detail::detail<USSEMatcher<V>>::GetMatcher(fn, name, bitstring)
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// Vector multiply-add (Normal version)
|
// Vector multiply-add (Normal version)
|
||||||
@@ -744,6 +744,21 @@ static std::optional<const USSEMatcher<V>> DecodeUSSE(uint64_t instruction) {
|
|||||||
ffffffff = src2_inc (8 bits)
|
ffffffff = src2_inc (8 bits)
|
||||||
*/
|
*/
|
||||||
INST(&V::smlsi, "SMLSI ()", "11111010--01-n--ttttppppssssdrcieeeeeeeeaaaaaaaabbbbbbbbffffffff"),
|
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
|
// Kill program
|
||||||
/*
|
/*
|
||||||
11111 = op1
|
11111 = op1
|
||||||
|
|||||||
Reference in New Issue
Block a user