Open ColinChargyBentley opened 1 year ago
Hi, @ColinChargyBentley. You are right, stdlib is missing max/min functions for short vectors at the moment.
One possible approach to achieve optimal code is to use "fake varying" for implementing max/min (like @JeffRous here https://github.com/ispc/ispc/issues/2460).
uniform double<4> max(uniform const double<4> a, uniform const double<4> b)
{
uniform double<4> r;
foreach (i = 0 ... 4) {
r[i] = max(a[i], b[i]);
}
return r;
}
Hi,
In the meantime, do I have a workaround to indicate which instruction to use to compute double<4> max (in plain C++, I could use _mm256_max_ps) ?
Best regards, Colin Chargy