I'm trying to come up with a definition of Vector4 that wouldn't make ispc 
generate performance warnings wrt gather/scatter:
https://ispc.godbolt.org/z/ctMCVa

Can anyone show me a Vector4 (or Vector3) struct that is warning-free?
Here are my tests, all resulting in warnings:

struct Vector4
{
    float X, Y, Z, W;
};

struct Vector4A
{
    float V[4];
};

struct Vector4SOA
{
    float<4> V;
};

export void SOATest(uniform Vector4SOA outs[], uniform Vector4SOA ins[], 
uniform int count)
{
    foreach (i = 0 ... count)
    {
        Vector4SOA vv = ins[i];
        vv.V[0]++;
        outs[i] = vv;
    }
}

export void ATest(uniform Vector4A outs[], uniform Vector4A ins[], uniform 
int count)
{
    foreach (i = 0 ... count)
    {
        Vector4A vv = ins[i];
        vv.V[0]++;
        outs[i] = vv;
    }
}

export void Test(uniform Vector4 outs[], uniform Vector4 ins[], uniform int
 count)
{
    foreach (i = 0 ... count)
    {
        Vector4 vv = ins[i];
        vv.X++;
        outs[i] = vv;
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ispc-users/89895d8a-9c02-4f56-a4e0-39d6e292d9e4%40googlegroups.com.

Reply via email to