GBE: fix one potential bug in UnsignedI64ToFloat.
authorZhigang Gong <zhigang.gong@intel.com>
Tue, 6 May 2014 03:20:41 +0000 (11:20 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Thu, 8 May 2014 04:52:47 +0000 (12:52 +0800)
Set exp to a proper value to make sure all the inactive lanes
flag bits are 1s which satisfy the requirement of the following
ALL16/ALL8H condition check.

v2:
enable the first JMPI's optimization rather the second,
as it has higher probability.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
backend/src/backend/gen_context.cpp

index 00cbf1d..a6a6503 100644 (file)
@@ -907,6 +907,10 @@ namespace gbe
                                             GenRegister mantissa, GenRegister tmp, GenRegister flag) {
     uint32_t jip0, jip1;
     GenRegister dst_ud = GenRegister::retype(dst, GEN_TYPE_UD);
+    p->push();
+      p->curr.noMask = 1;
+      p->MOV(exp, GenRegister::immud(-1)); // make sure the inactive lane is 1 when check ALL8H/ALL16H condition latter.
+    p->pop();
     p->FBH(exp, high);
     p->ADD(exp, GenRegister::negate(exp), GenRegister::immud(31));  //exp = 32 when high == 0
     p->push();
@@ -928,7 +932,6 @@ namespace gbe
         jip0 = p->n_instruction();
         p->JMPI(GenRegister::immud(0));
       p->pop();
-
       p->curr.predicate = GEN_PREDICATE_NONE;
       p->curr.noMask = 1;
       p->CMP(GEN_CONDITIONAL_G, exp, GenRegister::immud(23));