From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366233; cv=none; d=zohomail.com; s=zohoarc; b=eA8SQV2mdGFEFpYE2JDMHRcbzIkz0mOv4YF+jUJCwsrxFGb+WqQyK2iatGo7gxyBGTDGMwve/21lPIRtHCTjgtRdtiiq6gs7qSkEr40vBhKfjyOV8QUmfrSwgEQbPEjDYqZq3Ry4Grz22tblKRA1mFQp+UzkGE+CApGDVBG0Pvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366233; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FQtSYNQ9FYu489GYjbt0/q1hC/7cQF6o3qMq6jMUhtw=; b=LD8tJkK66FeZFWOZJZY0E9NtGhf3GyiZnK3t0jAV0NuV8QbZ6f0mpK575u6PiSzIprfDabF+9XJLQGT3WM9OjBLtppwLGjfWzz3uE0ixbwuFsbBmENAn5S/v85HGvzcQsDkjnpbdGznO7+Dw5ZQZptkAHnR5ihUoMWt0teRwpys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366233211460.84420277486527; Fri, 30 Oct 2026 06:17:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTP-0003Oj-CS; Fri, 30 Oct 2026 09:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSi-0002YX-HC for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:06 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSd-0005UZ-AB for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:02 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-6f8a519e215so648046eaf.1 for ; Fri, 30 Oct 2026 06:15:57 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366157; x=1793970957; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=FQtSYNQ9FYu489GYjbt0/q1hC/7cQF6o3qMq6jMUhtw=; b=yy+aMhKb1C78GmN2/HMM6p9dJTOpgJNsewp7PSg33wQVS92ZVx3mahZkFi2bwNc+EC zHP+/dCcracz6fgVtEfI2gQioRdZ+2Vo09+i0F6gT6OUYRS9adpMkxBgd+2N83llL7TA V9V422DylfX93KCFosElbbwGGWSgPT+czlfxkJJEKrlmXNzSqrB3yi0j4sVFlpN7/K/h DhQdu0ic/vmsksq1JETXw0w5dwhj0SafeAb5QeCiTYxvh4SZgmUjllyX1fvjK8E/EizY am9RfiiQ2Ky2QNrs6TUj+jqhRTVUIelsLRbfnuPcz5/gZVDmrMuyzngncyOi/8aX5tGq G/LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366157; x=1793970957; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FQtSYNQ9FYu489GYjbt0/q1hC/7cQF6o3qMq6jMUhtw=; b=1sNxa+GVa6nGqBTyUxWEjxpSBJ0nDEr/tTXvCDvBJ6C72/N25bNpzvGMkZMWcBtGp4 e3HMScufjx3wmWwpjgVf87YxK/k7BGwgVgINg6j3I6rUZeij8ecWikTjSe2Q2OehSZDM 5wKaXYy+3RVQQMfQ1TIxzULNFYw/RYAKq2BfQzoQ4tfThxAgamllIbb0V77na9rbE+W+ bAnPvd1XtrsLl/ib7ATMji6XG0s7yLJWOmA3/dBGraS0085XFUDW597v/eqnGIuMnJTD vIXzCTImMZzdrHc/HqLw7aEok0THMXh9LBrJj411Q6ueWgqPWYghqLPbe1r0np11r0OO j9ww== X-Gm-Message-State: AFq9FYIqEa/x08TMrPcF0kQXU3nhg1pW77Aih6XIQdWJxo8w10H7/k7Y 2rOchIxDw4cqZ+YmeT7zqpk3V/6Au/xHG1laexE1aJoxjz8HFXG11/3HIKwJjd2XvsW6Rb7TF9r CME0C X-Gm-Gg: AYBFou1og8HJMwmimGAsgETCTBpokZ6h/Yf8t5/ff43nAbkhApX9GQWRB0JwjFfEQn5 S4NVsleI5ZJ8IW6dJlKlmz6CYdtnaTornzlrm8135KcT7lJAmdzWXxrYnPjD5qWsc+lcmkew7o7 8Rfq6ERDScqhE6lz+MoTruXVkqsrzfko2F75uSeEhVmxZvjxE4Qj5UU5Ao1IRc5//L5DOFC2K5A ZczUsGG1bHFVCZK2IiClaXx+Xma0XWTG8p8w3U9+1B7kniocWFtp/eEEgfrIez8exIxo5SIBWig UoWA8jV9hdVVVY1j/e1hIPCapquBACmMODdbJOp9tLdI2viZz8V0OO2tq5HxbPwDJZVvhW1vjYE CZScmNPS9VXEDxuOzm70cf8SO8ybe9YBHQgTn6XylxtaSP5XZ191xSt+ch2OZNOYdT5AdIS8mfd XtPT7I4KhINBMhAXzLamisfzI8Ej5IkdPokvfd0WL3KQ3xT65fOgQxJzxeru3jCxZLUAIbexU6u lpp8i2TpH5SywNQ5AjqEiJJOmBUyNAhs68XUgTAEAhV4Z8NHwaW4A3UoSNHhaZQ88WVhg/MtmL7 4q0AB/EUZdFoMJRxgBtC714wxfL6dA== X-Received: by 2002:a05:6820:308a:b0:6d8:462d:2755 with SMTP id 006d021491bc7-714ddf3c652mr2982990eaf.37.1793366156856; Fri, 30 Oct 2026 06:15:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PULL 01/19] tcg: Adjust NONNULL annotation on *_diff functions Date: Fri, 30 Oct 2026 08:15:36 -0500 Message-ID: <20261030131554.41208-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c2c; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366234156158500 In tcg/sparc64 we use tcg_tbrel_diff with NULL as a negative addend in a relocation. Fixes: b0b6701a4018 ("tcg: Annotate functions in tcg.h with QEMU_*_NONNULL") Reported-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/tcg/tcg.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 8f409b23b7..3dc26b919d 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -881,7 +881,6 @@ static inline TCGLabel *arg_label(TCGArg i) * This version relies on GCC's void pointer arithmetic to get the * correct result. */ -QEMU_ARG_NONNULL static inline ptrdiff_t tcg_ptr_byte_diff(const void *a, const void *b) { return a - b; @@ -895,7 +894,7 @@ static inline ptrdiff_t tcg_ptr_byte_diff(const void *a= , const void *b) * Produce a pc-relative difference, from the current code_ptr * to the destination address. */ -QEMU_ARG_NONNULL +QEMU_ARG_LIST_NONNULL(1) static inline ptrdiff_t tcg_pcrel_diff(TCGContext *s, const void *target) { return tcg_ptr_byte_diff(target, tcg_splitwx_to_rx(s->code_ptr)); @@ -909,7 +908,7 @@ static inline ptrdiff_t tcg_pcrel_diff(TCGContext *s, c= onst void *target) * Produce a difference, from the beginning of the current TB code * to the destination address. */ -QEMU_ARG_NONNULL +QEMU_ARG_LIST_NONNULL(1) static inline ptrdiff_t tcg_tbrel_diff(TCGContext *s, const void *target) { return tcg_ptr_byte_diff(target, tcg_splitwx_to_rx(s->code_buf)); --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366215; cv=none; d=zohomail.com; s=zohoarc; b=ZDtkO3T2MyK9vRZTrD8koqXqDn+oKmqZeYfvdrIz1IK3jx+reRXwabbaWRKaUxHbzXPzzNQqWsGiogbSOBulmTS43bQG6gt+61l2jdWHU66I7GoPkoT8Ei8x4adFvdk9/kJW6MDVfTHAuBvombkcvxSo8K0uXhSMyPoPI09ysas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366215; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kflzdU7DETJFjXbwtdoyvY7Xj5HZXyjjC9ZJcSFVySw=; b=iUMm92pIAV/f9Pjm3PApMWMxsGfBcQBHm9JZ5AHKUJWoxJCqQkTrfU7Xhgs5yfIUq/8AkZ1CuES6kjTKPyMXlapGR/J8b2HO6GK7UYXd7pMGsU9n7DW80TMyL632TW9b1TkTLMEGAHddvfdhj/aZsN2yD35L8uP1SPu4gukefoU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366215369141.7918343071866; Fri, 30 Oct 2026 06:16:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTO-0003Jk-Mc; Fri, 30 Oct 2026 09:16:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSi-0002YZ-IM for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:06 -0400 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSe-0005Un-Fv for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:03 -0400 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-4a6fb4040cfso235623fac.3 for ; Fri, 30 Oct 2026 06:15:58 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366158; x=1793970958; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kflzdU7DETJFjXbwtdoyvY7Xj5HZXyjjC9ZJcSFVySw=; b=U28XKRCpQPugeB9F2kybSLcNBms91Iho7Hh0hA7RMED7DOByHfXIT7wNshoa7Bh+uI 32Dn5d/X5ObsQPgkAbCQmNIEFAJERUjeVnRN2OEvH8D1RHghkehjXXINMLdWXI5b7gK+ nlqLToRYwYk9vOoGPdxvhY0vI3pc3iqiNRgKmTxnCVPnpCnFr8gNuRRhr4kjStd6nFP+ qNf5/KvFX6Xgv9QXbfbiM7wwfYwtR5ySkODaVSLtnTApxvR3ed02KrUMJa+O2fNJUvbf tBZkAk3FYrRVfon8bixxKpZoveLHF08pyZJhheNXvXIn3lAz9imen73jf1wGMQHXsyM7 fzYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366158; x=1793970958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=kflzdU7DETJFjXbwtdoyvY7Xj5HZXyjjC9ZJcSFVySw=; b=gxooIUFGKtmey8EIqLvhmstfKw+6yGRJ2fUf1nnVKSy5kW5g5FfQCr9hzQ6ykzFoLs u2avcH822VpedbsuZdvC4AHkW5k7hICtWbTilR0SWZ8itOcJsfaNt2ztRwv4ovHa36NW C0iCfH3+2n2byA/nh8fOKeiIRfZrh1F/PaLbiSm5qP4WXZpp84SB5l+fQ73OydWTqkAM 5c9hzyfcdHVFDqLNF7+XjBV4AinLVWSfceTcosYk44ID3PI61buVJH89IzuF5YdYiH+L jyhtnxAW5pPC4T/EljrnsRNVmOB30IlNkKuQFF/+w62BzZ9Tn8WQHkH2OJ15KZqHXbtK 2t4g== X-Gm-Message-State: AFq9FYKWSi5H3rT752jFw/CsNwpT93l4nFaux2+5WgGQoNGhApngTukt Q0NbSmCy7kKM8YgFLw4lTf1ezMIZwSipUGltB1B3/KAeogvl5zqz0EvvmA1cEeCFBF4K25IZb8w 9t72t X-Gm-Gg: AYBFou2grLelYBJv5RH1JYgmg5plhhWryAyhHNohdPxdMmuvIMqSNkmES/JBuUof+aD O3rbogDz+rhlfwLOPK8Zkdfyjl5d03wQ+H7Fk5wvIp36Yv7Zh1gwAgQ3+edbBzCo1ixpxK8jjgZ W1VMx2ocuqB+9mqybff59rxFtS4cf8k5IoBrwZ+qeqmUn9uzuMYdc2R3PUa3Zuqgulhw3vhFhNu duQOvG6mbE+U9oQ6gpsLmJ2sMnEteVqrqfoTn7ZSgfNhRZloPzeNpBOrdhVB5WFRiRcVLwIsopu 0hHjrl1YtQraVDZJ2CTDD+s28zDFOhFiWqaRonS2mBdOUemSZT04SxmvYFaq0NHAMohNVqcR2NN t2LSzjQfr7TlULrgaLfc9aJ9inNEI6wopZqPiMp377I/o5SIVG7tBnXlujmFgyIfnXoN0G6/JZY Mt65eEDWOAYgRf9IZtlyoQ8L75O7yRQ/Qna+ahwOB7jN1OHM62mPCHcgeehX+JVJRumdjCbsMa1 bBUhIXSAGtvDbPZcSSLqQ/g68ApV8uxlCc4L3ZoQKs7oJbTux/cOP+VfGWFLENuUtx/IriBOz2w Kv4E4THVwGx+AT3NKVt7I5DmMe9hJQ== X-Received: by 2002:a05:6870:1b16:b0:455:adbc:2154 with SMTP id 586e51a60fabf-4a906ca95aemr1257070fac.0.1793366157801; Fri, 30 Oct 2026 06:15:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Aleksandr Sergeev Subject: [PULL 02/19] accel/tcg: Fix false awakening of gdb Date: Fri, 30 Oct 2026 08:15:37 -0500 Message-ID: <20261030131554.41208-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366217672158500 Content-Type: text/plain; charset="utf-8" From: Aleksandr Sergeev In qemu there is a mechanism to cancel execution of tb. If `cpu->neg.icount_decr` is <0, translation block will exit in prolog. E.g. such may happen when RCU thread kicks out vCPU. If tb is not executed, we shall not raise EXCP_DEBUG, because no step actually happened. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4766 Signed-off-by: Aleksandr Sergeev Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20261028072308.839836-1-al.sergeev@syntacore.com> --- accel/tcg/cpu-exec.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 9ead35418d..4497701486 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -478,16 +478,16 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int= *tb_exit) last_tb->tc.ptr, pc, lookup_symbol(pc)); } } - } - - /* - * If gdb single-step, and we haven't raised another exception, - * raise a debug exception. Single-step with another exception - * is handled in cpu_handle_exception. - */ - if (unlikely(cpu_single_stepping(cpu)) && cpu->exception_index =3D=3D = -1) { - cpu->exception_index =3D EXCP_DEBUG; - cpu_loop_exit(cpu); + } else { + /* + * If gdb single-step, and we haven't raised another exception, + * raise a debug exception. Single-step with another exception + * is handled in cpu_handle_exception. + */ + if (unlikely(cpu_single_stepping(cpu)) && cpu->exception_index =3D= =3D -1) { + cpu->exception_index =3D EXCP_DEBUG; + cpu_loop_exit(cpu); + } } =20 return last_tb; --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366210; cv=none; d=zohomail.com; s=zohoarc; b=mU89eOw66gwDOgOIxz5wp/iOrtNMF9A1y3fGQN/Gc/+9luzB2b+mL/aKxVbDcfnUoEQC5Mrd7OCdd5AeHs/RSEm2fiPToMLO4/AFjDmDFbhEqYI22SW8X0/LyrLM/BCvLTI7ZfiTVzxteHd1XCaHNlT2tnIOF7BK56pAWJRpYkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366210; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Qon+B/5TvTR1QAosPUVdPLGJfZbjiJlI+iI5Il3G1+U=; b=WoDk6WJiOf3M1ual4j3QDTCjTAo8OQ5q0jSpumCcGlZJxfjgm/eu/Rqfj88Lv6+Cm6fo10oPLK93HJiZJwkPiN+7oj7NeOHz+Wuivhor3YcWlgd7Z0uIchN07yllp2jWJiB9nnEBAy+R1JFsPLfcIBHtakEHcTawziCA+uNV7Ow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17933662107391010.8540399747775; Fri, 30 Oct 2026 06:16:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTQ-0003VG-32; Fri, 30 Oct 2026 09:16:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSq-0002ip-8D for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:17 -0400 Received: from mail-oo1-xc32.google.com ([2607:f8b0:4864:20::c32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSg-0005Uz-Ia for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:06 -0400 Received: by mail-oo1-xc32.google.com with SMTP id 006d021491bc7-6df5e315bd1so552434eaf.2 for ; Fri, 30 Oct 2026 06:16:00 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366159; x=1793970959; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Qon+B/5TvTR1QAosPUVdPLGJfZbjiJlI+iI5Il3G1+U=; b=vH8IvvGd5AHEgI4uXzi+BqGzyACJ6kopHL3SK6WwdExOHtCHnLbUOBz6VVDeaK+LUy bpvnOsfELzm7osqoD2J5LBmMSk2hoP7fqPPZTRlo8iU0ZOPfIY2KEsnncZNx5u6uVYB1 hWVnaPYBIcRQ3VepF4NmJUvVB0KKGR0UsdqC/S5YhpPNvPzmPJo3j/LVs21I8SGKiW/h MsecowK+LFmKd6PC3hehvIQj9d92z4NrxPWZHJu1du3ofnf9LCEOphBsURV0JBlObcf+ qyDEmWhTc4DgPJuyWT9hhga8TUP8099r5BOwDLWYGDh+vDM+I+DU3GpILTTVNSilPfFM ykgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366159; x=1793970959; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Qon+B/5TvTR1QAosPUVdPLGJfZbjiJlI+iI5Il3G1+U=; b=bbK5wMj5mn0LqbnmhzRnyTpHHcHLw7oZdTznzSWKQpvIF9DujRLj4yaP7jAlnz2jPt a06HZgEHeLknnMU8IKI0yV0AcpA22vhVuUaLxf0tvQY8Wu/O+E2vkkfFlOTONzNbZEFZ /vCk2MM393j9YPjNvyboFh/Y0dueWQw5xlCgWsYSHqP3fbh+0Tp4VL6Bjm9JAJPJK7n6 I3OEMFAxb0Ka+CjkJMlLw/n93fjAKZftDp6hxLiAajBu3B0vwCT8zLCRhqpOTH2hr2hy jCkB/TEPA8HlDKkEX3tpedXAex67rl2wc4tHOmRfihHwV2igRe5pFdIcUpz0eGGzu/r7 1p6w== X-Gm-Message-State: AFq9FYIBmDSkFllAVi7e4YJHuv1/6h5zjRU+et9g7DAuc48RoO8NhgoG 82rfbCRghPSpzUElIrkc9LjEjazds4KVOXRT4rMso+AW+NDFPBpgpRCha/wfTeHUtqaJ2jdq9q0 LaaVs X-Gm-Gg: AYBFou2Fb8fLN97gInox111VXAXZB5Am+D8bkONWMzHXeyihtZSklIO8mBuEZKVIzoR NZ9u0lazepuNBKAzGtbV+4MRrDTeqvhkSs9vIjCXwZIdx+gYZUUw3DLUTBBfyqNpJYVg5RZTJtU C7ftV0w3d0ZQ/6P0x9xQBf26o/g06qi4rA0ZWFxXeAn/34zGHt7UVp7JkH0PEbIcEAHXoj/fGV1 2XpDntd7OQOSd0s8PjeXCAfMFwv1AkDhm1VxIiJCy3h0u1gN8Q5LbohCpxvKTTh0GR6/BLsRHSx gdZOLe2Mn3SAvnF6CAeqqYaY6wEUFQaVRMSjPAaj5/T/dv5lY/bvraGUStqlxLtr2gPHNGh9ErI MRpSVCCLVNF8RysuuYafn0dbZwgUncPBa5eoN4oD65ziCmQiegtT/jLP4TZb/4ToACcccw1zc3i o1dV7k71fjwgxNwLTdZmSCTkE5r3RIjAS9fmQ3InwV1CSpYI8tGtbi9BeRh5JfG9fFiL6fwxCBa qdjWuQgjPFGIHY/701S5cvT98rVMnl5qQglI4zcpmROAgf0MH/MQ4VppTvgbLv6DNsgaUiDCfjG kLUzLegS4fBU6rnT+k1OzSHtjvAMNlbGFGNZbiqFoXtstLdgOV8= X-Received: by 2002:a05:6820:16ac:b0:706:5b0b:4e8e with SMTP id 006d021491bc7-714f252f907mr1454240eaf.55.1793366159055; Fri, 30 Oct 2026 06:15:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Stian Halseth , qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 03/19] accel/tcg: Do not flush and retry in place in tb_gen_code Date: Fri, 30 Oct 2026 08:15:38 -0500 Message-ID: <20261030131554.41208-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c32; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc32.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366214333154100 From: Stian Halseth When the code buffer is full in a serial context, tb_gen_code() flushes it and retries in place. cpu_exec_loop() then chains its last_tb, now freed, into the new TB. When that TB is invalidated, tb_jmp_unlink() follows the stale entry and qemu crashes inside its SIGSEGV handler. Always queue the flush and leave through cpu_loop_exit(), as before commit ebf7a5d294a3. This also brings back the cleanup in cpu_loop_exit() and cpu_exec_longjmp_cleanup() that the retry skipped. Since commit 25e5c6a320db ("accel/tcg: Allow cross-page goto_tb chaining in user-only builds"), user-only builds hit this easily, e.g. qemu-sparc64 -tb-size 1 on a program writing next to its PLT. Cc: qemu-stable@nongnu.org Fixes: ebf7a5d294a3 ("accel/tcg: Improve buffer overflow in tb_gen_code") Suggested-by: Alex Benn=C3=A9e Signed-off-by: Stian Halseth Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 328d96aba3..ea8257935e 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -288,12 +288,11 @@ TranslationBlock *tb_gen_code(CPUState *cpu, TCGTBCPU= State s) assert_no_pages_locked(); tb =3D tcg_tb_alloc(tcg_ctx); if (unlikely(!tb)) { - /* flush must be done */ - if (cpu_in_serial_context(cpu)) { - trace_tb_gen_code_buffer_overflow("tcg_tb_alloc"); - tb_flush__exclusive_or_serial(); - goto buffer_overflow; - } + /* + * Flush must be done. Always exit the cpu loop so that the + * last_tb linkage within the inner cpu loop does not apply. + */ + trace_tb_gen_code_buffer_overflow("tcg_tb_alloc"); queue_tb_flush(cpu); mmap_unlock(); /* Make the execution loop process the flush as soon as possible. = */ --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366255; cv=none; d=zohomail.com; s=zohoarc; b=e6KcJ/RoMys91hk/Z4g07dri/y4Nx/lmP9UA4xiVlRrLlqjEUNXm71mQg93xnznNGKVcc5XnQCfufcii34h3+1dLyL9GHNfONIrndFsF1LXn1GVpArgImKlk/hdjLsRh0VjAVmBl1N+dCAkyvzZqre7k6rwaBJzcpXR1t9UHZJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366255; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mwxXAe8gLx4Kv98pFPow54XcNdRbMEjAe+UH66vUv1c=; b=ZrIKiu/DhJyzpHft8aHz0uKOf/QB42lvUOi0+Fmj6VKdzbpC9nlpmOEYMg041AqWfca8Ove5wL688WeLPiMhmy9hTT4HcIk+zG0JerHJuNLuw82zooZ3Cig7fqd+h6OTQkWLo6uyaVRfaGXq8P+u7Fum0X+bstsPRhOgWVJZzGo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366255841867.9957891163878; Fri, 30 Oct 2026 06:17:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTS-0003il-Jp; Fri, 30 Oct 2026 09:16:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSr-0002jJ-Lw for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSi-0005VG-7X for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:08 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-8470d7d430fso284889a34.3 for ; Fri, 30 Oct 2026 06:16:01 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366160; x=1793970960; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=mwxXAe8gLx4Kv98pFPow54XcNdRbMEjAe+UH66vUv1c=; b=l1NtMFR0nxiRwtZz300q+AxL7WDip5ipmBCPyL36J8//5Q/KETSAj1br6GsVmaz/qn Vr55o7dtgvGsv4YN+nZrhwh4AsPDlktURMAzbh7AkgoFni1fLMyy0/eVQuj57LLWlBpX bTGZguk9YHZiYLyStvKgPdGLYzIR2E2Z7+92rBgZC3rvR0HtQc33IAC7VbsCxE7UPRGZ bUGvyWRPTljXpKU6aRvbs/GUmaiQe2N4HdujTRSVj4QrLZZ9e/LPONQ9Hj00OtoiP08n ICquXsqcj8r0O+J941oLVU0JK/e6gVOhKOkJmrHvVaa60wFHaE1WmQAbH/rrSLMiF0ui Gy3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366160; x=1793970960; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mwxXAe8gLx4Kv98pFPow54XcNdRbMEjAe+UH66vUv1c=; b=l428dOtWEpQ9YfgY8wxF4ynh3CnkLMMPa7o1UNW7BjycCV/wI7XwKH8PQkcKRzREXe cIJn3DrVsGoMsR8ah2rGHQOS6B45E+T4uV0OtuFj3zydEpAEEpx3ipDtJtHxLW2+i39j kAsymvk0kUllY57xmTXx6oTJD8v5B00YKNZVagIAipYNjW3eNTbhYPr02G7cjwJO/aM5 kBQfnypaQNA8x0sDUSLzSDUbE9x7QRuNNIzQc1Ze9yCVL+I1Oah9QdSJ8CUNtKWivESn 4iIlAWHbEacii717J0pcZ2THPnXkHb72IrppAi/XRG6TXoCFRkOuoRNkr6AyTu4KxbQ1 3T3w== X-Gm-Message-State: AFq9FYK8lTupYZXLpprEcVcLHiuTkVSE2ind+qZj2ZoSYxRBpB+oz1qp LaXMmpKt1WFuiU3qfsXigSiz7X5jKCHFgQlv5UnLsTIWA++TWpFjJ0v/CO9JWB/yiWkDOtz82PI 19u5X X-Gm-Gg: AYBFou24h2gMvGsnNKyYXXEI39KNqFBGkGkRNiKn6ntCwrRE2ElBm8W2zYKd9bQ0xXu G39+4jms5j+O8FwVr5q2LWWXECF/Sa3HhU1eN5H5as+1I8mMsjrNb5jFO+EfupUQ1NxN5bLaakw evjvCSIXGqT3OIFNMg3s6rONp9L9olC/sJ98Hzyf6zGXqxa6Rg4YKIu6lWOQYl+IZjJfW0hxNt4 xkVVzysvwl20cZN+YY99zAJ3mkgAsgQ6rAQeU62fvb2ckHqhad++XTEnY3rumxdamU716d54yrX NmbQGOxldBEesvYG1oJbMTgsWzlsha/2IMSEpGTWMGZ8YzTYUsdcNCZVgfcrgtwflaO4eXn1Jq7 bFrqEf2jWeOxmTDb+605WwbftwZnO8XEBDxlPmccfoI+zuDeRGNw8KKI7uMsIyZMInk2ZnXR+wH EmEcs+ZwhD54r3d0IJpDk+H+hO+w8EAO0I51QTffezcUQQJ0K74H3UKj7jqjuQr2b8NB50rheaR duGUg39ixyUWY+tgrObLc/JGFwRMJ+Xqv3dUVn9yu+BH2xTf9LFiAQbmvGAJIjZ/vVGHFPjUYru 5/VEAxas1tYc7cSAvO+2S4UweT0FeA== X-Received: by 2002:a05:6808:6415:b0:564:b24:af6a with SMTP id 5614622812f47-5640dde8044mr1499495b6e.38.1793366159995; Fri, 30 Oct 2026 06:15:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/19] tcg: Add INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:39 -0500 Message-ID: <20261030131554.41208-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366256467158500 Add an opcode for compound address formation. Reviewed-by: Matt Turner Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- docs/devel/tcg-ops.rst | 4 ++++ include/tcg/tcg-opc.h | 1 + tcg/aarch64/tcg-target-has.h | 3 +++ tcg/loongarch64/tcg-target-has.h | 3 +++ tcg/ppc64/tcg-target-has.h | 3 +++ tcg/riscv64/tcg-target-has.h | 3 +++ tcg/s390x/tcg-target-has.h | 3 +++ tcg/sparc64/tcg-target-has.h | 3 +++ tcg/tci/tcg-target-has.h | 3 +++ tcg/x86_64/tcg-target-has.h | 3 +++ tcg/tcg.c | 22 ++++++++++++++++++++++ tcg/aarch64/tcg-target.c.inc | 4 ++++ tcg/loongarch64/tcg-target.c.inc | 4 ++++ tcg/ppc64/tcg-target.c.inc | 3 +++ tcg/riscv64/tcg-target.c.inc | 3 +++ tcg/s390x/tcg-target.c.inc | 3 +++ tcg/sparc64/tcg-target.c.inc | 3 +++ tcg/tci/tcg-target.c.inc | 4 ++++ tcg/x86_64/tcg-target.c.inc | 4 ++++ 19 files changed, 79 insertions(+) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 88d48a1f99..51fa183e91 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -524,6 +524,10 @@ Misc =20 - | Reverse the 64 bits of input *t1* with output in *dest*. =20 + * - lea *dest*, *t1*, *t2*, *sh*, *imm* + + - | *dest* =3D *t1* + (*t2* << *sh*) + *imm*. + Conditional moves ----------------- =20 diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index f3a81d5d7f..884345afe5 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -64,6 +64,7 @@ DEF(ld16s, 1, 1, 1, TCG_OPF_INT) DEF(ld32u, 1, 1, 1, TCG_OPF_INT) DEF(ld32s, 1, 1, 1, TCG_OPF_INT) DEF(ld, 1, 1, 1, TCG_OPF_INT) +DEF(lea, 1, 2, 2, TCG_OPF_INT) DEF(movcond, 1, 4, 1, TCG_OPF_INT) DEF(mul, 1, 2, 0, TCG_OPF_INT) DEF(muls2, 2, 2, 0, TCG_OPF_INT) diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h index 69e83efb69..86672b2eab 100644 --- a/tcg/aarch64/tcg-target-has.h +++ b/tcg/aarch64/tcg-target-has.h @@ -57,4 +57,7 @@ #define TCG_TARGET_sextract_valid(type, ofs, len) 1 #define TCG_TARGET_deposit_valid(type, ofs, len) 1 =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-= has.h index 32abc6f457..31e6ea9632 100644 --- a/tcg/loongarch64/tcg-target-has.h +++ b/tcg/loongarch64/tcg-target-has.h @@ -54,4 +54,7 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, uns= igned len) } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/ppc64/tcg-target-has.h b/tcg/ppc64/tcg-target-has.h index a3711feeae..d11d82f184 100644 --- a/tcg/ppc64/tcg-target-has.h +++ b/tcg/ppc64/tcg-target-has.h @@ -66,4 +66,7 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, uns= igned len) } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/riscv64/tcg-target-has.h b/tcg/riscv64/tcg-target-has.h index aef10c2d9d..93f8baad09 100644 --- a/tcg/riscv64/tcg-target-has.h +++ b/tcg/riscv64/tcg-target-has.h @@ -69,4 +69,7 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, uns= igned len) =20 #define TCG_TARGET_deposit_valid(type, ofs, len) 0 =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h index 0aeb5ba01a..58e3afe526 100644 --- a/tcg/s390x/tcg-target-has.h +++ b/tcg/s390x/tcg-target-has.h @@ -77,4 +77,7 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, uns= igned len) } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h index b29fd177f6..4182a7c1aa 100644 --- a/tcg/sparc64/tcg-target-has.h +++ b/tcg/sparc64/tcg-target-has.h @@ -19,4 +19,7 @@ =20 #define TCG_TARGET_deposit_valid(type, ofs, len) 0 =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/tci/tcg-target-has.h b/tcg/tci/tcg-target-has.h index 64742cf0b7..f4f9ddf595 100644 --- a/tcg/tci/tcg-target-has.h +++ b/tcg/tci/tcg-target-has.h @@ -17,4 +17,7 @@ #define TCG_TARGET_sextract_valid(type, ofs, len) 1 #define TCG_TARGET_deposit_valid(type, ofs, len) 1 =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/x86_64/tcg-target-has.h b/tcg/x86_64/tcg-target-has.h index d249c1b3e7..6ffae51f92 100644 --- a/tcg/x86_64/tcg-target-has.h +++ b/tcg/x86_64/tcg-target-has.h @@ -105,4 +105,7 @@ tcg_target_extract_valid(TCGType type, unsigned ofs, un= signed len) } #define TCG_TARGET_extract_valid tcg_target_extract_valid =20 +#define TCG_TARGET_lea_sh_valid(type, sh) 0 +#define TCG_TARGET_lea_imm_valid(type, imm) 0 + #endif diff --git a/tcg/tcg.c b/tcg/tcg.c index 1cd6d41d31..d19c3fb857 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1095,6 +1095,12 @@ typedef struct TCGOutOpSubtract { TCGReg a0, tcg_target_long a1, TCGReg a2); } TCGOutOpSubtract; =20 +typedef struct TCGOutOpLea { + TCGOutOp base; + void (*out)(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1, + TCGReg a2, unsigned sh, tcg_target_long imm); +} TCGOutOpLea; + #include "tcg-target.c.inc" =20 #ifndef CONFIG_TCG_INTERPRETER @@ -1191,6 +1197,7 @@ static const TCGOutOp * const all_outop[NB_OPS] =3D { OUTOP(INDEX_op_ld16u, TCGOutOpLoad, outop_ld16u), OUTOP(INDEX_op_ld32s, TCGOutOpLoad, outop_ld32s), OUTOP(INDEX_op_ld32u, TCGOutOpLoad, outop_ld32u), + OUTOP(INDEX_op_lea, TCGOutOpLea, outop_lea), OUTOP(INDEX_op_movcond, TCGOutOpMovcond, outop_movcond), OUTOP(INDEX_op_mul, TCGOutOpBinary, outop_mul), OUTOP(INDEX_op_muls2, TCGOutOpMul2, outop_muls2), @@ -5796,6 +5803,21 @@ static void tcg_reg_alloc_op(TCGContext *s, const TC= GOp *op) } break; =20 + case INDEX_op_lea: + { + const TCGOutOpLea *out =3D &outop_lea; + int sh =3D new_args[3]; + tcg_target_long imm =3D new_args[4]; + + tcg_debug_assert(!const_args[1]); + tcg_debug_assert(!const_args[2]); + tcg_debug_assert(TCG_TARGET_lea_sh_valid(type, sh)); + tcg_debug_assert(TCG_TARGET_lea_imm_valid(type, imm)); + + out->out(s, type, new_args[0], new_args[1], new_args[2], sh, i= mm); + } + break; + case INDEX_op_goto_ptr: tcg_debug_assert(!const_args[0]); tcg_out_goto_ptr(s, new_args[0]); diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 273462ca61..b601b19c7f 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -3081,6 +3081,10 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; + static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl, unsigned vece, const TCGArg args[TCG_MAX_OP_ARGS], diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.= c.inc index 69e76807d6..17784d8bbe 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -2098,6 +2098,10 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; + static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg rd, TCGReg rs) { diff --git a/tcg/ppc64/tcg-target.c.inc b/tcg/ppc64/tcg-target.c.inc index cd1c234367..99f4469f4b 100644 --- a/tcg/ppc64/tcg-target.c.inc +++ b/tcg/ppc64/tcg-target.c.inc @@ -3633,6 +3633,9 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; =20 int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) { diff --git a/tcg/riscv64/tcg-target.c.inc b/tcg/riscv64/tcg-target.c.inc index 03f32c5819..ec0c8e1af0 100644 --- a/tcg/riscv64/tcg-target.c.inc +++ b/tcg/riscv64/tcg-target.c.inc @@ -2740,6 +2740,9 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; =20 static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl, unsigned vece, diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 4d1a779c47..2fd7012d04 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -3187,6 +3187,9 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; =20 static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg dst, TCGReg src) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 35cd14a5b6..cb457453ff 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -2120,6 +2120,9 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; =20 static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 4cd1c1431c..6942fdbb4e 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -1220,6 +1220,10 @@ static inline bool tcg_out_sti(TCGContext *s, TCGTyp= e type, TCGArg val, return false; } =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; + /* Test if a constant matches the constraint. */ static bool tcg_target_const_match(int64_t val, int ct, TCGType type, TCGCond cond, int vece) diff --git a/tcg/x86_64/tcg-target.c.inc b/tcg/x86_64/tcg-target.c.inc index 590c9c2402..46efee87e6 100644 --- a/tcg/x86_64/tcg-target.c.inc +++ b/tcg/x86_64/tcg-target.c.inc @@ -3357,6 +3357,10 @@ static const TCGOutOpStore outop_st =3D { .out_i =3D tgen_st_i, }; =20 +static const TCGOutOpLea outop_lea =3D { + .base.static_constraint =3D C_NotImplemented, +}; + static int const umin_insn[4] =3D { OPC_PMINUB, OPC_PMINUW, OPC_PMINUD, OPC_VPMINUQ }; --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366222; cv=none; d=zohomail.com; s=zohoarc; b=WXetMXTWIVvE9ENkSOoY9gLNCAPs6LRm2iK3xGtMmRCZzPhsrcC0myQEthkmA6q2CCjgLPJ9N5eedSfOyBD/yV25Ly7YZK3/V/QfkdaWFFOKWrhUN9R+H8Wn+A3iVGowYcaPlMLaBJGTguWRyeBfm12bHhIW0zTBnwK5vfUp6nY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366222; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HNTd1g80+YDEGB6ituftaPpJ1wOUyR7NzGt5BUdivzo=; b=BzW1x9mbCn4tmYbJhAcJJhkMJ/tz/TbIghD56srldp5m8Ab7rfty43Ze72r0jo4DOgWhLeuArDztchUeAYn2j/FKUicrs8ENZeERy8Pz7EdnO8Vsldid+WsBQx9bvABWxQc9TWmxNmV/UuVBzsA6uk/f2HXMFPtUFepn9lyamHU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366222469600.2854981474088; Fri, 30 Oct 2026 06:17:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTV-00045W-Mw; Fri, 30 Oct 2026 09:16:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSr-0002jG-5E for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSi-0005VK-8d for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:08 -0400 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-4a755bbe158so473280fac.0 for ; Fri, 30 Oct 2026 06:16:01 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366161; x=1793970961; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HNTd1g80+YDEGB6ituftaPpJ1wOUyR7NzGt5BUdivzo=; b=nNHsQtxonVA2SO4Q3T52lMVOB1+ssLkP5CMV232ZCtk/UetA9k0Bj31vlDpqi40hZn ttWmpA5O1dNbxRpRbu0TM0PcOMUhKa9X3UAFsZ/tdFp3QW3yzMelCuulnvZsQjSi7kRu O24oLGRM5fV+4sBzfyZjIm/MQtlEMAaqBrl9trDMKFVaGk99wyQZkPKHhoQD5pZ/03U4 uTPbY23bGxGqlYJK9FxR7W+6mDoIlZF8aY/znY54liRZd4Q/oKaIG6pXMChfclEaF/ZX LSzM4W77SAjGZk+NdbHbPMWZ+CJsss+NhfFrs89lsmcHpvnX0UvAEvspnycsIRZBLYO0 3ldA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366161; x=1793970961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=HNTd1g80+YDEGB6ituftaPpJ1wOUyR7NzGt5BUdivzo=; b=zDi6xskLv/tuAmsl2msKijOv5/B7rD9aNjbjeQdSmD0nEjcnTscI7bhzsNkZPozaV6 uH+Vk5QHT3gX9OR7bIdO1qFp3nO2RhXdFK9g85bOO6v0DIAnYmoMHE4XXdKbGRmFBOCu 2s/WzStSJhT/ba/ungK4FUgY+9yvUIxvTQtq4VdzdDnjvgpZnmdbJM49idZ6Yz/XBNvb o19Ic9TnABFzTZDPqSZCUY75b9ZJNByKQeEkGAalRheh4xegN9jXwfAyj56PeAatDyAv R5v7ufUMHZ6OCAx7i3GgSbeE1BFYbjj8yLK9yot70RJ2KltnIUsMwmSWr2jDp1At9/u8 uO9g== X-Gm-Message-State: AFq9FYLHP9EL9ithu1j5vW+9gs/VmJo8GiWOExKPFFPaM1/Ao3HcsXxL rZrh06ivT5z+j+chfHjSpzRpx/FbCS50lv4lN8bTdLmQ3oTiJJvio6C+X8rNE8zB8h7vNVoID5j N+hch X-Gm-Gg: AYBFou1/NuHJ+voXMJwEZkwqqxlrPRoehWObtsj3n7jnA5rM00H292fEWjN8xzg8znA Om5mQ/Gi58TOQ+yNgYbYvl3B4MHNHdSmwVJVY3llYy1rJHzxjsr1iLCe8ZCLoaNSfs2VOjq+5vJ yQAsHMxeSG62Hin3I6P/hHrsFIL6uUPwAytzAdPT6N5OIIRGkOEorXYh53nK4QUhvO7Tms22zNr JqqOtr6jAfugefgymj3JX6PBN0HjnfEkEd4EM2DJLv4GSADlKsV/Nrsh8pMG/3UnKJkFSRWxeeB liNehb23tJfTfWV5bn8TrmO4irTgScEau6+zWKA3xosvHRAnD/mvwmG6TlxbvZGpNgiIFMMv2Xx OL2vlaLW5JYYkRjtHXNz1Oi/Bq/t4udCOwCerGkpfkgJil+EKSMIyOEQPXFqGID8wr1r/Smxk9W pFH4QIWrd4O2mJOctVnajZPIoKQzzHtn0klTdKQptm/vHdK3jOFnsZYrfAcoYDRlV/r5oTFFkKV PDmrgPvdrswoAy55P+RWuYwqilNM3jTpMoJ3Ad9+E3nxyUNnyB62Jaw+63tnoV3wVNLf59eVWVw hMrtS3YRny6ycYj5KyApA6IQINGNZJABbgTDdxiTRtQEFLLDBw0= X-Received: by 2002:a05:6871:88b:b0:47b:e30b:893c with SMTP id 586e51a60fabf-4a8e05ff2d3mr2807198fac.6.1793366160896; Fri, 30 Oct 2026 06:16:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 05/19] tcg: Add tcg_gen_lea_{i32,i64,tl} Date: Fri, 30 Oct 2026 08:15:40 -0500 Message-ID: <20261030131554.41208-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2f; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366224506154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 2 ++ include/tcg/tcg-op-def.h.inc | 1 + tcg/tcg-op.c | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 3721164236..a7d001c959 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -83,6 +83,7 @@ typedef TCGv_i64 TCGv; #define tcg_gen_shri_tl tcg_gen_shri_i64 #define tcg_gen_sar_tl tcg_gen_sar_i64 #define tcg_gen_sari_tl tcg_gen_sari_i64 +#define tcg_gen_lea_tl tcg_gen_lea_i64 #define tcg_gen_brcond_tl tcg_gen_brcond_i64 #define tcg_gen_brcondi_tl tcg_gen_brcondi_i64 #define tcg_gen_setcond_tl tcg_gen_setcond_i64 @@ -209,6 +210,7 @@ typedef TCGv_i64 TCGv; #define tcg_gen_shri_tl tcg_gen_shri_i32 #define tcg_gen_sar_tl tcg_gen_sar_i32 #define tcg_gen_sari_tl tcg_gen_sari_i32 +#define tcg_gen_lea_tl tcg_gen_lea_i32 #define tcg_gen_brcond_tl tcg_gen_brcond_i32 #define tcg_gen_brcondi_tl tcg_gen_brcondi_i32 #define tcg_gen_setcond_tl tcg_gen_setcond_i32 diff --git a/include/tcg/tcg-op-def.h.inc b/include/tcg/tcg-op-def.h.inc index e694f0e38c..c9caab2138 100644 --- a/include/tcg/tcg-op-def.h.inc +++ b/include/tcg/tcg-op-def.h.inc @@ -37,6 +37,7 @@ DEF3(ld8s, TCGV, TCGv_ptr, tcg_target_long) DEF3(ld8u, TCGV, TCGv_ptr, tcg_target_long) DEF3(ld16s, TCGV, TCGv_ptr, tcg_target_long) DEF3(ld16u, TCGV, TCGv_ptr, tcg_target_long) +DEF5(lea, TCGV, TCGV, TCGV, unsigned, TINT) DEF2(mov, TCGV, TCGV) DEF2(movi, TCGV, TINT) DEF6(movcond, TCGCond, TCGV, TCGV, TCGV, TCGV, TCGV) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 4814a493c0..fced3811c2 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -820,6 +820,49 @@ void tcg_gen_ld16u(TCGType type, TCGTemp *dst, tcg_gen_op_tti(INDEX_op_ld16u, type, dst, base, ofs); } =20 +void tcg_gen_lea(TCGType type, TCGTemp *dst, TCGTemp *base, + TCGTemp *index, unsigned sh, int64_t imm) +{ + g_autoptr(TCGTemp) t =3D tcg_temp_new_ebb(type); + + if (imm !=3D 0) { + if (TCG_TARGET_lea_imm_valid(type, imm)) { + /* + * The immediate is non-zero and valid. + * If the shift is out of range, perform the shift first + * so that we can still emit (base + t + imm) as one insn. + */ + if (!TCG_TARGET_lea_sh_valid(type, sh)) { + tcg_gen_shli(type, t, index, sh); + index =3D t; + sh =3D 0; + } + tcg_gen_op_tttii(INDEX_op_lea, type, dst, base, index, sh, imm= ); + return; + } + + /* + * If we can make the immediate smaller by folding it + * into index before the shift, do so. + */ + if (sh !=3D 0 && imm =3D=3D (imm >> sh) << sh) { + tcg_gen_addi(type, t, index, imm >> sh); + index =3D t; + imm =3D 0; + } + } + + if (sh =3D=3D 0) { + tcg_gen_add(type, dst, base, index); + } else if (TCG_TARGET_lea_sh_valid(type, sh)) { + tcg_gen_op_tttii(INDEX_op_lea, type, dst, base, index, sh, 0); + } else { + tcg_gen_shli(type, t, index, sh); + tcg_gen_add(type, dst, base, t); + } + tcg_gen_addi(type, dst, dst, imm); +} + void tcg_gen_mov(TCGType type, TCGTemp *dst, TCGTemp *src) { if (src !=3D dst) { --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366224; cv=none; d=zohomail.com; s=zohoarc; b=SJ/c+SbDgBGorKCca6q0CUYQ31RmKnTNQFTNxqqqPWSbK42GGpJHC7C4vj/bE7PXR461wy1edMVsdOEdHl4+JGwSdX18lkVuuXerHYz4iOPp0fayHCoA5RTbDyUJ/CnyK8T3drIldfP4cwhml1Voib0j0HZCBgd6J/otQTGzXlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366224; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=592OvYlsDPOvpeaaM3tWp55SFH77481VstyWeJdhzWs=; b=PapPZMeaZ+cc+8hvUjfogJ9J/vmwEiIMTCNOI0RQh7rksSNNnHjO3q85FXgDILLaYsjB8N24gEOKyeJ10pU9njDjjzrJd8VSEcQH96tr0qHNvQvODFM43HUmXL1rASXnfXWnmtXr8VlUexdHfZnfUMV/WDjU+7P1EAGj1iPPW/M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366224430898.5995155406932; Fri, 30 Oct 2026 06:17:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTd-0004oV-Gx; Fri, 30 Oct 2026 09:17:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSq-0002io-8K for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:17 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSi-0005VP-7e for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:06 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-4a75171af39so160892fac.2 for ; Fri, 30 Oct 2026 06:16:02 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366162; x=1793970962; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=592OvYlsDPOvpeaaM3tWp55SFH77481VstyWeJdhzWs=; b=GuA8LrQDVs4O8rzX1ppQY4zua0rD4hoikn0ISN7wzpcFZVChzvMiPPGV22uwtdE4vb sobwNRhu/I09kQYE3Oj6K+K6pXwP/r0EBNrfZU22s7ib+2gpkjgMbXt0FLU0fkfJzhou JWHqCnxHv6kEMv+kB42ReoU14kmq2ZnlU1WoBbhiY8xX4m6AvzFzZREVDlr3L3qzxAvu +xPXqI6c7A+y503BaF+rAVshqxtgKzvrF8i+TdokYZyXD+kbPfcFv5Pi+UCrbnlJcUGl BGHvYCe+NpZx6u7ldMPF34c0pNJJ6tOR/elv5TMg9eRTUBA+/Xpez7e1zoOXKrua1Xjp +iug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366162; x=1793970962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=592OvYlsDPOvpeaaM3tWp55SFH77481VstyWeJdhzWs=; b=vPLzGP0eg9jMd5zK9v8X2yhJIBTYFeEzMziGZl6gTI7ain8ObNBfCokfrKXBr0UKbL bZykbRJEtZq+ROu3CWuGClNrhFfXsOT5iuA23ZIFPMALfMMmCD6Dk4zvmPoeipyWNg9k KicV2fP1SDamL9fTZkwgWstVErSFAlAA1Cn1EooFt2mQWgZbChSarnU2ClPDuw2DeSBH BJSaXs6jHBATHOG1A37vxXx2LkS6u1YDG2fsNu0ypHzWaMe77qj2uDj5D/k2HUGMxZtn OyGNp+QNVf8iA+JbEoZLEthAEr1UEZRbBYmoAjU6GrOTbP7hyKatFEwZr5oC1ru0WCBc ZT9g== X-Gm-Message-State: AFq9FYL6SlgWL4sHUZtb9Ti6psJELk0GFOuEVoNOP59U8stqmfdN1jbP xbxVLyyPoetWPl3lBKoUzr80RzgVhUGtkqgjBI84U2zDGJ4wez4Ew29xOfL4V30zUT5MEAWCBxc 0fqtt X-Gm-Gg: AYBFou3kim779oH+hbo/cb7USKeQyZ/qwQR99bulyW9GowyD+VGlF9rAQacpQNgHct/ 7WQgvglwZd8ZiIsGVm8XuLkHH74iS4pNtRRD7jhUYNEZ69gy6A76BK+Rz0slHSwVyiuUWglDGJv nJ4yUPU8FLDTbGv0ut7rVaQ9lEZqB4XgXWX+sqFEDrATxikm7RLCBid/oGeXUj7whQJPXYJAY7J Ho36pKFhx8s7A0jDFxTrAj1nGhUJtzEDikNe5E6dPE+ir0f6TnJpF9VTtsALxlLZG4NPRBqDFj5 7znDSYsgFcCCnu/MjUWpLGDh7yI9nTArs6Gmvo9Fr5/r1g2vMddxcjia+u6kr5fhM48pvGEnPU0 mbh0Zx7Au66ntOsTkY2TPMhxq6B7Tjwh05rOVbYl6AZPtQ8CBjgDjwXhsyvo/ZQbFZNYmLObTDx EyXnSArnflTdNv/7lmIa4uTyg0nJn9dupHVkd8McBj9BFLcITmzZqgeTvVoEHKH0VtcT4wzuaaN TSUQniv+HLufABSgPhnoUvTmpU7xmV78WpnelFpIY5WDnfJV/yZ3YZgNlArZHvq669HsPCk6wM+ K5dA86hdunxIe8Q4DK7emXD0iC++sQ== X-Received: by 2002:a05:6870:828e:b0:494:b587:7fb9 with SMTP id 586e51a60fabf-4a90778017dmr1355255fac.54.1793366161811; Fri, 30 Oct 2026 06:16:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 06/19] tcg/optimize: Handle INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:41 -0500 Message-ID: <20261030131554.41208-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366225889158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/optimize.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 294eb5ed29..a518707887 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2106,6 +2106,68 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) return fold_masks_zo(ctx, op, z_mask, o_mask); } =20 +static bool fold_shift(OptContext *ctx, TCGOp *op); +static bool fold_lea(OptContext *ctx, TCGOp *op) +{ + TCGArg sh =3D op->args[3]; + TCGArg imm =3D op->args[4]; + int var_mask =3D 0; + + if (arg_is_const(op->args[1])) { + imm +=3D arg_const_val(op->args[1]); + } else { + var_mask |=3D 1; + } + if (arg_is_const(op->args[2])) { + imm +=3D arg_const_val(op->args[2]) << sh; + } else { + var_mask |=3D 2; + } + + switch (var_mask) { + case 0: + return tcg_opt_gen_movi(ctx, op, op->args[0], imm); + + case 1: + if (imm =3D=3D 0) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); + } + op->opc =3D INDEX_op_add; + op->args[2] =3D arg_new_constant(ctx, imm); + break; + + case 2: + if (sh =3D=3D 0) { + if (imm =3D=3D 0) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[2]); + } + op->opc =3D INDEX_op_add; + op->args[1] =3D op->args[2]; + op->args[2] =3D arg_new_constant(ctx, imm); + break; + } + if (imm =3D=3D 0) { + op->opc =3D INDEX_op_shl; + op->args[1] =3D op->args[2]; + op->args[2] =3D arg_new_constant(ctx, sh); + return fold_shift(ctx, op); + } + + /* If arg1 was not already 0, fold the immediates. */ + if (arg_const_val(op->args[1]) !=3D 0) { + if (TCG_TARGET_lea_imm_valid(ctx->type, imm)) { + op->args[1] =3D arg_new_constant(ctx, 0); + op->args[4] =3D imm; + } else { + op->args[1] =3D arg_new_constant(ctx, imm); + op->args[4] =3D 0; + } + } + break; + } + return finish_folding(ctx, op); +} + static bool fold_mb(OptContext *ctx, TCGOp *op) { /* Eliminate duplicate and redundant fence instructions. */ @@ -2218,7 +2280,6 @@ static bool fold_mul_highpart(OptContext *ctx, TCGOp = *op) return finish_folding(ctx, op); } =20 -static bool fold_shift(OptContext *ctx, TCGOp *op); static bool fold_multiply2(OptContext *ctx, TCGOp *op) { swap_commutative(op->args[0], &op->args[2], &op->args[3]); @@ -3220,6 +3281,9 @@ void tcg_optimize(TCGContext *s) case INDEX_op_st_vec: done =3D fold_tcg_st_memcopy(&ctx, op); break; + case INDEX_op_lea: + done =3D fold_lea(&ctx, op); + break; case INDEX_op_mb: done =3D fold_mb(&ctx, op); break; --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366219; cv=none; d=zohomail.com; s=zohoarc; b=SmopyQwosUQwCsjksNipvaE9aDA1jVoDr5EFfQF9wVGK7GuEToMLF1EONPk2pwMM6v96Cc6d8WwFPgkvg1t0e9FilMu4CEffIkIk9kt9Xj7KMJSvRU2cuWIetUILC5YkPw35KYjOd9Vm/lExwROgfQjXwBsdE55tfZ7BQ/KGHoA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366219; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pgqHmLtxUI+2J2wQe5DSkZKh5v8ZwaNLONboGey2duQ=; b=JKjuvfN1cL+H9QSueeBUHkL7JR2Pe2o24MgXDc+MaDEwdnhMXp7bpzYtqFvHZteBzuEtthMA/TCcqZc4q3I77sSY2V10WfYFP2wWkaX2QutgZaTYm++o+tofk6K9Nh0zIPGlr9ITuO2+mQs5MHWx82JEjM+sO6fNbBFsea8hRXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366219371214.05542265534893; Fri, 30 Oct 2026 06:16:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTS-0003ax-1D; Fri, 30 Oct 2026 09:16:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSr-0002j9-3J for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSi-0005VW-90 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:08 -0400 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-55e0090c580so221550b6e.3 for ; Fri, 30 Oct 2026 06:16:03 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366163; x=1793970963; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=pgqHmLtxUI+2J2wQe5DSkZKh5v8ZwaNLONboGey2duQ=; b=benbp1nqL3fhxu5dz+sAHjIfMvkjyiM/M4FPJLzdUdTnA1h+ntYLGEbPdSRG5th2Lx 3JL4axkWQrTogKlVDPboGDV4BSwn+bRtLC8AC7E0nEqBg7fkDbRFTLv5u3ppnO22ccj0 mmfzRzTN+TVBah4RXiKRbDfzAgnIonxz+7KN+rq8hqUN/OQk3FKGXQDjyKZ4HRA7SNN9 d14Uf8ouSaRNlyLkoJWal1z3bR8WD3nF1q1Oi9V5JRX1jGdk+x8hK/H9GazKFcah7W1s RTfz9p9CCbhYVo0umfrM7hwvKkvog5awTypkKgDQloMuS1xHGQeZS48Rf99BDzzj80hC O7oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366163; x=1793970963; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=pgqHmLtxUI+2J2wQe5DSkZKh5v8ZwaNLONboGey2duQ=; b=B6YVEZg3VeXAlyUxN5DstO6PZpmBC6CYG3N4ZnQGhbs+jU/PbDH1IaNcmd6nFhP3Vl OtKGsaqReZQZw8gucGt+UaRBSFRdKYNYjDK31KwJUcuc+Lo3LPZ2sffNkEimZ+7tH1AL IjzA7evr4HBIIcGvK2bx7xgpNEyKhIf5cEWfotUZgNMz0MDWPMBo+2qY+PudEwjneN5E hHZDWOra1bI2K0tkasg8/HICduQkWiUNigD5Nly9PfVH9jWn9s7pduPakodUJk+BLdK1 ku5fWPMerCI00IlL0ikphomUJp7Sv35yGaxwU5ByT/d4JnYD6FgQJjyxEb06TdmaOMIJ mD9A== X-Gm-Message-State: AFq9FYLT5y0QlWtfLDFqwJAB3iPF1OGbZY7NiQzNEXEv/yfUejHk4rF3 RShS5cvqsoBj2tirmW27klPfT4vYzaKn1/qV1ULPBHIgCJ5bzNsr263J9xsiH/tNWcVxPLo1il5 iWOTr X-Gm-Gg: AYBFou3yiMpNyz2BrKkk5eEd0AHFUx8WNczVp9J+M5QfAb7vMRzvVaxcRh7rDbqWR9C SYfPAnMBGKcOde3+guK6s7yQgU/N2Pnet3txVqaRVGMLcd8ckLlmdlZG3Pp5JQIoznMSQdyFXBa MEKwMjfsxtAHM6N2+9BJ1FGlodm6MZ/pOU5MHo9XzgOLfUASB7UCXSx4Qm4GtCHsN5GxbmsTLMi F1RVWkwl+jtRXS9cALExXvu+SAcDbb538E9WEvCVhITkkwJVkDrhPe9jfekEObCekJRLeVBi9o3 63KmcAVts9TYDhRjVoKsDpKO5XRfQ9keoPODT8oXl0gP1HnvPa+nIZdcHQb0MBvwriR49KBFycZ /nAMT0STrrWNSubYwwmZj31jlCb+3i3dfhrpOI0nLfC84FtW0j5N07hlBdE4jmHa77ZXkr7KFuf dGuKiJKzJs9gN25cqCN6P8iI0q7xV1nCVgOvTOoN8t3Rpw01Kv/8Y2ZH0VL52XNSVZ2oVvzA0MI VDZo/w6YoGJCs+g9iBKquKRM6RJPbjsar65HHcUn+g38Ssl5zvYzuK2qVnKSf5LyJkxX0/CasHH D7K6qjEzEFh/D8b0A3BFz2aJ7Ab9cts= X-Received: by 2002:a05:6808:1a0e:b0:4e8:5ba:8809 with SMTP id 5614622812f47-5640dd797c1mr1741195b6e.26.1793366162970; Fri, 30 Oct 2026 06:16:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/19] target/alpha: Use tcg_gen_lea_i64 for S{4,8}ADD{L,Q} Date: Fri, 30 Oct 2026 08:15:42 -0500 Message-ID: <20261030131554.41208-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366219724158500 Reviewed-by: Matt Turner Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/alpha/translate.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index c66e3f9c14..6f18b8d1af 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -1474,10 +1474,8 @@ static DisasJumpType translate_one(DisasContext *ctx= , uint32_t insn) break; case 0x02: /* S4ADDL */ - tmp =3D tcg_temp_new_i64(); - tcg_gen_shli_i64(tmp, va, 2); - tcg_gen_add_i64(tmp, tmp, vb); - tcg_gen_ext32s_i64(vc, tmp); + tcg_gen_lea_i64(vc, vb, va, 2, 0); + tcg_gen_ext32s_i64(vc, vc); break; case 0x09: /* SUBL */ @@ -1502,10 +1500,8 @@ static DisasJumpType translate_one(DisasContext *ctx= , uint32_t insn) break; case 0x12: /* S8ADDL */ - tmp =3D tcg_temp_new_i64(); - tcg_gen_shli_i64(tmp, va, 3); - tcg_gen_add_i64(tmp, tmp, vb); - tcg_gen_ext32s_i64(vc, tmp); + tcg_gen_lea_i64(vc, vb, va, 3, 0); + tcg_gen_ext32s_i64(vc, vc); break; case 0x1B: /* S8SUBL */ @@ -1524,9 +1520,7 @@ static DisasJumpType translate_one(DisasContext *ctx,= uint32_t insn) break; case 0x22: /* S4ADDQ */ - tmp =3D tcg_temp_new_i64(); - tcg_gen_shli_i64(tmp, va, 2); - tcg_gen_add_i64(vc, tmp, vb); + tcg_gen_lea_i64(vc, vb, va, 2, 0); break; case 0x29: /* SUBQ */ @@ -1544,9 +1538,7 @@ static DisasJumpType translate_one(DisasContext *ctx,= uint32_t insn) break; case 0x32: /* S8ADDQ */ - tmp =3D tcg_temp_new_i64(); - tcg_gen_shli_i64(tmp, va, 3); - tcg_gen_add_i64(vc, tmp, vb); + tcg_gen_lea_i64(vc, vb, va, 3, 0); break; case 0x3B: /* S8SUBQ */ --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366344; cv=none; d=zohomail.com; s=zohoarc; b=MDW8HqxKxbmcHMw13R7qZz0M1Nn66muo1m49n6YAvjNA0GRqbcFkXuS0ZpDkSyIV2ec1D+72aAMAvSJBSil+VkUDLR/krvG5xq9jzA51Gxh7g9T3Fegg9btHM6MpcUJfb7hm/J8JhLyQ+1JubrdU/ohksZqlAJW4M2vzTE/Jnrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366344; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CkynieniSMNB9bKfWnjCUGS/8yE0sMA+FHoBj/3zs6c=; b=FaU53Rcx9P9Pk96k77pzj/D5dvBk7DsbyuHQC22qrC1uEPGsmhwgtHN8FamYJOKfCvfFAhplzS0DyNM2+xoaKir42xiROHavx/vwN6C0JpSi4iYK2FFciKtDeP8B/YFxqcQ2JYNf19dgGDvUjuR2J9UogF9aZ5StVk4bw5iMReA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366344224828.2847796988367; Fri, 30 Oct 2026 06:19:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTZ-0004Sx-Fs; Fri, 30 Oct 2026 09:16:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSr-0002j8-2x for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:17 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSj-0005Vg-4w for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:08 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-8490a7d6696so474390a34.3 for ; Fri, 30 Oct 2026 06:16:04 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366164; x=1793970964; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=CkynieniSMNB9bKfWnjCUGS/8yE0sMA+FHoBj/3zs6c=; b=eYGk9KDoSPfZL67whQ4j0hmsUKtyCm/dsZiy8toVKthXuLXosHB9fdA3Ksxy/PMHPY 3WtJ49XeZL2wjQ1EEkeRZ7HTbzzGMADT0ChWWBPY5L8Xx4iGG0rRyPkCLMNlzCtoN/k/ 6V1Szk0pAcXziUtA3onCcE78tBl9LzhtQELVe8Hpt6T8/xJCYSvT6Y7y9Yh9lNISlJ+Z ax73hN+sQN4IKMYiuB/2kKsPIuvZSwFHMAra5qGt0/rMeeJP+0hguQsvUd8RByoaShuz NaLOTEaNY+r0OqzMugNJXaT/70fQT5LiThUTtzYw9h5ks6Hgln8EJgaB5G21Ag6OktBG V4Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366164; x=1793970964; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CkynieniSMNB9bKfWnjCUGS/8yE0sMA+FHoBj/3zs6c=; b=tBGX29SYjRwd3c0GV9qKgoaRQOnxKFAvZ5z8RZV9tvMZuqE6YdijQqJ6NfchRGRBpj aitXF6jN1y6MUnOXmoJNUfWZqEupTIJtiQhtZd+K7jSngNZQiT99x5hGnC07DAy+SlXt RRMD2pAejaljzZLsaSqW3jTjkhE5BH1QcUPw48h0OAzX2/rQEpEsX89X0nc3br5HMnnj LP3NsHA1+AusHEvw/wfsDEPTHfci8dAgcNIHIh8aZDiXTAI7wkwuOqFK5OfcStahyAws LgoljYc5Lfq4jFBMxnGr3Co/7Teiss/xWBZY0EBlYbzg+AsNfgnWPujWThZkhEdxtqjs WJVQ== X-Gm-Message-State: AFq9FYIKdJ97OJNFFYysyyUV/aE8XsX5suAJmf/Vg4nRw/x8xGptUr2j zLNEcDd55/CgfUpzW3zCG2F6G9WqJejQ1OV89MYjiXHmPFZjHMgFdZUkC7IZ3h7Ms9lKFas4Yr7 aJYIo X-Gm-Gg: AYBFou22T3VySDearYG6B71dZOToe2O42XxkSh0JCRL6gc9NctpX6lY99KDBKWQ+tYK 3nYQOKUgLKMz2X19J+I13hrlP7tQtCSpler9l4wk4iafNb0CKHe7aUgVZNcR7Dz7VA3Bi79CX7N +phXkUcDbsYfSJVefV8Fl03BJMISUT1OVT8yVOMFGFc8dHkwQYTYVsQQyqHwK7cOpJPqI6BmFNw yfpqq8qbZ8t8ZwvwwJ497nwVrimpDy6chc4+mqaXHJDhH9CiU2ERlfmLvplH1DV+ADrmeb/Qbdj +iDFydST/O9g/e8hYN78mM5UARFLBEgaa5r/1ODOpdkcWhNAq2Yh8E7sVQGwdBdyDBzPLkZ4pw2 oeEG3gUy70Y7YDOx0DIPu9LPbAGZZ/0WHn+/ITbX3ZqBgQhO9qYLX7MTbuOc4e7tSEDKgXh0Thm 5nMD2mfOzLTw5WxSLI/f8iyuIvQ6FaDKbXKP6+2BtI9XVVW4kHEW3PuDMqfEi6o32f1GG4pq66G YGX9vFXkGll86542vstLv/u/EyiVy3rLoEA84KisvmWebqc4ogndQ1jPM0bS/8J6fKtHuF+Ockf YpAuepzxGQqsDIAVPIjINn6jjVWViw== X-Received: by 2002:a05:6808:4fce:b0:4d6:9222:99f7 with SMTP id 5614622812f47-5640dde6011mr1717399b6e.55.1793366163796; Fri, 30 Oct 2026 06:16:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 08/19] target/loongarch: Use tcg_gen_lea_tl for ALSL Date: Fri, 30 Oct 2026 08:15:43 -0500 Message-ID: <20261030131554.41208-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366346128158500 Reviewed-by: Matt Turner Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/loongarch/tcg/insn_trans/trans_arith.c.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/loongarch/tcg/insn_trans/trans_arith.c.inc b/target/loo= ngarch/tcg/insn_trans/trans_arith.c.inc index 2be057e932..c358e64264 100644 --- a/target/loongarch/tcg/insn_trans/trans_arith.c.inc +++ b/target/loongarch/tcg/insn_trans/trans_arith.c.inc @@ -188,9 +188,7 @@ static void gen_rem_w(TCGv dest, TCGv src1, TCGv src2) =20 static void gen_alsl(TCGv dest, TCGv src1, TCGv src2, target_long sa) { - TCGv t0 =3D tcg_temp_new(); - tcg_gen_shli_tl(t0, src1, sa); - tcg_gen_add_tl(dest, t0, src2); + tcg_gen_lea_tl(dest, src2, src1, sa, 0); } =20 static bool trans_lu32i_d(DisasContext *ctx, arg_lu32i_d *a) --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366210; cv=none; d=zohomail.com; s=zohoarc; b=YnRv5bkPQYjCdM45ohHRDv/0vuhbhN9Qcr8G9bW2LcSOIMBGpF+uWX6+ZQEltQV9v05ruGAn9Oo4qVFDStL3SBacWX3lknSLE5xBz45TbkQMPd3P5REPKI9ZGIV627BSiDxIGIay92wLsPC9pJ1TTKM3DrMlYhaBaCSKVFbSLzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366210; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9O2d7CElZ9IXGoq8YSEMQJ7ssfbfEc/q8B0mzqzGpjg=; b=eaUU7npAgkqOJdfVdNjTiIHjhZly/nAhC/33CoYr71sqWIeYGyqKGTwImErazfq/RXjbIEOs62vQznm29lD+8CZHbi9nYjgnRhUXGtlt1wMAiFMbC3yjYFifIbQuOFy0F4LjdfU9S2lMKoE/w1LfykO/QmYo3Q5p/1TGQ5YUmOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17933662108621011.6205037028192; Fri, 30 Oct 2026 06:16:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTP-0003R0-Nc; Fri, 30 Oct 2026 09:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSs-0002kB-Rr for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSm-0005Vr-P8 for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:13 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-703be215729so293901eaf.1 for ; Fri, 30 Oct 2026 06:16:05 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366164; x=1793970964; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=9O2d7CElZ9IXGoq8YSEMQJ7ssfbfEc/q8B0mzqzGpjg=; b=Okeo89GXaan7g4qlY8SsfSzMkDZLq+jbHnTyHcLWfShSPzAVdhmHrToHPUnd9kB5Ty L1Zw/rfg041ECTR+rP9ZYg9TTvbkNqR5hCnJew8OQvFP8Wrt6YbIQIzBarTGXl9mNmvp QoPbGpoNX7w3btFdkrN9L8Fym3O9XyYU5w6cMFMEAbS5lNzjXWeipHR5Ulu5hEcMxfCe 7t2z4ZnrZjjFuwldPoPq35PqOwDNMmJDFmBfgVzKpjuyA92l+vwabkfpoRpWq4vAEv2h tfIR395JMo9Z6NZJlRhDmi9VQRz/CWYPiIMEsh1B1gUt+dUXNixMClwqDP1zxoxv2g5E Ugsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366164; x=1793970964; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9O2d7CElZ9IXGoq8YSEMQJ7ssfbfEc/q8B0mzqzGpjg=; b=s9r+etljwgicjAL/9HICfTa8U+hAn6PDV2XVYWYwrsVP2xR6lrNzCK8YY06tCxbB4U SxMrKAI840xvuAup4ggy5YTblInrQPfAtlutWHqDkhtxsP/DJnx8x48kp1KOK1qRyk/L YyhV1LrG4tBrDqDg7GlE6n0JcL833oQ3L72+RpXHJP4q6N6sSRNjVXxvCXWWKDZlrg5S t978v7eAtknEJO17JpJJ0n9W+11SEkzK6TXc9lrI4KaLkNBWkzW3XvAVGwo/LtLO8na4 NYgfkF6W/LzUvfyfsNlL9zRsxh0ZKGWqZxhBV0TxvikMUX9mXGUQ4X2xp2wmru1KxiHT n5dw== X-Gm-Message-State: AFq9FYJJVkSP2tCsjDRl5qEyQ6HzxoqEFM/szBLxo+H5MRHkp3oKGl3I 8iLQ9ieDRbNpSHRXY5rnzA57G9KcwDygkotY0Vo75/23PzN3sDQa+p43Zy+bL2ocESGF4hm9vqW Lpa5Z X-Gm-Gg: AYBFou2LtKkU/wc8lqIdBlaUaB0CvB16g5yjm6nQxsecG0ue8O/OjNd7KSQw8vYiVAH H6c9YZYe0GZ+lPNAMpQOSK5GZglyATLlGkyUHobpNGjSEn5pRXN3K6NE5UrMFXdejjP4VVIrZ9f Js8MbrXLeJqFsx975Sl3QGcXdCR5zq1vey2ZZnAh7aZ634iVLx55+JXoougKpgdT/y95W8bljzc 38+mMn4N447td069TZkmuMTRuxoY+XF/RFgqV3fAtrkw/bmjtRMtWAju6SpfFHpP3pbFX+g4ftK oYujlzxiE/adLi4agi++8vs8q9BVhP93H1Se3xiKxvp2rU0GImpZE15KMEoWVPggokUz53IKFbn a+NqFw1RVWHjB1Q8cg+miIqTeQLZLJFtYy9cKL9RkufCIkEMHHU/0a0tPwMFDrXTLvXRFghYBCy YoxnRr8nuTbEikxQdJDpuK8tvA3FadX+lWNcY2kBIPbkcdkdGZrWbZnaKeMPiK8tyK28rDjrcAR hRVoPMB513RvYUoMOSDYRgYdPJuJSO6keQ+ObJNvPDy4pciCXCP8G+7GApmnjgJsVyOkube61rm 9lgSD6wiGMvwqGQGGqibLME3iVzqWg== X-Received: by 2002:a05:6820:f004:b0:6f4:80f6:6ae7 with SMTP id 006d021491bc7-714f2a34674mr1382014eaf.67.1793366164495; Fri, 30 Oct 2026 06:16:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner Subject: [PULL 09/19] target/mips: Use tcg_gen_lea() for [D]LSA and MXU S32LD*V opcodes Date: Fri, 30 Oct 2026 08:15:44 -0500 Message-ID: <20261030131554.41208-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c2e; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366214284154100 From: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Matt Turner Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20260831062630.58771-1-philmd@oss.qualcomm.com> --- target/mips/tcg/mxu_translate.c | 3 +-- target/mips/tcg/translate_addr_const.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index a38f4da12b..5361c94b34 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -1596,8 +1596,7 @@ static void gen_mxu_s32ldxvx(DisasContext *ctx, bool = reversed, =20 gen_load_gpr(t0, Rb); gen_load_gpr(t1, Rc); - tcg_gen_shli_i32(t1, t1, strd2); - tcg_gen_add_i32(t0, t0, t1); + tcg_gen_lea_i32(t0, t0, t1, strd2, 0); =20 tcg_gen_qemu_ld_i32(t1, t0, ctx->mem_idx, MO_SL | mo_endian_rev(ctx, reversed) | diff --git a/target/mips/tcg/translate_addr_const.c b/target/mips/tcg/trans= late_addr_const.c index 1d140e918d..910177e43b 100644 --- a/target/mips/tcg/translate_addr_const.c +++ b/target/mips/tcg/translate_addr_const.c @@ -26,8 +26,7 @@ bool gen_lsa(DisasContext *ctx, int rd, int rt, int rs, i= nt sa) t1 =3D tcg_temp_new(); gen_load_gpr(t0, rs); gen_load_gpr(t1, rt); - tcg_gen_shli_tl(t0, t0, sa); - tcg_gen_add_tl(cpu_gpr[rd], t0, t1); + tcg_gen_lea_tl(cpu_gpr[rd], t1, t0, sa, 0); tcg_gen_ext32s_tl(cpu_gpr[rd], cpu_gpr[rd]); return true; } @@ -47,7 +46,6 @@ bool gen_dlsa(DisasContext *ctx, int rd, int rt, int rs, = int sa) t1 =3D tcg_temp_new(); gen_load_gpr(t0, rs); gen_load_gpr(t1, rt); - tcg_gen_shli_tl(t0, t0, sa); - tcg_gen_add_tl(cpu_gpr[rd], t0, t1); + tcg_gen_lea_tl(cpu_gpr[rd], t1, t0, sa, 0); return true; } --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366211; cv=none; d=zohomail.com; s=zohoarc; b=iHX9UZ8QmSVhbtBmR8Yl7S9tAP2fBNZvHgvzbG+WCC+bjw22+9UBuHn7/W1HULgPb83uVheuCG6fdGDmRg8BFrUexzjDRldYQBV2zEBOhI6C1O5HCfbIl7+rV3Z8EovmmdfPcKRdbu2jfxwCBFnCNsczZwk8XiLvL4jtb2tEZSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366211; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5j5+t/rNvpj+687FV3vQnTBAaY6AK814ujVkWS3xeMA=; b=ONvfTTOYQURVWjFFWqm3YNAVaAbfKj3zdrESoD8GTSfp0me3Dk+ggb9s1IKGr5ok7YwO6obn92wZqclDFRPU2M1Vbbnz+NLyhkDcoFr14nPRg6F3W7SveKbSpcWoZhFViRLBXb9/wy+qaFgzuTc8aLEtDRqqrq+PaJ8pEuRPPNI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366211384970.4085158125771; Fri, 30 Oct 2026 06:16:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTN-000399-RB; Fri, 30 Oct 2026 09:16:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSs-0002kC-Uh for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSo-0005Vz-TC for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:13 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-6df0b02fe91so1349470eaf.0 for ; Fri, 30 Oct 2026 06:16:06 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366165; x=1793970965; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=5j5+t/rNvpj+687FV3vQnTBAaY6AK814ujVkWS3xeMA=; b=Gi9K7B7/waqHp2pYi6zXZ78XEN84dnfRoDLlCC628l4JJv6l2+xGVtO/OlCIdelEMi IeekT/LZ2F5TKrpaXBeZYELwy1XV7N4+I/BiAlJiAI58wmX2bxW2NUMonCbXsDzYcIHU miwJcLSILj4AMl8XkaV518TlA5ILdGKCLtUEgYKK8ZXorI0pewqnN5+S2oCOhFasyq+g rF4ajMXk9KNG4RSSGBIFImx0GcvQIZe9lHr1ZMID5q97laLPdlYDw6+pqjUOZ7f+9ZWk WeBFMmqUcjJ3H81L3GGvhrWgX5+0gvL62nXCl95+VHWJ1xzUiTO0PU7puWu/WM772mui 6Bdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366165; x=1793970965; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=5j5+t/rNvpj+687FV3vQnTBAaY6AK814ujVkWS3xeMA=; b=EC2vogOquPFrD+W2ioo40LDC4UtJSfhbDwegWKSsr9SjXuDVTI/NftAwGqJJoLjV5A m5RYrQUUvEf3b7HGILRt5bJkifattrA8saw56Ir0EkvFPzxMr0fwWRqlig+5SxC6U926 FxZs7oCxut/RtCOO41xbElBG3I84creXGtpvMgeqJ5Cv+00uuCihAvNUUKI2CqvGvBv0 GOkna/shg4vBkUSeeG0nY7cIEvMgnJsQdnbH22V1VywH0k2BbP/LbLdskUmOdT6DUVVF DZpgotlLiZ6jdBvGoQHJe+bogTs9bUUrZ74O0tPgeVGK68bMOp77vybBScPK5wEbVBWF jZyw== X-Gm-Message-State: AFq9FYKt2Tze336VOCI/+hVwBW7per63JazEYfAgs5WWOoXkxU8X29av YONdmHeFk0bkr3tzABKWQbOVnw25EEx3QN6GgbETAacXZpQ80sW/1GZlUu0XT4RXyL7VFiZkJ/B egrXP X-Gm-Gg: AYBFou2YsezcQB0mW0UpS6jrA5tQM8WsXd5VCnaMa/Z1A29UoT2B1fqU0E3VsLO4Tqm laycjNqwRhJa1h5PY9quQ7f9h5fPMFuPGqstShtgdIPufEfcYzQwv2mjYrSgGOHeZrpodbr79v9 cqv3OSdypwh2MbUE4xlJT7DqWasQPuMDZ0xYYaqaAtjrgPB+GHjveSv7+rF+SM2j1UO+C741i6r U4CyyFPmzq9IIMW+jpUno8KyeTJre1LDfi1hZb5Yd2qXGwHLkx364pu/+wK5p9+PKAkxi86oqK7 pBrmI0nyeniQ7B++4gZ/xgQ6d0UXxUD67NHtpzpFaCJ6VUefRbCXE+iQ6eq/Fx1nCHH2sazu9Ok Co6fYxN6vbx0pJLbGZ5iSUnKAur+0NFJ5Ji07jcX4AVT5jUkm+MbV01EziZwCzo2vb1eEfKA8TX Wwq0+A/q3sdGSY15ugs0VOFQc29v/QZhDYmRi18PDzeG9XsEZysoYDjiddpg3GNea3hdrJKATmN 6/buw8jv4ajkiPjlni16tZgalR1GIwaFiG/yHg6K/r0FqWJJFhHLSn/g86xUboEUyCEoY5t/XVs /YZfQKiMSR/JcrCL4xxs28yxpvQzeQ== X-Received: by 2002:a05:6820:c91:b0:70d:1de:34ad with SMTP id 006d021491bc7-714ddf79d7cmr2957683eaf.41.1793366165152; Fri, 30 Oct 2026 06:16:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/19] target/riscv: Use tcg_gen_lea_tl for SH*ADD Date: Fri, 30 Oct 2026 08:15:45 -0500 Message-ID: <20261030131554.41208-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366213857158500 Reviewed-by: Matt Turner Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/riscv/tcg/insn_trans/trans_rvb.c.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/riscv/tcg/insn_trans/trans_rvb.c.inc b/target/riscv/tcg= /insn_trans/trans_rvb.c.inc index 3e74be223b..82e715c7b7 100644 --- a/target/riscv/tcg/insn_trans/trans_rvb.c.inc +++ b/target/riscv/tcg/insn_trans/trans_rvb.c.inc @@ -336,10 +336,7 @@ static bool trans_orc_b(DisasContext *ctx, arg_orc_b *= a) #define GEN_SHADD(SHAMT) \ static void gen_sh##SHAMT##add(TCGv ret, TCGv arg1, TCGv arg2) \ { \ - TCGv t =3D tcg_temp_new(); \ - \ - tcg_gen_shli_tl(t, arg1, SHAMT); \ - tcg_gen_add_tl(ret, t, arg2); \ + tcg_gen_lea_tl(ret, arg2, arg1, SHAMT, 0); \ } =20 GEN_SHADD(1) --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366266; cv=none; d=zohomail.com; s=zohoarc; b=lw66ak1hdxf5ATHVAr66yBGrHpMa8i5nJGb0NNj+GJK7gsk6X5+7PsA6IAdQQgwBAiGqiiYyIGuJMCoVXQ9z6Fr0OxSGAZURN2QmzCvS+w5HQaCfVysdQMiLR1EhOY3QkgvvLcpOPh1dxrNc5whS3b+o+7q2heE4buTF3E0DAoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366266; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UufAhb1eCSDnMmYHzX8h68pmrDRUz8YER2QPgDo1oN4=; b=kBmN00hEeR53pCtPpAlixSZ+BfgiQLfjBpRojRs44PhO4etOIfHZVQDOteEAnY0Yur7FUCP2jZI4+C4KlYa66Yhq4yPyP6XwJgSJ9/Xlf/pSfK06sPBQJjxohdsiJVUkN7c1VLJ5VJH58rpTS2hPWj/y9j/vOgNupXiOws4RMiY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366266514699.2944672525863; Fri, 30 Oct 2026 06:17:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTX-0004JT-Tx; Fri, 30 Oct 2026 09:16:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSs-0002kF-WA for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSq-0005W6-RE for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:14 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-483c607ccb4so418261fac.0 for ; Fri, 30 Oct 2026 06:16:06 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366166; x=1793970966; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=UufAhb1eCSDnMmYHzX8h68pmrDRUz8YER2QPgDo1oN4=; b=CENQrE+gstcsbBKxh6+PcCPtzFfLTD46RtAdADQvca8bO+WRwbgN345rh455LjMjII 7xEExFnz3sSdKAdfN3rDA3JsHUCtRkKoHjU37PJNaflbGI1dfvkgogvVse2aqhoWF+mZ NJmVZ3eJ+XgWQqLKZ1UWAnSnSHropDFDhJP1M5aI5nZfjbFtvgGujxZ6RzV9pGQoe+A4 sFFKoJlZWH/28uTVcYzE6XEstyNQCGcEUzkFJ5kYWc5zjXFqa3qVMhZYp/s663W0kY3F 7lBVwxWM+jaD3V5j7awW+FoHrdA0um5BJbBHxBcD5yDj42KTs4/NEnXO2827/gScNH6R /+9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366166; x=1793970966; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UufAhb1eCSDnMmYHzX8h68pmrDRUz8YER2QPgDo1oN4=; b=0l2CjL+snGmdYdU60/OKKPptiCH2F87ATv2XDEvv8pJCyWtWSkKj7QhYku6DiKDaC5 sqSKaVUAN/LhYOVwB/e5G5mcrt1KmXTpaNyyLMAVyqnZTcJIlY2HGne2zvP6nrQCcVfX tV3PE3jmnHr/QNu4XHWd8SS/4XCCVGzh/XqjW3kHSFVvAZo+2LMQKv/wyH5+5rD34AB5 47otvCtR7IbRzU/AJz7ggEL4GPdcKHEat+ci1r7DUE0P7/qH4BSoSQhN51uA81H4WlLJ Qy/MOVDmVRYNgllGubS0Mh8Sfpx3hlwZRObrb5FiOov+vx94a7V2zw0CEP1G1oCY0WPp 4l1A== X-Gm-Message-State: AFq9FYLhStsNhQ5Ei6VwzLQOX3baXuPvFHh31yeUB78kltrGpv2yAMrR h6CwT5Uj/+fEmWDBeOyg/7vDVb6hfjJYg5f+fcvz9o5ktvz9/THl5uO4hCZLHX6pomnhp7eb396 ZfWv5 X-Gm-Gg: AYBFou3oWEY0lTVr/8Xmw40Vr4gNVS8a5NnftkVlz7qsAxE0KQZ64ZpXC+7wij3GC5Q wX8EAhXA+Sx58PHVoYmNrKwUDmQf2z7OoTxUwxW41/bHNOhbj1WYOSwttaiX9Qi8mfY7SAOyocd FR5Z240J4hmX7leeV0FUWhIE70FHpffWthVCPWqsMtYWFluUTjDDXVszHu0ts8VMWn2oenam1rP OR1yUKatGpcwCLdh0aU/zWBzje4VY7zn1cWM4mFUNSBB8I6oqt9z2SvL2wBqfd/3/d7LVJ6cJP4 BYYIYn1/SwjZ3vRZYnL7WWCCfYQWokXu+0IpvtwqAMbHP+NpDFJNNQ1lUbQpaOFaLMm5nBNFoW3 Fh/9rq8cEfPiD1gfZHI0RLiwGDEToiuE+AMpyb43dYQPKyPTyM8AQtBFNUSSC5hOSnPvceV/cbk aDG9qN2a83skd8hb72V4YFCOBhMD+X4scfaq/fOpwK5EksvxyYX+c3DZsH5C/X6VnUBld5459mx 0g4bwf/Jv/GaTnIlCg6teWfBrU/ojYyB1Z0NlOxH5TXcibYejQ2aLLJ33wqJ6ZfxCD9H6LkYoL8 ieLhp/i56H4BLW2r+hjA6Pt3TCl9pg== X-Received: by 2002:a05:6870:e090:b0:4a7:5eb7:ab97 with SMTP id 586e51a60fabf-4a907704825mr1478668fac.32.1793366165933; Fri, 30 Oct 2026 06:16:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 11/19] target/s390x: Use tcg_gen_lea_i64 in get_address Date: Fri, 30 Oct 2026 08:15:46 -0500 Message-ID: <20261030131554.41208-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366268883158500 While there's no actual shift, use the compound function to add two registers and an immediate in one step. Reviewed-by: Matt Turner Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 474d604ed1..ce55edb93a 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -460,8 +460,8 @@ static TCGv_i64 get_address(DisasContext *s, int x2, in= t b2, int d2) * displacements early we create larger immediate addends. */ if (b2 && x2) { - tcg_gen_add_i64(tmp, regs[b2], regs[x2]); - gen_addi_and_wrap_i64(s, tmp, tmp, d2); + tcg_gen_lea_i64(tmp, regs[b2], regs[x2], 0, d2); + gen_addi_and_wrap_i64(s, tmp, tmp, 0); } else if (b2) { gen_addi_and_wrap_i64(s, tmp, regs[b2], d2); } else if (x2) { --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366214; cv=none; d=zohomail.com; s=zohoarc; b=kRLvD1JxNsMHaMqvjkgq3E4zUVHGrJ1EoCECFDjSkGLe7cYS2d1TPBmQcz74ZqRT+fTywNeRLiYAZnsv8XIi1KYl9Ou4i3JeJS0CXw4nSNZAIaKTH4gtYj4taUWA8odwV/aq4S25S8L5Vb+Pzm4z1Z1VVyCZf08IJU6t1/jIxaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366214; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sHlhV1ZqXIbzro91dvfRRIbXHqg/uhhPXyMLjbkNVnQ=; b=ClKVwtBaQWoqJTlIg6QoKIH2An2iFEeuhlvD2aDdy9NKjS9o+8pgXXF4OXk1lcgWE/m5SnHyQGys38w/L42VoLxs5hjVWPO119RNLNkNXcle1aVfNb8HDDcLsDlqdMrqwrFmkY498TRteWcFa//qlxfjUn28Fnnv8M99dck5YcQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366214949910.7343950641133; Fri, 30 Oct 2026 06:16:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTT-0003mM-Ad; Fri, 30 Oct 2026 09:16:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSu-0002ls-On for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:20 -0400 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSr-0005WJ-EC for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:15 -0400 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-4af173320f9so558329b6e.2 for ; Fri, 30 Oct 2026 06:16:08 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366167; x=1793970967; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=sHlhV1ZqXIbzro91dvfRRIbXHqg/uhhPXyMLjbkNVnQ=; b=h28LgiaoarJ+lkZLQQGz8FtqdiuB+JXymfYB5x4xHzS2YbvQ3vzoTEl4k1h7QRMRbF 0FTOzUMfErZviQ40vtZuMiHQGyt9amitn0o5m6xmMYPCNgMJh2LZH9lCIqOeP86DRa9X qpHdMwTFnAc8Rwxd60egWyUYifyPfjfZD5poDIj5ni/3474ou0djFxIZJlB/NV219qD/ pvuXZM2Cnq6ZrZgu6G3Q/MjL9A0JjOh1iGYORJVoCu2z0d9T0XBz4DN0flc0GrPgJ7XF g5yWeOwr/AEQpTywSW5QRQOAuHaJ+kz9FhzP5s4Ac8syBXL0PUul1nvru29hP5W89D8T 3IFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366167; x=1793970967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=sHlhV1ZqXIbzro91dvfRRIbXHqg/uhhPXyMLjbkNVnQ=; b=Pe+C4XTgRqKa/+UgADEv58K2xeJUyxekhkSbBjgpRXNg2XRqvKO+K2Tk7QYko70Fpw 2GxoylzI1nLWkMd7nK0udxqja7hOFBAMVWuaU5w+pw7X1gXBldG2Ez8uO6gflAahdvXx hvuZs8w9PnSINWP0KdZW8tmvb2wWEyNdn9ZBW2pWeiaP9Sl6Lvu4ssCn8HRY4LhZ+FCW ZtM6+nPP/nHGHETosSCqb7fYpnzXeJXtwNxX4MxhTf9W5mKz3JxtbYNpRfg0nxvN7uKV xtj5Nt8sN5Z3nexwvT6ZwexEzjJ5trb0tgEawICIxPOUWOWOe9ZSi126OI5j6vt0evKM HiBg== X-Gm-Message-State: AFq9FYJJFc7LI3hRiX6mXy747QVeUrJbWou/OnprjEaVICUEurp46x3y 4WhMz3/g+hKSzvqE4FDylukm/mUcJdLfH6x+4kgLL0bYtGMaPQuPw6kIEVGVFxuTGG+mmZbuiAU QBvTI X-Gm-Gg: AYBFou1nP6zdxn3XKE0vJwZIFb4bh8j9xNqA0ZZX+GGcyrZB7/Yf6lzWpU3ib4iZbYg 3hrilLhlehKf/TmtKgN3jvGq9Mh0J5++OduR2rwXtq/mnqHtiUWSfTds7nKOFs8fBaMxIaQpPSr /s2Nran+jpBgwl9W6XqeXBKYpqV6ogZYmm4w37Jzhv5lj0xZDZdNr+SlgcEds2HgD7InxiwzJVr nGfqtkokhFzuq+0+WekqL+QMWJDOzhqBya0FrOI1uwbdvxADQ6L5/1NtLWpZ9c02bRGE4nZ6BRi 4r/mcL3U2pjr73mdE4wQp+6SfktzuMN4eqzB0hMeQxD9jarcyRG8EmYDn04aYgaBJid7v2BOT9T wUwU4G/wZ3C6NGJxHB8UYogQrYiWmNuQ3mzXhK4hQMp55UssJ1Z1Dy4yH22sxAGmkWjApwRNSxk SQr6NYGWwgc6mWy/RrRTHDU/ThhUKZShwcrqPG6AZnK5LClZ6H+uuowc0TJjuLvfeOVF3nsa8cj q+4YamZmj16xliu31aMqwZvC7YnrrfDLOlLpUWhLbRAW7un5SpAgkjK9/LGNYnHLCbQIVgXeBDc CsaPZG9yAG0wHL377OgM+2zLV6fXEA== X-Received: by 2002:a05:6808:1585:b0:4d6:2545:b12a with SMTP id 5614622812f47-5640de05bc0mr1559805b6e.26.1793366167228; Fri, 30 Oct 2026 06:16:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 12/19] target/i386: Use tcg_gen_lea_tl in gen_lea_modrm_1 Date: Fri, 30 Oct 2026 08:15:47 -0500 Message-ID: <20261030131554.41208-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366215709158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index dd417cb534..5199c330ac 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1698,31 +1698,32 @@ static TCGv gen_shiftd_rm_T1(DisasContext *s, MemOp= ot, /* Compute the address, with a minimum number of TCG ops. */ static TCGv gen_lea_modrm_1(DisasContext *s, AddressParts a, bool is_vsib) { - TCGv ea =3D NULL; + TCGv ea =3D (a.base >=3D 0 ? cpu_regs[a.base] : NULL); =20 if (a.index >=3D 0 && !is_vsib) { + TCGv index =3D cpu_regs[a.index]; + + if (ea) { + tcg_gen_lea_tl(s->A0, ea, index, a.scale, a.disp); + return s->A0; + } if (a.scale =3D=3D 0) { - ea =3D cpu_regs[a.index]; + ea =3D index; } else { - tcg_gen_shli_tl(s->A0, cpu_regs[a.index], a.scale); + tcg_gen_shli_tl(s->A0, index, a.scale); ea =3D s->A0; } - if (a.base >=3D 0) { - tcg_gen_add_tl(s->A0, ea, cpu_regs[a.base]); - ea =3D s->A0; - } - } else if (a.base >=3D 0) { - ea =3D cpu_regs[a.base]; - } - if (!ea) { + } else if (!ea) { if (tb_cflags(s->base.tb) & CF_PCREL && a.base =3D=3D -2) { /* With cpu_eip ~=3D pc_save, the expression is pc-relative. */ tcg_gen_addi_tl(s->A0, cpu_eip, a.disp - s->pc_save); } else { tcg_gen_movi_tl(s->A0, a.disp); } - ea =3D s->A0; - } else if (a.disp !=3D 0) { + return s->A0; + } + + if (a.disp !=3D 0) { tcg_gen_addi_tl(s->A0, ea, a.disp); ea =3D s->A0; } --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366308; cv=none; d=zohomail.com; s=zohoarc; b=lJ1FkWQ9DKf6Zot2w9pYug5nG1pn3Y9xHqruaEaBzwStb8nw4qR4NLBBEZTEEWlddXsCTzmOPwECltAxFT/Jn2Ogsr4cRZZ0ujuzV4gcphHDBzAVgI1Y180YnGMs1O+eATVfxny07xaFwvmG0cF33okOdOIhdZSWaAnyqXRwy+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366308; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=atAC01GEf0RC/TlwNQYSAbvHRgqsLoIGLDuuvf/uLTg=; b=kT12OkVuaylMRrascHlMrxcffGh5i57SFHoJ0Qqqd2u2JUz8unuK7gX+ZDetF/HIBuGUtHr1xJ3ycb7AgdfX8DjB8CczHphKozzceA8qLvMqT5ENlLCHP9vwiAuK7/r/HlYqfBlqFs5Rwdz67ei57M0Ck4wKU+Vc2aIq7V00dFk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179336630813834.66796830694784; Fri, 30 Oct 2026 06:18:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTU-0003yW-NU; Fri, 30 Oct 2026 09:16:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSu-0002lu-Pz for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:20 -0400 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSq-0005WP-VK for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:15 -0400 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-6deb848ddd7so535111eaf.0 for ; Fri, 30 Oct 2026 06:16:09 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366168; x=1793970968; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=atAC01GEf0RC/TlwNQYSAbvHRgqsLoIGLDuuvf/uLTg=; b=ocVltD5cLbGmQAbV2JVYQJ0yJ83Ap/MOXgZLPMcNAMoaAhsaRMxiafOcrRZUsz1S76 /BVyAIiLr/3JSvRoJZzxn6aVT9pYa9pwfckK2szYGKP0B4XFqzaxlbDXsduNrm/MhTrF SP14i1Ys6XgdcvW5gSXsUt/tAOJ9241cNDnopS0GpwoeBP6zAcOq3HbK+8wTdQ0muXFX ksY7nz8t4/wvLc1pGcZccxGc88Sgivxrx+AmMO6Aowg87/qkVWX+DZquGTO6RG9YyRBY ZGaE+Dv5qqjoot2OPwj3AKiKBX7wyLDMQc64fbmLigZzeHBAMODtcU4IB7QIL0oEsjwY GOFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366168; x=1793970968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=atAC01GEf0RC/TlwNQYSAbvHRgqsLoIGLDuuvf/uLTg=; b=iP18sIxzg2K1GDuOWZq3CBtcFJ8MRh4A0ty2oC/73VVbWOSIoq7yXyI2LfJLqoA9P7 0ilL30QYbVLaXKq/L+qVieQs85ViZKGublqhc6Vv13nqEgYvn/D7ZM88qybvmbbiTni3 ItcAW4F2zSIx5/TtfnyUcGEQHNNBr3GZmzBQVm3X5ZXbsf2CegTE3pbB0d/djksNYfJC NOUNkm605Dg/Wy7gWPA4CNCyQDEwlJSZSAqDuVQtH/GEaKd19TRJk2AAl0tmHoSyyVQG 2e+HUJnaiQXzZMMORo/dnA1PfWXDU5pf6bbPQgS7SAuYmiFQwm4cys8s+rUrQNLFKxD0 SnOQ== X-Gm-Message-State: AFq9FYJ6XRyAimwDZKf+UrZ74qWMI4PaK69VIQ/lgiuFpCdhfhu7MMUF p0mOUXwcpPERjjnNKiD4CUDq2MHfIcRCYRbrGutlnV/zg6kSqg26SJZ0AugqYaOKRn1var55eZg BusVJ X-Gm-Gg: AYBFou0Vrap+KYcchB8o1Atx7Q4hnG5U1b7YGgUQKjHYjqXdJbPZ7442x+WVlOWwp8F zG7HojPVVIeR5OknHA/8IYhpEbvaFNk7FMn2ZmMFqlY0LXJrE1wI7Fhs/rxuSaP7IzDQce/Ax41 s+7l24mHctxrcd/zPOHhGryCvDhOyUuNiBsl4kZ9QC8FMZAu3CDeSwuq/+pzYK6938J5sWYu6gY eIPS1GjyFetrlDTg7GD3DN9CMx8XPpJfxzR59Lqpv5wEBN9q8owL0myvykZFBVwc1/rQbhuCDAa AClQUl5a4epal1G0jdzhMlGlU8/gle7kLVoBNWgxyvthHkr4BSoTn3AOwWRoGKsvrh95tDMYDWM N8yq6/wgvsRtLNH73HHKayB7W2+seuGh50Y45ZCM2096DnOWBRMO9edLqcg5Oj/UJqGPvxDJuAD tNMcEMHcgLiaMrB22FTR29nrIeDfuOVQNxeZABD7YHSgBnymUF3oYrhSx16EXsf+B6F2XpCi6Bw I/ihTPj2OB9pxpgoM3ts0+eGAx6r3HhDHJAPYpehNOR0fth1kerwdo8El94BUuhqNdQWlFgfh3q qbyDnjF+rDzsDGLppbbRhcl3Knv4ew== X-Received: by 2002:a05:6820:7097:20b0:6b7:83c5:fde8 with SMTP id 006d021491bc7-714f240aab7mr873627eaf.41.1793366167995; Fri, 30 Oct 2026 06:16:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 13/19] tcg/x86_64: Introduce TCG_REG_NONE Date: Fri, 30 Oct 2026 08:15:48 -0500 Message-ID: <20261030131554.41208-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c2b; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366309645158500 Content-Type: text/plain; charset="utf-8" Rather than hard-code -1, or compare < 0, use something more descriptive. This also allows more use of TCGReg. Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/x86_64/tcg-target.h | 1 + tcg/x86_64/tcg-target.c.inc | 66 ++++++++++++++++++++----------------- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/tcg/x86_64/tcg-target.h b/tcg/x86_64/tcg-target.h index 7ebae56a7d..7109722f24 100644 --- a/tcg/x86_64/tcg-target.h +++ b/tcg/x86_64/tcg-target.h @@ -31,6 +31,7 @@ #define MAX_CODE_GEN_BUFFER_SIZE (2 * GiB) =20 typedef enum { + TCG_REG_NONE =3D -1, TCG_REG_EAX =3D 0, TCG_REG_ECX, TCG_REG_EDX, diff --git a/tcg/x86_64/tcg-target.c.inc b/tcg/x86_64/tcg-target.c.inc index 46efee87e6..d85e95a32b 100644 --- a/tcg/x86_64/tcg-target.c.inc +++ b/tcg/x86_64/tcg-target.c.inc @@ -210,7 +210,8 @@ static bool tcg_target_const_match(int64_t val, int ct, return 0; } =20 -# define LOWREGMASK(x) ((x) & 7) +#define LOWREGMASK(x) ((x) & 7) +#define REGOR0(x) ((x) =3D=3D TCG_REG_NONE ? 0 : (x)) =20 #define P_EXT 0x100 /* 0x0f opcode prefix */ #define P_EXT38 0x200 /* 0x0f 0x38 opcode prefix */ @@ -525,7 +526,7 @@ static const uint8_t tcg_cond_to_jcc[] =3D { [TCG_COND_TSTNE] =3D JCC_JNE, }; =20 -static void tcg_out_opc(TCGContext *s, int opc, int r, int rm, int x) +static void tcg_out_opc(TCGContext *s, int opc, TCGReg r, TCGReg rm, TCGRe= g x) { int rex; =20 @@ -573,14 +574,14 @@ static void tcg_out_opc(TCGContext *s, int opc, int r= , int rm, int x) tcg_out8(s, opc); } =20 -static void tcg_out_modrm(TCGContext *s, int opc, int r, int rm) +static void tcg_out_modrm(TCGContext *s, int opc, TCGReg r, TCGReg rm) { tcg_out_opc(s, opc, r, rm, 0); tcg_out8(s, 0xc0 | (LOWREGMASK(r) << 3) | LOWREGMASK(rm)); } =20 -static void tcg_out_vex_opc(TCGContext *s, int opc, int r, int v, - int rm, int index) +static void tcg_out_vex_opc(TCGContext *s, int opc, TCGReg r, TCGReg v, + TCGReg rm, TCGReg index) { int tmp; =20 @@ -631,8 +632,8 @@ static void tcg_out_vex_opc(TCGContext *s, int opc, int= r, int v, tcg_out8(s, opc); } =20 -static void tcg_out_evex_opc(TCGContext *s, int opc, int r, int v, - int rm, int index, int aaa, bool z) +static void tcg_out_evex_opc(TCGContext *s, int opc, TCGReg r, TCGReg v, + TCGReg rm, TCGReg index, int aaa, bool z) { /* The entire 4-byte evex prefix; with R' and V' set. */ uint32_t p =3D 0x08041062; @@ -677,7 +678,8 @@ static void tcg_out_evex_opc(TCGContext *s, int opc, in= t r, int v, tcg_out8(s, opc); } =20 -static void tcg_out_vex_modrm(TCGContext *s, int opc, int r, int v, int rm) +static void tcg_out_vex_modrm(TCGContext *s, int opc, TCGReg r, + TCGReg v, TCGReg rm) { if (opc & P_EVEX) { tcg_out_evex_opc(s, opc, r, v, rm, 0, 0, false); @@ -688,7 +690,7 @@ static void tcg_out_vex_modrm(TCGContext *s, int opc, i= nt r, int v, int rm) } =20 static void tcg_out_vex_modrm_type(TCGContext *s, int opc, - int r, int v, int rm, TCGType type) + TCGReg r, TCGReg v, TCGReg rm, TCGType = type) { if (type =3D=3D TCG_TYPE_V256) { opc |=3D P_VEXL; @@ -696,8 +698,8 @@ static void tcg_out_vex_modrm_type(TCGContext *s, int o= pc, tcg_out_vex_modrm(s, opc, r, v, rm); } =20 -static void tcg_out_evex_modrm_type(TCGContext *s, int opc, int r, int v, - int rm, int aaa, bool z, TCGType type) +static void tcg_out_evex_modrm_type(TCGContext *s, int opc, TCGReg r, TCGR= eg v, + TCGReg rm, int aaa, bool z, TCGType ty= pe) { if (type =3D=3D TCG_TYPE_V256) { opc |=3D P_VEXL; @@ -711,12 +713,12 @@ static void tcg_out_evex_modrm_type(TCGContext *s, in= t opc, int r, int v, mode for absolute addresses, ~RM is the size of the immediate operand that will follow the instruction. */ =20 -static void tcg_out_sib_offset(TCGContext *s, int r, int rm, int index, +static void tcg_out_sib_offset(TCGContext *s, TCGReg r, TCGReg rm, TCGReg = index, int shift, intptr_t offset) { int mod, len; =20 - if (index < 0 && rm < 0) { + if (index =3D=3D TCG_REG_NONE && rm =3D=3D TCG_REG_NONE) { /* * Try for a rip-relative addressing mode. This has replaced * the 32-bit-mode absolute addressing encoding. @@ -747,7 +749,7 @@ static void tcg_out_sib_offset(TCGContext *s, int r, in= t rm, int index, =20 /* Find the length of the immediate addend. Note that the encoding that would be used for (%ebp) indicates absolute addressing. */ - if (rm < 0) { + if (rm =3D=3D TCG_REG_NONE) { mod =3D 0, len =3D 4, rm =3D 5; } else if (offset =3D=3D 0 && LOWREGMASK(rm) !=3D TCG_REG_EBP) { mod =3D 0, len =3D 0; @@ -759,7 +761,7 @@ static void tcg_out_sib_offset(TCGContext *s, int r, in= t rm, int index, =20 /* Use a single byte MODRM format if possible. Note that the encoding that would be used for %esp is the escape to the two byte form. */ - if (index < 0 && LOWREGMASK(rm) !=3D TCG_REG_ESP) { + if (index =3D=3D TCG_REG_NONE && LOWREGMASK(rm) !=3D TCG_REG_ESP) { /* Single byte MODRM format. */ tcg_out8(s, mod | (LOWREGMASK(r) << 3) | LOWREGMASK(rm)); } else { @@ -768,7 +770,7 @@ static void tcg_out_sib_offset(TCGContext *s, int r, in= t rm, int index, /* Note that the encoding that would place %esp into the index field indicates no index register. In 64-bit mode, the REX.X bit counts, so %r12 can be used as the index. */ - if (index < 0) { + if (index =3D=3D TCG_REG_NONE) { index =3D 4; } else { tcg_debug_assert(index !=3D TCG_REG_ESP); @@ -785,32 +787,34 @@ static void tcg_out_sib_offset(TCGContext *s, int r, = int rm, int index, } } =20 -static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, int r, int rm, - int index, int shift, intptr_t offset) +static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, TCGReg r, + TCGReg rm, TCGReg index, + int shift, intptr_t offset) { - tcg_out_opc(s, opc, r, rm < 0 ? 0 : rm, index < 0 ? 0 : index); + tcg_out_opc(s, opc, r, REGOR0(rm), REGOR0(index)); tcg_out_sib_offset(s, r, rm, index, shift, offset); } =20 -static void tcg_out_vex_modrm_sib_offset(TCGContext *s, int opc, int r, in= t v, - int rm, int index, int shift, +static void tcg_out_vex_modrm_sib_offset(TCGContext *s, int opc, + TCGReg r, TCGReg v, TCGReg rm, + TCGReg index, int shift, intptr_t offset) { - tcg_out_vex_opc(s, opc, r, v, rm < 0 ? 0 : rm, index < 0 ? 0 : index); + tcg_out_vex_opc(s, opc, r, v, REGOR0(rm), REGOR0(index)); tcg_out_sib_offset(s, r, rm, index, shift, offset); } =20 /* A simplification of the above with no index or shift. */ -static inline void tcg_out_modrm_offset(TCGContext *s, int opc, int r, - int rm, intptr_t offset) +static void tcg_out_modrm_offset(TCGContext *s, int opc, TCGReg r, + TCGReg rm, intptr_t offset) { - tcg_out_modrm_sib_offset(s, opc, r, rm, -1, 0, offset); + tcg_out_modrm_sib_offset(s, opc, r, rm, TCG_REG_NONE, 0, offset); } =20 -static inline void tcg_out_vex_modrm_offset(TCGContext *s, int opc, int r, - int v, int rm, intptr_t offset) +static void tcg_out_vex_modrm_offset(TCGContext *s, int opc, TCGReg r, + TCGReg v, TCGReg rm, intptr_t offset) { - tcg_out_vex_modrm_sib_offset(s, opc, r, v, rm, -1, 0, offset); + tcg_out_vex_modrm_sib_offset(s, opc, r, v, rm, TCG_REG_NONE, 0, offset= ); } =20 /* Output an opcode with an expected reference to the constant pool. */ @@ -1890,7 +1894,7 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, = TCGLabelQemuLdst *l) =20 #ifdef CONFIG_USER_ONLY static HostAddress x86_guest_base =3D { - .index =3D -1 + .index =3D TCG_REG_NONE }; =20 #if defined(__linux__) @@ -2174,7 +2178,7 @@ static void tgen_qemu_ld(TCGContext *s, TCGType type,= TCGReg data, HostAddress h; =20 ldst =3D prepare_host_addr(s, &h, addr, oi, true); - tcg_out_qemu_ld_direct(s, data, -1, h, type, get_memop(oi)); + tcg_out_qemu_ld_direct(s, data, TCG_REG_NONE, h, type, get_memop(oi)); =20 if (ldst) { ldst->type =3D type; @@ -2312,7 +2316,7 @@ static void tgen_qemu_st(TCGContext *s, TCGType type,= TCGReg data, HostAddress h; =20 ldst =3D prepare_host_addr(s, &h, addr, oi, false); - tcg_out_qemu_st_direct(s, data, -1, h, get_memop(oi)); + tcg_out_qemu_st_direct(s, data, TCG_REG_NONE, h, get_memop(oi)); =20 if (ldst) { ldst->type =3D type; --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366298; cv=none; d=zohomail.com; s=zohoarc; b=Z8iUDqjS+YXEbDHaxpe7js8kDNPSBnPLvxk9E2dSkWpInKd2U+JP365lk5bpcnYgPuijTP/cNCAp+AUkgx0uWhONmVMdlfVPTVh2/jvHRI1aNdRLtmvuBhGWfXA5xNKZn6SVDQPo1EK7oeNnfmt7Hf+JG/sJviWJwsnq9Lb0xuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366298; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/s6kyHIPPO7wmb797pBUvtqZP0z9Faww+WNYejTokjM=; b=Hl6hN3TKAuRf4l+eIHpzLku9m+mC09ZFVVbo45gTM+NyZ9CMzHYmWThamadJ/hgtJj05NNHZY1TAGWBkEgjWmu0z5hdfzyxmBpaKmhOe6e7zWNGj0pngPVLUui2DujPAJ1lZPLTmAkexB07ldr1gJlrGd0QohrAKd5jAA1aPkQY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366298339791.5255282596195; Fri, 30 Oct 2026 06:18:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTg-00056Q-Iy; Fri, 30 Oct 2026 09:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSs-0002kD-VO for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:18 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSq-0005WU-0B for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:14 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-5326cdde017so190978b6e.2 for ; Fri, 30 Oct 2026 06:16:09 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366169; x=1793970969; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/s6kyHIPPO7wmb797pBUvtqZP0z9Faww+WNYejTokjM=; b=bOuBU6DnUSghDrdGsR/gXDEbE9ZFrHytkHDIJEDN+WOSY2iOQqKbVLYOlsH97miIW3 D+qQMX7MOp2kaiI6Sfk+d9rdfug2Zhz8qMZO2FjytdS05pMaBQnYWg/mi+kTGtibocAl 9f9w6gCVMTZJZGW5GEiNo91PIFpOFy33VZsOj0S+fWSh8arYQuDm11ubnY0y281e+QJM vE+/S/MVX476Ec7unbGqYJc04rUc9dT1aTIngLs/QlXtTN13OWsxcCzDPzaXCXQpJnVX /cHMeqO6d8Ao3/RQeqVX8j/uwvcb+jqANBmeBQf/BegptBPcIQg61GiZIG1FxrVBv/mS qKMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366169; x=1793970969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/s6kyHIPPO7wmb797pBUvtqZP0z9Faww+WNYejTokjM=; b=mF0UOwUJwccYk3vefFfuiAb4x70gBadBmNcfK7/aHxR5iPcyTrencexUg+669AzFWg MxqjrOcXwk6ibZR9YiWWR20ivawiZ7fS+kQIARSAfuk8lasc9izoWyvR95sCQ2OpisyG Kuxd15GLIJzEq3nGABFQHwxR1RsJzzg+6LYF3Q3Jcb1H8+RlrQJLD/JAqJvCnyuvaj7X HTACxu8X98wC4jri0nb9B6D4qwMCDR69yQ7T4RC2hw26b8o0GxIBw6YbO33cmhIrvMYc zAWnC9i3D0g/WK9Dp2jcHJ5r22x86B2D7QJkQk1px795WpNFZBMe1Tq2O2vuITYqWOnQ Yb1A== X-Gm-Message-State: AFq9FYJBa1ZltBu6wZPl97XJ0z0V4OXUgpDUHSNO4ny7ZrDWgpT3OTDd sti6NjcDqviqvRnME7Rf34VSc05B/iDijXJQ5S0zqNVes8btjHjd0fkCDpaCtvONNem1pnMYVaj tIL/N X-Gm-Gg: AYBFou38xu7n8oHAtqR+4Bh9TmwZM89+s+mTJ0DPFkVk19+Y27nz/WbZ0SiU+piJFEy jDO+h3PwHs+7z9kFMNg+cWBiZH5Rg9wVfSJfn5fIKAcFTKTAdZsCc6nGH1u9KrlxjznCMz1aDOF QmYUwc2PN4H4Sp7xQIl+MpRfeJqzuD9Ww/yUJExdzzTDniK/V2zOTZ4q1JvtCKnUWhc++XGgGcr HniaZfhSUcb69bVObSDlojGDZX5dBfRBMgD+tGSgadjIKS8ZTlPZ9UXFBmVGiWxMT6x/t+2qwdO 8NPO5t/48qmJtDAo68EAA7Uv4+9LmzXFzUQpTud5ciRKJoihUMf22WjCcCQzKrzwrbFB5lFy4BH 8cLNPhBw315xYVEMnLoPLL5n3dZBZtOgdZp/cjj4mhCELWW37PoOSsxXVR7wIEvPfaFA0oQDl3q SqpVz/X6x1a6pSznzzQ7i1TFLT/wmHw/81yYNQRprIXBqej/PfBFBR9hVu6BvP+n9C42atkmMhz 2Ba8/j17g9dOrXIotOjPBnMh+EZFCTzU1AoWW7jGTPRjKEqNqTNAxWkEQG6GpWhT/fnHWfjDrMX rx88XK1GlfRIa2nLhL3AVFaUERJMQA== X-Received: by 2002:a05:6809:1c:20b0:4fa:8d48:3a6a with SMTP id 5614622812f47-5640dc2a78bmr1055051b6e.18.1793366169130; Fri, 30 Oct 2026 06:16:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 14/19] tcg/x86_64: Implement INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:49 -0500 Message-ID: <20261030131554.41208-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366299938154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/x86_64/tcg-target-con-set.h | 1 + tcg/x86_64/tcg-target-has.h | 4 ++-- tcg/x86_64/tcg-target.h | 2 ++ tcg/x86_64/tcg-target.c.inc | 11 ++++++++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tcg/x86_64/tcg-target-con-set.h b/tcg/x86_64/tcg-target-con-se= t.h index 7df9bf4917..2529539f89 100644 --- a/tcg/x86_64/tcg-target-con-set.h +++ b/tcg/x86_64/tcg-target-con-set.h @@ -47,6 +47,7 @@ C_O1_I2(r, r, r) C_O1_I2(r, r, re) C_O1_I2(r, r, ri) C_O1_I2(r, rO, re) +C_O1_I2(r, rz, r) C_O1_I2(x, x, x) C_N1_I2(r, r, r) C_N1_I2(r, r, rW) diff --git a/tcg/x86_64/tcg-target-has.h b/tcg/x86_64/tcg-target-has.h index 6ffae51f92..f1d3d256ee 100644 --- a/tcg/x86_64/tcg-target-has.h +++ b/tcg/x86_64/tcg-target-has.h @@ -105,7 +105,7 @@ tcg_target_extract_valid(TCGType type, unsigned ofs, un= signed len) } #define TCG_TARGET_extract_valid tcg_target_extract_valid =20 -#define TCG_TARGET_lea_sh_valid(type, sh) 0 -#define TCG_TARGET_lea_imm_valid(type, imm) 0 +#define TCG_TARGET_lea_sh_valid(type, sh) ((sh) <=3D 3) +#define TCG_TARGET_lea_imm_valid(type, imm) ((imm) =3D=3D (int32_t)= (imm)) =20 #endif diff --git a/tcg/x86_64/tcg-target.h b/tcg/x86_64/tcg-target.h index 7109722f24..3444bcdca0 100644 --- a/tcg/x86_64/tcg-target.h +++ b/tcg/x86_64/tcg-target.h @@ -80,4 +80,6 @@ typedef enum { TCG_REG_CALL_STACK =3D TCG_REG_ESP } TCGReg; =20 +#define TCG_REG_ZERO TCG_REG_NONE + #endif diff --git a/tcg/x86_64/tcg-target.c.inc b/tcg/x86_64/tcg-target.c.inc index d85e95a32b..3fca0693e2 100644 --- a/tcg/x86_64/tcg-target.c.inc +++ b/tcg/x86_64/tcg-target.c.inc @@ -3361,8 +3361,17 @@ static const TCGOutOpStore outop_st =3D { .out_i =3D tgen_st_i, }; =20 +static void tgen_lea(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1, + TCGReg a2, unsigned sh, tcg_target_long imm) +{ + int rexw =3D type =3D=3D TCG_TYPE_I32 ? 0 : P_REXW; + tcg_out_modrm_sib_offset(s, OPC_LEA + rexw, a0, a1, a2, sh, imm); +} + static const TCGOutOpLea outop_lea =3D { - .base.static_constraint =3D C_NotImplemented, + /* Allow "lea imm(, a2, sh), a0" via TCG_REG_ZERO constraint */ + .base.static_constraint =3D C_O1_I2(r, rz, r), + .out =3D tgen_lea, }; =20 static int const umin_insn[4] =3D { --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366298; cv=none; d=zohomail.com; s=zohoarc; b=H/JxyiZk9Np0KGuoJYdpIr0DrCsXZq0YQUdio8cyKr8Da5bcdHnc1b7/xsmJEhg+YC4cQfqKFxwqlsD1k49+9JD4jVXkMuujspjmER2VeGSFKI4z+OpoZfb0Yg9RRI1WJTSrb2OsKhmWUKvJJg9DonLLOI3DtfvWYarXYC2R2p0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366298; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D2fdLlvb+BRbVtRIo4uLPfcunyMOSQZp2TZDVBOzWlg=; b=MPNWIjZzHJ1wCP6Kqbefbn9Cm8jhpxRePqkAKzfNOWRl9FqfIJc0BHAqQj2KGBvj8MRyp85Mq12iLL0W6x/bu5HzbPJ5C0wNjlXL9XHPZNXRHa7CVWYAr1Zq85bMcVsFZlH5jvYG1mspLBzYnwRM7QOgdyWrFdcC1WPHsOZzSGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366298367259.91801489443185; Fri, 30 Oct 2026 06:18:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTj-0005PG-Cb; Fri, 30 Oct 2026 09:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmSu-0002lt-Pa for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:20 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSs-0005WY-Lm for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:16 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-8253bc5a613so503967a34.0 for ; Fri, 30 Oct 2026 06:16:10 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366170; x=1793970970; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=D2fdLlvb+BRbVtRIo4uLPfcunyMOSQZp2TZDVBOzWlg=; b=JijKBCKAL/E9cJ6GuySvLlspRaG9k3s/g2XO0Wg/+NjOqIIQP9Xc5LxP0w/oJjwL1I EbikA0W2RbFyxw8HcA7Cr02xcjl101YcfdKHjTJ6vhVUFqiyBfrSwajS51vGwtzTyTZ4 n0VC5mJqRBI7u0DL4DgI9+vkG60+WMc6PP9AAzMgUI5tpnu4SA5chzaFtd4hUSBsrous tntTpDLurxJoiBMN6Jv3dsqPlqQISwy9HaM9oCNPbPK/dcfNvey65E4PVXEG4q1V0b9w nZzPZtnnnCEpIXt2AlaWL7akbh6rQgxM6sGt3XkcgJl+Ry5yNX+C0ZJlqXTxHA8MZqEN abNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366170; x=1793970970; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=D2fdLlvb+BRbVtRIo4uLPfcunyMOSQZp2TZDVBOzWlg=; b=GVTSpwLNsEJ8ZN/B8ZO7E0on3xrlC3jf/6XapJXeG7Pb4FsVHOSd6eL+ITyFeAZcem 6XR0Vz46LN3cfr8YdsdYfk3qnNLGyq2bngLDYAmsHurSFGvXJio28hvq6z4yTAZ6UfIo GLZVy3yFaVRyURXvKNW72GqLFPcuoWoo3BV0ZfqT3P0Qw2wjvYJVqRlZpTUiY9/jOmFb OxM9kyiwhFP61fEaNACxzgBL/G/LhBf4hrYKbCUy9eWWtfQ5CcR5gj9Su/KZ5+ZlrAaB Z1NpORHhPonbtLJBktEJaehxsp/uXreZtpjnhl6picTcoUJWbNc14i1LKLPBVRXPzXhz l1Ew== X-Gm-Message-State: AFq9FYKQUqsAfeBAKRtGWrjDd5CaHGqIPCJUHwrHX/9Es/uwiEgMm5NR pImzbSUcWhwndZkhpjKsEwOoIsLZ47sC1KpqBbagvaIDHKNQuRtbYIFDCHFS/wrX6kop+9V6ugK 3T/TP X-Gm-Gg: AYBFou1SAmW/NtmseWkB61oJG2RBWcmkAc1FPkcwc/xTXdilr3XDVBNSkAp6CQPGwAz fAqfj8ur4v4q+u8uSJ2PyJAqkabuBWYkZjgdlHU8husotMx32TKP1Z+PVHMe39upKoF4GS1e304 cGdCv6fWZPwzm10kXc+rx53rEtnxtjIgXkGPKA4XyXQjg5JrfJ4/iKaN3CUFjhRZqvNbLurVzV3 1oPCjF79SvSKfJe6qLtLSO2dahwGaoxfAo0ldf1bhnRqn22YOgSK1wg5FcWANG/EC41mcqj41pP or3SiYEe3jbYwxY9qwANGTq7i2bbcc4HZdzxXV83kuAMYEh3V3BZBXTNNwg1Tv81MKx0BU4rFxT pBMsI4RjSl47SidmK3b2/r3tNNotrMqt69sxWDr7hZUMbNekS2O0FJhdQ9TeXUd1yKUcNKMRGHr j8COHf0qE7vapuE9Rc09F6a/JTaMRO5Dkgngkqm4a1xvpPas7g3X0tSOveFqymbYlAhPPv2K1QB 56Apd3pOMGWFdWFF+4rj0c8H9N+cAAed/kDmuJlo6ViLeGui+S8XA9pdtfHiQ+cMCI62V0D6NRn Pfs7RyPUGXmxBgUHPf7DhW98l+W5kA0= X-Received: by 2002:a05:6820:858a:10b0:709:d804:88c4 with SMTP id 006d021491bc7-714f28017c4mr909197eaf.89.1793366169933; Fri, 30 Oct 2026 06:16:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 15/19] tcg/loongarch64: Import SLADD insns Date: Fri, 30 Oct 2026 08:15:50 -0500 Message-ID: <20261030131554.41208-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366299871154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-insn-defs.c.inc b/tcg/loongarch64/tcg-insn= -defs.c.inc index e907fc755f..ececc6a3dd 100644 --- a/tcg/loongarch64/tcg-insn-defs.c.inc +++ b/tcg/loongarch64/tcg-insn-defs.c.inc @@ -4,7 +4,7 @@ * * This file is auto-generated by genqemutcgdefs from * https://github.com/loongson-community/loongarch-opcodes, - * from commit 1b95bb8c443ad71e266120fd97bd227df2d8ecfc. + * from commit 2d84c975e8894afc8b3ee9b8559f10308a658440. * DO NOT EDIT. */ =20 @@ -24,6 +24,7 @@ typedef enum { OPC_REVBIT_D =3D 0x00005400, OPC_SEXT_H =3D 0x00005800, OPC_SEXT_B =3D 0x00005c00, + OPC_SLADD_W =3D 0x00040000, OPC_ADD_W =3D 0x00100000, OPC_ADD_D =3D 0x00108000, OPC_SUB_W =3D 0x00110000, @@ -62,6 +63,7 @@ typedef enum { OPC_MOD_D =3D 0x00228000, OPC_DIV_DU =3D 0x00230000, OPC_MOD_DU =3D 0x00238000, + OPC_SLADD_D =3D 0x002c0000, OPC_SLLI_W =3D 0x00408000, OPC_SLLI_D =3D 0x00410000, OPC_SRLI_W =3D 0x00448000, @@ -619,6 +621,18 @@ encode_djk_insn(LoongArchInsn opc, TCGReg d, TCGReg j,= TCGReg k) return encode_djk_slots(opc, d, j, k); } =20 +static int32_t __attribute__((unused)) encode_djkua2_insn(LoongArchInsn op= c, + TCGReg d, TCGReg= j, + TCGReg k, + uint32_t ua2) +{ + tcg_debug_assert(d >=3D 0 && d <=3D 0x1f); + tcg_debug_assert(j >=3D 0 && j <=3D 0x1f); + tcg_debug_assert(k >=3D 0 && k <=3D 0x1f); + tcg_debug_assert(ua2 <=3D 0x3); + return encode_djka_slots(opc, d, j, k, ua2); +} + static int32_t __attribute__((unused)) encode_djsk12_insn(LoongArchInsn opc, TCGReg d, TCGReg j, int32_t sk12) { @@ -1426,6 +1440,13 @@ static void __attribute__((unused)) tcg_out_opc_sext= _b(TCGContext *s, TCGReg d, tcg_out32(s, encode_dj_insn(OPC_SEXT_B, d, j)); } =20 +/* Emits the `sladd.w d, j, k, ua2` instruction. */ +static void __attribute__((unused)) +tcg_out_opc_sladd_w(TCGContext *s, TCGReg d, TCGReg j, TCGReg k, uint32_t = ua2) +{ + tcg_out32(s, encode_djkua2_insn(OPC_SLADD_W, d, j, k, ua2)); +} + /* Emits the `add.w d, j, k` instruction. */ static void __attribute__((unused)) tcg_out_opc_add_w(TCGContext *s, TCGRe= g d, TCGReg j, TCGReg k) @@ -1692,6 +1713,13 @@ static void __attribute__((unused)) tcg_out_opc_mod_= du(TCGContext *s, TCGReg d, tcg_out32(s, encode_djk_insn(OPC_MOD_DU, d, j, k)); } =20 +/* Emits the `sladd.d d, j, k, ua2` instruction. */ +static void __attribute__((unused)) +tcg_out_opc_sladd_d(TCGContext *s, TCGReg d, TCGReg j, TCGReg k, uint32_t = ua2) +{ + tcg_out32(s, encode_djkua2_insn(OPC_SLADD_D, d, j, k, ua2)); +} + /* Emits the `slli.w d, j, uk5` instruction. */ static void __attribute__((unused)) tcg_out_opc_slli_w(TCGContext *s, TCGR= eg d, TCGReg j, uint32_t = uk5) --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366326; cv=none; d=zohomail.com; s=zohoarc; b=HdJxm63V4Wkyko2M/nxqaPvHYBdBWW5S2zG2KPSI5PNunQcQsEtOihMXoE1iEcXufWLa9ZKK5XI4wWaiqxkJgcDO6UbCcX0GY9KXReLJ60U4d0/N6FOM1dW/n+U4Tue2YW4US2oTRxagXUxiahxE+vKh7VWwUBVKfUwEVLGGOpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366326; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iAMNDbHUNDI+apCmKSgDC28TQZ7cIrC7r+UwC/sNOys=; b=dBcPP37hGj67owoRw3eVm8wTYRlWCEHazW51w5Qmn9Kjao9bF9T1HXexF+pzP1TjMlf5Yn88NjH76ja/q1JrXpdhOvgYBW9VBWF2ubDjNEHC2WN4Dri0fPy5jwIs9vX6yBxPUcmLf91v44ZWOjjPaJFLzYIKPy3IJr0kGNJTZ2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366326598766.7260598849409; Fri, 30 Oct 2026 06:18:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTm-0005gR-37; Fri, 30 Oct 2026 09:17:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmT2-0002pP-Ly for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:29 -0400 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmSz-0005Yg-Rm for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:23 -0400 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-47b47de8b4cso403611fac.3 for ; Fri, 30 Oct 2026 06:16:21 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366181; x=1793970981; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iAMNDbHUNDI+apCmKSgDC28TQZ7cIrC7r+UwC/sNOys=; b=xzGxbr0GWvJgK46En1oRr7WJmOINMTWniHBh0n15SHmShd4e+lJCyyiGBO+emmT/ph /DEw9qEAVSKFUZTABpOwr9F++FOvsGtHmplcW40OZ1N20E1AA+KyCxqxVroR6rg3ow4J V92Yh8hDgXVGrbAG4KMRjiM3Fl1wy938a91/RuB4xzJIkb5qVBkneEeWyzMJMI6jyB52 emA+aDr9n+GXoRk2tcJf1dHRGXQBJimu7w7vc352vzFy5U54IguTQAusRUIyBL6FjY1m rpSbR9wKHhxNbPABcGsw5IdpK9k9z0Ym/+fUDA0HdH1g3Qs/apuYGf5pGkT1MQgwZx1g z7Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366181; x=1793970981; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=iAMNDbHUNDI+apCmKSgDC28TQZ7cIrC7r+UwC/sNOys=; b=yMU+EFYwazSUNxFiEHqf+JJwNtrXS/HCtwFRYIyA/FeENwn9N1id8Cyzsyfa2ph7c4 NtYBwMzqueLKcTukLKw2kfx6+KRE61NEazDv6s0FAuQ25D9oyCqGJxG6ycJv4ldc2ksG geXZaRvc3u1nF+nlSk7tBbHFZLElCtn0RN8iVcxnde9S/PtFWI4rRtBahQqear7nyX4z 1YV8i4eCSMwMMUsQ9b0m61uys2w62wqh2Wg0Mkw5t4aAkOX5JU56DBuMmg3+SmWRj2cc ofAqZHzK27gfmxedXCldc23jG1jmU3viNVodCaXbBHog/tryIblIGeUIkuluWlFHcQNR DgnQ== X-Gm-Message-State: AFq9FYKQ+zc+XpDNBfo1q0fe4wudnQOFNqDNQGVpV8khhzRA0SD2nwy7 cfs4rKA+dLfajcWTKfVpaqKuJGt9hHS4Fz+i4lvUkRqkaNvm158s9jJ36ppAY3S26ug1d3cpYVN RIUIH X-Gm-Gg: AYBFou0KjmuBjb8F3NTjyDPjkDgUuvJYGzNgAM2A6ROrESzNqfEFumM01QLlBHI/8J1 w0ro79CnoXgWtB0AwbHCpt2H9y8UFKDHsJ58amNkMdHaCFgcSxsWvwR9xIIGRnqPqAJGXqQwDmk g5C+779hF43cMZJp2yyLMLGFw93t2sn8LYY8gp3zt2Xdif+3qO4lkrbJNkxXcB2CmZxuf/NaYdx AGjoOwtViC4rXfM6ntrhfzoM1pHeHEPiDZAP50cBF7wertFnBLuiylF0Spoh01LUpQKs4w8MRZ+ S83utXJE2lmXmaszsF56GGPQ8qxTNcp4pGK4NnQrK5Bj3zytPGA2P00FQCQWlt3nZkqr6Eo1Cqc +ccScdzh63g4Gwn67z42J0I283MxFR4Zuw746dZsZpfOVM05YUze3ww/fCiDAXr5vRyMywMzs/3 l1wR9ZPdD7F5yxVwn+BPF9kwZmp7j19JoFvyCVKMOgqrI0HfGOxCCVK1AdR0rBYARNZKxaUYbOW 9CBjFCeKNhwpQxnXzeavwZdWDrH0ww0s24wpYxqmVfTMGuZR/Idv4VfdYmhNd3mmm/lmRolBf+O WySdByT67OT8uQeSjczCsEYHYkf7UAFx/Ysngg6jXNeuXA7B1gTO X-Received: by 2002:a05:6870:82ac:b0:485:d31b:775c with SMTP id 586e51a60fabf-4a9076e94b1mr1386919fac.26.1793366171149; Fri, 30 Oct 2026 06:16:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 16/19] tcg/loongarch64: Implement INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:51 -0500 Message-ID: <20261030131554.41208-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366327779158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-has.h | 4 ++-- tcg/loongarch64/tcg-target.c.inc | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-= has.h index 31e6ea9632..53b7ca4057 100644 --- a/tcg/loongarch64/tcg-target-has.h +++ b/tcg/loongarch64/tcg-target-has.h @@ -54,7 +54,7 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, uns= igned len) } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid =20 -#define TCG_TARGET_lea_sh_valid(type, sh) 0 -#define TCG_TARGET_lea_imm_valid(type, imm) 0 +#define TCG_TARGET_lea_sh_valid(type, sh) ((sh) >=3D 1 && (sh) <= =3D 4) +#define TCG_TARGET_lea_imm_valid(type, imm) ((imm) =3D=3D 0) =20 #endif diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.= c.inc index 17784d8bbe..377cd9ec08 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -2098,8 +2098,19 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static void tgen_lea(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1, + TCGReg a2, unsigned sh, tcg_target_long imm) +{ + if (type =3D=3D TCG_TYPE_I32) { + tcg_out_opc_sladd_w(s, a0, a2, a1, sh - 1); + } else { + tcg_out_opc_sladd_d(s, a0, a2, a1, sh - 1); + } +} + static const TCGOutOpLea outop_lea =3D { - .base.static_constraint =3D C_NotImplemented, + .base.static_constraint =3D C_O1_I2(r, r, r), + .out =3D tgen_lea, }; =20 static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366298; cv=none; d=zohomail.com; s=zohoarc; b=mhKB2F4RQfyuMpKoweCr17argZGNnHhyDPuemwLzzkYbkcm/cQylllEAPJyCP+J6yS4hEsgz6eDJdiAAUSRoS9CKtu5MGQuVTR5Bre5PKP33+QqnNRP8GFxjpwHM1kVkiX5d8HK4tEl/bvjfMhBzfueubv+s4i4evQ7Sz6pFMC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366298; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UYG7YseAeEwVr3rhaXK6Mt/QyGw+G8RGw3F7A/nr5iY=; b=EEaHp7F3Sp1jYx/n0P+tOm1g7WSc7QlD8BJYI2t4pIPzgcGktFgfwjLtwoxYU0EAiS4ZHpZJ2wX4IOOK9bjNjfycD2Dpt8vKqC1ngoybFTotDj3upKQd94Py5RqR1YA6ojENQVvXlhewTWA6SWD43Gmc0Rq+vIt6HZc79h4lH8Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793366298150773.838171989184; Fri, 30 Oct 2026 06:18:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTU-0003qp-1C; Fri, 30 Oct 2026 09:16:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmT4-0002rW-2h for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:33 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmT2-0005Ym-DT for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:25 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-843a4ca671eso308389a34.2 for ; Fri, 30 Oct 2026 06:16:22 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366182; x=1793970982; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UYG7YseAeEwVr3rhaXK6Mt/QyGw+G8RGw3F7A/nr5iY=; b=j/WjEOH0KCrzwFVGCcfxpf0vv5wX3Hwyn2sy4gyAkbHDJcJlMEvLO2EJkglA80ST1Y gk2BNdyqULtBaiFT+J0HdbHlbqQqd9UuQpTQ06HLnv5J+aFYAy0G+TvdakVEIvQR1wmI GReJTnFP9kMtxkoI5r/iGJ4LVir59I37YmUO0m7kMiuLaVnj3ayswi2JRsE2sIYGQJ+N OigJbKx+ChPNJGc9z4xblkAMWI6MWbXVtifaRFn8uKFjJHGOOuHVNrj6kFojIqeN+IRM cN8G6J7FTM54OO/v0xzQFRrtsBBdR+7+h0tsodqTNZNQTubiFUE3MZfMdxAdS+mcydY7 NwZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366182; x=1793970982; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=UYG7YseAeEwVr3rhaXK6Mt/QyGw+G8RGw3F7A/nr5iY=; b=Gd5XZJ+3qljjTM39SbUwyAyJA2m6dP5dIZhvhcyZsYdkEsh62GY7xPIcB8k9K+mRo7 jjSi2nYd8OEitC6lIsyNBu0hUnvmT98QGDDQWY9UcsxcB3ayfDW+vEerTHm7PGMytLUp exmMo8PMQYOTUksV7aDlb50bXCpqsJaaAI8/5EJZz/rJzJYH4PuhseaWVlZEl1c9ca35 P+VRf+yc+tAQcy5NqjtekT/7sht8XdgAAMKQbvPC/u3nQL/Aes/A7KNtgepCp2jsgFzC ynXRD4aRCobMlxSv6M1T/oiW2Zl9XeY3JEM+7xgDQGkvq7htnReUYN3dZ1iPvGRBVd8J v2bQ== X-Gm-Message-State: AFq9FYIOpNg5eHkdKEBNOmG+fdzbfjXl7/gvDSau/Q6Ac88xp6fhsZLr QtKsnfof5OYopn+i6wrE6Bbi+IYVqaXqKZOYGZ8rqqeRkGCzvy99GT+l8Ad7XriwlJ5JEQ77M+7 ulSos X-Gm-Gg: AYBFou3xDG2NgzNs2hG91bq9d+R9dbsEa9K97WzZYNw2vKZCwlMPxz1BWZipihme+Bx oBi2i9q204GHDAd0nUdu3hitNn9MbU+p/T+2xRyGtk7vHCXPH/81qQUfZNGiVt1Ma4Pcjor52Da O6dsjaC72S1nwv7b7GmREOFnbQMZ69XG6+pC0Wrf4TSu2bzbJ/RsBlF8JQ7fOfPLf/q/ZOUffeE SIIjrYUF8jPS/l3ypDctZPRJ3ciCImPz4hw9Oe5ChY25EeIWEDoguUuYiHCXI8feNoMbnBDPDI2 t6x+6uKbMFsuS8iKs5LIPQYa1SyjIdHM4S2+lLHdXlZ1h+auzd3u7ewnhBn/Ue4qN1AS0ND/oBK w1ZXEYZUYmFHiXs1MHX7QSGPt9e372rqDjLMgSiUnuhopqvK1djchEtxU+o5XDGKOBk2YyCj53Z W4kgCLqJfEx5pUIK3wMRd/YQoLR8DlN4JgwMVNTFuR5JKRo4QaMIumCwDGlOTdhE7HFqFNmIUpf 4jzGvgJvhnQAMQED5fQq8yCAAYvPJFv+MtfYmshCek0JJb7mwvsCNuRZuKHFmqwgGhCFF1YX9f6 OzSg11myt1yQC2hBX7/GP5uSbYUdUg== X-Received: by 2002:a05:6808:1a21:b0:4fc:248a:de3b with SMTP id 5614622812f47-5640dc291femr1512103b6e.23.1793366182108; Fri, 30 Oct 2026 06:16:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 17/19] tcg/aarch64: Implement INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:52 -0500 Message-ID: <20261030131554.41208-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::336; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366299311158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target-has.h | 4 ++-- tcg/aarch64/tcg-target.c.inc | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h index 86672b2eab..b0868e5827 100644 --- a/tcg/aarch64/tcg-target-has.h +++ b/tcg/aarch64/tcg-target-has.h @@ -57,7 +57,7 @@ #define TCG_TARGET_sextract_valid(type, ofs, len) 1 #define TCG_TARGET_deposit_valid(type, ofs, len) 1 =20 -#define TCG_TARGET_lea_sh_valid(type, sh) 0 -#define TCG_TARGET_lea_imm_valid(type, imm) 0 +#define TCG_TARGET_lea_sh_valid(type, sh) ((sh) < tcg_type_bits(t= ype)) +#define TCG_TARGET_lea_imm_valid(type, imm) ((imm) =3D=3D 0) =20 #endif diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index b601b19c7f..5c186156c0 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -3081,8 +3081,15 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static void tgen_lea(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1, + TCGReg a2, unsigned sh, tcg_target_long imm) +{ + tcg_out_insn(s, addsub_realshift, ADD_LSL, type, a0, a1, a2, sh); +} + static const TCGOutOpLea outop_lea =3D { - .base.static_constraint =3D C_NotImplemented, + .base.static_constraint =3D C_O1_I2(r, r, r), + .out =3D tgen_lea, }; =20 static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366298; cv=none; d=zohomail.com; s=zohoarc; b=fN/wpTsFZH0Etb0SesM8UMDJhzH5rJjtbih+L21+8PHNem7fhIidI3aq1mjdmRnS9M5NBkDHdV10fWP/pA5Q8ndJdAboIoQakSq6ZdtsGd4meMug9kWFucSIKxPUV/YptnOsIhfv8STfJDwQAvHiRB7com3BgE2FcIxxGvLzwOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366298; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ib3WcmPpduqmQAQzGFLThrdz609C8UkaI8Pr5YC7zC8=; b=JOxzt1C/rqq3uuovCPXkRY3cyobHHQ5y+s1b++p9hHW3gIRb1Hx/ItCNQHGXGWQXh8TpmjV14KvHIlqSydbKkzRO7UftCejVwJL6zuQnD62QEOarV0rO0ntsS4z2htab731xbMG9TURys0n4M8doNxTMjTS/Pu4DbU95fAbBwJY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179336629806832.00455467071379; Fri, 30 Oct 2026 06:18:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmUS-0006fX-4L; Fri, 30 Oct 2026 09:17:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmTB-0002y5-Io for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:37 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmT7-0005ZL-OB for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:32 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-47b47de8b4cso403711fac.3 for ; Fri, 30 Oct 2026 06:16:29 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366188; x=1793970988; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ib3WcmPpduqmQAQzGFLThrdz609C8UkaI8Pr5YC7zC8=; b=egLSZ8tUL4BbTaozQLjeLzjZIkhS7tHHSJJgCmXx9l5of5C4jGEYUr9fivBR0/fex/ epL6zk8E2xMnD7Qpp6Iaf/6/JW4LkCogXcsLH/e6GvRgSoempigcVRACUN+kJ0Pv6x9z AXSlUWhZ4/L3QMMpR0TNJmBJJUxi0tcMwMqm0TUbyCOIPtQ3yvOdlDY4j+E8eHj17QHq 7eLETCVroYaqJcd5aHws5X2KkL94FmA2PmugROldiqDAF6c6A/QwCHGQid7HPvE0ytKX mbIMMDUy8OwpsFmYmRpVZbS1WYDZzHErB5OaQDZeWmic/3ZnJCw5fE3bdHOM0O0wjq5K w92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366188; x=1793970988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ib3WcmPpduqmQAQzGFLThrdz609C8UkaI8Pr5YC7zC8=; b=YJf3z/bagt6gv7zkQAQqTTeOf2QsT8Bt0tYyZkuGEwi4ahoXI9BmOTZVNss9tCjoAg O15UqUqHGHbZ89xchRtlOzsheBuB4aScxFHD4RghUwi5LKOovPBbYVju80K6AWR2sOIh 78zk3fIWTnvrwJNFn/3fmOz3KDEodqDXkjSdM2t3779iJkmxVxyYX85bU4l0iSt6rxZA xTdQY2NddV20V00/hbU/dLFL/atoOtfgrgKn2tq4qcRND18/RqkmcvOJa5tZEVp5NrFc knNW5m3efs9lxEHd6YJlvOxY2rW5hjOsqNnWExyhG5KZIZ4dGsncwcTGrxRDGy1/ntZj LHeA== X-Gm-Message-State: AFq9FYLrbA1eUn3Rt/Gq8NChosc+iZoJaJso7ujlNtfpfLkd6SKFcQoY z+HgseHDSgkuAHqcEJXMWwYuF635Iwu+yYOHxOjJmY5VXkYo6Rxu/0jkWR3aToy0m1IhQOT2pHE 66Tkf X-Gm-Gg: AYBFou3pALbJUZKDt+EXNh4vNGqSR+Hi0MUD9+wRor8ft46CdtLj8nODHLthNsiPJEL w6pi2bHWMuYHIWLYSVAZW8rMSOwuixOnn43cbZEvb95H5FVNf8+S/tAXixXarRY+Yox11kRPReS rLZ4EsSU3SIbjNx9zLqwayCOjDB3LRT7zH+K7u5SrqKG6ScQUla39IEG/d/TOkrk0GOqBHcc8vT 9XFK1bhLO6r+YUCRGMxOjgw+5XnOnhTI6U1GVLrVtSSgeCDPQyry04Bmn5Uw2rPVOS9qTjK6Im9 heyvy8n6PU+gb3ml85gIaeanlixaYlMHO9WmLu37tIHlta30xqGFQg1IKMWrjMnF4ohP6OQCVyI wfdwyO67SXlyMFdxJy93acgEYLwFtDtcYz9cdKgXl/+lBBqFQi8zNPCu7NYd8w+EfRBZKbMPTnz FXUNO5KOucpw2t0cU8mEDH6UFS2H7jXHBXfkLItR+/up4s4f7JRZ9cwMyo822yrUFqDMRKFXH6S ojHn9sIX0MvHvHD36uAOte1Jc/pcQ8yJ2JmDko6DtU3TlTgNmEMHHEMKoOGM1YCgRCz+GuzBdbq M5HLSrO/X4hGNWLnIemxW4/0OtoH8xo= X-Received: by 2002:a05:6870:5ba2:b0:494:21ea:9805 with SMTP id 586e51a60fabf-4a90771a635mr1360554fac.32.1793366182999; Fri, 30 Oct 2026 06:16:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 18/19] tcg/riscv64: Implement INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:53 -0500 Message-ID: <20261030131554.41208-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366299855154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/riscv64/tcg-target-has.h | 12 ++++++++++-- tcg/riscv64/tcg-target.c.inc | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tcg/riscv64/tcg-target-has.h b/tcg/riscv64/tcg-target-has.h index 93f8baad09..3cdeb5c390 100644 --- a/tcg/riscv64/tcg-target-has.h +++ b/tcg/riscv64/tcg-target-has.h @@ -69,7 +69,15 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, un= signed len) =20 #define TCG_TARGET_deposit_valid(type, ofs, len) 0 =20 -#define TCG_TARGET_lea_sh_valid(type, sh) 0 -#define TCG_TARGET_lea_imm_valid(type, imm) 0 +/* + * The SH*ADD instructions only operate on full register width. + * To allow TCG_TYPE_I32, we'd need a subsequent extension, + * with the result no better than the separate shift+add insns. + */ +#define TCG_TARGET_lea_sh_valid(type, sh) \ + (cpuinfo & CPUINFO_ZBA && \ + (type) =3D=3D TCG_TYPE_REG && \ + (sh) >=3D 1 && (sh) <=3D 3) +#define TCG_TARGET_lea_imm_valid(type, imm) ((imm) =3D=3D 0) =20 #endif diff --git a/tcg/riscv64/tcg-target.c.inc b/tcg/riscv64/tcg-target.c.inc index ec0c8e1af0..6da52929a4 100644 --- a/tcg/riscv64/tcg-target.c.inc +++ b/tcg/riscv64/tcg-target.c.inc @@ -224,6 +224,7 @@ typedef enum { =20 /* Zba: Bit manipulation extension, address generation */ OPC_ADD_UW =3D 0x0800003b, + OPC_SHxADD =3D 0x20000033, /* plus sh << 13 */ =20 /* Zbb: Bit manipulation extension, basic bit manipulation */ OPC_ANDN =3D 0x40007033, @@ -2740,8 +2741,21 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static void tgen_lea(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1, + TCGReg a2, unsigned sh, tcg_target_long imm) +{ + tcg_out32(s, encode_r(OPC_SHxADD, a0, a2, a1) | (sh << 13)); +} + +static TCGConstraintSetIndex cset_zba_rrr(TCGType type, unsigned flags) +{ + return cpuinfo & CPUINFO_ZBA ? C_O1_I2(r, r, r) : C_NotImplemented; +} + static const TCGOutOpLea outop_lea =3D { - .base.static_constraint =3D C_NotImplemented, + .base.static_constraint =3D C_Dynamic, + .base.dynamic_constraint =3D cset_zba_rrr, + .out =3D tgen_lea, }; =20 static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, --=20 2.53.0 From nobody Mon Nov 23 04:30:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793366246; cv=none; d=zohomail.com; s=zohoarc; b=NsPwVXAmlgTVYWYHtigq3uvOWMUi8ewvAsPXSTTmp6jjC6PF7FBeotUWkrpWeQSg3i/oY4LKM6nVEzRjMlgmgAV09IUjYdH0Q9EKXRvC1ZOu3S0kmH8b1g33J4Sd3tSfh4NbmKZO7+CazBUCogkdAqLKZLDVUgx3HsF92RpThhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793366246; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IQ45TU92KrE3ygg0OK53jApJZRB54/B3zPueBnzjfQ4=; b=GCAvllyqhHYGkStOP/SCsXneRNidI4GUjkdggGrgtUBFAaZN1iIrG+exCZVfvdar1elpLsY3TFHY7/yB4vNype93+67Ds7peo6tMuOSb4cs/rnt2e5Ig25Qn+n5lctsrQNLqvw24b1JagXK6qvICpUqMX+IVU87jLhAx9Fab+nE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179336624610173.0236084616796; Fri, 30 Oct 2026 06:17:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xMmTp-00061k-96; Fri, 30 Oct 2026 09:17:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xMmT5-0002rY-7n for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:33 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xMmT3-0005Yx-6v for qemu-devel@nongnu.org; Fri, 30 Oct 2026 09:16:26 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-4a76f0cce5fso351075fac.2 for ; Fri, 30 Oct 2026 06:16:24 -0700 (PDT) Received: from stoup ([50.233.235.3]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4a90ae4e6bcsm1796812fac.3.2026.10.30.06.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 06:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793366184; x=1793970984; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=IQ45TU92KrE3ygg0OK53jApJZRB54/B3zPueBnzjfQ4=; b=Sc2zcGfOEfYmdEJmvnJ2c/cfxLnFweiU/GK8tvkQ6uNOhjAI79czDWe9pJ1QQNeQI4 jCF3JE0cHibHMOIRDIrw7EbG/u9agz54xazWBD86NqBBUs1efqIGVX5CPaTk2QTPEAox UH0aeC0+mw9d5iVDAz+xOHnCa0n6yUx7GSrGWmTiEAAbXvoQIMwspnyAD/cTnAB1JiCP ZT3DdUmGZJejWQkOppq65QAcxzueBwYeGe8ojL0Hz5/k7bbN8rtSRfMwV8GKJvnv4D8D AY60aBJWXj+zktXeV6mZJMoy+1p4+xXx0FEJWrJt3mGmPvMa8qYKBbnyavuXDRqUPNKh Oz4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793366184; x=1793970984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=IQ45TU92KrE3ygg0OK53jApJZRB54/B3zPueBnzjfQ4=; b=Obok2gcnwhvMeMaFS81s1JYJaPQZOgacpEE4t+6KeWLA4cI18cPL6l5yddo0FyEaTD QBEQ5oOeV4FNxnvS/nqwX88xszFzuK8H32Ldd/ruhy886wk89o3+sWYIxWG5xYMsrzLu ILWE9TG82UrboJ7UEnINrHp9sAl9M5UH1nn00zOVa16r5+DgYfAIBkhf+fgrTt4rwCHS zAj8J6Aa08xfAxQRefdW2Sbl/uxRhsRleV5MrkKAY+k61DeHF9Wwbz2cnb1ICMkqldLS xfXViD3XfW2zALg3AlVuR7lm/ywEsq2Md+Xt2npv3A0Xm73iZuABtEBLx5C6IkAtr5VL 8nbg== X-Gm-Message-State: AFq9FYJaEMSphLHHimIXikrDvZQZtbm8AdS8oORQ30C+N9MfVt/98Yl4 d8I77vF1DBbjSZNKgjXNSroVZ7861xX56gyG+4YUnPq0kwIyC9TtEmyi9y34WSIilJAC2aX8vWv FebDE X-Gm-Gg: AYBFou1QD9Qz4zOn/3yq0nCx2urlyErmJoljW/yL/cHWrTx+K0anH45G03yWzd4ub9o dbPIMRMEuUJfm/117hmfb9RBoV5WpKzkrPR1IgSCfrFVvHqOJOy2lZUXsMbYWdXyl2gcAKF8Vs2 HCmvIgjghawQp0nOJxIEv9Ac3PgHeNhx2Th40u/NbJf4iB34yeVHWWzOvd+DM6HAzNgQnKVU4n+ PNAtOqN51cWMAx8gD7eaUtnNcpNmSQTnSYgjhS7/ZwxNFVQNqrs+iG+36iw4/r9XQcbUXcoIuKx bAeHDelWPPBVNteGJxIyZb6ZXiV0Hm7Liw4bSG7nc6bGNRprlPxca88dofRjCNHx+Q5jjDzYOMR /dXXvAfWpBUbx0tYUYXaeCBaS0rJf4FDYJuPuuZ4Z4SzcC3rO8aSJFp59UNszSlVBkerQQrkrBs hGyMDQQKrNUjON/dgxn/dJMUzPuYGbGGh8qUsCncmUhBeX1BnGsuuxm8KlTghRBgr1nS54R5bVk y2da8WbVZsjvPvnOSiN9KWHit/HAv2g031LIP4IoqYGuQM7n6KczdZgxjscTi8PtRqVpIUsILr9 DjIg+UylFXHEL1b+ZUwLmtwwnS8ltg== X-Received: by 2002:a05:6871:7286:b0:49e:691c:1bdb with SMTP id 586e51a60fabf-4a9076d9931mr1382395fac.32.1793366183822; Fri, 30 Oct 2026 06:16:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Matt Turner Subject: [PULL 19/19] tcg/s390x: Implement INDEX_op_lea Date: Fri, 30 Oct 2026 08:15:54 -0500 Message-ID: <20261030131554.41208-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261030131554.41208-1-richard.henderson@linaro.org> References: <20261030131554.41208-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1793366248319158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Matt Turner Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-has.h | 5 +++-- tcg/s390x/tcg-target.c.inc | 13 ++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h index 58e3afe526..33a3b72318 100644 --- a/tcg/s390x/tcg-target-has.h +++ b/tcg/s390x/tcg-target-has.h @@ -77,7 +77,8 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, uns= igned len) } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid =20 -#define TCG_TARGET_lea_sh_valid(type, sh) 0 -#define TCG_TARGET_lea_imm_valid(type, imm) 0 +#define TCG_TARGET_lea_sh_valid(type, sh) ((sh) =3D=3D 0) +#define TCG_TARGET_lea_imm_valid(type, imm) \ + ((imm) >=3D -0x80000 && (imm) < 0x80000) =20 #endif diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 2fd7012d04..db3b2fc3c9 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -3187,8 +3187,19 @@ static const TCGOutOpStore outop_st =3D { .out_r =3D tcg_out_st, }; =20 +static void tgen_lea(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1, + TCGReg a2, unsigned sh, tcg_target_long imm) +{ + if (imm >=3D 0 && imm < 0x1000) { + tcg_out_insn(s, RX, LA, a0, a1, a2, imm); + } else { + tcg_out_insn(s, RXY, LAY, a0, a1, a2, imm); + } +} + static const TCGOutOpLea outop_lea =3D { - .base.static_constraint =3D C_NotImplemented, + .base.static_constraint =3D C_O1_I2(r, r, r), + .out =3D tgen_lea, }; =20 static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, --=20 2.53.0