deplinenoise / tundra

Tundra is a code build system that tries to be accurate and fast for incremental builds
MIT License
438 stars 75 forks source link

Added support for targets with ISPC #337

Closed emoon closed 2 years ago

emoon commented 2 years ago

This PR adds support to specify different targets when using ISPC like this

ISPC {
    Pass = "IspcGen",
    Source = "lanes.ispc",
    Targets = "sse4,avx2"
},

When setting several targets to ISPC the compiler will generate one object file and one header for each target. The default function that one calls in this mode will do a run-time selection and call the appropriate one depending on instruction set the CPU supports. The user can chose to not use this function but instead calling function_name_<target> such as foobar_avx2 and do the detection themselves.

Changes in this PR does a bunch of things