n = new_node1(IR_FIELD, base);
if (n) {
- n->Target = (char *) oper->a_id;
+ n->Field = (char *) oper->a_id;
n->Store = _slang_new_ir_storage(base->Store->File,
base->Store->Index,
size);
slang_print_ir(n->Children[0], indent + 3);
break;
case IR_JUMP:
- printf("JUMP %s\n", n->Target);
+ printf("JUMP %s\n", n->Label->Name);
break;
case IR_CJUMP0:
- printf("CJUMP0 %s\n", n->Target);
+ printf("CJUMP0 %s\n", n->Label->Name);
slang_print_ir(n->Children[0], indent+3);
break;
case IR_CJUMP1:
- printf("CJUMP1 %s\n", n->Target);
+ printf("CJUMP1 %s\n", n->Label->Name);
slang_print_ir(n->Children[0], indent+3);
break;
(void*) n->Store);
break;
case IR_FIELD:
- printf("FIELD %s of\n", n->Target);
+ printf("FIELD %s of\n", n->Field);
slang_print_ir(n->Children[0], indent+3);
break;
case IR_FLOAT:
storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask);
storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store);
inst->SrcReg[0].NegateBase = NEGATE_XYZW;
- inst->Comment = n->Comment;
return inst;
}
{
slang_ir_opcode Opcode;
struct slang_ir_node_ *Children[3];
- const char *Comment;
- const char *Target; /**< Branch target string */
+ slang_ir_storage *Store; /**< location of result of this operation */
+ GLint InstLocation; /**< Location of instruction emitted for this node */
+
+ /** special fields depending on Opcode: */
+ const char *Field; /**< If Opcode == IR_FIELD */
GLuint Writemask; /**< If Opcode == IR_MOVE */
GLfloat Value[4]; /**< If Opcode == IR_FLOAT */
slang_variable *Var; /**< If Opcode == IR_VAR or IR_VAR_DECL */
- slang_ir_storage *Store; /**< location of result of this operation */
- GLint InstLocation; /**< Location of instruction emitted for this node */
struct slang_ir_node_ *BranchNode; /**< Used for branching instructions */
slang_label *Label; /**< Used for branches */
} slang_ir_node;