mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-10 03:35:00 -06:00
Merge 4c97c2ff51 into d7ccf25e6f
This commit is contained in:
commit
c98bfe4e95
@ -663,6 +663,18 @@ void EmitGetExec(EmitContext& ctx) {
|
||||
UNREACHABLE_MSG("Unreachable instruction");
|
||||
}
|
||||
|
||||
Id EmitGetExecLo(EmitContext& ctx) {
|
||||
const Id scope_subgroup = ctx.ConstU32(static_cast<u32>(spv::Scope::Subgroup));
|
||||
const Id ballot = ctx.OpGroupNonUniformBallot(ctx.U32[4], scope_subgroup, ctx.true_value);
|
||||
return ctx.OpCompositeExtract(ctx.U32[1], ballot, 0u);
|
||||
}
|
||||
|
||||
Id EmitGetExecHi(EmitContext& ctx) {
|
||||
const Id scope_subgroup = ctx.ConstU32(static_cast<u32>(spv::Scope::Subgroup));
|
||||
const Id ballot = ctx.OpGroupNonUniformBallot(ctx.U32[4], scope_subgroup, ctx.true_value);
|
||||
return ctx.OpCompositeExtract(ctx.U32[1], ballot, 1u);
|
||||
}
|
||||
|
||||
void EmitGetVcc(EmitContext& ctx) {
|
||||
UNREACHABLE_MSG("Unreachable instruction");
|
||||
}
|
||||
|
||||
@ -30,6 +30,8 @@ void EmitPhiMove(EmitContext&);
|
||||
void EmitJoin(EmitContext& ctx);
|
||||
void EmitGetScc(EmitContext& ctx);
|
||||
void EmitGetExec(EmitContext& ctx);
|
||||
Id EmitGetExecLo(EmitContext& ctx);
|
||||
Id EmitGetExecHi(EmitContext& ctx);
|
||||
void EmitGetVcc(EmitContext& ctx);
|
||||
void EmitGetSccLo(EmitContext& ctx);
|
||||
void EmitGetVccLo(EmitContext& ctx);
|
||||
|
||||
@ -2565,7 +2565,7 @@ enum class OperandField : u32 {
|
||||
VccHi,
|
||||
M0 = 124,
|
||||
ExecLo = 126,
|
||||
ExecHi,
|
||||
ExecHi = 127,
|
||||
ConstZero,
|
||||
SignedConstIntPos = 129,
|
||||
SignedConstIntNeg = 193,
|
||||
|
||||
@ -341,6 +341,20 @@ T Translator::GetSrc(const InstOperand& operand) {
|
||||
UNREACHABLE_MSG("unhandled SDWA");
|
||||
case OperandField::Dpp:
|
||||
UNREACHABLE_MSG("unhandled DPP");
|
||||
case OperandField::ExecLo:
|
||||
if constexpr (is_float) {
|
||||
value = ir.BitCast<IR::F32>(ir.GetExecLo());
|
||||
} else {
|
||||
value = ir.GetExecLo();
|
||||
}
|
||||
break;
|
||||
case OperandField::ExecHi:
|
||||
if constexpr (is_float) {
|
||||
value = ir.BitCast<IR::F32>(ir.GetExecHi());
|
||||
} else {
|
||||
value = ir.GetExecHi();
|
||||
}
|
||||
break;
|
||||
case OperandField::VccLo:
|
||||
if constexpr (is_float) {
|
||||
value = ir.BitCast<IR::F32>(ir.GetVccLo());
|
||||
|
||||
@ -210,6 +210,14 @@ U1 IREmitter::GetExec() {
|
||||
return Inst<U1>(Opcode::GetExec);
|
||||
}
|
||||
|
||||
U32 IREmitter::GetExecLo() {
|
||||
return Inst<U32>(Opcode::GetExecLo);
|
||||
}
|
||||
|
||||
U32 IREmitter::GetExecHi() {
|
||||
return Inst<U32>(Opcode::GetExecHi);
|
||||
}
|
||||
|
||||
U1 IREmitter::GetVcc() {
|
||||
return Inst<U1>(Opcode::GetVcc);
|
||||
}
|
||||
|
||||
@ -67,6 +67,8 @@ public:
|
||||
|
||||
[[nodiscard]] U1 GetScc();
|
||||
[[nodiscard]] U1 GetExec();
|
||||
[[nodiscard]] U32 GetExecLo();
|
||||
[[nodiscard]] U32 GetExecHi();
|
||||
[[nodiscard]] U1 GetVcc();
|
||||
[[nodiscard]] U32 GetVccLo();
|
||||
[[nodiscard]] U32 GetVccHi();
|
||||
|
||||
@ -84,6 +84,8 @@ OPCODE(ReadTcsGenericOuputAttribute, F32, U32,
|
||||
// Flags
|
||||
OPCODE(GetScc, U1, Void, )
|
||||
OPCODE(GetExec, U1, Void, )
|
||||
OPCODE(GetExecLo, U32, Void, )
|
||||
OPCODE(GetExecHi, U32, Void, )
|
||||
OPCODE(GetVcc, U1, Void, )
|
||||
OPCODE(GetVccLo, U32, Void, )
|
||||
OPCODE(GetVccHi, U32, Void, )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user