-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Armv7m compiler rt #2150
Armv7m compiler rt #2150
Conversation
…unctions to compiler-rt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for this contribution @vegecode. Does it work for you now? Did you also try targeting thumb?
I opened an issue for the reason the tests are failing: #2154 As a workaround can you remove |
Hey Andrew, I have not tried targeting thumb yet. The MCU I'm targeting is a Cortex M4 and it doesn't have an Arm instruction state, only Thumb-2. I can try it and see what happens. I suspect the code will be identical. I am running on the target currently. I can do release small for reasonable code, while release fast and release safe require me to make fake stubs for the missing compiler-rt functions I listed above in order to build. A release small and safe would be quite nice as the debug build is too big to be any use really on a microcontroller. I'll make an issue for it. Also, the functions that are failing in the build log are in addXf3.zig. mulXf3 doesn't have them listed as inline. |
Also, sorry about the failing test. I'm stilling having issues with my build setup. I think I've got it figured out now. |
Right, I first ran into this issue when doing the mulXf3 functions and had to remove the |
Thanks for this @vegecode. I know you ran into a lot of frustrating things when working on it. Are there any more blockers for your project? |
No more blockers. There are more compiler-rt functions needed and the built-in functions not being excluded is irritating, but that's it. Anything else I just need to make an issue for. Thanks for asking and for all your help. I do need to actually come up with something to do with Zig now that it's running! Maybe I'll try writing a simple RTOS. I really just want to help get Zig out there. I think embedded is a critical area for its success. Rust doesn't seem to be making a dent at all, so there is definitely space for it. |
I agree about the built in functions not being excluded is irritating. I opened #2062 for it. I could have sworn I addressed this already and solved it, but here we are. Maybe it is something simple. Anyway I'm confident it will be solved within a release cycle or two. |
asm volatile ( | ||
\\ mov r3, r1 | ||
\\ mov r1, r2 | ||
\\ mov r2, r3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this comes straight from llvm's compiler-rt, but is this tested? because it clobbers r3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can test this with armv7 hardware. Just compile for armv6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm. I didn't realize there was a r0 register.
The builtin functions that are getting included for no reason will still require:
__aeabi_fdiv
__aeabi_ddiv
__aeabi_fcmpeq
__aeabi_dcmpeq
__aeabi_dcmpgt
__aeabi_dcmplt