]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ir_block_create_store/p will now honor -fadjust-vector-fields by using STORE_V/STOREP...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 11 Aug 2012 17:38:02 +0000 (19:38 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 11 Aug 2012 17:38:02 +0000 (19:38 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 74923c4d8655279180f01653fc61c01924fdda07..d9fdcf75d6912566db160790b8f6e52cbeba28f7 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -963,6 +963,11 @@ bool ir_block_create_store(ir_block *self, ir_value *target, ir_value *what)
 #endif
         op = type_store_instr[vtype];
 
+    if (OPTS_FLAG(ADJUST_VECTOR_FIELDS)) {
+        if (op == INSTR_STORE_FLD && what->fieldtype == TYPE_VECTOR)
+            op = INSTR_STORE_V;
+    }
+
     return ir_block_create_store_op(self, op, target, what);
 }
 
@@ -980,6 +985,10 @@ bool ir_block_create_storep(ir_block *self, ir_value *target, ir_value *what)
     vtype = what->vtype;
 
     op = type_storep_instr[vtype];
+    if (OPTS_FLAG(ADJUST_VECTOR_FIELDS)) {
+        if (op == INSTR_STOREP_FLD && what->fieldtype == TYPE_VECTOR)
+            op = INSTR_STOREP_V;
+    }
 
     return ir_block_create_store_op(self, op, target, what);
 }