]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Merging master
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Mon, 16 Jul 2012 09:40:30 +0000 (11:40 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Mon, 16 Jul 2012 09:40:30 +0000 (11:40 +0200)
1  2 
gmqcc.h
ir.c

diff --cc gmqcc.h
Simple merge
diff --cc ir.c
index e35a7d00cf3dcb29a9a79b68ba86073dc7b6f4ec,f2c0f14dac64b3d50f9c3d4ec199753d18e5673f..1bf5513de82df32c00b76b6bd28495e3c4c48c79
--- 1/ir.c
--- 2/ir.c
+++ b/ir.c
@@@ -56,14 -54,26 +56,32 @@@ uint16_t type_store_instr[TYPE_COUNT] 
      INSTR_STORE_FNC,
      INSTR_STORE_ENT, /* should use I */
  #if 0
 -    INSTR_STORE_ENT, /* integer type */
 +    INSTR_STORE_I, /* integer type */
  #endif
 -    INSTR_STORE_V, /* variant, should never be accessed */
 +    INSTR_STORE_Q,
 +    INSTR_STORE_M,
 +
 +    INSTR_STORE_M, /* variant, should never be accessed */
  };
  
 -    INSTR_STOREP_V, /* variant, should never be accessed */
+ uint16_t type_store_instr[TYPE_COUNT] = {
+     INSTR_STOREP_F, /* should use I when having integer support */
+     INSTR_STOREP_S,
+     INSTR_STOREP_F,
+     INSTR_STOREP_V,
+     INSTR_STOREP_ENT,
+     INSTR_STOREP_FLD,
+     INSTR_STOREP_FNC,
+     INSTR_STOREP_ENT, /* should use I */
+ #if 0
+     INSTR_STOREP_ENT, /* integer type */
+ #endif
++    INSTR_STOREP_Q,
++    INSTR_STOREP_M,
++
++    INSTR_STOREP_M, /* variant, should never be accessed */
+ };
  MEM_VEC_FUNCTIONS(ir_value_vector, ir_value*, v)
  
  /***********************************************************************
@@@ -915,44 -869,8 +895,7 @@@ bool ir_block_create_storep(ir_block *s
       */
      vtype = what->vtype;
  
-     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;
-         case TYPE_FIELD:
-             op = INSTR_STOREP_FLD;
-             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;
-         case TYPE_QUATERNION:
-             op = INSTR_STOREP_Q;
-             break;
-         case TYPE_MATRIX:
-             op = INSTR_STOREP_M;
-             break;
-         default:
-             /* Unknown type */
-             return false;
-     }
+     op = type_storep_instr[vtype];
 -
      return ir_block_create_store_op(self, op, target, what);
  }