From patchwork Tue Mar 26 19:01:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 231517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1127F2C0077 for ; Wed, 27 Mar 2013 06:02:55 +1100 (EST) Received: from localhost ([::1]:50984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKZ92-0005IP-8j for incoming@patchwork.ozlabs.org; Tue, 26 Mar 2013 15:02:52 -0400 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 Received: from [2001:470:d4ed:0:ea11:32ff:fea1:831a] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UKZ7z-0007yy-MT; Tue, 26 Mar 2013 20:01:48 +0100 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1UKZ7x-0002SK-Vm; Tue, 26 Mar 2013 20:01:45 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2013 20:01:39 +0100 Message-Id: <1364324502-9124-8-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364324502-9124-1-git-send-email-aurelien@aurel32.net> References: <1364324502-9124-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f15:c4f::1 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 07/10] target-i386: SSE4.2: fix pcmpXstrX instructions in "Equal ordered" mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The inner loop should only change the current bit of the result, instead of the whole result. Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson --- 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; }