x86 intrinsics for sale cheap

Johan j at j.nl
Wed May 31 16:07:55 UTC 2023


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:
>> I have been working on simple wrappers around new(ish) x86 
>> instructions that are not otherwise accessible. Also with 
>> replacement functions in straight D for machines where the 
>> instruction is not available. Currently only for GDC as LDC 
>> doesn’t support some of the features of GCC inline asm that I 
>> am relying on  - named parameters in the asm with %[name] 
>> syntax. But hopefully that will get fixed by the LDC 
>> maintainers, so I will be able to work with either compiler. 
>> My routines need more testing and a vast amount of cleanup. So 
>> it’s early days.
>>
>> Is that something that you would be interested in for the D 
>> runtime library? (For GDC / LDC ?) I unfortunately haven’t 
>> attacked DMD yet because that uses a different inline asm 
>> syntax, and would mean a rewrite. But that isn’t a problem 
>> because thr DMD user gets the pure D replacement anyway due to 
>> conditional compilation.
>>
>> If you are interested, then let me know. I do need help 
>> testing though and some advice about unit tests.
>
> 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




More information about the Digitalmars-d mailing list