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

Support zero and sign extension for ARMv7 #798

Open
sarranz opened this issue May 17, 2024 · 1 comment
Open

Support zero and sign extension for ARMv7 #798

sarranz opened this issue May 17, 2024 · 1 comment
Labels
arm Related to the arm port feature request

Comments

@sarranz
Copy link
Collaborator

sarranz commented May 17, 2024

This doesn't work

export fn main() -> reg u32 {
    reg u16 x;
    x = 0;
    reg u32 r;
    r = (32u)x;
    return r;
}

We need to use the UBFX and SBFX instructions that are already implemented in the compiler,. The problem is the U32 restriction for all arm related things.

@sarranz sarranz added feature request arm Related to the arm port labels May 17, 2024
@sarranz
Copy link
Collaborator Author

sarranz commented May 23, 2024

We can do this with the instructions from #805, I don't know if there's any reason to prefer one or the other.
Edit: it looks like UXTH/UXTB have a smaller encoding than UBFX, but in general we always want to be 32bit aligned and in this case it doesn't make any difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Related to the arm port feature request
Projects
None yet
Development

No branches or pull requests

1 participant