Open bit-hack opened 8 years ago
Should we be making the abstraction between implementations at a different level? Intrinsic level?
I was thinking about having intrinsic_traits
which would have architecture specific specialisations, this would allow the float4
type to contain only the logic and keep the details of the intrinsics elsewhere.
Selecting the intrinsic_traits
would depend on #ifdef
's and a using intrinsic_traits = x86_intrinsic_tratis
on each path.
How does that sound?
If I understand correctly then this would be an interesting approach. This would however be limited by however well two vector instruction sets map to each other. It seems like it would be worth trying out this approach and seeing how it fairs. Perhaps we/I should knock up a WIP branch and try to add some very basic Neon stuff and see how it looks?
We should think about how to support multiple implementations of our vector classes. One thought would be to make changes similar to the following:
Its quite nice that we can also reuse our test suite to test all of these specializations and ensure they are equivalent, by just changing the platform and compiler flags.