From patchwork Thu Jul 4 12:48:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 809956 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1149122wru; Thu, 4 Jul 2024 05:50:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWFkQxEa/6EjJPAhXgXnttdBf2YebPp0BYcyWQWvXN9h8R87CsyCvK9tFxBYcJYIixhbZ/YEPCh2s1pc2yS45f8 X-Google-Smtp-Source: AGHT+IGKBW7Tk8HPKVaj8er6MDxgZXf0S/5dsUuCrxtyBJl0qzyhmoB3fN7TB04DvoMiFdbO+XRi X-Received: by 2002:a05:622a:1306:b0:440:ec00:fff6 with SMTP id d75a77b69052e-447cbf790c5mr17116821cf.41.1720097412450; Thu, 04 Jul 2024 05:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720097412; cv=none; d=google.com; s=arc-20160816; b=FvIt4rcwmF9CQ1zSyXB982qMMb4P7IkIFkS0uLgy9Eh7o1KW7Gje/otR93k2d8Y118 CrKvwHkkBS5eTSSuxiwzSPPEVXpwKUb/fYDQ6IDBVWnEWZrJv8JSIwpU2Mpvkg6+uS0x KTXYThVgnNDo/ijuUugzoLYOVst7CuuSPCPJVomnM/FoOU4jeBgHJSADwaSYc/A4X+xa 8WH2KnCOlWLfGcaJc5WJjQhqZ1Vob5Zmw1U6ntCbzxo1huIlo0QqPbWEz6lwmVMierUm Ooy9vkvuxaMt5Pk2TNYlwHupG9ZM5U7UWMWnIIvfjC2ZDRZqjd86EiB6ql+3MGhpEyRq Rq7w== 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=HqVZKGWwLYIho8s+dbwmaQlOXHg0rU9w0F293n3SGQQ=; fh=Ai/7iYl8PqklBRG+OcSfTczWOCBx0/sAgKz4aM3nNvc=; b=gVCDwppXmJDPGcbAv43TLc+Nrc4UYhHx7kDHIpFTjky+U+wa0e3VlHNr6ax2yggGkd 2Umc1rBt0pKb24LyEsFbb/SFgBrMGc7+nY/cEjyaUmoez9mI1i1Gy8zIl0xePQyoRgMX J0Hg/wMVSv1ZIIExyB/ImOCxvenurYAidY8iN4RuNOJttrVbq2RbjZoiWxrzAz/6X/gE Idlr1Gqyj5hH2CcpVQV1DesrOP+9Cd6ZhPlKoVsSq0ZyqsXfYMR101pBAHFikzn3XJiO obnpOimQIN8CJy61NR0K7IEGFaVVFEbufc5vkEAhT1qfltDkocMbJAgoswyfIOT4lkCT 4mQg==; 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 d75a77b69052e-4465149f5d6si146315111cf.398.2024.07.04.05.50.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jul 2024 05:50:12 -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 1sPLte-0004W9-7D; Thu, 04 Jul 2024 08:49:10 -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 1sPLtT-0004E5-Fg; Thu, 04 Jul 2024 08:49:01 -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 1sPLtJ-0006KZ-Ts; Thu, 04 Jul 2024 08:48:58 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 291587739F; Thu, 4 Jul 2024 15:48:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id B657FFE784; Thu, 4 Jul 2024 15:48:26 +0300 (MSK) Received: (nullmailer pid 1471779 invoked by uid 1000); Thu, 04 Jul 2024 12:48:26 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Song Gao , Michael Tokarev Subject: [Stable-7.2.13 05/17] tcg/loongarch64: Fix tcg_out_movi vs some pcrel pointers Date: Thu, 4 Jul 2024 15:48:12 +0300 Message-Id: <20240704124826.1471715-5-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 Simplify the logic for two-part, 32-bit pc-relative addresses. Rather than assume all such fit in int32_t, do some arithmetic and assert a result, do some arithmetic first and then check to see if the pieces are in range. Cc: qemu-stable@nongnu.org Fixes: dacc51720db ("tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi") Reviewed-by: Song Gao Reported-by: Song Gao Signed-off-by: Richard Henderson (cherry picked from commit 521d7fb3ebdf88112ed13556a93e3037742b9eb8) Signed-off-by: Michael Tokarev (Mjt: context fixup in tcg/loongarch64/tcg-target.c.inc) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index d326e28740..f1934b6d7b 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -332,8 +332,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, * back to the slow path. */ - intptr_t pc_offset; - tcg_target_long val_lo, val_hi, pc_hi, offset_hi; + intptr_t src_rx, pc_offset; tcg_target_long hi32, hi52; bool rd_high_bits_are_ones; @@ -344,24 +343,23 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, } /* PC-relative cases. */ - pc_offset = tcg_pcrel_diff(s, (void *)val); - if (pc_offset == sextreg(pc_offset, 0, 22) && (pc_offset & 3) == 0) { - /* Single pcaddu2i. */ - tcg_out_opc_pcaddu2i(s, rd, pc_offset >> 2); - return; + src_rx = (intptr_t)tcg_splitwx_to_rx(s->code_ptr); + if ((val & 3) == 0) { + pc_offset = val - src_rx; + if (pc_offset == sextreg(pc_offset, 0, 22)) { + /* Single pcaddu2i. */ + tcg_out_opc_pcaddu2i(s, rd, pc_offset >> 2); + return; + } } - if (pc_offset == (int32_t)pc_offset) { - /* Offset within 32 bits; load with pcalau12i + ori. */ - val_lo = sextreg(val, 0, 12); - val_hi = val >> 12; - pc_hi = (val - pc_offset) >> 12; - offset_hi = val_hi - pc_hi; - - tcg_debug_assert(offset_hi == sextreg(offset_hi, 0, 20)); - tcg_out_opc_pcalau12i(s, rd, offset_hi); + pc_offset = (val >> 12) - (src_rx >> 12); + if (pc_offset == sextreg(pc_offset, 0, 20)) { + /* Load with pcalau12i + ori. */ + tcg_target_long val_lo = val & 0xfff; + tcg_out_opc_pcalau12i(s, rd, pc_offset); if (val_lo != 0) { - tcg_out_opc_ori(s, rd, rd, val_lo & 0xfff); + tcg_out_opc_ori(s, rd, rd, val_lo); } return; } From patchwork Thu Jul 4 12:48:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 809959 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1149885wru; Thu, 4 Jul 2024 05:52:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU0B1qReFaLrOXYONW8aDgt2iw+TQAST97nZst9kcQMxoaLLZHqNOsy7y1n+IvJI4LPqV7gPa6mBMN/h0Iuzddb X-Google-Smtp-Source: AGHT+IFF44eGtMfWD2kDCusCOpYv1M8Kd54PPNDwb0JeK0dHuP0N1MqL6GwlxeNOe1EeJKinu1oY X-Received: by 2002:ac8:5a0e:0:b0:440:b388:97b4 with SMTP id d75a77b69052e-447ccedca37mr21466971cf.12.1720097537326; Thu, 04 Jul 2024 05:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720097537; cv=none; d=google.com; s=arc-20160816; b=Eu+dXKgMU9MzjlbLzJflI0rl2HE6GW898qlQApgq3RKx9R6MkwZ1V5IdfUOw5YZvjR IRjxnNM8tJes8KVvmv+4elI11yafNlBUVZZN3W4/HBv8SMKAb+TjpdtVuMP0cR++lu8b /BpybLEjMHnziBvig53Qgbr6HwPYMpxiMwIr0OsRmkqfn6YAuoQ5eZ/tLEzCw59u2zuS CAfFxQB7Do7Ibo7fGMiXP712CB2ITTC7WV5FmnMD+jr+CRSOEaAofQpNJVzEXmKhJF5h yDe0eo1IkLp9Vyd3Oib5i3/rkIKtR0Kw9iE5jdYnr6Ydzokq6pKCVFAD+zAfR5dkl5s4 rz/w== 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=EOn58UzZtmEYJZImxXVoTiPbTczyE6J4bri+6m6lVVk=; fh=A4vIXZNXIoB8OzgrPW//ptQqgNR9R/NYpLJXMUODF7M=; b=lnmGIMEp0hkjK18/hRE3BVvKyqP17nE1h/gFZpmFeuKsDLb+U23jcMOP2pjSFa1vPG DQjoeH/Fk1u0cCV/RFDqU2ccge//wZ9b+m8VjWZk0E2/FUwY5JnY2qKEsGlI7OknJ1Q4 fa/jucSr0nmRW0IekTj3xuHT094Lem5jqwCuB3YRlZVUgLq56/EgXjNCOUid60xtelhk nhtrmJJG5Nm+qf1KXPrBvOE4hE95ORTKvZGFUg8ivpzrlXJczV9Rit0ewhIROIUZkGLP JbgH8CttN30M5t3lS0nSM0PZlMkagsFaEZ018XL67FZqMr8CY8SgG8+unNHmdtgw0Uwo dNdg==; 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 d75a77b69052e-446514e8181si145296881cf.776.2024.07.04.05.52.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jul 2024 05:52:17 -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 1sPLti-0004eR-8U; Thu, 04 Jul 2024 08:49:14 -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 1sPLtg-0004aW-4L; Thu, 04 Jul 2024 08:49:12 -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 1sPLte-0006Ug-8X; Thu, 04 Jul 2024 08:49:11 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 85A6B773A4; Thu, 4 Jul 2024 15:48:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1DCDBFE789; Thu, 4 Jul 2024 15:48:27 +0300 (MSK) Received: (nullmailer pid 1471795 invoked by uid 1000); Thu, 04 Jul 2024 12:48:26 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , Richard Henderson , Michael Tokarev Subject: [Stable-7.2.13 10/17] tests: don't run benchmarks for the tsan build Date: Thu, 4 Jul 2024 15:48:17 +0300 Message-Id: <20240704124826.1471715-10-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: Alex Bennée All we are really doing here is checking that TSAN builds compile and are therefor a tool available to developers. The benchmarks are not representative of QEMU's actual threading behaviour and they burn precious CI time. Indeed switching to check-unit reveals many unaddressed issues which have been logged at: https://gitlab.com/qemu-project/qemu/-/issues/1496 So for now disable the make check and make this a build only test. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20230228190653.1602033-8-alex.bennee@linaro.org> (cherry picked from commit 7c7d369b33f01d3705a14c361689776de6bb5b7a) Signed-off-by: Michael Tokarev diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index dec57a3240..9b6da37582 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -469,7 +469,6 @@ tsan-build: CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --enable-trace-backends=ust --enable-fdt=system --disable-slirp TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user - MAKE_CHECK_ARGS: bench V=1 # gprof/gcov are GCC features build-gprof-gcov: From patchwork Thu Jul 4 12:48:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 809957 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1149148wru; Thu, 4 Jul 2024 05:50:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW82TRUnCcKx3Dcu+V2DwSEi/N8XB6WzlsJeM45SXEg4O6MJdVmmJxTwLtv9Pji4Pze6JGAIbhdrvc+vwqqQqke X-Google-Smtp-Source: AGHT+IHGt2zQV0tmJIUgTCvxa2BdPBxx8h+1zi0ybnSyPW6eue0zGZExNJZlRUJ+ubMR14omnQeT X-Received: by 2002:ac8:5a05:0:b0:446:51fc:725e with SMTP id d75a77b69052e-447cbf774a3mr20830541cf.39.1720097417004; Thu, 04 Jul 2024 05:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720097416; cv=none; d=google.com; s=arc-20160816; b=GVWy7t2K9U1BH+IYFlnht24jyEpsB42EayeAnERGVqJlCsiQ/Xk2QccK3Pkv2oRk6M u0w7cUkofcO++ONXq2dMk8rd0Bi0yJMsLVwxoT8WBHjz78WCQhC/MhwjhHYygUtZWt1q xmTQkzm8prujlexnlWuFewKk3Fw0VxFXXxH+xr4czBPYYg6RQJYiuI3S41f1Q5K1vdL8 M1O2hULmsgcKtFe8wKQWSGj5o120NLrlhVeIWB6tP6EMjVYrjWAEyly8tCWMnt7/UFHK v+EG/693Nyb7pS8inV15lJxeOyH9q/+j+bzjMBDmxGSOAyUH1jAjDo8ejisLY+gWUAd3 IjwA== 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=qCasKOkGqSxhwUlalA5uM8l4e36rVSeL7lP7AidxsEs=; fh=NoJ7n5JVE2hviRF6uNBFRIJvWH7igafuy1AIwg26ToM=; b=f6GHRMFF7zrkU1NrIRgAzGFmpdPwaUgIx1ROgg9t+/hx4RnfOD39cd8DwIhII7HjiR CeKSw8Hb3l6pIoljjwCCq8Xj/NLeZflM1PPglPPDSzpz5be0iV/ZCYbKCWTq9lC7M26j pC4ArtTf6SQxO/EA/IriUkGqT2fiVpshG2FKUqENfR+f2aoFjJ0vt+YgqMkfpzYOc02l vv7NhKiv7PhHsHjofZ4qLq2rjSmXke137uUCzpAuKTNoKUgHlhVAxGywTSt3cc/toj8r YzY+Zb1/9yngHWKKNqo/Nd92qh5wE8nKILbEuQip4cKpswGQB8EXuBYCgpnjvrF1xz9o Fe7w==; 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 d75a77b69052e-4465148768dsi168209591cf.248.2024.07.04.05.50.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jul 2024 05:50:16 -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 1sPLuJ-0005i3-5V; Thu, 04 Jul 2024 08:49:51 -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 1sPLu5-0005OJ-Ds; Thu, 04 Jul 2024 08:49:41 -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 1sPLu3-0006Vn-Hs; Thu, 04 Jul 2024 08:49:37 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B327F773A7; Thu, 4 Jul 2024 15:48:22 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 4C392FE78C; Thu, 4 Jul 2024 15:48:27 +0300 (MSK) Received: (nullmailer pid 1471804 invoked by uid 1000); Thu, 04 Jul 2024 12:48:26 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Peter Maydell , Michael Tokarev Subject: [Stable-7.2.13 13/17] target/arm: Fix VCMLA Dd, Dn, Dm[idx] Date: Thu, 4 Jul 2024 15:48:20 +0300 Message-Id: <20240704124826.1471715-13-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/vec_helper.c b/target/arm/vec_helper.c index f59d3b26ea..859366e264 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -842,7 +842,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. */ @@ -904,7 +904,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. */