From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKZ8K-00051W-Tq for qemu-devel@nongnu.org; Tue, 26 Mar 2013 15:02:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKZ8E-0005tg-Jl for qemu-devel@nongnu.org; Tue, 26 Mar 2013 15:02:08 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:49212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKZ8E-0005o8-CK for qemu-devel@nongnu.org; Tue, 26 Mar 2013 15:02:02 -0400 From: Aurelien Jarno Date: Tue, 26 Mar 2013 20:01:39 +0100 Message-Id: <1364324502-9124-8-git-send-email-aurelien@aurel32.net> In-Reply-To: <1364324502-9124-1-git-send-email-aurelien@aurel32.net> References: <1364324502-9124-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH 07/10] target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno The inner loop should only change the current bit of the result, instead of the whole result. Signed-off-by: Aurelien Jarno --- target-i386/ops_sse.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h index 2fc5fdd..77ab410 100644 --- a/target-i386/ops_sse.h +++ b/target-i386/ops_sse.h @@ -2036,10 +2036,11 @@ static inline unsigned pcmpxstrx(CPUX86State *env, Reg *d, Reg *s, case 3: for (j = valids - validd; j >= 0; j--) { res <<= 1; - res |= 1; + v = 1; for (i = MIN(upper - j, validd); i >= 0; i--) { - res &= (pcmp_val(s, ctrl, i + j) == pcmp_val(d, ctrl, i)); + v &= (pcmp_val(s, ctrl, i + j) == pcmp_val(d, ctrl, i)); } + res |= v; } break; } -- 1.7.10.4