Uh oh!
There was an error while loading. Please reload this page.
Add Hexagon support - #41524
Conversation
rust-highfive
commented
Apr 25, 2017
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
michaelwu
commented
Apr 25, 2017
I also have a wip for support for HVX v60 intrinsics in librustc_platform_intrinsics, but I haven't tested it on the emulator yet. |
This requires an updated LLVM with D31999 and D32000 to build libcore. A basic hello world builds and runs successfully on the hexagon simulator.
michaelwu
commented
Apr 25, 2017
Oh. Looks like the builder is using an older system llvm which has a hexagon backend without an assembly parser. Should I avoid old llvms somehow? Or do we need a newer docker image? |
We want to support older LLVM versions (currently 3.7 upwards) for the sake of distros and other people building rustc with their own LLVM, and hence we have a few (one?) builder that tests that. However, there's no need to support each and every feature with older LLVM, so as long as it builds and tests pass, everything's fine. So in the worst case, you could disable the Hexagon target when building with an older LLVM. (Of course, if everything except the asm parser can be made to work with reasonable effort, that's good as well.) Edit: You could repurpose the version query in the build script to not include the |
Just noticed your edit after pushing a commit to do exactly that. I put in a version check requiring LLVM 4 or newer. Looks like LLVM 3.8 added the asm parser, but that's not likely to build libcore successfully. Probably actually need LLVM 5, but there's a chance LLVM 4 can work if we backport the necessary fixes. |
michaelwu
commented
Apr 26, 2017
Turns out LLVM 4.0 plus some hexagon fixes does work, so I'll put up a PR for that soon. |
arielb1
commented
Apr 26, 2017
alexcrichton
commented
Apr 26, 2017
Looks good to me, thanks for the PR! @michaelwu lemme know when you're good on testing (e.g. when .travis.yml changes are back to normal) and I'll r+ |
michaelwu
commented
Apr 26, 2017
@alexcrichton I think I've tested enough. I just added a commit to build hexagon in LLVM by default since the rest of the hexagon support in rust is going to be built anyway, so why not.. |
alexcrichton
commented
Apr 26, 2017
Just to confirm, but could you measure the before/after size of LLVM compiling in hexagon? Just want to make sure we're not surprisingly adding like 100MB of extra libs. |
michaelwu
commented
Apr 26, 2017
On a release build of LLVM on x86-64 Linux, I'm measuring an increase of 30MB in the bin, include, and lib directories. llc is increased by about 2MB. |
hanna-kruppe
commented
Apr 26, 2017
That doesn't matter, what's interesting for Rust is the size increase of the Rust toolchain (e.g., |
michaelwu
commented
Apr 26, 2017
Agreed - I'm doing full rust builds to see what happens. LLVM only size comparisons were faster to do. I expect the size increase to be close to the increase in llc's size though. |
michaelwu
commented
Apr 26, 2017
stage1 directory increases by about 5mb. |
alexcrichton
commented
Apr 26, 2017
Ok, that seems pretty reasonable, thanks for taking a look! @bors: r+ |
michaelwu
commented
Apr 26, 2017
Hm, did bors miss that r+? |
alexcrichton
commented
Apr 26, 2017
@bors: r+ |
bors
commented
Apr 26, 2017
📌 Commit 22eb3c6 has been approved by |
alexcrichton
commented
Apr 26, 2017
there we go! |
…hton Add Hexagon support This requires an updated LLVM with https://reviews.llvm.org/D31999 and https://reviews.llvm.org/D32000 to build libcore. A basic hello world builds and runs successfully on the hexagon simulator. libcore is fine with LLVM fixes, but libstd requires a lot more work since there's a custom rtos running on most hexagon cores. Running Linux sounds possible though, so maybe getting linux + musl going would be easier. Here's the target file I've been using for testing ``` { "arch": "hexagon", "llvm-target": "hexagon-unknown-elf", "os": "none", "target-endian": "little", "target-pointer-width": "32", "data-layout": "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048", "linker": "hexagon-clang", "linker-flavor": "gcc", "executables": true, "cpu": "hexagonv60" } ```
…hton Add Hexagon support This requires an updated LLVM with https://reviews.llvm.org/D31999 and https://reviews.llvm.org/D32000 to build libcore. A basic hello world builds and runs successfully on the hexagon simulator. libcore is fine with LLVM fixes, but libstd requires a lot more work since there's a custom rtos running on most hexagon cores. Running Linux sounds possible though, so maybe getting linux + musl going would be easier. Here's the target file I've been using for testing ``` { "arch": "hexagon", "llvm-target": "hexagon-unknown-elf", "os": "none", "target-endian": "little", "target-pointer-width": "32", "data-layout": "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048", "linker": "hexagon-clang", "linker-flavor": "gcc", "executables": true, "cpu": "hexagonv60" } ```
michaelwu
commented
May 15, 2017
For anyone who wants an example of how to use this, I just put up https://github.com/michaelwu/hexagon-hello-world |
This requires an updated LLVM with https://reviews.llvm.org/D31999 and https://reviews.llvm.org/D32000 to build libcore.
A basic hello world builds and runs successfully on the hexagon simulator. libcore is fine with LLVM fixes, but libstd requires a lot more work since there's a custom rtos running on most hexagon cores. Running Linux sounds possible though, so maybe getting linux + musl going would be easier.
Here's the target file I've been using for testing