Any usable SIMD implementation?

Johan Engelen via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 6 07:31:58 PDT 2016


On Wednesday, 6 April 2016 at 13:26:51 UTC, 9il wrote:
> On Wednesday, 6 April 2016 at 12:40:04 UTC, Manu wrote:
>> On 6 April 2016 at 07:41, Johan Engelen via Digitalmars-d 
>> <digitalmars-d at puremagic.com> wrote:
>>> [...]
>>
>> With respect to SIMD, knowing a processor model like 
>> 'broadwell' is not helpful, since we really want to know 
>> 'sse4'. If we know processor model, then we need to keep a 
>> compile-time table in our code somewhere if every possible cpu 
>> ever known and it's associated feature set. Knowing the 
>> feature we're interested is what we need.
>
> Yes, however this can be implemented in a spcial Phobos module. 
> So compilers would need less work. --Ilya

After browsing through some LLVM code, I think is actually very 
easy for LDC to also tell you about which features (sse2, avx, 
etc.) a target supports.

Probably the most difficult part is defining an API. Ilya made a 
start here:
http://forum.dlang.org/post/eodutgruoofruperrgif@forum.dlang.org
(but he doesn't like his earlier API "bool a = 
__target("broadwell")" any more ;-P , I also think enum cpu = 
__target(); would be nicer)



More information about the Digitalmars-d mailing list