executor: fully expand const vars into the temp register
authorWim Taymans <wtaymans@redhat.com>
Thu, 18 Sep 2014 17:32:18 +0000 (19:32 +0200)
committerWim Taymans <wtaymans@redhat.com>
Fri, 19 Sep 2014 09:08:36 +0000 (11:08 +0200)
When loading a const in a register, always make it cover the full
register so that it containts enough values to be used in x2 and
x4 instructions.

orc/orcexecutor.c

index 6fe296d..21513f3 100644 (file)
@@ -292,6 +292,12 @@ orc_executor_emulate (OrcExecutor *ex)
         /* FIXME hack */
         load_constant (tmpspace[insn->src_args[k]], 8,
             var->value.i);
+        if (var->size == 1)
+          opcode_ex[j].shift = 3;
+        else if (var->size == 2)
+          opcode_ex[j].shift = 2;
+        else if (var->size == 4)
+          opcode_ex[j].shift = 1;
       } else if (var->vartype == ORC_VAR_TYPE_PARAM) {
         opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
         /* FIXME hack */