Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAltivec/VSX support #42743
Comments
sanxiyn
added
the
O-PowerPC
label
Jun 19, 2017
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
hlandau
commented
Feb 13, 2018
•
|
The altivec intrinsics are already exposed ( Maybe rename this to "VSX support"? |
This comment has been minimized.
This comment has been minimized.
|
No :) the first part is getting the intrinsics then I'll need to add an adaptation layer in stdsimd to make so they behave the same on le and be. I'm still far from getting that done. (and the amount of instructions still not mapped is larger than it should) (yes I ended up writing the support myself...) |
This comment has been minimized.
This comment has been minimized.
|
So things have changed a bit. I have a branch implementing it in
The main blocker is the lack of a quality PowerPC emulator with support for altivec and VSX (qemu is giving us problems here). There are alternatives (rust-lang-nursery/stdsimd#176 (comment)) but they are outside our control which means that they might be unreliable over time. The second main blocker is that the altivec and vsx intrinsics are implemented with compiler magic in C, using function overloading (a feature not available in neither C nor Rust). That can be worked around with traits, and we can use sealed traits to avoid exposing those via The third main blocker is the lack of an intrinsics specification in machine readable form that could be used for automatic verification. The only document I've found is the OpenPower architecture ISA spec in PDF and the clang / gcc C++ headers. That is, the automatic verification tool is going to either have to parse a PDF, or C++ code. Both formats are not ideal. Maybe we could use rust-bindgen to generate Rust wrappers over the C++ code and parse the Rust code instead, but those headers use vector extensions of the corresponding compilers that rust-bindgen probably cannot handle right now. In any case, closing this issue requires a non-trivial amount of work. At least a couple of months for somebody working full-time on it. |
This comment has been minimized.
This comment has been minimized.
|
I interacted a bit with the llvm community to see if there is a simple way to extract the information we need from the intrinsics template file. I hadn't get through it since it involves look at In theory we could have OpenPower document the intrinsics the way we put them in rust and have a separate chapter of the Power ISA book for us, since we will need to repeat the little-endian adaptation for the instructions with endianness-bias we might not spare a large amount of time but might be another option. I'm quite sure @edelsohn can help us regarding having the CI running and decide which direction we can go. |
This comment has been minimized.
This comment has been minimized.
Does this chapter exist for C already? If so, generating it in xml or similar formats (assuming it is currently in tex or similar) might be enough for us to parse it. |
lu-zero commentedJun 18, 2017
Since llvm seems to have an almost viable intrinsics support now, is it possible to expose them in rust like the neon ones?