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

Confusing treatment of immediates #882

Open
sarranz opened this issue Aug 27, 2024 · 0 comments
Open

Confusing treatment of immediates #882

sarranz opened this issue Aug 27, 2024 · 0 comments
Labels

Comments

@sarranz
Copy link
Collaborator

sarranz commented Aug 27, 2024

This code works

export
fn ok(reg u64 x) -> reg u64 {
    x = x;
    x ^= 3 |64u 0xffffffff;
    return x;
}

but this doesn't

export
fn bad(reg u64 x) -> reg u64 {
    x = x;
    x ^= 3 | 0xffffffff;
    return x;
}

because the operator is assumed to have size 256. Moreover, this works

export
fn worse(reg u64 x) -> reg u64 {
    x = x;
    x ^= 3 + 0xffffffff;
    return x;
}

which I find confusing. Is there a good reason for this?

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

No branches or pull requests

1 participant