From nobody Wed Nov 5 04:29:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533126827459178.10618902497527; Wed, 1 Aug 2018 05:33:47 -0700 (PDT) Received: from localhost ([::1]:39615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqK1-000743-LR for importer@patchew.org; Wed, 01 Aug 2018 08:33:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqHh-0005lG-Pg for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkqHg-0004Qt-GM for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:21 -0400 Received: from mail-ua0-x233.google.com ([2607:f8b0:400c:c08::233]:38534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkqHg-0004QL-Bm for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:20 -0400 Received: by mail-ua0-x233.google.com with SMTP id o11-v6so12543518uak.5 for ; Wed, 01 Aug 2018 05:31:20 -0700 (PDT) Received: from cloudburst.twiddle.net ([190.166.236.188]) by smtp.gmail.com with ESMTPSA id f60-v6sm4247847uaf.10.2018.08.01.05.31.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 05:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QmJi8veTXHAPWn+vDwupbHDsSR7WDss7mhFB9JuugSg=; b=N/UnTB4vz3xLRmov3Y8C2xfh+t3d204KdPltZiu5trecaOytG2VAbCprMF1XvBzZo/ Yh9KKWWq1GDabJX4nw9yOLYW3zEfjMyH1G/+gJ6sD5eqd8yOi9CMc87502eCS7dhlU3y Hm/2RgfXLPXBgG2pj3LAuwwIEH4YiF05AkcmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QmJi8veTXHAPWn+vDwupbHDsSR7WDss7mhFB9JuugSg=; b=lTXg5jalBNayHazhuSEH52GFQ+HA6SHkYdyLk3Cjqo6R+hRsM+dq+waPCtCIo1izMd KwvCoMmLKPmyoqsOV84FNK1fbm6VkFXXxbmIpgmn/t7tswXzLw+PjjAfOx0q0mACZqbC 0LVMAgrv0uMreAQm9DZ8O4cYE04wvrlz0tviYfAyTEdg6+lXU/5+q+PN65R+0ceIIBeN Rf8Jn6SPqnpxCtdeWeynqiXm7G/qfueQQ1XrXyIpqzgdY81UkJJyVldvN0WBeolQzKxq 1XfF0HDF9d1hgH0vkYYb+TqdpHFRLlf++pH+xasxjzIhuxUbdpX4d7jMVQ4u0nci3GOq sS6Q== X-Gm-Message-State: AOUpUlEb466DnpdRKveSk0U4V4rg2a1wb09doe2s60gW5dmOpLS8u2qs R3ElCG8KIRTIF1aDXD8pRvH2Q5HvvPg= X-Google-Smtp-Source: AAOMgpes71IYNFwyBsj1TF4ZE9OchvWyN3s5g4jk5wnoM+LuojHfYd+LUgXTn9eqD18hSPYu7cVuxw== X-Received: by 2002:a9f:37c8:: with SMTP id q66-v6mr18092449uaq.180.1533126679418; Wed, 01 Aug 2018 05:31:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 1 Aug 2018 08:31:08 -0400 Message-Id: <20180801123111.3595-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180801123111.3595-1-richard.henderson@linaro.org> References: <20180801123111.3595-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::233 Subject: [Qemu-devel] [PATCH 1/4] target/arm: Fix sign of sve_cmpeq_ppzw/sve_cmpne_ppzw X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The normal vector element is sign-extended before comparing with the wide vector element. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Laurent Desnogues Tested-by: Alex Benn=C3=A9e Tested-by: Laurent Desnogues --- target/arm/sve_helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 54795c9194..9bd0694d55 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2436,13 +2436,13 @@ uint32_t HELPER(NAME)(void *vd, void *vn, void *vm,= void *vg, uint32_t desc) \ #define DO_CMP_PPZW_S(NAME, TYPE, TYPEW, OP) \ DO_CMP_PPZW(NAME, TYPE, TYPEW, OP, H1_4, 0x1111111111111111ull) =20 -DO_CMP_PPZW_B(sve_cmpeq_ppzw_b, uint8_t, uint64_t, =3D=3D) -DO_CMP_PPZW_H(sve_cmpeq_ppzw_h, uint16_t, uint64_t, =3D=3D) -DO_CMP_PPZW_S(sve_cmpeq_ppzw_s, uint32_t, uint64_t, =3D=3D) +DO_CMP_PPZW_B(sve_cmpeq_ppzw_b, int8_t, uint64_t, =3D=3D) +DO_CMP_PPZW_H(sve_cmpeq_ppzw_h, int16_t, uint64_t, =3D=3D) +DO_CMP_PPZW_S(sve_cmpeq_ppzw_s, int32_t, uint64_t, =3D=3D) =20 -DO_CMP_PPZW_B(sve_cmpne_ppzw_b, uint8_t, uint64_t, !=3D) -DO_CMP_PPZW_H(sve_cmpne_ppzw_h, uint16_t, uint64_t, !=3D) -DO_CMP_PPZW_S(sve_cmpne_ppzw_s, uint32_t, uint64_t, !=3D) +DO_CMP_PPZW_B(sve_cmpne_ppzw_b, int8_t, uint64_t, !=3D) +DO_CMP_PPZW_H(sve_cmpne_ppzw_h, int16_t, uint64_t, !=3D) +DO_CMP_PPZW_S(sve_cmpne_ppzw_s, int32_t, uint64_t, !=3D) =20 DO_CMP_PPZW_B(sve_cmpgt_ppzw_b, int8_t, int64_t, >) DO_CMP_PPZW_H(sve_cmpgt_ppzw_h, int16_t, int64_t, >) --=20 2.17.1 From nobody Wed Nov 5 04:29:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533126834859175.04961321618998; Wed, 1 Aug 2018 05:33:54 -0700 (PDT) Received: from localhost ([::1]:39617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqK9-00078v-Cp for importer@patchew.org; Wed, 01 Aug 2018 08:33:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqHj-0005mK-1v for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkqHi-0004Sx-9J for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:23 -0400 Received: from mail-ua0-x241.google.com ([2607:f8b0:400c:c08::241]:38611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkqHi-0004SE-1L for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:22 -0400 Received: by mail-ua0-x241.google.com with SMTP id o11-v6so12543567uak.5 for ; Wed, 01 Aug 2018 05:31:21 -0700 (PDT) Received: from cloudburst.twiddle.net ([190.166.236.188]) by smtp.gmail.com with ESMTPSA id f60-v6sm4247847uaf.10.2018.08.01.05.31.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 05:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=meIxI9REfNuuDXqb2d2tUiCdfpPmOKrHrmyjZQJNHEc=; b=RipsZSu7IzIAoT8UZJK51TdZ9oAsytH1dwONaFGzgLna61/90YWjLBxtrlHvAEwqqG l/zIOR7YO2ljcyq3AQBS5+WLH3WTHeJveOYamNkbWkcSqbNgoDXCjk3OE0tTYlHmC86R M6WNbl/iK4QXEkbf+c9sR+KsyvZ8vaWtQyvM4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=meIxI9REfNuuDXqb2d2tUiCdfpPmOKrHrmyjZQJNHEc=; b=ohKVkSQMhzxAC+YP1imPV0JFFKZs920XtWAhzkRJ+5+28VB5bI0JTd8ybh5mckUf6X 7GbZUCth8trC9wX7LbobHn8EGQv14zXfSkt7Ozxc++1sSihG2dEqP+CkQfuIOeNEASwx G1+M7JPVJHUpTNQ4OnI9kSNOrN6LplEoLj0wCBmxpoDeQC7yDKPzwidBNRSZ4J4nqDsO y9th6wkCz4wGFv/u22BFCBgIki5DyJ4TKIOe7clXy37Ne3lJ92hpi1QPT2Yq2HTT75oK dS9SLAHV6t/tva0NP0RpfWCRCdTW2zAofN0wmI4zFCL47kpTSgGLWB0HPCy/+p5ZXFh9 /vuA== X-Gm-Message-State: AOUpUlHTB5AM1fwErJXcCdZrBTZPHbVKuZMMJA+sOB63izFfDVr624mH WXamR+w7OoTvZYZhcSo6ZCEoVmwsxxg= X-Google-Smtp-Source: AAOMgpegJe57AMUoj0vlXtXP9z6MA7ssCmZLbZefdjLQYi8rm7YTJ6RLpOluF3wG+g45mOxsqu/Xkg== X-Received: by 2002:ab0:238f:: with SMTP id b15-v6mr17877170uan.164.1533126681148; Wed, 01 Aug 2018 05:31:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 1 Aug 2018 08:31:09 -0400 Message-Id: <20180801123111.3595-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180801123111.3595-1-richard.henderson@linaro.org> References: <20180801123111.3595-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::241 Subject: [Qemu-devel] [PATCH 2/4] target/arm: Fix typo in do_sat_addsub_64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Used the wrong temporary in the computation of subtractive overflow. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Alex Benn=C3=A9e Tested-by: Laurent Desnogues --- target/arm/translate-sve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 374051cd20..9dd4c38bab 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -1625,7 +1625,7 @@ static void do_sat_addsub_64(TCGv_i64 reg, TCGv_i64 v= al, bool u, bool d) /* Detect signed overflow for subtraction. */ tcg_gen_xor_i64(t0, reg, val); tcg_gen_sub_i64(t1, reg, val); - tcg_gen_xor_i64(reg, reg, t0); + tcg_gen_xor_i64(reg, reg, t1); tcg_gen_and_i64(t0, t0, reg); =20 /* Bound the result. */ --=20 2.17.1 From nobody Wed Nov 5 04:29:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533127013946226.09328769866886; Wed, 1 Aug 2018 05:36:53 -0700 (PDT) Received: from localhost ([::1]:39643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqMu-0001kN-S6 for importer@patchew.org; Wed, 01 Aug 2018 08:36:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqHp-0005sT-St for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkqHj-0004Uy-Sh for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:29 -0400 Received: from mail-ua0-x242.google.com ([2607:f8b0:400c:c08::242]:39890) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkqHj-0004Ua-OX for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:23 -0400 Received: by mail-ua0-x242.google.com with SMTP id g18-v6so12543556uam.6 for ; Wed, 01 Aug 2018 05:31:23 -0700 (PDT) Received: from cloudburst.twiddle.net ([190.166.236.188]) by smtp.gmail.com with ESMTPSA id f60-v6sm4247847uaf.10.2018.08.01.05.31.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 05:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gaII0zNOehxL/uVYcqOMRBb0l0zQg1hJOdueMjvS+cs=; b=QWQSGj2DmKBGSsWJOjHYpfCzs08Y543d94SZCbKennPay4LW3IuguFP9xv24i5sdlV mXo4lfsAeXxyO6hk8AS2yVL4YwXTwceBO0FC1ExoBB7Wp14ydfNVGCgr/kIi1Y/nmIg+ eRLHzk6tp3AL0uDPOQ45OaV/xP8AIxo7saq50= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gaII0zNOehxL/uVYcqOMRBb0l0zQg1hJOdueMjvS+cs=; b=qZfplYl3z7PerOo8eNEmhkNwkFu6c7iNJVU2y8CHlQ/phpngmis/nraesa7aRf/T1v zw/u6O+eG0VGb3cTnojE7ocq20yTHJjaPNqgvf4mY7Spbi/qaOjtaVoJcgrFpbuxWTmK s6hIp2Qap2xe8aQ/569Np7wMN5MA5//rBmA9xmKrpSNlOVmfHvvlkCci8yZyObORsOSL sCr5ZL99GBDRltzEIITbkK65Spxvi9s5XjtvCj1qoj7yVFmGkPU6WEak8JioVm7nFy4v Xz2Rac7864EfFRufgkJrm4EmKQHUlO7pk3D5FuxWwxao45rr+niSkMnkxI20CDp9QzUC /Yzg== X-Gm-Message-State: AOUpUlHXiMmGvf7OjqdSL4y2zNoW3BOYsluPnNeVD7DgKBQ25Nb2+0q0 BRYJVk+IDrVUx+Y81K8E8ahYu7ElhYM= X-Google-Smtp-Source: AAOMgpfgeDK8Wd5kBWi3Ee4aQNMv/nqKrufIa3txwd0RwlzCsbKMcQ8VfeDNip7m/qBlOwngL5m9Pg== X-Received: by 2002:ab0:6a6:: with SMTP id g35-v6mr18381341uag.16.1533126682855; Wed, 01 Aug 2018 05:31:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 1 Aug 2018 08:31:10 -0400 Message-Id: <20180801123111.3595-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180801123111.3595-1-richard.henderson@linaro.org> References: <20180801123111.3595-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::242 Subject: [Qemu-devel] [PATCH 3/4] target/arm: Reorganize SVE WHILE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The pseudocode for this operation is an increment + compare loop, so comparing <=3D the maximum integer produces an all-true predicate. Rather than bound in both the inline code and the helper, pass the helper the number of predicate bits to set instead of the number of predicate elements to set. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Alex Benn=C3=A9e Tested-by: Laurent Desnogues --- target/arm/sve_helper.c | 5 ---- target/arm/translate-sve.c | 49 +++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 9bd0694d55..87594a8adb 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2846,11 +2846,6 @@ uint32_t HELPER(sve_while)(void *vd, uint32_t count,= uint32_t pred_desc) return flags; } =20 - /* Scale from predicate element count to bits. */ - count <<=3D esz; - /* Bound to the bits in the predicate. */ - count =3D MIN(count, oprsz * 8); - /* Set all of the requested bits. */ for (i =3D 0; i < count / 64; ++i) { d->p[i] =3D esz_mask; diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 9dd4c38bab..89efc80ee7 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -3173,19 +3173,19 @@ static bool trans_CTERM(DisasContext *s, arg_CTERM = *a, uint32_t insn) =20 static bool trans_WHILE(DisasContext *s, arg_WHILE *a, uint32_t insn) { - if (!sve_access_check(s)) { - return true; - } - - TCGv_i64 op0 =3D read_cpu_reg(s, a->rn, 1); - TCGv_i64 op1 =3D read_cpu_reg(s, a->rm, 1); - TCGv_i64 t0 =3D tcg_temp_new_i64(); - TCGv_i64 t1 =3D tcg_temp_new_i64(); + TCGv_i64 op0, op1, t0, t1, tmax; TCGv_i32 t2, t3; TCGv_ptr ptr; unsigned desc, vsz =3D vec_full_reg_size(s); TCGCond cond; =20 + if (!sve_access_check(s)) { + return true; + } + + op0 =3D read_cpu_reg(s, a->rn, 1); + op1 =3D read_cpu_reg(s, a->rm, 1); + if (!a->sf) { if (a->u) { tcg_gen_ext32u_i64(op0, op0); @@ -3198,32 +3198,47 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE = *a, uint32_t insn) =20 /* For the helper, compress the different conditions into a computation * of how many iterations for which the condition is true. - * - * This is slightly complicated by 0 <=3D UINT64_MAX, which is nominal= ly - * 2**64 iterations, overflowing to 0. Of course, predicate registers - * aren't that large, so any value >=3D predicate size is sufficient. */ + t0 =3D tcg_temp_new_i64(); + t1 =3D tcg_temp_new_i64(); tcg_gen_sub_i64(t0, op1, op0); =20 - /* t0 =3D MIN(op1 - op0, vsz). */ - tcg_gen_movi_i64(t1, vsz); - tcg_gen_umin_i64(t0, t0, t1); + tmax =3D tcg_const_i64(vsz >> a->esz); if (a->eq) { /* Equality means one more iteration. */ tcg_gen_addi_i64(t0, t0, 1); + + /* If op1 is max (un)signed integer (and the only time the addition + * above could overflow), then we produce an all-true predicate by + * setting the count to the vector length. This is because the + * pseudocode is described as an increment + compare loop, and the + * max integer would always compare true. + */ + tcg_gen_movi_i64(t1, (a->sf + ? (a->u ? UINT64_MAX : INT64_MAX) + : (a->u ? UINT32_MAX : INT32_MAX))); + tcg_gen_movcond_i64(TCG_COND_EQ, t0, op1, t1, tmax, t0); } =20 - /* t0 =3D (condition true ? t0 : 0). */ + /* Bound to the maximum. */ + tcg_gen_umin_i64(t0, t0, tmax); + tcg_temp_free_i64(tmax); + + /* Set the count to zero if the condition is false. */ cond =3D (a->u ? (a->eq ? TCG_COND_LEU : TCG_COND_LTU) : (a->eq ? TCG_COND_LE : TCG_COND_LT)); tcg_gen_movi_i64(t1, 0); tcg_gen_movcond_i64(cond, t0, op0, op1, t0, t1); + tcg_temp_free_i64(t1); =20 + /* Since we're bounded, pass as a 32-bit type. */ t2 =3D tcg_temp_new_i32(); tcg_gen_extrl_i64_i32(t2, t0); tcg_temp_free_i64(t0); - tcg_temp_free_i64(t1); + + /* Scale elements to bits. */ + tcg_gen_shli_i32(t2, t2, a->esz); =20 desc =3D (vsz / 8) - 2; desc =3D deposit32(desc, SIMD_DATA_SHIFT, 2, a->esz); --=20 2.17.1 From nobody Wed Nov 5 04:29:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533127020791395.56444423524874; Wed, 1 Aug 2018 05:37:00 -0700 (PDT) Received: from localhost ([::1]:39649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqN9-0001yx-Kk for importer@patchew.org; Wed, 01 Aug 2018 08:36:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkqHm-0005pr-6Y for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkqHl-0004Wo-GZ for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:26 -0400 Received: from mail-vk0-x242.google.com ([2607:f8b0:400c:c05::242]:33290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkqHl-0004WY-DG for qemu-devel@nongnu.org; Wed, 01 Aug 2018 08:31:25 -0400 Received: by mail-vk0-x242.google.com with SMTP id y70-v6so9187212vkc.0 for ; Wed, 01 Aug 2018 05:31:25 -0700 (PDT) Received: from cloudburst.twiddle.net ([190.166.236.188]) by smtp.gmail.com with ESMTPSA id f60-v6sm4247847uaf.10.2018.08.01.05.31.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 05:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RjWB24CfHHwazw6nmvjHvKW+AktiQYvHixMnI+ZWPTY=; b=Au5LamOfXCquq1zXmk3d8Ck598RZclsLaAnHFVcB0vIej2LhyIKO4V/yso5niLmjqs 1bKwV8ciXv9NjS+LOZBc9wjOhDt6tH2ARbl0GgRKFqlUe8BqFzm2IFUZEFajmfByWEgX rX/kJ5UXRKOW1fvS/PgcxkG4u0WUt+/j5M6IA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RjWB24CfHHwazw6nmvjHvKW+AktiQYvHixMnI+ZWPTY=; b=W1i1mPJBrNjNOjbuvDpCQ+SymE9SvG2dULMT+BqtwYifcpb04+Cf3ERX6UDQG+WmWA l6lk2UYcUmxTK6L7iR0ys0FCsvq3c4xjYx58+fax39nwLgL3Bhe2Wu/x9p+fmn7xfS+l 8N4p0QbxMKQKwsY07taadnu4JHGvl2hQ2+QpD6wJPug0/RoFw3ZnarITSKnGCqBI0hZa h06FApgD+dKf6yn0KSRqd1Mp9t5NrTxer+fxmkHMs5J5nxYLwvj9oWGaa78P+kyRdOg0 0AaijRw7SsQ7hHK/Svaxz2WtbD5FupA+tBWfYRMgnAby+4WIhqdaWuykfe9TOWn+AvP3 LwHw== X-Gm-Message-State: AOUpUlHyjB6uBDP1hWJcmVsoF95NfNG1Wai/9trYs73aaMP31utr11Ya mh5LYo/qvjyMTBGeVuboHuIv8y23C8E= X-Google-Smtp-Source: AAOMgpdlUMk79r9wWfipu2ry/XXBIP9r/a93Ax9giXcNOf+LRfsUVQQgwNasyZeCuDEzHWIcKb/66w== X-Received: by 2002:a1f:430f:: with SMTP id q15-v6mr15803628vka.92.1533126684567; Wed, 01 Aug 2018 05:31:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 1 Aug 2018 08:31:11 -0400 Message-Id: <20180801123111.3595-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180801123111.3595-1-richard.henderson@linaro.org> References: <20180801123111.3595-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c05::242 Subject: [Qemu-devel] [PATCH 4/4] target/arm: Fix typo in helper_sve_movz_d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Laurent Desnogues Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Alex Benn=C3=A9e Tested-by: Laurent Desnogues --- target/arm/sve_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 87594a8adb..c3cbec9cf5 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -1042,7 +1042,7 @@ void HELPER(sve_movz_d)(void *vd, void *vn, void *vg,= uint32_t desc) uint64_t *d =3D vd, *n =3D vn; uint8_t *pg =3D vg; for (i =3D 0; i < opr_sz; i +=3D 1) { - d[i] =3D n[1] & -(uint64_t)(pg[H1(i)] & 1); + d[i] =3D n[i] & -(uint64_t)(pg[H1(i)] & 1); } } =20 --=20 2.17.1