Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle f64 values in phis #168

Open
zbanks opened this issue Nov 5, 2021 · 0 comments
Open

Handle f64 values in phis #168

zbanks opened this issue Nov 5, 2021 · 0 comments

Comments

@zbanks
Copy link
Collaborator

zbanks commented Nov 5, 2021

Brought up by JoshDuMan on Discord from the appendGfx_message function in PM.

There is in the function that Ethan and I were working on, a set of inequalities that do

if (x > 1.0) {
} else if (X < 1.0) {
}

where 1.0 is a double
For the first load, mips2c correctly sees that the load into the comparison register is a double
But when the double 1.0 is reused for the second case, it seems to only see the 0 load into the register and outputs instead

if (x > 1.0) {
} else if (X < 0.0) {
}

The issue here is that the rhs of the comparison (1.0/0.0) is from a PhiExpr. In assign_phis(), although the type of the phi is known to be f64, it only reads the value from final_register_states of the main float reg, instead of combining it like InstrArgs.dreg() does.

This may get even more complicated if both regs are PhiExprs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant