x86 intrinsics for sale cheap

max haughton maxhaton at gmail.com
Wed May 31 16:45:35 UTC 2023


On Wednesday, 31 May 2023 at 16:33:47 UTC, Cecil Ward wrote:
> On Wednesday, 31 May 2023 at 16:07:55 UTC, Johan wrote:
>> On Wednesday, 31 May 2023 at 15:58:53 UTC, Cecil Ward wrote:
>>> On Wednesday, 31 May 2023 at 15:56:45 UTC, Cecil Ward wrote:
>>>> [...]
>>>
>>> The instructions are those that were new with the Haswell 
>>> micro architecture so that’s what ten years ago now, so now 
>>> is the time that these instructions will become more usable 
>>> for programmers worried about older machines, and there are 
>>> the fallbacks too, as far as I have got with that.
>>
>> Are you aware of intel-intrinsics? 
>> https://code.dlang.org/packages/intel-intrinsics
>> It sounds like you are duplicating the effort; better to team 
>> up with that project.
>>
>> -Johan
>
> Yes, I am very aware, and was even thinking of using the same 
> names. My goals are rather different though and I don’t use the 
> same non-standard __xmm256 type names (or whatever). Those 
> Intel routines don’t have a fallback equivalent though for 
> machines where the instruction isn’t available so there’s some 
> Intel sales promotion in there since you do need to have a 
> sufficiently new CPU or nothing.
>
> And I’m concentrating solely on D, not trying to write thing in 
> C, put another wrapper round that for D and then hope it all 
> still inlines with zero overhead parameter passing.
>
> Lastly, those Intel intrinsics are I assume, unless I’m wrong, 
> restricted to the Intel C/C++ compiler. And I’m GDC/LDC only.
>
> So quite a gulf there and I’m not solely trying to do the same 
> thing. And it’s D first, and with zero overhead being a 
> requirement.

You and Johan might be talking past each other here, 
"intel-intrinsics" in this case refers to p0nce's implementation 
of Intel's intrinsic (names and semantics) in D. There is no 
dependency on any Intel software. There are some traps that he 
has worked around that you will bump into at some point, so I 
recommend looking closely at what he has done. A subset also work 
on Arm.


More information about the Digitalmars-d mailing list