mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-16 00:58:01 -05:00
glasm: Catch more register leaks
Add support for null registers. These are used when an instruction has no usages. This comes handy when an instruction is only used for its CC value, with the caveat of having to invalidate all pseudo-instructions before defining the instruction itself in the register allocator. This commits changes this. Workaround a bug on Nvidia's condition codes conditional execution using branches.
This commit is contained in:
@ -23,7 +23,13 @@ void EmitIdentity(EmitContext&, IR::Inst& inst, const IR::Value& value) {
|
||||
}
|
||||
|
||||
void EmitConditionRef(EmitContext& ctx, IR::Inst& inst, const IR::Value& value) {
|
||||
ctx.Add("MOV.S {},{};", inst, ScalarS32{ctx.reg_alloc.Consume(value)});
|
||||
// Fake one usage to get a real register out of the condition
|
||||
inst.DestructiveAddUsage(1);
|
||||
const Register ret{ctx.reg_alloc.Define(inst)};
|
||||
const ScalarS32 input{ctx.reg_alloc.Consume(value)};
|
||||
if (ret != input) {
|
||||
ctx.Add("MOV.S {},{};", ret, input);
|
||||
}
|
||||
}
|
||||
|
||||
void EmitBitCastU16F16(EmitContext&, IR::Inst& inst, const IR::Value& value) {
|
||||
|
Reference in New Issue
Block a user