Add support for "switch" statements.

Switches with both uniform and varying "switch" expressions are
supported.  Switch statements with varying expressions and very
large numbers of labels may not perform well; some issues to be
filed shortly will track opportunities for improving these.
This commit is contained in:
Matt Pharr
2012-01-11 09:15:05 -08:00
parent 9670ab0887
commit b67446d998
26 changed files with 1402 additions and 92 deletions

2
ispc.h
View File

@@ -437,6 +437,8 @@ enum {
COST_VARYING_IF = 3,
COST_UNIFORM_LOOP = 4,
COST_VARYING_LOOP = 6,
COST_UNIFORM_SWITCH = 4,
COST_VARYING_SWITCH = 12,
COST_ASSERT = 8,
CHECK_MASK_AT_FUNCTION_START_COST = 16,