Skip to content

umaal instruction #112

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

Closed
pftbest opened this issue Oct 16, 2016 · 8 comments
Closed

umaal instruction #112

pftbest opened this issue Oct 16, 2016 · 8 comments

Comments

@pftbest
Copy link
Contributor

pftbest commented Oct 16, 2016

So I was playing with compiler-builtins-snapshot in qemu, and my program was hanging for no apparent reason. Then I looked into the code that was causing problems and found this instruction:

0x3c8a <core::num::flt2dec::strategy::grisu::format_shortest_opt+652>   umaal  r1, r5, r2, r3

This instruction should not be used on thumbv7m-none-eabi target.

@japaric
Copy link
Member

japaric commented Oct 17, 2016

umaal

This is a Cortex-M4 or newer instruction and shouldn't be generated by the thumbv7m target.

Do you have steps to reproduce? This sounds like the built-in thumbv7m target could be missing a "negative" LLVM feature. Are you passing any extra compiler flag related to codegen, like -C cpu=? Are you linking to C code?

@pftbest
Copy link
Contributor Author

pftbest commented Oct 17, 2016

you can compile the code in question, it is on https://github.com/pftbest/rplayground

@japaric
Copy link
Member

japaric commented Oct 17, 2016

The instruction doesn't seem to come from compiler-builtins-snapshot AFAICT:

$ cargo clone compiler-builtins-snapshot && cd $_

$ xargo build --target thumbv7m-none-eabi

$ arm-none-eabi-objdump -CD target/thumbv7m-none-eabi/debug/libcompiler_builtins_snapshot.rlib | grep uma || echo no matches
no matches

$ xargo build --target thumbv7m-none-eabi --release

$ arm-none-eabi-objdump -CD target/thumbv7m-none-eabi/release/libcompiler_builtins_snapshot.rlib | grep uma || echo no matches
no matches

@japaric
Copy link
Member

japaric commented Oct 17, 2016

I see you have two .json files in your project. Could you, by mistake, by using the stm32f429zi target with QEMU instead of the qemu target? The former is a thumbv7em target and its binaries would have the umaal instruction.

@pftbest
Copy link
Contributor Author

pftbest commented Oct 17, 2016

Could you, by mistake by using the stm32f429zi

no, it is commented out in the Makefile, I always use make clean make all and make run to build and run the project.

The instruction doesn't seem to come from compiler-builtins-snapshot

This may be the case, I'm not sure where it comes from, maybe it is from libcore, as is suggested by the core::num::flt2dec::strategy::grisu::format_shortest_opt prefix

@japaric
Copy link
Member

japaric commented Oct 17, 2016

Yes, they are coming from libcore. This is a bug in the target definition and should be fixed upstream, in rust-lang/rust.

@japaric
Copy link
Member

japaric commented Oct 17, 2016

Filed rust-lang/rust#37227

@japaric japaric closed this as completed Oct 17, 2016
@pftbest
Copy link
Contributor Author

pftbest commented Oct 17, 2016

Thank you

tgross35 pushed a commit to tgross35/compiler-builtins that referenced this issue Feb 23, 2025
112: [WIP]: implement atan2 r=japaric a=P1n3appl3

This depends on `atan()`. There was a pr for that but it seems to have been closed without adding it?

Co-authored-by: Joseph Ryan <[email protected]>
Co-authored-by: Jorge Aparicio <[email protected]>
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

2 participants