Thread overview
[Issue 18865] Add x86 SIMD Intrinsics to druntime
Dec 11, 2020
ponce
Jan 07, 2021
ponce
Apr 25, 2022
ponce
Oct 27, 2022
ponce
Oct 28, 2022
Jack Stouffer
Oct 28, 2022
Richard Cattermole
Nov 01, 2022
ponce
Nov 01, 2022
ponce
Dec 17, 2022
Iain Buclaw
December 11, 2020
https://issues.dlang.org/show_bug.cgi?id=18865

ponce <aliloko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aliloko@gmail.com

--- Comment #1 from ponce <aliloko@gmail.com> ---
intel-intrinsics has equivalent for:
  mmintrin.h
  xmmintrin.h
  emmintrin.h
  pmmintrin.h

--
January 07, 2021
https://issues.dlang.org/show_bug.cgi?id=18865

ponce <aliloko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |SIMD

--
April 25, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

--- Comment #2 from ponce <aliloko@gmail.com> ---
Since then, added support for:
    tmmintrin.h
    smmintrin.h
    nmmintrin.h

And a few others that are only partially done.

--
October 27, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

--- Comment #3 from ponce <aliloko@gmail.com> ---
I suggest that this bug should be closed. Moving intel-intrinsics to duntime would be possible of course, but not trivial or desirable I think.

--
October 28, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

--- Comment #4 from Jack Stouffer <jack@jackstouffer.com> ---
(In reply to ponce from comment #3)
> I suggest that this bug should be closed. Moving intel-intrinsics to duntime would be possible of course, but not trivial or desirable I think.

I disagree. I think a systems programming language should absolutely have as good out-of-the-box support for SIMD types and intrinsics as clang or gcc (at least for x64, NEON would be nice). Mainstream Intel SIMD is over 20 years old; the idea of a systems language not having great support for this would be as odd as not having support for atomic intrinsics.

BTW core.atomic is a good example of what we already have in druntime. It already special cases atomic operators between inline ASM for DMD and LLVM intrinsic calls for LDC (at least LDC's overloaded version does anyway). So I don't see why we couldn't do the same thing for Intel intrinsics.

--
October 28, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

Richard Cattermole <alphaglosined@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaglosined@gmail.com

--- Comment #5 from Richard Cattermole <alphaglosined@gmail.com> ---
(In reply to Jack Stouffer from comment #4)
> BTW core.atomic is a good example of what we already have in druntime. It already special cases atomic operators between inline ASM for DMD and LLVM intrinsic calls for LDC (at least LDC's overloaded version does anyway). So I don't see why we couldn't do the same thing for Intel intrinsics.

core.atomic is a great example of when intrinsics need to be compiler backed and not emulated by inline assembly.

core.atomic can be 3-4 call stacks deep before the inline assembly actually gets executed. This gives plenty of time for whatever was returned to no longer be true. This is a major problem for lock-free concurrent programming.

It is how you get segfaults, please don't ask me how I know.

--
November 01, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

--- Comment #6 from ponce <aliloko@gmail.com> ---
> So I don't see why we couldn't do the same thing for Intel intrinsics.

"intel-intrinsics" need not become an unmaintained thing in druntime.

--
November 01, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

--- Comment #7 from ponce <aliloko@gmail.com> ---
(In reply to Jack Stouffer from comment #4)
> I don't see why we couldn't do the same thing for Intel intrinsics.

Because it's a ton of work, hence why compiler writers did provide "builtins" but not "intrinsics".

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18865

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--