ARM: Fix branch prediction issue with CB(N)Z instruction
authorBrian Grayson <b.grayson@samsung.com>
Fri, 9 Mar 2012 20:32:41 +0000 (15:32 -0500)
committerBrian Grayson <b.grayson@samsung.com>
Fri, 9 Mar 2012 20:32:41 +0000 (15:32 -0500)
src/arch/arm/isa/templates/branch.isa

index 3a8fbb3633d10dd82ff3d07a4dcf06387b6620b7..6edfb0ee0f7164205bb3436ad000ec0d225a258d 100644 (file)
@@ -212,6 +212,8 @@ class %(class_name)s : public %(base_class)s
 };
 }};
 
+// Only used by CBNZ, CBZ which is conditional based on
+// a register value even though the instruction is always unconditional.
 def template BranchImmRegConstructor {{
     inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
                                           int32_t _imm,
@@ -219,14 +221,7 @@ def template BranchImmRegConstructor {{
         : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _imm, _op1)
     {
         %(constructor)s;
-        if (!(condCode == COND_AL || condCode == COND_UC)) {
-            for (int x = 0; x < _numDestRegs; x++) {
-                _srcRegIdx[_numSrcRegs++] = _destRegIdx[x];
-            }
-            flags[IsCondControl] = true;
-        } else {
-            flags[IsUncondControl] = true;
-        }
+        flags[IsCondControl] = true;
     }
 }};