summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_ir.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-08-05 16:18:39 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-08-05 16:18:39 -0600
commit1308ca6d2168c5c2f81a8e675687e9d9a4db1a28 (patch)
tree43f2e21146f58870037442871b833ea447dd5551 /src/mesa/shader/slang/slang_ir.c
parent749c1b9fbe4bd89e61dfc3657ad4f8adae20ff2b (diff)
mesa: glsl: re-org of intermediate/temp storage
Simplify the code for allocating storage for intermediate results. Use fewer temps in some cases. Also, use new asm vec4_move intrinsic instead of regular assigments in various constructors. For example: float f; vec3 v; v.xyz = f; is not legal GLSL, so do this instead: __asm vec4_move v.xyz, f; // note: f will auto-expand into f.xxxx Plus, fix assorted bugs in structure comparison.
Diffstat (limited to 'src/mesa/shader/slang/slang_ir.c')
-rw-r--r--src/mesa/shader/slang/slang_ir.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c
index 23d554234e..3a0b8bf3a0 100644
--- a/src/mesa/shader/slang/slang_ir.c
+++ b/src/mesa/shader/slang/slang_ir.c
@@ -54,7 +54,8 @@ static const slang_ir_info IrInfo[] = {
{ IR_NOTEQUAL, "IR_NOTEQUAL", OPCODE_NOP, 1, 2 },
/* unary ops */
- { IR_I_TO_F, "IR_I_TO_F", OPCODE_NOP, 1, 1 },
+ { IR_MOVE, "IR_MOVE", OPCODE_MOV, 4, 1 },
+ { IR_I_TO_F, "IR_I_TO_F", OPCODE_MOV, 4, 1 }, /* int[4] to float[4] */
{ IR_F_TO_I, "IR_F_TO_I", OPCODE_INT, 4, 1 }, /* 4 floats to 4 ints */
{ IR_EXP, "IR_EXP", OPCODE_EXP, 1, 1 },
{ IR_EXP2, "IR_EXP2", OPCODE_EX2, 1, 1 },
@@ -82,7 +83,7 @@ static const slang_ir_info IrInfo[] = {
{ IR_KILL, "IR_KILL", OPCODE_NOP, 0, 0 },
{ IR_COND, "IR_COND", OPCODE_NOP, 0, 0 },
{ IR_CALL, "IR_CALL", OPCODE_NOP, 0, 0 },
- { IR_MOVE, "IR_MOVE", OPCODE_NOP, 0, 1 },
+ { IR_COPY, "IR_COPY", OPCODE_NOP, 0, 1 },
{ IR_NOT, "IR_NOT", OPCODE_NOP, 1, 1 },
{ IR_VAR, "IR_VAR", OPCODE_NOP, 0, 0 },
{ IR_VAR_DECL, "IR_VAR_DECL", OPCODE_NOP, 0, 0 },
@@ -326,8 +327,8 @@ _slang_print_ir_tree(const slang_ir_node *n, int indent)
assert(!n->Children[1]);
_slang_print_ir_tree(n->Children[0], indent + 3);
break;
- case IR_MOVE:
- printf("MOVE (writemask = %s)\n", writemask_string(n->Writemask));
+ case IR_COPY:
+ printf("COPY (writemask = %s)\n", writemask_string(n->Writemask));
_slang_print_ir_tree(n->Children[0], indent+3);
_slang_print_ir_tree(n->Children[1], indent+3);
break;