F16SOP#
Format: F16SOP jDest, kDest, movDest, jArgumentA, jArgumentE, jOp, jArgumentB, jArgumentF, kArgumentC, kArgumentG, kOp, kArgumentD, kArgumentH, movSource
Phase0: F16SOP W0{.E0|.E1}.jOut, (W0|W1){.E0|.E1}.kOut, (W1|_), Sn{.E0|.E1}{.NEG}, (Sn|0){.E0|.E1}{.ONEMINUS}, jOp, Sn{.E0|.E1}{.NEG}, (Sn|0){.E0|.E1}{.ONEMINUS}, Sn{.E0|.E1}{.NEG}, (Sn|0){.E0|.E1}{.ONEMINUS}, kOp, Sn{.E0|.E1}{.NEG}, (Sn|0){.E0|.E1}{.ONEMINUS}, (S3|_)
Phase1: -
Phase2: -
Description: 16-bit floating point sum of products, one source.
a, b, c, d = {S0, S1, S2, S3, S4, S5}.
z = min(s1, 1 - s0)
e, f, g, h = {S0, S1, S2, S3, S4, S5} or z.
v, w, x, y = {S0, S1, S2, S3, S4, S5}.
jop = any of {add, sub, min, max, rsub, mad}
kop = any of {add, sub, min, max, rsub}
if (jop == mad)
{
W0.e0 = a*e+v
W1.e0 = b*f+x
W0.e1 = c*g+w
W1.e1 = d*h+y
}
else
{
j = (a * e) jop (b * f)
k = (c * g) kop (d * h)
if (rfmt(1) = 1)
{
w1 = toF32([k)
w0 = toF32([j)
}
else if (rfmt(0) = 1) then
{
w0[31:16] = one of {j, a, b}
w0[15:0] = one of {k, c, d}
}
else
{
w0[31:16] = one of {k, c, d}
w0[15:0] = one of {j, a, b}
}
}
Example:
void main()
{
mediump vec4 a16 = a;
mediump vec4 b16 = b;
mediump vec4 c16 = c;
fragColor = a16 * b16 + c16;
}
2 : sop r0.joutj, sh4, i3, add, sh8, 0.oneminus
sop r1.koutk, sh5, i1, add, i0, 0.oneminus