Plan of Attack for SPIRV and NVPTX

Johan Engelen via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun May 22 03:13:02 PDT 2016


On Sunday, 22 May 2016 at 06:41:53 UTC, Nicholas Wilson wrote:
> Hello
>
> I have made a wiki entry for targeting SPIRV and NVPTX.
>
> I will have some time over the upcoming (southern hemisphere) 
> winter break to work on this.
>
> please comment and destroy.

Sounds like a great (tough!) project!

For plan of attack, what I would do is:

1. Get something _super_ simple working. For example, a kernel 
for vector addition.
    Don't do any legality checks, etc, really just get it to work. 
Code can be ugly hacks, whatever you need to get it to work.
This would teach you how to integrate the target into LDC. 
Possibly you find out that the design you started out with 
doesn't quite fit well, and so you may have to reimplement parts 
with a better design knowing what you've learned so far.

2. Legality: disable pretty much all fancy D features for @kernel 
stuff.
    Try to stay out of the ddmd code as much as possible, perhaps 
do the legality checking in an extra semantic pass (AST walk) in 
LDC code, an equivalent of a "semantic4" but with a better name.
    Add a ton of test cases.

3. Start implementing support for D features, slowly relaxing the 
legality contraints.



More information about the digitalmars-d-ldc mailing list