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

Replace asm macros by rust macros #730

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

jannic
Copy link
Member

@jannic jannic commented Dec 18, 2023

According to https://doc.rust-lang.org/stable/reference/inline-assembly.html#directives-support the assembly directive .macro is not part of the supported subset.

The reference further explains: "The result of using other directives is assembler-specific (and may cause an error, or may be accepted as-is)"

So while it obviously works right now, it might cause issues in future versions of rust. Not sure if this would be avoided as a breaking change. To be on the safe side, replace asm macros by rust macros.

According to https://doc.rust-lang.org/stable/reference/inline-assembly.html#directives-support
the assembly directive `.macro` is not part of the supported subset.

The reference further explains: "The result of using other directives is
assembler-specific (and may cause an error, or may be accepted as-is)"

So while it obviously works right now, it might cause issues in future
versions of rust. Not sure if this would be avoided as a breaking
change. To be on the safe side, replace asm macros by rust macros.
@thejpster
Copy link
Member

Have we checked that the asm generated is the same / equivalent? And/or have we run some tests on hardware?

@jannic
Copy link
Member Author

jannic commented Dec 21, 2023

Have we checked that the asm generated is the same / equivalent? And/or have we run some tests on hardware?

Unfortunately the generated binaries are different. But the changes are not in the division functions. It's things like changed register allocations all over the place. I don't know why rustc acts that way.

The few binaries I tried on real hardware do work.

@jannic jannic merged commit 7c9117c into rp-rs:main Dec 22, 2023
8 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants