-
-
Notifications
You must be signed in to change notification settings - Fork 741
std.simd work in progress, for consideration #2862
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
Conversation
…ufMask had inverse order of arguments compared to the current one).
Adding LDC support. Added LDC support to more functions. More LDC support. More LDC support. Added a shitload of LLVM intrinsic declaration and changed most of version(GNU) to version(GNU_OR_LDC). More LDC support. Use ldc.gccbuiltins. Fixed a few bugs. Fixed a bug in swizzle in parseElements. Made toFloat, toInt and toDouble work when the argument and the result have the same type. Moved std.simd.numElements definition to a separate template, which stops LDC from allocating an array at run time. Made a few things work with GDC. Added support for byte, ubyte, short and ushort vectors to GDC version of swizzle Added void16 to isVector. Replaced spaces with tabs and removed trailing whitespace Uncomented safe, pure, @nothrow.
…nline_ir. Implemented maskEqual and others for all types. Made more function instances work Made abs() work with unsigned numbers. I think just returning the parameter is more useful here than causing an error. Made abs() work with long2 (using the same implementation as for byte16). Made min() and max() work with long2 and ulong2. Use inline llvm ir in loadUnaligned Also made the naming of variables inside shufflevector, insertelement, etc. more consistent. Use ldc.simd.
Supports const/immutable/shared. Fixed some bugs.
Noice! ETA for getting this to reviewable state? |
I really don't know, there are hurdles... There's a bunch of things, I'll attempt to recall the complete set and perhaps bug them individually or something? |
Yes, "bug" them individually in Bugzilla sounds like a good idea. |
ping |
I saw that @lakh has done his own implementation - maybe he might be able to tell us his reasons. |
It's still blocked on the compilers. I still have no way to detect what simd version was supplied to the compiler on the command line on GCC/Clang, and DMD has no such concept. The library can't emit opcodes that violate the simd level request made to the compiler; I need to know the level requested and then I can produce the best code for that level using static if. @greenify His implementation comes at it from a totally different angle. His focuses on just wrapping up the arch-specific intrinsics rather than making a usable portable library, it's lower level than mine. It has its place, but I obviously don't agree that's the right approach or I would have written mine that way. Anyone who wants to hit the intrinsics directly will do just that. I tried very hard to strike a practical balance between low-level-ness, efficiency, high-level-usability, and portability. |
@TurkeyMan Are there bugs for these problems? |
See the |
ping @TurkeyMan - did the SIMD discussion solve your problems? |
Not really. Anyway, I am keen to see this done, but it's a particularly hard module to get right. I think it might be best to approach broken into small sets of related functions? |
Yep I would recommend to put it on dub, it's more visible to other people, easier to test and submit PRs ;-) |
It's been there for like, a long time: https://code.dlang.org/packages/simd |
Why not make it work on one architecture just to start? Because it's experimental your proposal doesn't have to be feature complete. |
I'm going to close this as it'll have to go through the Phobos review process regardless, and it's on dub so there's not a huge rush to get it into Phobos. |
is it a dead feature request with any interest ? |
Well, the package is on dub (https://code.dlang.org/packages/simd) and so far there hasn't been much interest in pushing this into phobos. That being said, this is up for take for anyone who's willing to push for this and open a PR to |
@bioinfornatics I recommend checking out https://github.com/AuburnSounds/intel-intrinsics |
I'm still interested in this, but it needs to be done in a more incremental manner. It's impossible to get any major development through here without doing it in small steps. |
FWIW we could start with a very small |
I'll leave this here for visibility and commentary.