From 93793d420baf63279baea3bd1a39cea25fea440f Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Tue, 6 May 2014 11:20:41 +0800 Subject: [PATCH] GBE: fix one potential bug in UnsignedI64ToFloat. 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 Reviewed-by: "Yang, Rong R" --- backend/src/backend/gen_context.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp index 00cbf1d..a6a6503 100644 --- a/backend/src/backend/gen_context.cpp +++ b/backend/src/backend/gen_context.cpp @@ -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)); -- 2.7.4