op = INSTR_STORE_ENT;
#endif
break;
+ default:
+ /* Unknown type */
+ return false;
+ }
+ return ir_block_create_store_op(self, op, target, what);
+}
+
+bool ir_block_create_storep(ir_block *self, ir_value *target, ir_value *what)
+{
+ int op = 0;
+ int vtype;
+ if (target->vtype == TYPE_VARIANT)
+ vtype = what->vtype;
+ else
+ vtype = target->vtype;
+
+ if (vtype != what->vtype)
+ {
+ /* Cannot implicitly convert when storing through a pointer */
+ return false;
+ }
+
+ switch (vtype) {
+ case TYPE_FLOAT:
+ op = INSTR_STOREP_F;
+ break;
+ case TYPE_VECTOR:
+ op = INSTR_STOREP_V;
+ break;
+ case TYPE_ENTITY:
+ op = INSTR_STOREP_ENT;
+ break;
+ case TYPE_STRING:
+ op = INSTR_STOREP_S;
+ break;
+#if 0
+ case TYPE_INTEGER:
+ op = INSTR_STOREP_I;
+ break;
+#endif
+ case TYPE_POINTER:
+#if 0
+ op = INSTR_STOREP_I;
+#else
+ op = INSTR_STOREP_ENT;
+#endif
+ break;
+ default:
+ /* Unknown type */
+ return false;
}
return ir_block_create_store_op(self, op, target, what);
}
ir_value *left, ir_value *right);
bool GMQCC_WARN ir_block_create_store_op(ir_block*, int op, ir_value *target, ir_value *what);
bool GMQCC_WARN ir_block_create_store(ir_block*, ir_value *target, ir_value *what);
+bool GMQCC_WARN ir_block_create_storep(ir_block*, ir_value *target, ir_value *what);
ir_value* ir_block_create_add(ir_block*, const char *label, ir_value *l, ir_value *r);
ir_value* ir_block_create_sub(ir_block*, const char *label, ir_value *l, ir_value *r);