Operation Grouping#
It is better to group scalar and vector operations separately. This way the compiler can pack more operations into a single cycle.
fragColor.xyz = t.xyz * t.x * t.y * t.wzx * t.z * t.w; // seven cycles
{sop, sop, sopmov}
{sop, sop, sopmov}
{sop, sop}
{sop, sop, sopmov}
{sop, sop}
{sop, sop, sopmov}
{sop, sop}
-->
fragColor.xyz = (t.x * t.y * t.z * t.w) * (t.xyz * t.wzx); // four cycles
{sop, sop, sopmov}
{sop, sop, sopmov}
{sop, sop}
{sop, sop}