From patchwork Thu Jul 4 21:00:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 809967 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1334755wru; Thu, 4 Jul 2024 14:02:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEpXjUSYZApgKwt5QWiFHfYZvV8Eaxmmu0zks5vJr0ZPQ6DZIhjfucDh9gd4rDHt2T5RqywFULC15jA0xFkTSy X-Google-Smtp-Source: AGHT+IEIGUD1ELdzga61c8S89j/xIMmRwOwiVs4gHaMLQjFPwyEDlNBkQ/zptKL/6j6XDjJh1x4b X-Received: by 2002:a05:6214:3011:b0:6b5:eaa0:6cac with SMTP id 6a1803df08f44-6b5ed08586cmr35011376d6.63.1720126965790; Thu, 04 Jul 2024 14:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720126965; cv=none; d=google.com; s=arc-20160816; b=XHncDzxKp5yseSqZ3SVcaqoWXfMGyC6xjb4NiYbA36E6VrEaHxfK++5vtmjJQTQ5WE TPiMbNSnMq97f2LwH+7cssMM9CmZjpWAVItOYvJ05GTtArZXfKGZHC6DD4UJ6GpuZLWO 55f35sOiY7q5vmoF0pBeElnmzT4mWoDL0FbG34O75GGYzTkyyQOaL6WzICfCVdrDIBqL hTBDG/t3+VXlROxBUZ1hdFtas5uvG625dLzxAr3ayGbF8ZFsqiaBqbbTTEPu40QYlq/z GoeqzS06s/43nXPTFtyZL0XSWbUZzkNm0qqGt/h60OM+juR1SIJ7hcBeJHvQIU13LeTc 4avw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=dpa00ZWK0z3zWvsAxlTHsXonch8Y5l4laAm1UlBM0zs=; fh=NoJ7n5JVE2hviRF6uNBFRIJvWH7igafuy1AIwg26ToM=; b=WeS30IHPxM8yB/vzzkOBmSbKT5V33Tpcvvpd6wJKESG0ea8DaorfPbHuA82gjUbO/T BpUHkTGuFt8+WBkWd07Vqd5p64wAfmwSpaVNgojiBbuz2cUdkXYajqKENTEYuMM5WILV fhDLcQbMk36wIu4YTISKIZ3mhw0r9A3rnWlTY6Cu6ztEzqo6hsvDMUYvxBD/vs1kR8gh 2X/PQdaSPKE/6rQIByHP1K8yY0RWwYAJHId+B2jEpkogqRCsotqyrxgx9zX+5d4lpyYa LMy4wd8ZoZR52rovAtAO6tQi3ouRX84G1rCsHoD6U77Lkui5ujYPwttFFYVzyA03nRV2 Xx9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b59e5ef618si158346636d6.396.2024.07.04.14.02.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jul 2024 14:02:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPTaR-0008Tp-UH; Thu, 04 Jul 2024 17:01:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPTaP-0008Iq-6G; Thu, 04 Jul 2024 17:01:49 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPTaN-0004Pa-F5; Thu, 04 Jul 2024 17:01:48 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3A8F87756C; Fri, 5 Jul 2024 00:00:51 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 511A5FECA5; Fri, 5 Jul 2024 00:00:56 +0300 (MSK) Received: (nullmailer pid 1507755 invoked by uid 1000); Thu, 04 Jul 2024 21:00:55 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Peter Maydell , Michael Tokarev Subject: [Stable-9.0.2 14/22] target/arm: Fix VCMLA Dd, Dn, Dm[idx] Date: Fri, 5 Jul 2024 00:00:44 +0300 Message-Id: <20240704210055.1507652-14-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson The inner loop, bounded by eltspersegment, must not be larger than the outer loop, bounded by elements. Cc: qemu-stable@nongnu.org Fixes: 18fc2405781 ("target/arm: Implement SVE fp complex multiply add (indexed)") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2376 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 76bccf3cb9d9383da0128bbc6d1300cddbe3ae8f) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 1f93510b85..cc7cab338c 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -843,7 +843,7 @@ void HELPER(gvec_fcmlah_idx)(void *vd, void *vn, void *vm, void *va, intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); uint32_t neg_real = flip ^ neg_imag; intptr_t elements = opr_sz / sizeof(float16); - intptr_t eltspersegment = 16 / sizeof(float16); + intptr_t eltspersegment = MIN(16 / sizeof(float16), elements); intptr_t i, j; /* Shift boolean to the sign bit so we can xor to negate. */ @@ -905,7 +905,7 @@ void HELPER(gvec_fcmlas_idx)(void *vd, void *vn, void *vm, void *va, intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); uint32_t neg_real = flip ^ neg_imag; intptr_t elements = opr_sz / sizeof(float32); - intptr_t eltspersegment = 16 / sizeof(float32); + intptr_t eltspersegment = MIN(16 / sizeof(float32), elements); intptr_t i, j; /* Shift boolean to the sign bit so we can xor to negate. */