Thread overview
avx512 usage
Jan 21, 2018
Igor Shirkalin
Jan 21, 2018
Johan Engelen
Jan 21, 2018
Igor Shirkalin
Jan 25, 2018
David Nadlinger
January 21, 2018
Hello,

we use LDC to dynamically select compiled and optimized code with particular instructions set with help of @target pragma. To make this we take core.cpu module, but it can't detect avx512 instructions presence. Does LDC have its own some cpu instruction detection runtime routine(s) to make use of avx512-set?

Igor
January 21, 2018
On Sunday, 21 January 2018 at 12:52:41 UTC, Igor Shirkalin wrote:
> Hello,
>
> we use LDC to dynamically select compiled and optimized code with particular instructions set with help of @target pragma. To make this we take core.cpu module, but it can't detect avx512 instructions presence. Does LDC have its own some cpu instruction detection runtime routine(s) to make use of avx512-set?

You can use mir.cpuid:
https://code.dlang.org/packages/mir-cpuid
https://github.com/libmir/mir-cpuid

( It would be great if you could write an article about how you use dynamic selection and @target. It will be very helpful for other D programmers. Contact Mike Parker if you want to write something for the D blog, where he can help writing. https://github.com/mdparker . Thanks! )

-Johan


January 21, 2018
On Sunday, 21 January 2018 at 13:09:29 UTC, Johan Engelen wrote:
> On Sunday, 21 January 2018 at 12:52:41 UTC, Igor Shirkalin wrote:
>> Hello,
>>
>> we use LDC to dynamically select compiled and optimized code with particular instructions set with help of @target pragma. To make this we take core.cpu module, but it can't detect avx512 instructions presence. Does LDC have its own some cpu instruction detection runtime routine(s) to make use of avx512-set?
>
> You can use mir.cpuid:
> https://code.dlang.org/packages/mir-cpuid
> https://github.com/libmir/mir-cpuid
>
> ( It would be great if you could write an article about how you use dynamic selection and @target. It will be very helpful for other D programmers. Contact Mike Parker if you want to write something for the D blog, where he can help writing. https://github.com/mdparker . Thanks! )

Johan, thanks for mir.cpuid direction.
I'll call for Mike's help about an article if it is really interesting and useful/helpful for D programmers.

Igor

January 25, 2018
On Sunday, 21 January 2018 at 17:15:38 UTC, Igor Shirkalin wrote:
> I'll call for Mike's help about an article if it is really interesting and useful/helpful for D programmers.

Yes, please do! (We should make sure things are somewhat nicely cleaned up on the LDC side of things first, of course, but with your recent set of changes, this seems to be the case already anyway.)

 – David