mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 13:25:45 +00:00
glasm: Use CMP.S for Select32
also fixes ADD and SUB to use U modifier
This commit is contained in:
parent
b27f30fa2e
commit
94ee083286
3 changed files with 8 additions and 12 deletions
|
@ -24,12 +24,7 @@ void EmitSelectU16(EmitContext&, std::string_view, std::string_view, std::string
|
|||
|
||||
void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
|
||||
std::string_view true_value, std::string_view false_value) {
|
||||
ctx.Add("MOV.U.CC RC,{};", cond);
|
||||
ctx.Add("IF NE.x;");
|
||||
ctx.Add("MOV.U {},{};", inst, true_value);
|
||||
ctx.Add("ELSE;");
|
||||
ctx.Add("MOV.U {},{};", inst, false_value);
|
||||
ctx.Add("ENDIF;");
|
||||
ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value);
|
||||
}
|
||||
|
||||
void EmitSelectU64(EmitContext&, std::string_view, std::string_view, std::string_view) {
|
||||
|
@ -40,8 +35,9 @@ void EmitSelectF16(EmitContext&, std::string_view, std::string_view, std::string
|
|||
throw NotImplementedException("GLASM instruction");
|
||||
}
|
||||
|
||||
void EmitSelectF32(EmitContext&, std::string_view, std::string_view, std::string_view) {
|
||||
throw NotImplementedException("GLASM instruction");
|
||||
void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
|
||||
std::string_view true_value, std::string_view false_value) {
|
||||
ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value);
|
||||
}
|
||||
|
||||
void EmitSelectF64(EmitContext&, std::string_view, std::string_view, std::string_view) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue