-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
expose CPU and features as part of the target #2051
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
Comments
Thanks for typing up the issue. Float-abi = hard should work by specifying As for Lines 7830 to 7835 in f2ca2ac
This is something I haven't looked into yet to know the best way to do it, but I'd accept a pull request that provides a workaround exposing this option to the CLI (and the build system which is mostly in |
I figured that's what the hf was doing, but I couldn't see the end result
without the fpu being specified and functional.
Thanks.
…On Mon, Mar 11, 2019 at 3:15 PM Andrew Kelley ***@***.***> wrote:
Thanks for typing up the issue. Float-abi = hard should work by specifying gnueabihf,
eabihf, or musleabihf` for the target ABI. Is that not working?
As for -fpu=fpv4-sp-d16, I think this is a general problem of exposing
CPU args/features. I'm guessing here:
https://github.com/ziglang/zig/blob/f2ca2ace0943a81e0fc5b59347feac177a71eb6c/src/codegen.cpp#L7830-L7835
This is something I haven't looked into yet to know the best way to do it,
but I'd accept a pull request that provides a workaround exposing this
option to the CLI (and the build system which is mostly in std/build.zig).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2051 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Alxei4XkGC6-C5QLHh1_rSV4F16mx3WQks5vVrlhgaJpZM4bpczg>
.
|
I think this issue may be a bit difficult for drive-by contributors. I'll repeat the comment I made on a pull request here: Although LLVM is currently the only backend of Zig, the language does not depend on LLVM, and it is planned to support non-LLVM backends. Even though the target cpu and features options need to eventually be given to LLVM in a way that LLVM understands, we still need to expose these options in a way that is independent of LLVM. That means the CLI option cannot be called --llvm-cpu or --llvm- anything. zig targets must list all the possible options. The CLI should be able to reject invalid options without consulting LLVM. I recognize this is in direct contradiction with my earlier comment, and I apologize for that. Sometimes it takes me a while to realize the path forward. |
I'm not sure I'll be able to do it in time for 0.5.0, but I'll give this a slight priority bump, at the expense of other issues in the 0.5.0 milestone. |
I accidentally made a duplicate issue here: #2883 But since that issue has the checklist, I'll make this one refer to that one. I consider this a high priority issue for this milestone. |
When building for a Cortex-M4F there is currently no way to tell LLVM to use the floating point unit on the processor.
With clang you can pass the option -mfpu=fpv4-sp-d16 and -mfloat-abi=hard and it will output the correct assembly and use the FPU.
Using the options "-mllvm -float-abi=hard -mllvm -fpu=fpv4-sp-d16" gives an llvm error unless I am mistaken.
Regardless, having a zig native way to specify those options would be nice.
The text was updated successfully, but these errors were encountered: