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

Armv7m compiler rt #2150

Merged
merged 6 commits into from
Apr 1, 2019
Merged

Conversation

justinbalexander
Copy link
Contributor

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

Copy link
Member

@andrewrk andrewrk left a 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?

@andrewrk
Copy link
Member

andrewrk commented Apr 1, 2019

I opened an issue for the reason the tests are failing: #2154

As a workaround can you remove inline and add a comment linking to the issue?

@justinbalexander
Copy link
Contributor Author

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.

@justinbalexander
Copy link
Contributor Author

Also, sorry about the failing test. I'm stilling having issues with my build setup. I think I've got it figured out now.

@andrewrk
Copy link
Member

andrewrk commented Apr 1, 2019

Also, the functions that are failing in the build log are in addXf3.zig. mulXf3 doesn't have them listed as inline.

Right, I first ran into this issue when doing the mulXf3 functions and had to remove the inline for them. I didn't make the issue until now though.

@andrewrk andrewrk merged commit 3199792 into ziglang:master Apr 1, 2019
@andrewrk
Copy link
Member

andrewrk commented Apr 1, 2019

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?

@justinbalexander
Copy link
Contributor Author

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.

@andrewrk
Copy link
Member

andrewrk commented Apr 1, 2019

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
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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.

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.

3 participants