tgsi_exec: Jump over entirely non-taken THEN or ELSE branches.

TGSI has these nice labels for us for where to jump in this case, let's
use them.  Improves piglit arb_shader_image_load_store-shader-mem-barrier
runtime massively, though not enough to make the test really reasonable to
run.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9347>
This commit is contained in:
Eric Anholt
2021-03-01 12:23:56 -08:00
committed by Marge Bot
parent 3429c83f87
commit e2aff7425d

View File

@@ -5494,7 +5494,9 @@ exec_instruction(
mach->CondMask &= ~(1 << i);
}
UPDATE_EXEC_MASK(mach);
/* Todo: If CondMask==0, jump to ELSE */
/* If no channels are taking the then branch, jump to ELSE. */
if (!mach->CondMask)
*pc = inst->Label.Label;
break;
case TGSI_OPCODE_UIF:
@@ -5507,7 +5509,9 @@ exec_instruction(
mach->CondMask &= ~(1 << i);
}
UPDATE_EXEC_MASK(mach);
/* Todo: If CondMask==0, jump to ELSE */
/* If no channels are taking the then branch, jump to ELSE. */
if (!mach->CondMask)
*pc = inst->Label.Label;
break;
case TGSI_OPCODE_ELSE:
@@ -5518,7 +5522,10 @@ exec_instruction(
prevMask = mach->CondStack[mach->CondStackTop - 1];
mach->CondMask = ~mach->CondMask & prevMask;
UPDATE_EXEC_MASK(mach);
/* Todo: If CondMask==0, jump to ENDIF */
/* If no channels are taking ELSE, jump to ENDIF */
if (!mach->CondMask)
*pc = inst->Label.Label;
}
break;