mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
shader: V_FFBH_I32
This commit is contained in:
@@ -13356,6 +13356,37 @@ TestCase VectorIntegerOps() {
|
||||
O::S_ENDPGM}};
|
||||
}
|
||||
|
||||
TestCase VectorFfbhI32NativeAndVop3OnGpu() {
|
||||
using O = ShaderOpcode;
|
||||
|
||||
constexpr std::array inputs = {0x00000000u, 0x40000000u, 0x80000000u,
|
||||
0x0fffffffu, 0xffff0000u, 0xfffffffeu,
|
||||
0xffffffffu, 0x80000000u};
|
||||
std::vector<u32> code;
|
||||
for (u32 i = 0; i < inputs.size() - 1u; i++) {
|
||||
AppendVMovU32(&code, 30, i * 4u);
|
||||
AppendBufferLoadDword(&code, 14, 30);
|
||||
code.push_back(0x7e1c770eu); // v_ffbh_i32 v14, v14
|
||||
AppendStoreVgpr(&code, 14, i);
|
||||
}
|
||||
AppendVMovU32(&code, 30, (inputs.size() - 1u) * 4u);
|
||||
AppendBufferLoadDword(&code, 14, 30);
|
||||
AppendVop3(&code, 0x1bbu, 15, Vgpr(14), 0);
|
||||
AppendStoreVgpr(&code, 15, inputs.size() - 1u);
|
||||
AppendEnd(&code);
|
||||
|
||||
TestCase test;
|
||||
test.name = "VectorFfbhI32NativeAndVop3OnGpu";
|
||||
test.code = std::move(code);
|
||||
test.initial.assign(inputs.begin(), inputs.end());
|
||||
test.expected = {0xffffffffu, 1u, 1u, 4u, 16u, 31u, 0xffffffffu, 1u};
|
||||
test.opcodes = {O::V_MOV_B32, O::BUFFER_LOAD_DWORD, O::V_FFBH_I32,
|
||||
O::BUFFER_STORE_DWORD, O::S_ENDPGM};
|
||||
test.decoded_counts = {{"V_FFBH_I32 v14, v14", inputs.size() - 1u},
|
||||
{"V_FFBH_I32 v15, v14", 1u}};
|
||||
return test;
|
||||
}
|
||||
|
||||
TestCase Vop1SdwaFfblCapturedHighWordSource() {
|
||||
using O = ShaderOpcode;
|
||||
|
||||
@@ -20492,6 +20523,7 @@ std::vector<TestCase> MakeCases() {
|
||||
AddCase(VectorMoves);
|
||||
AddCase(VectorVop3MoveAppliesFloatSourceModifiers);
|
||||
AddCase(VectorIntegerOps);
|
||||
AddCase(VectorFfbhI32NativeAndVop3OnGpu);
|
||||
AddCase(Vop1SdwaFfblCapturedHighWordSource);
|
||||
AddCase(Vop1SdwaNotCapturedByte0Source);
|
||||
AddCase(Vop2SdwaSubNcExactByte2Destination);
|
||||
|
||||
@@ -4019,6 +4019,18 @@ void TestNewShaderDecoderArchitecture() {
|
||||
cmp_eq_u64.src1.kind == OperandKind::VccLo,
|
||||
"decoder rejected the captured VOP3 V_CMP_EQ_U64 instruction");
|
||||
|
||||
const uint32_t ffbh_i32_code[] = {0x7e1c770eu};
|
||||
Instruction ffbh_i32;
|
||||
Check(DecodeInstruction(ffbh_i32_code, 0u, ffbh_i32, &error),
|
||||
error.c_str());
|
||||
Check(ffbh_i32.family == Family::VOP1 &&
|
||||
ffbh_i32.opcode == Opcode::V_FFBH_I32 &&
|
||||
ffbh_i32.dst.kind == OperandKind::Vgpr && ffbh_i32.dst.reg == 14u &&
|
||||
ffbh_i32.src_count == 1u &&
|
||||
ffbh_i32.src0.kind == OperandKind::Vgpr &&
|
||||
ffbh_i32.src0.reg == 14u,
|
||||
"decoder rejected the captured VOP1 V_FFBH_I32 instruction");
|
||||
|
||||
const uint32_t literal_code[] = {EncodeVop1(0x01, 2, 255u), 0x12345678u};
|
||||
Instruction literal;
|
||||
Check(DecodeInstruction(literal_code, 0u, literal, &error), error.c_str());
|
||||
|
||||
Reference in New Issue
Block a user