On 25/06/12 09:56, Timothy Normand Miller wrote:

  What I'm doing right NOW is working on the
option where there are complex predicates and compare instructions
that don't know the condition.

I'm not sure to understand.
Can you provide an example ?

Option A:  Simple compare instructions, multiple condition flags, and
a complex condition code on every instruction.
Option B:  Multiple specialized compare instructions, few condition
flags, simple condition code on every instruction.
Option C:  No predication.

I'm not sure ARM style predication will work for GPU or GPGPU
loads. My understanding is that predicates work well for the
code in typical integer loads where moves often depend on the
outcome of arithmetic, like

if (a == b)
    c = 0;
else
    c = d;

For GPUs, though, the much more common pattern is for one
math result to be used to determine whether more math will be
needed, with longer instructions sequences between decision
points. Typical is the specular lighting component in the ADS
lighting calc:

if (dot(normal, normalize(lightSource.position) > 0) {
    halfDotV = max(0.0, dot(normal, lightSource.halfVector));
    spec = material.specular * pow(halfDotV, material.shininess);
}

AFAIK it won't be possible to use predication for this unless
every math instruction has two variants, one which sets the
condition codes and one which doesn't.

Predicated (conditional) move instructions would be very handy
though, as there are a lot of min/max/clamp operations in GPU
graphics code.

        cheers,
        Hugh Fisher
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to