mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 04:46:27 -05:00
glasm: Fix moving U64 immediates to registers in GLASM
This commit is contained in:
parent
80813b1d14
commit
8eb72ff0dc
2 changed files with 4 additions and 3 deletions
|
@ -43,7 +43,8 @@ struct RegWrapper {
|
|||
RegWrapper(EmitContext& ctx, Value value)
|
||||
: reg_alloc{ctx.reg_alloc}, allocated{value.type != Type::Register} {
|
||||
if (allocated) {
|
||||
reg = value.type == Type::F64 ? reg_alloc.AllocLongReg() : reg_alloc.AllocReg();
|
||||
const bool is_long{value.type == Type::F64 || value.type == Type::U64};
|
||||
reg = is_long ? reg_alloc.AllocLongReg() : reg_alloc.AllocReg();
|
||||
} else {
|
||||
reg = Register{value};
|
||||
}
|
||||
|
|
|
@ -289,9 +289,9 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF64> {
|
|||
case Shader::Backend::GLASM::Type::F32:
|
||||
break;
|
||||
case Shader::Backend::GLASM::Type::U64:
|
||||
return format_to(ctx.out(), "{}", Common::BitCast<f64>(value.imm_u64));
|
||||
return fmt::format_to(ctx.out(), "{}", Common::BitCast<f64>(value.imm_u64));
|
||||
case Shader::Backend::GLASM::Type::F64:
|
||||
return format_to(ctx.out(), "{}", value.imm_f64);
|
||||
return fmt::format_to(ctx.out(), "{}", value.imm_f64);
|
||||
}
|
||||
throw Shader::InvalidArgument("Invalid value type {}", value.type);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue