From nobody Fri May 17 03:39:21 2024 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=1680923119; cv=none; d=zohomail.com; s=zohoarc; b=JAVAjh0fTmOdwimUCTA3fgWC3isUEXoLhecwIKHLVcNz2DDdOX5tKP0r9QLZroGwB8LCdrH9kXt509QO3j3FgJftebO4pqOBaUSg2w77IFdWk5rrka2F9QXvgB/iO9YTLVh92jT0vAtNFVkuBImAkYuBU1VCKkr8XDMttE6hSYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923119; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DIvMa6yODJNeTBsR2OjDHB1GmvQgxFX82aBlXYH2wug=; b=bTV2lzOTHVw2/KMeqRJ1lt7n3KGQMNO3eHMoMGUcANXV7mfZaQ1HxTAobYjnMdP4CC4kOyinq6NAxkt1RwBuyUMjX59AjXJ/rD86LCy6ek0f9bdUs/yyqhjOX6WsRdPJooZOQO7fkYE/PAT7qLAPNp1wpMWKvvn7dlzDuHZSeIA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923119596868.8030909151164; Fri, 7 Apr 2023 20:05:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkys3-00045h-HH; Fri, 07 Apr 2023 23:04:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys1-00044y-Al for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:05 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkyrz-0004V3-6G for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:04 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-24059dcdd90so186174a91.2 for ; Fri, 07 Apr 2023 20:04:02 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923041; 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; bh=DIvMa6yODJNeTBsR2OjDHB1GmvQgxFX82aBlXYH2wug=; b=VQF/omSn3a38pU5ljC0bM2Y438nmFjf/SeLl9tiLfA/wt6kzi+1h9a2Wc6tHgXGO+7 Y0YLRVKW5MBqGN2uSqBRL6fa1FljuIKXtMd+jjzGuoIW70eN9UG47DsQniNX1EUkRk6l Op1T/xlnJ9c2TSUyhQGtUEq9Ex9Xp8SO7srfG9VggsTbWDCT/89hZVK+Jq6QHtQvd22k Sq7QXYXvTLh6Lspa5+HkFt97skV4Wnh54/MftWbCxEpjzA9ncv9jWLYp6SQqeMlgvoWK kSiBXZGv/8wjfOA2Eg6nKnKGgAuN6rXdtlnP42RMqKrFkw/YnFcTC5EYMWIviKjMmEgG jyLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923041; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DIvMa6yODJNeTBsR2OjDHB1GmvQgxFX82aBlXYH2wug=; b=KTnx7DQ7MbMZZCSZaH+Tl+IlrRxAJzBXoRzKBJerCB+LC5T1P3n6YXT6E5OMfuiQLX 5kEn36JCQRtK5GVFmCvAWUyHtQ41MBqu2laySYFCAF6CmsrCh6Pm4FvJ7mwvLyN9F6Ug MhEPPPc728du93IKrUwFjt3uy6qvotrGlbYIh/BzRahsrsbRR9w66lO1dNueNUjkVSxR 3B5NyqGXQ3Cdgc/A5T1kaFnLNrKXOKdA3B5AjBTUNzGFEjKT6eNfF4yDffehDBMOuuaA ZjKFVOd6SsJjzhsv6meyrFYAna3YSsSCG0GWwN+Sn1iehXpfT7uQfhdM1tDGYVquxIkr Yblw== X-Gm-Message-State: AAQBX9fCgsqByFNrgsrO3EImiZjF0OB246gL81nOdK3x6ECJcTneN9O5 Y7NewOdC/g+H8iBaXjy4hFL7XW8EA21ciQmYe9M= X-Google-Smtp-Source: AKy350bm9LgN3ObC87to4skKX+LkfgfJgHB8Py1tNg86ex7jHtJr/30sjcKuGd+P90+8JtqGEncxXA== X-Received: by 2002:a62:6443:0:b0:625:ce21:3b1b with SMTP id y64-20020a626443000000b00625ce213b1bmr3852802pfb.3.1680923041640; Fri, 07 Apr 2023 20:04:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 01/12] tcg/mips: Move TCG_AREG0 to S8 Date: Fri, 7 Apr 2023 20:03:48 -0700 Message-Id: <20230408030359.3368868-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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: 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: 1680923120554100005 No functional change; just moving the saved reserved regs to the end. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.h | 2 +- tcg/mips/tcg-target.c.inc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 68b11e4d48..8cdc803523 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -76,7 +76,7 @@ typedef enum { TCG_REG_RA, =20 TCG_REG_CALL_STACK =3D TCG_REG_SP, - TCG_AREG0 =3D TCG_REG_S0, + TCG_AREG0 =3D TCG_REG_S8, } TCGReg; =20 /* used for function call generation */ diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 34908c799a..c24b780818 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2493,7 +2493,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) } =20 static const int tcg_target_callee_save_regs[] =3D { - TCG_REG_S0, /* used for the global env (TCG_AREG0) */ + TCG_REG_S0, TCG_REG_S1, TCG_REG_S2, TCG_REG_S3, @@ -2501,7 +2501,7 @@ static const int tcg_target_callee_save_regs[] =3D { TCG_REG_S5, TCG_REG_S6, TCG_REG_S7, - TCG_REG_S8, + TCG_REG_S8, /* used for the global env (TCG_AREG0) */ TCG_REG_RA, /* should be last for ABI compliance */ }; =20 --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923150; cv=none; d=zohomail.com; s=zohoarc; b=PFtGVdjB1ec4yiv8GoI2u5NB7AIW8Yadwb/SEbyDBMtUpG/NLgMTRsxKT/XSchM0FTcaqlYJPm4xXZBuFwXWazcd2y47M/k81maqj4EkGGVIwrCiyM/feoFCt672AyBtOpDUT6Lz9PvLcZ8wV6OiSeldv8QBNg/mHRbOJsyAqNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923150; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bW/9qvl2SShSEu4dmNJ/Qic9SYEvM+f5ESU99Mx+Y1A=; b=b/EfAPqRGiImxIp7QUK5iBfRWzCccJ1iqI2yTOfQTfW+7y1KoamZoa9CsjRjmG4hTyW3aTucyH87MbxHERxJblINo0znvrhE6iviGwJqnRwK7T5Pd47iQNc8IwAsP6zRPZDM10xMdK+G/F9dpvjt306gVXWfAHPaI7x+WhOorZA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923150087205.36129927095556; Fri, 7 Apr 2023 20:05:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkys4-000465-Mj; Fri, 07 Apr 2023 23:04:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys2-00045A-3L for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:06 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys0-0004VC-6r for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:05 -0400 Received: by mail-pl1-x632.google.com with SMTP id ik20so271255plb.3 for ; Fri, 07 Apr 2023 20:04:03 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923042; 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; bh=bW/9qvl2SShSEu4dmNJ/Qic9SYEvM+f5ESU99Mx+Y1A=; b=LWXAT+4rPistnTNVuibEQuEPdepdbNeUGwua2dTNuoLLBUVZazqZMhHtqNzHwp8fF1 6G2StfcY2nsmu9X6xtQTS0vPdEk1CKaTo/Qy3+RpsXZ6ZFZt5oZkaGuCIP3npGuhyEo2 AW7OB1yQo445RHA4SVcdhUNQQm2FdCgaO6hj5LSoI2f/RA4i4ktMpOWhOCM334w/hazp nmDshBhJLB5zZ6oSQb2u/XyZ8bCSUepclXQx5cNclgM/GeDOgYfp3vPGTagLzBT8sCdy YYB1xRyGbwL/fLF7rnfgLw74jEIsomCb/sN7JjGqUX5F78p0JEHOeidysYMOVk1NLL9I GnHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923042; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bW/9qvl2SShSEu4dmNJ/Qic9SYEvM+f5ESU99Mx+Y1A=; b=x5uk7tkMhymhDud9MT+9gufuTOY3gF+yMv3NcYF1yxu20J2hxVDhsy///mzatH9pub 3dkzzkA1NUFIQGJm6EU/mwwjwkx0S5HNjckwbytlpYggf3GYOea1vlYJRrc9F+1eDbbc th+wbThWjOcC/fZ/+QfCIMc/jnSJcyywDa/UTTZJuLZoli+NJipXe6Xr3rXht90iz3pK N1AC3CWFa2yYX13I6fpYKpzvymYiqU4vBBuV5kVsjweE8E9dOaLW5C37PoapKiTT8l6W QIGSry6GHAnLnyRvSlsnEGLyr5S/X5jl+Cgfy3gKIYqm/xh1LBtySaPJnXeQdl+FLmRM Hg2w== X-Gm-Message-State: AAQBX9dzGMI6gtDjWOBL9aKXHp4Ro17vemjlLhZ7QjYJyt76TURkztyE rh6ev+mpx5LGYiHdlovg+2Ki1VOEpJM/X8vC5ok= X-Google-Smtp-Source: AKy350YpX7ld2D1W5WZkE4PQ1MWlwESbzaWz5YpiFainDMhJT3gww3V+MHQDDca/JQiUWkEjrlZAxw== X-Received: by 2002:a05:6a20:6504:b0:d9:162d:98e8 with SMTP id n4-20020a056a20650400b000d9162d98e8mr4537341pzg.13.1680923042415; Fri, 07 Apr 2023 20:04:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 02/12] tcg/mips: Move TCG_GUEST_BASE_REG to S7 Date: Fri, 7 Apr 2023 20:03:49 -0700 Message-Id: <20230408030359.3368868-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: 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: 1680923150337100001 No functional change; just moving the saved reserved regs to the end. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index c24b780818..cc4ca2ddbe 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -86,7 +86,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET= _NB_REGS] =3D { #define TCG_TMP3 TCG_REG_T7 =20 #ifndef CONFIG_SOFTMMU -#define TCG_GUEST_BASE_REG TCG_REG_S1 +#define TCG_GUEST_BASE_REG TCG_REG_S7 #endif =20 /* check if we really need so many registers :P */ @@ -2500,7 +2500,7 @@ static const int tcg_target_callee_save_regs[] =3D { TCG_REG_S4, TCG_REG_S5, TCG_REG_S6, - TCG_REG_S7, + TCG_REG_S7, /* used for guest_base */ TCG_REG_S8, /* used for the global env (TCG_AREG0) */ TCG_REG_RA, /* should be last for ABI compliance */ }; --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923131; cv=none; d=zohomail.com; s=zohoarc; b=Kev0GFlkLtQdSX4c5vfPfym9HIEjpwgTfmi5uuUcNU8YjHPmBMJ2TKNWyQNfUUW0kCtJxrCfDZUahIkRCDQMqOPVJUGz52EkHUZqxvwSgEQtuLEwt6dZpH3a4MxWdIJ6Hk/fGpi7gOSx0y7EbxsDhs/hvD4YChlavzzZx0kVrmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923131; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=paKwch7BjeMSmw6hwR7oUnfRqPHVOt6iFq9garwBFk4=; b=CED8FpaZL48GslcYWpz5NerD87RrFXNKxkwOsVHQUuUo824dXnTh4VpfxWBXrK1OXcrMlnnSyu0Qng0FmWJGnzGvSiKsxi4iYLddO18lFpASFf63UOtUUISm5eUtUI+oerjA+Dt2XtRy2G8jCGPBqBXRNwHTbhuVZ/bFNHNkgEw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923131728817.4677093497506; Fri, 7 Apr 2023 20:05:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysK-000497-8y; Fri, 07 Apr 2023 23:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys2-00045G-B7 for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:06 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys0-0004VX-L1 for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:06 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2406ba77100so167640a91.3 for ; Fri, 07 Apr 2023 20:04:04 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923043; 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; bh=paKwch7BjeMSmw6hwR7oUnfRqPHVOt6iFq9garwBFk4=; b=eyhjwGRvQyLlXdxCtMgim5Yfn0doYYesVfGVNttLMbtNM/n8/3Mqm5fne8AVFqtxAk D8SWfr6Lo67957ZPVUsBXfQG6YeNY6r4ADydzfaGxlI00rNY3WItQVUh2aibXnSOx/tY vJNi5zOP5YAxBjjqBVO/29NcwdU/4MaDpifzls6q2g9mhTOt/aqDaSjo4B91x+LuzaGy j+EkX5YM2N9nnu9Hvaq8NL3bXwwBNfVTfkXQ4UNQNUmTfide5DqFyZ6ZPJkiHRSvfadO PmczQtpL9lP5LT1+8uPkDVtqaDCa/NDBzawjsXxYeV83mTTiKboKoQ7v9bqu3dzmcctd nk1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=paKwch7BjeMSmw6hwR7oUnfRqPHVOt6iFq9garwBFk4=; b=tfxEIlnXKGv8gwpxfSEiTXeyKb8kg4F3HlaxtKNIYhsy1sr7I4cLd3ZMv1MuhxzxMp r2T1CjOQ7dZ90rMdZa8YGstTc5ezdzSogUOu7Qvi7Xa3Qqa4hsq3liPWdHYcjT2bng9G 94sKAcXWVg1NtrCZFyTwQGBOFP2H4SsYB2UVF/PnoCSpuNTG4XsJjQSVhRphY33c2mDz bjC/QwTJ6xY6PhCg+4RvK9F0AdThHmN0QIN3bim58BU0Mae4H5rWSaWhsrGBy1WlySr5 5aQSakpKnOMfWWQlw7uhsIYGdP57CDas5Lta/Bm1Lo+LavMKwDZJbEsLIeeEBOvNKZE3 xHqA== X-Gm-Message-State: AAQBX9f7B9aAM5IS6AftxZClObjLt3PozdPzsMtQwxThoU+EIjYd0Fvo glMSEGd4eRF9ZCgzFalSo/wXBAeOoA6vgM+ycGs= X-Google-Smtp-Source: AKy350Zw/YAV40a7KJmmAHZ12opnD2fw23FekPXuUw8QwakYSy9Qu74/7IKz37J9/SaygYBiDc37Vg== X-Received: by 2002:a62:4c1:0:b0:625:e051:e462 with SMTP id 184-20020a6204c1000000b00625e051e462mr4138100pfe.15.1680923043260; Fri, 07 Apr 2023 20:04:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 03/12] tcg/mips: Unify TCG_GUEST_BASE_REG tests Date: Fri, 7 Apr 2023 20:03:50 -0700 Message-Id: <20230408030359.3368868-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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: 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: 1680923132347100001 Content-Type: text/plain; charset="utf-8" In tcg_out_qemu_ld/st, we already check for guest_base matching int16_t. Mirror that when setting up TCG_GUEST_BASE_REG in the prologue. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index cc4ca2ddbe..0ade890ade 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2622,7 +2622,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) } =20 #ifndef CONFIG_SOFTMMU - if (guest_base) { + if (guest_base !=3D (int16_t)guest_base) { tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base); tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); } --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923191; cv=none; d=zohomail.com; s=zohoarc; b=ijq/5yJvkmF5J3YyrU8L1oMLypgN7sbCVX9u1nSi/zCI/QuLsG0YnBX9xSWzOBx/fFyrDZY7/xyOkHVyE9VfyNO39ZJF0YSZjwYkKR/w27/+ZRe9vRgNkGkGZARqL354gLEHTfkW7DLZ7WAIcr+zaFDZPd8Aztj1rMSQaFWRW6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923191; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c5z2pzBP4n2HbltkzexFBId6I7UVABJ9+twoIc3kNok=; b=UxHKz+DT3moFmUgj6D7fPXGxE8SU75KKo+Enc5ZVH+tfUtmnFNHPK7VwgFrVVUXDNg7B+0t782Mfz+Hk/ayGKuxykUaEThMz+nmzi+zUiLHisECoIPHcwK7wiay+HXXChxwmwGLaWbZfvRjzCN0Kra1iFwsxfTxxFeCymqVwGiw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923191329336.1477906778233; Fri, 7 Apr 2023 20:06:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysN-0004Bu-VT; Fri, 07 Apr 2023 23:04:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys3-00045j-Kw for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:07 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys1-0004Vv-R2 for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:07 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-62ddb232ddaso1414033b3a.1 for ; Fri, 07 Apr 2023 20:04:05 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923044; 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; bh=c5z2pzBP4n2HbltkzexFBId6I7UVABJ9+twoIc3kNok=; b=gl7qkuCNaaivOCQJm03bqTtlswOamaHuBdFG2RitJZZ0C+vQ8aJnezAJrFrwdSG6xm 4ZDFEl0av25cPV4dfSHE0obrV9RVuM4S2iUtCJDCwnRAORbK5znrOs1B6nrGdwP8V6pf uoawKzUZvOG1L0vNRXNTII5E9oSG53eUaZu7ah6igVtSkJwTG1w7sC486MW+mkeh/jpj e6rEmK52+TD2/z/bhD2uR49ytFd+RtKYPWGkE+lW4khdG7LLJK+1mj14MbWWvgeeWbkm QP4Yu5QiiGc0SiNBPYFXdWQNSP1WnFh5taEWawa2jPuTHVoXn9BTl5hR5TPRJvGLt0k7 Rr3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c5z2pzBP4n2HbltkzexFBId6I7UVABJ9+twoIc3kNok=; b=mHqu+moUmNSvEVUXcomuBSaz4KA7KH4n87sYGOBH7pGcI6uovU0gX89fgs4svRoMN7 4hAq9LP8Vqi8f/iVBJ+rkzaifZjW+xU/i0xE424kFxWSUBwqfCsee6prlWX9JpfAXk03 d/dgC7IN7jOMwszHONrleF8BNnqidOjmIrtn4h09a+wWRTJkhj3/JTv+zgwQxtdURX/8 nBCXpUOKa7HJ3NwaNKM/ZO8dQV6fMfO5Q83fZe0iZ8qWaxBda6SgoxXJYQP9rs0kgMoV 0/geT+cSm9AJ2buLTgm7fD4FmAgDE7hsVgW7BIBsR5h4ZCD4ICHMcN50GUxqBC9glWap GTCA== X-Gm-Message-State: AAQBX9f1TyvOq93QuBHToXKNZaFH/PAegB1jueUhyNSLe77YgW7WG9pW pstcIHY8/MVYhSCgWmlEW9U4YukYJjf2QOjvVHA= X-Google-Smtp-Source: AKy350YRuD4LioOy5Kz1YlSxulbMPBO+xJuMQWLqb4zwt4UBSQ7wIn+7FtbCWlsGYgJZgFxdIpccJg== X-Received: by 2002:a62:5204:0:b0:629:fae0:d96a with SMTP id g4-20020a625204000000b00629fae0d96amr3950131pfb.16.1680923044157; Fri, 07 Apr 2023 20:04:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 04/12] tcg/mips: Create and use TCG_REG_TB Date: Fri, 7 Apr 2023 20:03:51 -0700 Message-Id: <20230408030359.3368868-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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: 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: 1680923192805100003 Content-Type: text/plain; charset="utf-8" This vastly reduces the size of code generated for 64-bit addresses. The code for exit_tb, for instance, where we load a (tagged) pointer to the current TB, goes from 0x400aa9725c: li v0,64 0x400aa97260: dsll v0,v0,0x10 0x400aa97264: ori v0,v0,0xaa9 0x400aa97268: dsll v0,v0,0x10 0x400aa9726c: j 0x400aa9703c 0x400aa97270: ori v0,v0,0x7083 to 0x400aa97240: j 0x400aa97040 0x400aa97244: daddiu v0,s6,-189 Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 69 +++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 0ade890ade..c2f8d6550b 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -88,6 +88,11 @@ static const char * const tcg_target_reg_names[TCG_TARGE= T_NB_REGS] =3D { #ifndef CONFIG_SOFTMMU #define TCG_GUEST_BASE_REG TCG_REG_S7 #endif +#if TCG_TARGET_REG_BITS =3D=3D 64 +#define TCG_REG_TB TCG_REG_S6 +#else +#define TCG_REG_TB (qemu_build_not_reached(), TCG_REG_ZERO) +#endif =20 /* check if we really need so many registers :P */ static const int tcg_target_reg_alloc_order[] =3D { @@ -1895,27 +1900,61 @@ static void tcg_out_clz(TCGContext *s, MIPSInsn opc= v2, MIPSInsn opcv6, =20 static void tcg_out_exit_tb(TCGContext *s, uintptr_t a0) { - TCGReg b0 =3D TCG_REG_ZERO; + TCGReg base =3D TCG_REG_ZERO; + int16_t lo =3D 0; =20 - if (a0 & ~0xffff) { - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_V0, a0 & ~0xffff); - b0 =3D TCG_REG_V0; + if (a0) { + intptr_t ofs; + if (TCG_TARGET_REG_BITS =3D=3D 64) { + ofs =3D tcg_tbrel_diff(s, (void *)a0); + lo =3D ofs; + if (ofs =3D=3D lo) { + base =3D TCG_REG_TB; + } else { + base =3D TCG_REG_V0; + tcg_out_movi(s, TCG_TYPE_PTR, base, ofs - lo); + tcg_out_opc_reg(s, ALIAS_PADD, base, base, TCG_REG_TB); + } + } else { + ofs =3D a0; + lo =3D ofs; + base =3D TCG_REG_V0; + tcg_out_movi(s, TCG_TYPE_PTR, base, ofs - lo); + } } if (!tcg_out_opc_jmp(s, OPC_J, tb_ret_addr)) { tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, (uintptr_t)tb_ret_addr); tcg_out_opc_reg(s, OPC_JR, 0, TCG_TMP0, 0); } - tcg_out_opc_imm(s, OPC_ORI, TCG_REG_V0, b0, a0 & 0xffff); + /* delay slot */ + tcg_out_opc_imm(s, ALIAS_PADDI, TCG_REG_V0, base, lo); } =20 static void tcg_out_goto_tb(TCGContext *s, int which) { + intptr_t ofs =3D get_jmp_target_addr(s, which); + TCGReg base, dest; + /* indirect jump method */ - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_REG_ZERO, - get_jmp_target_addr(s, which)); - tcg_out_opc_reg(s, OPC_JR, 0, TCG_TMP0, 0); + if (TCG_TARGET_REG_BITS =3D=3D 64) { + dest =3D TCG_REG_TB; + base =3D TCG_REG_TB; + ofs =3D tcg_tbrel_diff(s, (void *)ofs); + } else { + dest =3D TCG_TMP0; + base =3D TCG_REG_ZERO; + } + tcg_out_ld(s, TCG_TYPE_PTR, dest, base, ofs); + tcg_out_opc_reg(s, OPC_JR, 0, dest, 0); + /* delay slot */ tcg_out_nop(s); + set_jmp_reset_offset(s, which); + if (TCG_TARGET_REG_BITS =3D=3D 64) { + /* For the unlinked case, need to reset TCG_REG_TB. */ + tcg_out_ldst(s, ALIAS_PADDI, TCG_REG_TB, TCG_REG_TB, + -tcg_current_code_size(s)); + } } =20 void tb_target_set_jmp_target(const TranslationBlock *tb, int n, @@ -1946,7 +1985,11 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, case INDEX_op_goto_ptr: /* jmp to the given host address (could be epilogue) */ tcg_out_opc_reg(s, OPC_JR, 0, a0, 0); - tcg_out_nop(s); + if (TCG_TARGET_REG_BITS =3D=3D 64) { + tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_TB, a0); + } else { + tcg_out_nop(s); + } break; case INDEX_op_br: tcg_out_brcond(s, TCG_COND_EQ, TCG_REG_ZERO, TCG_REG_ZERO, @@ -2499,7 +2542,7 @@ static const int tcg_target_callee_save_regs[] =3D { TCG_REG_S3, TCG_REG_S4, TCG_REG_S5, - TCG_REG_S6, + TCG_REG_S6, /* used for the tb base (TCG_REG_TB) */ TCG_REG_S7, /* used for guest_base */ TCG_REG_S8, /* used for the global env (TCG_AREG0) */ TCG_REG_RA, /* should be last for ABI compliance */ @@ -2627,6 +2670,9 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); } #endif + if (TCG_TARGET_REG_BITS =3D=3D 64) { + tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_TB, tcg_target_call_iarg_regs= [1]); + } =20 /* Call generated code */ tcg_out_opc_reg(s, OPC_JR, 0, tcg_target_call_iarg_regs[1], 0); @@ -2808,6 +2854,9 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_REG_RA); /* return address = */ tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP); /* stack pointer */ tcg_regset_set_reg(s->reserved_regs, TCG_REG_GP); /* global pointer = */ + if (TCG_TARGET_REG_BITS =3D=3D 64) { + tcg_regset_set_reg(s->reserved_regs, TCG_REG_TB); /* tc->tc_ptr */ + } } =20 typedef struct { --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923153; cv=none; d=zohomail.com; s=zohoarc; b=Ksp8wQ3YCarA+YFbH2pp6WYJGkyyeHftjb+iFviS6A4iHbG23ObniERHrgiJEJSFOji+08vj7TxZQeVyKueoMJbINiRdUbHfFwt9z6ELrHd6fFNt0XM5+ndez/1r6kQyb++5diAQ9n6hOyf5OFPMTn3Un9nV24T06feCaKtQFIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923153; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W3/mfgEEhut6lCtnwnsC8h9ARH2ugsuuRzfccUIm+yY=; b=DYDkLw6wJvbVyh2M2BWdd3mwwNt+qhKrHhuuaHZH1vcF0R9AQLdZYJTkX5fiZ1Y+oakLRym3A7WO+reFEbe8dX6SeGfYO91ls1LAaNPMr8brYjTAKW9MJi3k3cVmx/sN5gi3HplpSgwtYK14THzIOOmSUYCHO1W05vdlXnkJArg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923153859987.3935589883478; Fri, 7 Apr 2023 20:05:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysK-0004A4-V7; Fri, 07 Apr 2023 23:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys4-00045q-16 for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:08 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys2-0004WC-FJ for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:07 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1a51ba7fdfcso2440695ad.3 for ; Fri, 07 Apr 2023 20:04:06 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923045; 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; bh=W3/mfgEEhut6lCtnwnsC8h9ARH2ugsuuRzfccUIm+yY=; b=NPU/kOF95RAupGvsmTotsiz3qhWtLOBSASgDXO+AI30lz/6nIFjeeqmBnLPQMegUx6 r99dw5CD931Qkli7uBs8fxMjjpCkCIYMCZt+TWhzbY270Ra6iZy6aqLROygVlyLBzsPS cZ+HN7QV3Fk7xl7It1GQ+OPasvIedjpfOSusghtudtosikMrcWLcIZvQr0qXIOLhcQgc he1xa0MG9XthIyX9zhyQ8ZbLheZzHu/PYeqMOzS0+TLPAyCTQI0RdMlXk0pXgEcq6s8/ tbHFAof6dPT5HhX//8QMn47f/Wj46fW5gV9BaveHNodcHStXGusr7EjUoCrVp1o8Hzv/ dfKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W3/mfgEEhut6lCtnwnsC8h9ARH2ugsuuRzfccUIm+yY=; b=65L25JfcJdM4pMzIV3eN22DL4ergAD9mz/E8tm4hRGqmZ8RBeKK1Ky5D0RJAEOYuQg 9WAko/Yqf+SfnYJF9aVatt3YVv3uMAmy9Pi+KutMflGa2NNOm9gOnMbeFQnvY7VvgCNH uCm1gJ+4i83F3rz6ffl/XoyLrmCCh7bWb0GBTG8GWjGAhEdWl/vrUTODebIKWSSzL0pS pU3kP+RdJr6TNMTGEG1luY3LklMF+PPnHnBQy8eCFVNU3+vKD29ExzufCiPnABODlkCM jssSGIdiNXiYx6AV1bY41yU45ztOwtFOVwXMJO0HgJlQSswLVMuKm6+c/EshZKYbpHTK qbTQ== X-Gm-Message-State: AAQBX9fe54WmiFLw7IRpzNBxu5m/w63c3Fil6m4MM+imJMM9mUlV/Hr8 J5q69681fi+hVU8ABTq+EGTRir8juuTK0kySGm0= X-Google-Smtp-Source: AKy350ZAjbMzIlsNo2wndhliKgLRW7d4fShxDZd1hZiXMesORuKtR16FIO/ufQ8qo0+tKttIuNcedw== X-Received: by 2002:a62:3802:0:b0:633:5c46:5a68 with SMTP id f2-20020a623802000000b006335c465a68mr138760pfa.10.1680923044977; Fri, 07 Apr 2023 20:04:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 05/12] tcg/mips: Split out tcg_out_movi_one Date: Fri, 7 Apr 2023 20:03:52 -0700 Message-Id: <20230408030359.3368868-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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: 1680923154669100002 Content-Type: text/plain; charset="utf-8" Emit all constants that can be loaded in exactly one insn. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tcg/mips/tcg-target.c.inc | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index c2f8d6550b..f0ae418ba6 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -514,20 +514,34 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, = TCGReg ret, TCGReg arg) return true; } =20 +static bool tcg_out_movi_one(TCGContext *s, TCGReg ret, tcg_target_long ar= g) +{ + if (arg =3D=3D (int16_t)arg) { + tcg_out_opc_imm(s, OPC_ADDIU, ret, TCG_REG_ZERO, arg); + return true; + } + if (arg =3D=3D (uint16_t)arg) { + tcg_out_opc_imm(s, OPC_ORI, ret, TCG_REG_ZERO, arg); + return true; + } + if (arg =3D=3D (int32_t)arg && (arg & 0xffff) =3D=3D 0) { + tcg_out_opc_imm(s, OPC_LUI, ret, TCG_REG_ZERO, arg >> 16); + return true; + } + return false; +} + static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long arg) { if (TCG_TARGET_REG_BITS =3D=3D 64 && type =3D=3D TCG_TYPE_I32) { arg =3D (int32_t)arg; } - if (arg =3D=3D (int16_t)arg) { - tcg_out_opc_imm(s, OPC_ADDIU, ret, TCG_REG_ZERO, arg); - return; - } - if (arg =3D=3D (uint16_t)arg) { - tcg_out_opc_imm(s, OPC_ORI, ret, TCG_REG_ZERO, arg); + + if (tcg_out_movi_one(s, ret, arg)) { return; } + if (TCG_TARGET_REG_BITS =3D=3D 32 || arg =3D=3D (int32_t)arg) { tcg_out_opc_imm(s, OPC_LUI, ret, TCG_REG_ZERO, arg >> 16); } else { --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923171; cv=none; d=zohomail.com; s=zohoarc; b=VSNFmPsF/AfxL8w5Gs1Aysw6j2ddepgQ8PIJMF1h69ix0fL4q8SNawhuox7xpwqwWixnwO4vyPS37ZTcsbvaJbPQbT9H/zznZbTY9Er2LP97gWek6CRC/jBkEEDhsDDeFbUPTDBLKrqXN75WcY7yx18KgT48vAh81dApTMtIbEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923171; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Gzu1AS/Q0oolCiATqMvs9UIOuiHEvGAooRn6q/C3R8E=; b=Lr8SqeZsCqoJ1TjZtiNCDNU+EtExaKsBp9S/DlXrLc7DkOqEfS7xrKOzWAaoPIr5ugEeNSaQkOLchsT6iFaceB/X5pWdwyU7Vdrl90Ew/Q23uM3uqJexTLpMu4o2BtnKLalqrakBSsTO9dPSlmliCZ1nguwtjjpNja8EAjKItVU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923171938391.2286972795649; Fri, 7 Apr 2023 20:06:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysN-0004Bt-M3; Fri, 07 Apr 2023 23:04:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys4-00046A-Nl for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:08 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys3-0004WW-40 for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:08 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-62e62c2fbc3so273548b3a.3 for ; Fri, 07 Apr 2023 20:04:06 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923046; 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; bh=Gzu1AS/Q0oolCiATqMvs9UIOuiHEvGAooRn6q/C3R8E=; b=U7LR/u4jCS4SDehGeBbXPyApjo1EoVdQthKRJSIDi5B4sZsoHnXBn/VmkRxxopSdAs fXNjwqIwKr/bMNsGnmaUlh0h4oadBKiCfdQgJ5ASRWNz9BrQqXwVI629oEZ6n8adNkx+ nSmocfMq72ms79kDi7YxAWwCzB+dYOG468CgaHLbCb0bp8xv23KXayeLsTWZZeKntEFn amlRQUO6RhjxeIiLJYIvJIhH4kAQuN3vJaRQe7vrZ9yKSID+3LKb9Eyjo7KNW96h9xjW FBx+hIBJq3tKYTHNkid87Y0pcUNHEjFq05MKDpn9ta29gAacKAh15IylFJPjNIKFneJM c+Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gzu1AS/Q0oolCiATqMvs9UIOuiHEvGAooRn6q/C3R8E=; b=ZffO+/cNA25M9G1xeW+UXxFq2FBEcHBP7Prp5SH9aj34L0O6+Ia98P23vXmuWw9FUw aiXqaPJvFNMP3Lv1w/uZtmvrSjOXIeHW+8PxjhxGO8dzEkrBDdhnG2xGmyJWXs/nkbMq e/ngrCLBcOhLZSZKi4Z6HbsxKIr6ULwx1BRXq51HkpR0skkwVXiuK7aHei/fc4y9AFiG Zk4hhqdGG1S9Xh9huWVgX2xy670nQplm+YBfdj7lq1zFNo2ooSBtvLwXT3Wdl79vLOys b15lf9SeJqunKN1jm9rHgzDDsCJm5imaGboruFT7fkIUneAZNTKq0Jk5lZ89huEWXTks 0n1w== X-Gm-Message-State: AAQBX9e3piIIrLE0QAt3q/nWgySJWrgB2wxHMEqqwLfVC2TrBKw5UzQs QWswW6nAaz6n0WRKO/JJu+w9fS/cJThj6GZRM9I= X-Google-Smtp-Source: AKy350aAFRa39nW/RgZtPkq4H7HMQcOQSC5+uz5Y7B43V93iOotp1qwsUZS/Jq+gMjQFNi8vc6gUrQ== X-Received: by 2002:a62:1c8c:0:b0:626:80f:7a0d with SMTP id c134-20020a621c8c000000b00626080f7a0dmr4027913pfc.8.1680923045697; Fri, 07 Apr 2023 20:04:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 06/12] tcg/mips: Split out tcg_out_movi_two Date: Fri, 7 Apr 2023 20:03:53 -0700 Message-Id: <20230408030359.3368868-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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: 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: 1680923172422100005 Content-Type: text/plain; charset="utf-8" Emit all 32-bit signed constants, which can be loaded in two insns. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index f0ae418ba6..78710a25bf 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -531,6 +531,22 @@ static bool tcg_out_movi_one(TCGContext *s, TCGReg ret= , tcg_target_long arg) return false; } =20 +static bool tcg_out_movi_two(TCGContext *s, TCGReg ret, tcg_target_long ar= g) +{ + /* + * All signed 32-bit constants are loadable with two immediates, + * and everything else requires more work. + */ + if (arg =3D=3D (int32_t)arg) { + if (!tcg_out_movi_one(s, ret, arg)) { + tcg_out_opc_imm(s, OPC_LUI, ret, TCG_REG_ZERO, arg >> 16); + tcg_out_opc_imm(s, OPC_ORI, ret, ret, arg & 0xffff); + } + return true; + } + return false; +} + static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long arg) { @@ -538,21 +554,18 @@ static void tcg_out_movi(TCGContext *s, TCGType type, arg =3D (int32_t)arg; } =20 - if (tcg_out_movi_one(s, ret, arg)) { + /* Load all 32-bit constants. */ + if (tcg_out_movi_two(s, ret, arg)) { return; } =20 - if (TCG_TARGET_REG_BITS =3D=3D 32 || arg =3D=3D (int32_t)arg) { - tcg_out_opc_imm(s, OPC_LUI, ret, TCG_REG_ZERO, arg >> 16); + tcg_out_movi(s, TCG_TYPE_I32, ret, arg >> 31 >> 1); + if (arg & 0xffff0000ull) { + tcg_out_dsll(s, ret, ret, 16); + tcg_out_opc_imm(s, OPC_ORI, ret, ret, arg >> 16); + tcg_out_dsll(s, ret, ret, 16); } else { - tcg_out_movi(s, TCG_TYPE_I32, ret, arg >> 31 >> 1); - if (arg & 0xffff0000ull) { - tcg_out_dsll(s, ret, ret, 16); - tcg_out_opc_imm(s, OPC_ORI, ret, ret, arg >> 16); - tcg_out_dsll(s, ret, ret, 16); - } else { - tcg_out_dsll(s, ret, ret, 32); - } + tcg_out_dsll(s, ret, ret, 32); } if (arg & 0xffff) { tcg_out_opc_imm(s, OPC_ORI, ret, ret, arg & 0xffff); --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923133; cv=none; d=zohomail.com; s=zohoarc; b=LpPL/N3t6e1PWt7CHfSdyAmLO3PnlwSNsM80IAZVYeJfq7+UL5cqqXsnP0ObEsBXiVmiEJuktB1iTcpThAd9BLacNlxJDEOiiDDJXk30Z6cF2Z64WPARZwGKDu/fTsq8qC71H2wNF/z9WF03pbzYeAANpcLb2hvd1sQoMkMLLCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923133; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e/k0JGlbcsqGMaHltbL7Xp0AwaOGu40VP+SK9t+4TaA=; b=WOzNU6x3N3v6ZIN9K7RdDLb/ecxqenJXPQvrSPXSeVAUQ0n0n2jJ+gr/XECu+SaNoov00o/ozsqrfspgjY0LaMc2ozOe6f7VtYi+Jsb1BBhBHiH9QDgI1DLlMDj5G7RnhCXIyKi//sE7xyXJ61UeEAeIjUFIp5+UGut2aAT04NU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923133559410.2125028798897; Fri, 7 Apr 2023 20:05:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysK-0004A0-Ku; Fri, 07 Apr 2023 23:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys7-00046c-5b for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:12 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys3-0004Wr-Tw for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:09 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-62e026c026fso273861b3a.0 for ; Fri, 07 Apr 2023 20:04:07 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923046; 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; bh=e/k0JGlbcsqGMaHltbL7Xp0AwaOGu40VP+SK9t+4TaA=; b=kzt3BqEeQcEofufPrw3vrT2rNOSw+xy4ch54VhPcozeJoLidfTxyloyPlNGyrge1oY sI81VPPzXbgco8goiZk67CDDJQV+lmBegLd1K1lGZmHpaB9ppVOA+sbxoUTJD+ioAW5/ b4DCfpLfzAQa+Ir6dMFt3OCWAAzwYVGWEErm/T8Atzf5BSzCi34dIqVW94wd82KMP7Pi iMveu793cHi/Jh3+aMclxEvca7K3w8d0yoiT3Cdfk+mb/La/LsNFQYStO4Zzece43jWH bRGwPUeZv1jyqN7VDMVAGEaS+JE18Q7cPdVrrKRrh4+aFDyKjulww1dzYxV48+bXxlbP nmww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e/k0JGlbcsqGMaHltbL7Xp0AwaOGu40VP+SK9t+4TaA=; b=ON8SDfVIhGzBgod/PG8zLHPqjtxLQQ6BAS7LHUbfOMg6TlPkjDeHp2IlgzckyHWGy+ p5vlLnYB7Dvulx7D+6vi8QL0dYWIc+GKtpaX0ByyXl2yQKHi9T8lG4u5+wMVkVGNMlL7 21A4F7LC2VPIxCannXryJjCwQDYL5dOUN9JGnnkrfIHVl+ZqnbYvO3frt4cMX7Hrq6/G GzxLhAcoEn7KDbp4WGB0Fv1SMOiM5l8mRxn/um6rQlE+/ETKVISJ7HFoRA5nKbS3QJwB dnF8i2azcBI+28kPw7WhoEitppndx73t4ZxO16x6tQ624loXedzEi/2sAWj4976kE5hb R/AQ== X-Gm-Message-State: AAQBX9eYhTDcAUN4TIEINLQ2rBKy1edvBXeKoovzbNjvkd7vM6UlL1Dd +6F3AV1he3wZaCI9SFVMR2e83nz9D9uZb/xTicw= X-Google-Smtp-Source: AKy350bXzSmuzcedjDJGOKXHtrWV26w7Wevq0oDMya1NelVncj5HXQQc/uC/mu/M/FRcdSgCRSu8Sg== X-Received: by 2002:aa7:956b:0:b0:623:5880:98cd with SMTP id x11-20020aa7956b000000b00623588098cdmr940927pfq.5.1680923046508; Fri, 07 Apr 2023 20:04:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 07/12] tcg/mips: Use the constant pool for 64-bit constants Date: Fri, 7 Apr 2023 20:03:54 -0700 Message-Id: <20230408030359.3368868-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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: 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: 1680923134371100005 Content-Type: text/plain; charset="utf-8" During normal processing, the constant pool is accessible via TCG_REG_TB. During the prologue, it is accessible via TCG_REG_T9. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.h | 1 + tcg/mips/tcg-target.c.inc | 65 +++++++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 8cdc803523..88a8137bcc 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -207,5 +207,6 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_MEMORY_BSWAP 1 =20 #define TCG_TARGET_NEED_LDST_LABELS +#define TCG_TARGET_NEED_POOL_LABELS =20 #endif diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 78710a25bf..235295c689 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -25,6 +25,7 @@ */ =20 #include "../tcg-ldst.c.inc" +#include "../tcg-pool.c.inc" =20 #if HOST_BIG_ENDIAN # define MIPS_BE 1 @@ -168,9 +169,18 @@ static bool reloc_pc16(tcg_insn_unit *src_rw, const tc= g_insn_unit *target) static bool patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend) { - tcg_debug_assert(type =3D=3D R_MIPS_PC16); - tcg_debug_assert(addend =3D=3D 0); - return reloc_pc16(code_ptr, (const tcg_insn_unit *)value); + value +=3D addend; + switch (type) { + case R_MIPS_PC16: + return reloc_pc16(code_ptr, (const tcg_insn_unit *)value); + case R_MIPS_16: + if (value !=3D (int16_t)value) { + return false; + } + *code_ptr =3D deposit32(*code_ptr, 0, 16, value); + return true; + } + g_assert_not_reached(); } =20 #define TCG_CT_CONST_ZERO 0x100 @@ -490,6 +500,11 @@ static void tcg_out_nop(TCGContext *s) tcg_out32(s, 0); } =20 +static void tcg_out_nop_fill(tcg_insn_unit *p, int count) +{ + memset(p, 0, count * sizeof(tcg_insn_unit)); +} + static void tcg_out_dsll(TCGContext *s, TCGReg rd, TCGReg rt, TCGArg sa) { tcg_out_opc_sa64(s, OPC_DSLL, OPC_DSLL32, rd, rt, sa); @@ -547,8 +562,15 @@ static bool tcg_out_movi_two(TCGContext *s, TCGReg ret= , tcg_target_long arg) return false; } =20 -static void tcg_out_movi(TCGContext *s, TCGType type, - TCGReg ret, tcg_target_long arg) +static void tcg_out_movi_pool(TCGContext *s, TCGReg ret, + tcg_target_long arg, TCGReg tbreg) +{ + new_pool_label(s, arg, R_MIPS_16, s->code_ptr, tcg_tbrel_diff(s, NULL)= ); + tcg_out_opc_imm(s, OPC_LD, ret, tbreg, 0); +} + +static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, + tcg_target_long arg, TCGReg tbreg) { if (TCG_TARGET_REG_BITS =3D=3D 64 && type =3D=3D TCG_TYPE_I32) { arg =3D (int32_t)arg; @@ -558,18 +580,17 @@ static void tcg_out_movi(TCGContext *s, TCGType type, if (tcg_out_movi_two(s, ret, arg)) { return; } + assert(TCG_TARGET_REG_BITS =3D=3D 64); =20 - tcg_out_movi(s, TCG_TYPE_I32, ret, arg >> 31 >> 1); - if (arg & 0xffff0000ull) { - tcg_out_dsll(s, ret, ret, 16); - tcg_out_opc_imm(s, OPC_ORI, ret, ret, arg >> 16); - tcg_out_dsll(s, ret, ret, 16); - } else { - tcg_out_dsll(s, ret, ret, 32); - } - if (arg & 0xffff) { - tcg_out_opc_imm(s, OPC_ORI, ret, ret, arg & 0xffff); - } + /* Otherwise, put 64-bit constants into the constant pool. */ + tcg_out_movi_pool(s, ret, arg, tbreg); +} + +static void tcg_out_movi(TCGContext *s, TCGType type, + TCGReg ret, tcg_target_long arg) +{ + TCGReg tbreg =3D TCG_TARGET_REG_BITS =3D=3D 64 ? TCG_REG_TB : 0; + tcg_out_movi_int(s, type, ret, arg, tbreg); } =20 static void tcg_out_ext8s(TCGContext *s, TCGType type, TCGReg rd, TCGReg r= s) @@ -2693,10 +2714,20 @@ static void tcg_target_qemu_prologue(TCGContext *s) =20 #ifndef CONFIG_SOFTMMU if (guest_base !=3D (int16_t)guest_base) { - tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base); + /* + * The function call abi for n32 and n64 will have loaded $25 (t9) + * with the address of the prologue, so we can use that instead + * of TCG_REG_TB. + */ +#if TCG_TARGET_REG_BITS =3D=3D 64 && !defined(__mips_abicalls) +# error "Unknown mips abi" +#endif + tcg_out_movi_int(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base, + TCG_TARGET_REG_BITS =3D=3D 64 ? TCG_REG_T9 : 0); tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); } #endif + if (TCG_TARGET_REG_BITS =3D=3D 64) { tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_TB, tcg_target_call_iarg_regs= [1]); } --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923134; cv=none; d=zohomail.com; s=zohoarc; b=hU5PNtukVOSCK0eKd89L8CQ297XXuHb8eSJ+TtSpZ0T1K67aq/17j5hlJ2IrwYL7nyOqznkL0bmG8VHDa3MqBAWvz5zlFW/6dQeZroqpSO+uPZBN1y8f1dll5IDiXswWrv/Urcm1skRe9Yp7OsQooicnSzSaKYgEEOBumhcsxqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923134; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bWlAtcRNymG4w15Enb26bcQblUABjzhSzKBMFvp6WBM=; b=OSN/dwd/Di8eMLv8m/gnrMF5BFbs71tKyFFvBDfEqx2AZrY2DDtXn3WGgjbdWRBZ+W1qcVywrOJ18Tw+Ylojm1ZBxlZdOExt7eUsviNNEC2vqwg57FpRTgoi3qZY38BlxM2Hw34eUiVFM2OqaQ/LgB1SFHGXwoooDyKzdKPy5Y4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923134766886.9442712048775; Fri, 7 Apr 2023 20:05:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysL-0004An-Mo; Fri, 07 Apr 2023 23:04:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys7-00046b-5Q for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:12 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys4-0004Vv-5s for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:09 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-62ddb232ddaso1414066b3a.1 for ; Fri, 07 Apr 2023 20:04:07 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923047; 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; bh=bWlAtcRNymG4w15Enb26bcQblUABjzhSzKBMFvp6WBM=; b=u8ZAe8rGeYptpJksNsa8IKzrvjmNwmAzuJUsJT1/o6YBe+7BPVWgiM2z7aouROdi98 o5CLeLe9WfLzfnHPaQstCoyvykU76hxWWNL+I/R+85EXOB7p5g8wkJh9Qq67ytW0pxcY ZWiw77XCL89dPDOvgr6UqXWeVpZ/GMbCNVJksdw0Wqqp7M3MDr6LchiqIy1U0JbIrTFW UY5TrOpBDX6nVjBZuM8UCetEPkpfXCs0MtAPGVbqoDgpElkczaFOH74W8DzN+JsnBmim 5Di1PLq59kON2PERTBs+ap0/h4tBeOdZqzYtBXmB+PAYy9VSEPa4XIJfE4wRHBC4ZVts fCRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bWlAtcRNymG4w15Enb26bcQblUABjzhSzKBMFvp6WBM=; b=xAvkAzWKRUDJip0VY4vTByu0/Q159PUb+wq/erf+Yyq5i2J42exwpa46pvCI1g34Kz SnrgS3yI4FKhqJVOQHsf/txGLtWUZpF7HpMeL71zx89j3ZEEMxuHe4jLSCXLro2SdSnJ xhy20zCVhciBKYYuxqD9eBfVkMtNHQcY68ceKoz4kwhVLp7DlbKfSOyLgTOp70Apc+W6 gKEu0nsdJKMVEaApobo3tSTPCAxdUB7DjBGTuz7b9CLByCbDu1/fOQ89pdR5tEBRCxFr MKsrFqhULU7tWa3oWlSmwKUPEB9xcuqdEd5VEfs7rjYSwRoQR2gIJCeHuAipA8CianPR K7tQ== X-Gm-Message-State: AAQBX9dRj8TQ0sn78XOywGpJrK+ExpCSYbQRB+4DLQOYKpR86QUdSwqv H3IWR2EoeUZuVfxbiYg7tE/qf6hhT6xsRQZv5uk= X-Google-Smtp-Source: AKy350agneBDXvBzvZxvHHRspcRFKXTMv52UGa+OYjJtelOjh53UeN43XkWm7gzjv8oYD31J/xOlgQ== X-Received: by 2002:a05:6a00:2ea1:b0:5a8:c913:b108 with SMTP id fd33-20020a056a002ea100b005a8c913b108mr4167085pfb.9.1680923047420; Fri, 07 Apr 2023 20:04:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 08/12] tcg/mips: Aggressively use the constant pool for n64 calls Date: Fri, 7 Apr 2023 20:03:55 -0700 Message-Id: <20230408030359.3368868-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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: 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: 1680923136356100009 Content-Type: text/plain; charset="utf-8" Repeated calls to a single helper are common -- especially the ones for softmmu memory access. Prefer the constant pool to longer sequences to increase sharing. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 235295c689..e37aca5986 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1105,9 +1105,19 @@ static void tcg_out_movcond(TCGContext *s, TCGCond c= ond, TCGReg ret, =20 static void tcg_out_call_int(TCGContext *s, const tcg_insn_unit *arg, bool= tail) { - /* Note that the ABI requires the called function's address to be - loaded into T9, even if a direct branch is in range. */ - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T9, (uintptr_t)arg); + /* + * Note that __mips_abicalls requires the called function's address + * to be loaded into $25 (t9), even if a direct branch is in range. + * + * For n64, always drop the pointer into the constant pool. + * We can re-use helper addresses often and do not want any + * of the longer sequences tcg_out_movi may try. + */ + if (sizeof(uintptr_t) =3D=3D 8) { + tcg_out_movi_pool(s, TCG_REG_T9, (uintptr_t)arg, TCG_REG_TB); + } else { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_T9, (uintptr_t)arg); + } =20 /* But do try a direct branch, allowing the cpu better insn prefetch. = */ if (tail) { --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923161; cv=none; d=zohomail.com; s=zohoarc; b=fJr4Hz23HUn5gfLRe4BcZGtFjQ++rcpAOAkjlc2e7kRcMHyOFEgu7oPbKaffopA0lNvNuLE6cKaBdfHJpkX8uwxgPiHlCeGb8zDscW5fGQtJO9dsPGYRnWT2zMkkCYycVud0KvSZDKH66jgyElPgfPdBXeoNddHlM+MsXK4gpqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923161; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FzyqRtK+sy/Z6TtVMGGAfWbqpPjrDQw0gAte8M7H4fw=; b=mmlHNU/RZElALItGBziOQlNJhRd9tSwxJkbCfyhSp9z7pKI7T2GZHK2Rz5r1HvhWDuOTpdnMdcTHlyZCuIWes4N/hHA8vQD98iqxufPB3EHD6N13qb5lRwhulu6bxryxrbS22XacOEMU7YSbdgsQm8QsahZ2ozeoWzsbrn/srD0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923161386635.7139788024717; Fri, 7 Apr 2023 20:06:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysM-0004B5-C9; Fri, 07 Apr 2023 23:04:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys8-00046i-Jo for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:12 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys6-0004XJ-U8 for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:12 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1a2b01f5ac0so2480265ad.3 for ; Fri, 07 Apr 2023 20:04:09 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923048; 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; bh=FzyqRtK+sy/Z6TtVMGGAfWbqpPjrDQw0gAte8M7H4fw=; b=WBbmcMBkf84HRImxrgiMlGphpcTxjmM0y94roAkxI+Nns7qfCz4Bi9a8aFw6mN4SRQ 4LsDC92CFQgKGtcu3bguK2sXIADMyrSSbcDVhL8wl0VBNhxDghn+3KgpRzR4yakg7zIl 6BlE8mbh/jvUU6uBi6sjFHR7ciYveEMAUENMsOCayAPZQj1btQIkMCNus1mRzR08zT8w 6j4U5LoYjl+87E+GU07SnEHZJqep5tIF4tJY0Gs0FBcQ4tQIhv/DtaWFg3cr1aNGo28I WEFYth84zFpYI+NSSay0SVihFFa2dM+IdqcSepft93ach8dxbg96G9Box7MsHpk2eI4+ B/vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FzyqRtK+sy/Z6TtVMGGAfWbqpPjrDQw0gAte8M7H4fw=; b=f90RZ+MtFx7i/4e3WMWhY0lmhAb7cnsDo+B7QWxp1lufmw3sySihFl77h9Ve/rjL12 /GTaf5fDb53oqvoagRnJBjGfc1YjT0jcKcYy6xtor1empip7Un37BG2Dtk5ZVdHILhHO A4p6D/vwbXPW+IYef7UneGYwzIZV/MS/b6/CgMuOqckwPJwhSx64eQWUBa30CjCWCbKO yd3gV3CODCscXd4YDz3ie1MjQ+8RE83Q2zyqHmFCXu5vSL877KCd32bYhlVUuz333SWR Us/3XYzrZe+D6YDaZchgEO4d97/cdtJF7hZBUjvcVL+O03ny7zrMeOD46HBRwZHsrUnj TG0A== X-Gm-Message-State: AAQBX9efMQe+I0QTIoXIkB7OrOcUGZLB7sNDvABJOs7TBQ2exhoLj51H o8Xv729A8KEQ2v0L2aKTUCcXqcZKntfOGYV+duQ= X-Google-Smtp-Source: AKy350Yxv/PaKOTJdvLzEDjjNr6GkKLkFmbxgwmoT/xp4oPQXv4YiDq50zHOefzgSejCVMSwsa/02Q== X-Received: by 2002:a62:1c8f:0:b0:628:1852:8431 with SMTP id c137-20020a621c8f000000b0062818528431mr3516875pfc.30.1680923048271; Fri, 07 Apr 2023 20:04:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 09/12] tcg/mips: Try tb-relative addresses in tcg_out_movi Date: Fri, 7 Apr 2023 20:03:56 -0700 Message-Id: <20230408030359.3368868-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: 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: 1680923162379100001 Content-Type: text/plain; charset="utf-8" These addresses are often loaded by the qemu_ld/st slow path, for loading the retaddr value. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index e37aca5986..8c9a4cba9b 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -572,6 +572,8 @@ static void tcg_out_movi_pool(TCGContext *s, TCGReg ret, static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long arg, TCGReg tbreg) { + tcg_target_long tmp; + if (TCG_TARGET_REG_BITS =3D=3D 64 && type =3D=3D TCG_TYPE_I32) { arg =3D (int32_t)arg; } @@ -582,6 +584,17 @@ static void tcg_out_movi_int(TCGContext *s, TCGType ty= pe, TCGReg ret, } assert(TCG_TARGET_REG_BITS =3D=3D 64); =20 + /* Load addresses within 2GB of TB with 1 or 3 insns. */ + tmp =3D tcg_tbrel_diff(s, (void *)arg); + if (tmp =3D=3D (int16_t)tmp) { + tcg_out_opc_imm(s, OPC_DADDIU, ret, tbreg, tmp); + return; + } + if (tcg_out_movi_two(s, ret, tmp)) { + tcg_out_opc_reg(s, OPC_DADDU, ret, ret, tbreg); + return; + } + /* Otherwise, put 64-bit constants into the constant pool. */ tcg_out_movi_pool(s, ret, arg, tbreg); } --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923139; cv=none; d=zohomail.com; s=zohoarc; b=Pp4efWwJRLtk2zADl6BcJoQqbKDwTT7x54HwTuw9BHvLBA9sLf7oQzLLK6+Q6M8Fteohh/fflICEiPzY09eloE6VTbvZoF3PWbE6Me+sWgZ8GYrNXKAJosF8wsTPGV3QY3xcJQGIQVbtEx7GdqkFMua55hbtzXRF15pHl/2t9AU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923139; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qXbf2aRMCTtBppHDpY9IM0kHjyXVcQd7tAf8ZqkWMDo=; b=BS1dwzWwMG2ZuB29QDQHs6afm5BMhhM2QmWemBHg3crqaz4RHMrJI3ig/GLdm57aU89n+mpUU7t2EH17RvWNtWqxTIyCcg2w50D8itSxYIKaADAX+7xpT9mnr63r4DzlWHKmFyu2PJ/GIpgMSvDeduFCsXX8ch/lmE44Xi23HBo= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923139814257.1773924656178; Fri, 7 Apr 2023 20:05:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysL-0004Aq-Mh; Fri, 07 Apr 2023 23:04:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys8-00046w-OZ for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:16 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys6-0004XV-UQ for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:12 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1a52667955dso568995ad.1 for ; Fri, 07 Apr 2023 20:04:09 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923049; 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; bh=qXbf2aRMCTtBppHDpY9IM0kHjyXVcQd7tAf8ZqkWMDo=; b=FTXCgVP/95HEFIspOLfZ136qECwjSGJQUvczi/SbQeHnx+gOnaVOXZveNJxqncUL4U Jk9MrOR86i36mPOQsvyXh63NrUCXoWzJ+dBKcS5DnfhQ8+Ngqfi2ID7q5QjiJyaKqMtF pU02bOELa6OmdJgBa0zfLvlgN6f67kaZ4WXbW2Fm8b/FXgBO1Suc4HjoX8jGGEshsZXH Zz6T60PwEfq3tW5+lcHnLquv9K7VCHLwfpT/VGRkxh2Z2kMpK4tuwukfdeTcRUigQAd3 xKlN6U/EJ+Iv2il2tyArOHbAqec+CsJ0ZbEVlcKeswGv+eSdhvAyoi/K5+Vx3dqHMHco 3yvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qXbf2aRMCTtBppHDpY9IM0kHjyXVcQd7tAf8ZqkWMDo=; b=LL8lRelLXS6mRD07e4TjsdLlb6nUwvQHYfQ0e5HsDcq+3czESCNCqdbp1FN/NIls6V xngYsxaI5dxOzaIXAwUkFuDBWXZKj2c3+leT9hFNFTIhBjIBBcOTvz4BkP99zt3oi2y2 C1Ku8CYX24OGUtH9T2eR0Um35nqgRUqYg7lAvbn6JleyuP/DWFWyngQmDwh5Z/HSei9N xpXII56DxO0FMXk2YplvBvB8DfTOtDNBIk132MGXcwhP/0VwWwl5MYJwL05YkRKHZJsn 1321njZQZdqnIYLQL5Na/etN1Xf7q1zMsc9XLSi2k/oN8xWk29Y/mkFMyuUsSKVjLU32 Pg+g== X-Gm-Message-State: AAQBX9doE68hm7aCyJ+AvmkRO/dD0JNI0gT3I+aWoCGNtum+YO7+nloj WEPkpkYtbfZi4Gr3qn7PcNSF16FIMHT7yXaOqsI= X-Google-Smtp-Source: AKy350b3kfsPRqOzISAGU5Piki4vKfvTiJzxRLep+i8IuBrFgikSS48kloIrtHgrr63bWbsifHRnWg== X-Received: by 2002:aa7:94b8:0:b0:62d:b7ad:8071 with SMTP id a24-20020aa794b8000000b0062db7ad8071mr4589155pfl.15.1680923049084; Fri, 07 Apr 2023 20:04:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 10/12] tcg/mips: Try three insns with shift and add in tcg_out_movi Date: Fri, 7 Apr 2023 20:03:57 -0700 Message-Id: <20230408030359.3368868-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: 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: 1680923140589100003 Content-Type: text/plain; charset="utf-8" These sequences are inexpensive to test. Maxing out at three insns results in the same space as a load plus the constant pool entry. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 8c9a4cba9b..e7930963fc 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -573,6 +573,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType typ= e, TCGReg ret, tcg_target_long arg, TCGReg tbreg) { tcg_target_long tmp; + int sh, lo; =20 if (TCG_TARGET_REG_BITS =3D=3D 64 && type =3D=3D TCG_TYPE_I32) { arg =3D (int32_t)arg; @@ -595,6 +596,49 @@ static void tcg_out_movi_int(TCGContext *s, TCGType ty= pe, TCGReg ret, return; } =20 + /* + * Load bitmasks with a right-shift. This is good for things + * like 0x0fff_ffff_ffff_fff0: ADDUI r,0,0xff00 + DSRL r,r,4. + * or similarly using LUI. For this to work, bit 31 must be set. + */ + if (arg > 0 && (int32_t)arg < 0) { + sh =3D clz64(arg); + if (tcg_out_movi_one(s, ret, arg << sh)) { + tcg_out_dsrl(s, ret, ret, sh); + return; + } + } + + /* + * Load slightly larger constants using left-shift. + * Limit this sequence to 3 insns to avoid too much expansion. + */ + sh =3D ctz64(arg); + if (sh && tcg_out_movi_two(s, ret, arg >> sh)) { + tcg_out_dsll(s, ret, ret, sh); + return; + } + + /* + * Load slightly larger constants using left-shift and add/or. + * Prefer addi with a negative immediate when that would produce + * a larger shift. For this to work, bits 15 and 16 must be set. + */ + lo =3D arg & 0xffff; + if (lo) { + if ((arg & 0x18000) =3D=3D 0x18000) { + lo =3D (int16_t)arg; + } + tmp =3D arg - lo; + sh =3D ctz64(tmp); + tmp >>=3D sh; + if (tcg_out_movi_one(s, ret, tmp)) { + tcg_out_dsll(s, ret, ret, sh); + tcg_out_opc_imm(s, lo < 0 ? OPC_DADDIU : OPC_ORI, ret, ret, lo= ); + return; + } + } + /* Otherwise, put 64-bit constants into the constant pool. */ tcg_out_movi_pool(s, ret, arg, tbreg); } --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923170; cv=none; d=zohomail.com; s=zohoarc; b=d3SzNvh0UR7z950623+ABkc45v8b0NAXS+rkvru/Gtoze5PjGGGyonjgAdFABM0Xmhre+mmEDWflinFxlRlOPc3V3RAU08KAOrxPb56oEBH79G5yiUKncYQiQl/bdrRSeTAPUQJj4axr+Vmq4ocWxy8CnCJ5EmMM/zy79pI89dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923170; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mTrnnmRF46TF0Utts5Gj6LSoaUp0gjklQtGKntHQY08=; b=G1waY+7ahXcwf9nVn626/hlr2l3shWgOjAGMXc/zkeXGqQamDKOsdiHuwE4fmNZ6YT7cIeXxyTt3/AuiuFf8FaxTZ+BrQ7m1oGCgtIjNO09fFjiyneNGuBOuLT52Ja0ZPR2QVqlQ2VTea5Y8ufab0jnJ/3177CJd8TB1YZUbJe4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923170445651.3663424403259; Fri, 7 Apr 2023 20:06:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysN-0004BR-0v; Fri, 07 Apr 2023 23:04:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkys9-000477-KO for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:16 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys7-0004Xc-CU for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:13 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1a2b01f5ac0so2480275ad.3 for ; Fri, 07 Apr 2023 20:04:10 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923050; 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; bh=mTrnnmRF46TF0Utts5Gj6LSoaUp0gjklQtGKntHQY08=; b=iV/uqwPyAjg8i0zJ0P5MOgM4SVHbmtSLK62/+5jCD60Y8BDj6xDc+Ub4r8R5zDsfg0 oD+lqIxzO5JVOlGCq63a9atk/Sl0zNzHuyazeTanT+92g9f9NmBOek+KRfVViaWfGUwZ U9JThhc/JpZKb7hJ+oXZmwncapf66Ik5koPIsnzmbkWeKlvORgoW5TMHHlNik90yOaSG bwlgqUiWXYAI8QhMl8tk08cgZVpHv2WaFqx1miyCkzUvJmdx03ccbfO/yPIgDTy8op/f HTg6Oed68t/4qWMtIGmIAGnomR1lWF1yAq6pEP3q7bfAjqZAnkZ3xs9510+iFy8WLN7r VOxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mTrnnmRF46TF0Utts5Gj6LSoaUp0gjklQtGKntHQY08=; b=GGWKfTE6r4XhtwKj4MzlQ3ayLj63ZJbXfp/QGPdf1GKIXGuscHeFR1z/ka5+anQtDo +MlHQQCLoaNRcsJN5GVJX64jVbe2WqDbE7gIjXj2iODDKvWrusXFDIvoreFk4tc1a+ja kvecOLidhe+1m/tqc8QzC/P54OOxBBx0EPKAl5vJrbAdqadbrx8FoUJCLoxpCkS6+2I8 LEWXEtawLmgEjzixVeLZ9ZkBOhDvdU/zf+IITc0NJuCYcJq1/NOZ7hfRshiTPRzP5uQq y3dY84MAaxiM9Ka4RI5XK3J8PVFh9JfbOSFCYjDNye8S3oJ+amhY1t7c9bdO84ODxr67 ipFQ== X-Gm-Message-State: AAQBX9cTrgtzTFoZfMttxn5wYr1QLciyPCoFWr6PCQUaPKqzSaZ4mLgc 4LcqWQ2OZVWSki+ws1Us2M94WLksd1CgX0JKXEk= X-Google-Smtp-Source: AKy350ZXPkCSH2s/s0C/6Vn+6DZKj8HROK/I6nEQQ5iTVM5xZGbUBJG8+i/nelJBOqq0FzvI5LSkqw== X-Received: by 2002:a62:194b:0:b0:622:bbad:a2f3 with SMTP id 72-20020a62194b000000b00622bbada2f3mr4169171pfz.9.1680923049906; Fri, 07 Apr 2023 20:04:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 11/12] tcg/mips: Use qemu_build_not_reached for LO/HI_OFF Date: Fri, 7 Apr 2023 20:03:58 -0700 Message-Id: <20230408030359.3368868-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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: 1680923170690100001 Content-Type: text/plain; charset="utf-8" The new(ish) macro produces a compile-time error instead of a link-time error. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index e7930963fc..1df00bf027 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -37,11 +37,9 @@ # define LO_OFF (MIPS_BE * 4) # define HI_OFF (4 - LO_OFF) #else -/* To assert at compile-time that these values are never used - for TCG_TARGET_REG_BITS =3D=3D 64. */ -int link_error(void); -# define LO_OFF link_error() -# define HI_OFF link_error() +/* Assert at compile-time that these values are never used for 64-bit. */ +# define LO_OFF ({ qemu_build_not_reached(); 0; }) +# define HI_OFF ({ qemu_build_not_reached(); 0; }) #endif =20 #ifdef CONFIG_DEBUG_TCG --=20 2.34.1 From nobody Fri May 17 03:39:21 2024 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=1680923181; cv=none; d=zohomail.com; s=zohoarc; b=MWZd+IMHCCkdXpEVhF0Ng3WCsytzgzTy0+piFjBupI0WBaTCVRagPp1hIbOOv5neSimPJ3+TBEPW+kyrVo2E9GjPp0rAQZbvnbMpEAfcQfMwDTrtcv8LR01aVC5+3Hg3rgANnbdBUshHv06BYTP9RGzfhBfUeV2YMVhTW3yN6r4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680923181; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SMU8At/4U7O1Bf4F5hIg0nT65apfwtt8AlnB6b9nPKA=; b=LpStP48WU7tnHUN4oXL7Qc/Hvl0nuWj/8O/yWReLM8NLFd+FoUfbvlyX0w55sEld8MCmLnkiExPBEGBFUPvaOVfQZcHKQ4WKlXcNpEfls6suapkcdX1Shj2ui2f0LZUQOKMK8jlfLyGh524eRoejytXUULT9sWgj3f4u5aWa6pQ= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680923181050770.6173610756634; Fri, 7 Apr 2023 20:06:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkysN-0004Bh-87; Fri, 07 Apr 2023 23:04:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkysB-00047D-0j for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:16 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkys8-0004Xx-HR for qemu-devel@nongnu.org; Fri, 07 Apr 2023 23:04:14 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-632384298b3so271007b3a.0 for ; Fri, 07 Apr 2023 20:04:11 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id c12-20020aa78e0c000000b0062b5a55835dsm3687025pfr.213.2023.04.07.20.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 20:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680923051; 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; bh=SMU8At/4U7O1Bf4F5hIg0nT65apfwtt8AlnB6b9nPKA=; b=ou7uAIW3MZl13Z7eKTD+wPz+TNlGe3gYZGCDPxSNJIZ9rJYDDI9kPuBtHGPa6Ju4ZK 39ZmJiMaHlLKco733GwV0epXcoWso6pHXF3hPHfztxqwci9Og++Oz+1ReMzw5JbatEu4 MwEtO5q3ZORV0zAWpC9lcgTPlCHz7KGU6zIfPQcdYR1LaKIFJvP/cHiUB4F6RwJPNwuJ xNvMGjw3nNLFhrjaKhgGraVJbHKpLUx2aS4eOgVHplID2WbkvnYVAxGyZtuzVCR91Wuw /hP3sMRRVYDKTCa9/o0i+woKs0GeczfdZHEY/ZjB+a1ARrNvv2A6yZ8e7M0CbRdEfY1a ozSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680923051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SMU8At/4U7O1Bf4F5hIg0nT65apfwtt8AlnB6b9nPKA=; b=1oMLYj+egl7GbxTxX7Ns8msDFWsv4b7PA+EXQ6kIi15SXy7Hqt84+D2tQzdk8hMh1D PYP+e+mw12QHNcGTsWOGEXli093RcBowufvTZL5ZQXb55wK1ru6g/hluEoZTVvIRp9r9 wq8B9xU4YoY40jbNY4sv7/CoXiIUrFY5a7OPuLa3ARybxaTUKNIAet1r3Yw2bKir1YOs YM1nkLeLzU/LiyH1SuNbGUJANjNiGy96Z4xawTuD5dwxZnd/9X5CplbyBM3Img1x8nsO 5DJtzk3AUTFDntGJvIJJaMwsXaFEUzygjIHipo0DtCrkMENGMtHgblrPelAV/Y7qgqSO A+ig== X-Gm-Message-State: AAQBX9ewa1UUaGn9jBO3yQYMoM0fyzQdGraqoBg1cpTtX91GbwbUXbeA 4/G3fjG/y8zyLXmGSYN6+2U0QRTbM2D3JHrWHrc= X-Google-Smtp-Source: AKy350b5U+RXh1NniLRBD7GZb2rbeQdqCb277wf3+KVMpGo8ye3jYKkwv8PFIjCGY952/5IaDQYwPA== X-Received: by 2002:a05:6a00:2d95:b0:62d:d85b:fcfc with SMTP id fb21-20020a056a002d9500b0062dd85bfcfcmr4388409pfb.8.1680923050955; Fri, 07 Apr 2023 20:04:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 12/12] tcg/mips: Replace MIPS_BE with HOST_BIG_ENDIAN Date: Fri, 7 Apr 2023 20:03:59 -0700 Message-Id: <20230408030359.3368868-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408030359.3368868-1-richard.henderson@linaro.org> References: <20230408030359.3368868-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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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: 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: 1680923183212100003 Content-Type: text/plain; charset="utf-8" Since e03b56863d2b, which replaced HOST_WORDS_BIGENDIAN with HOST_BIG_ENDIAN, there is no need to define a second symbol which is [0,1]. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tcg/mips/tcg-target.c.inc | 88 ++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 1df00bf027..9767065af0 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -27,14 +27,8 @@ #include "../tcg-ldst.c.inc" #include "../tcg-pool.c.inc" =20 -#if HOST_BIG_ENDIAN -# define MIPS_BE 1 -#else -# define MIPS_BE 0 -#endif - #if TCG_TARGET_REG_BITS =3D=3D 32 -# define LO_OFF (MIPS_BE * 4) +# define LO_OFF (HOST_BIG_ENDIAN * 4) # define HI_OFF (4 - LO_OFF) #else /* Assert at compile-time that these values are never used for 64-bit. */ @@ -1354,7 +1348,7 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, = TCGLabelQemuLdst *l) if (TCG_TARGET_REG_BITS =3D=3D 32 && (opc & MO_SIZE) =3D=3D MO_64) { /* We eliminated V0 from the possible output registers, so it cannot be clobbered here. So we must move V1 first. */ - if (MIPS_BE) { + if (HOST_BIG_ENDIAN) { tcg_out_mov(s, TCG_TYPE_I32, v0, TCG_REG_V1); v0 =3D l->datahi_reg; } else { @@ -1438,8 +1432,8 @@ static bool tcg_out_fail_alignment(TCGContext *s, TCG= LabelQemuLdst *l) =20 if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) { /* A0 is env, A1 is skipped, A2:A3 is the uint64_t address. */ - TCGReg a2 =3D MIPS_BE ? l->addrhi_reg : l->addrlo_reg; - TCGReg a3 =3D MIPS_BE ? l->addrlo_reg : l->addrhi_reg; + TCGReg a2 =3D HOST_BIG_ENDIAN ? l->addrhi_reg : l->addrlo_reg; + TCGReg a3 =3D HOST_BIG_ENDIAN ? l->addrlo_reg : l->addrhi_reg; =20 if (a3 !=3D TCG_REG_A2) { tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_A2, a2); @@ -1551,8 +1545,8 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCG= Reg lo, TCGReg hi, tcg_out_opc_imm(s, OPC_LW, TCG_TMP1, base, 4); tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP0, 0, TCG_TMP0); tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP1, 0, TCG_TMP1); - tcg_out_opc_sa(s, OPC_ROTR, MIPS_BE ? lo : hi, TCG_TMP0, 16); - tcg_out_opc_sa(s, OPC_ROTR, MIPS_BE ? hi : lo, TCG_TMP1, 16); + tcg_out_opc_sa(s, OPC_ROTR, HOST_BIG_ENDIAN ? lo : hi, TCG_TMP= 0, 16); + tcg_out_opc_sa(s, OPC_ROTR, HOST_BIG_ENDIAN ? hi : lo, TCG_TMP= 1, 16); } else { tcg_out_bswap_subr(s, bswap32_addr); /* delay slot */ @@ -1560,15 +1554,15 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, T= CGReg lo, TCGReg hi, tcg_out_opc_imm(s, OPC_LW, TCG_TMP0, base, 4); tcg_out_bswap_subr(s, bswap32_addr); /* delay slot */ - tcg_out_mov(s, TCG_TYPE_I32, MIPS_BE ? lo : hi, TCG_TMP3); - tcg_out_mov(s, TCG_TYPE_I32, MIPS_BE ? hi : lo, TCG_TMP3); + tcg_out_mov(s, TCG_TYPE_I32, HOST_BIG_ENDIAN ? lo : hi, TCG_TM= P3); + tcg_out_mov(s, TCG_TYPE_I32, HOST_BIG_ENDIAN ? hi : lo, TCG_TM= P3); } break; case MO_UQ: /* Prefer to load from offset 0 first, but allow for overlap. */ if (TCG_TARGET_REG_BITS =3D=3D 64) { tcg_out_opc_imm(s, OPC_LD, lo, base, 0); - } else if (MIPS_BE ? hi !=3D base : lo =3D=3D base) { + } else if (HOST_BIG_ENDIAN ? hi !=3D base : lo =3D=3D base) { tcg_out_opc_imm(s, OPC_LW, hi, base, HI_OFF); tcg_out_opc_imm(s, OPC_LW, lo, base, LO_OFF); } else { @@ -1584,10 +1578,10 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, T= CGReg lo, TCGReg hi, static void tcg_out_qemu_ld_unalign(TCGContext *s, TCGReg lo, TCGReg hi, TCGReg base, MemOp opc, TCGType type) { - const MIPSInsn lw1 =3D MIPS_BE ? OPC_LWL : OPC_LWR; - const MIPSInsn lw2 =3D MIPS_BE ? OPC_LWR : OPC_LWL; - const MIPSInsn ld1 =3D MIPS_BE ? OPC_LDL : OPC_LDR; - const MIPSInsn ld2 =3D MIPS_BE ? OPC_LDR : OPC_LDL; + const MIPSInsn lw1 =3D HOST_BIG_ENDIAN ? OPC_LWL : OPC_LWR; + const MIPSInsn lw2 =3D HOST_BIG_ENDIAN ? OPC_LWR : OPC_LWL; + const MIPSInsn ld1 =3D HOST_BIG_ENDIAN ? OPC_LDL : OPC_LDR; + const MIPSInsn ld2 =3D HOST_BIG_ENDIAN ? OPC_LDR : OPC_LDL; =20 bool sgn =3D (opc & MO_SIGN); =20 @@ -1653,10 +1647,10 @@ static void tcg_out_qemu_ld_unalign(TCGContext *s, = TCGReg lo, TCGReg hi, tcg_out_opc_imm(s, ld1, lo, base, 0); tcg_out_opc_imm(s, ld2, lo, base, 7); } else { - tcg_out_opc_imm(s, lw1, MIPS_BE ? hi : lo, base, 0 + 0); - tcg_out_opc_imm(s, lw2, MIPS_BE ? hi : lo, base, 0 + 3); - tcg_out_opc_imm(s, lw1, MIPS_BE ? lo : hi, base, 4 + 0); - tcg_out_opc_imm(s, lw2, MIPS_BE ? lo : hi, base, 4 + 3); + tcg_out_opc_imm(s, lw1, HOST_BIG_ENDIAN ? hi : lo, base, 0 + 0= ); + tcg_out_opc_imm(s, lw2, HOST_BIG_ENDIAN ? hi : lo, base, 0 + 3= ); + tcg_out_opc_imm(s, lw1, HOST_BIG_ENDIAN ? lo : hi, base, 4 + 0= ); + tcg_out_opc_imm(s, lw2, HOST_BIG_ENDIAN ? lo : hi, base, 4 + 3= ); } break; =20 @@ -1680,19 +1674,19 @@ static void tcg_out_qemu_ld_unalign(TCGContext *s, = TCGReg lo, TCGReg hi, tcg_out_opc_imm(s, lw2, TCG_TMP1, base, 4 + 3); tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP0, 0, TCG_TMP0); tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP1, 0, TCG_TMP1); - tcg_out_opc_sa(s, OPC_ROTR, MIPS_BE ? lo : hi, TCG_TMP0, 16); - tcg_out_opc_sa(s, OPC_ROTR, MIPS_BE ? hi : lo, TCG_TMP1, 16); + tcg_out_opc_sa(s, OPC_ROTR, HOST_BIG_ENDIAN ? lo : hi, TCG_TMP= 0, 16); + tcg_out_opc_sa(s, OPC_ROTR, HOST_BIG_ENDIAN ? hi : lo, TCG_TMP= 1, 16); } else { tcg_out_opc_imm(s, lw1, TCG_TMP0, base, 0 + 0); tcg_out_bswap_subr(s, bswap32_addr); /* delay slot */ tcg_out_opc_imm(s, lw2, TCG_TMP0, base, 0 + 3); tcg_out_opc_imm(s, lw1, TCG_TMP0, base, 4 + 0); - tcg_out_mov(s, TCG_TYPE_I32, MIPS_BE ? lo : hi, TCG_TMP3); + tcg_out_mov(s, TCG_TYPE_I32, HOST_BIG_ENDIAN ? lo : hi, TCG_TM= P3); tcg_out_bswap_subr(s, bswap32_addr); /* delay slot */ tcg_out_opc_imm(s, lw2, TCG_TMP0, base, 4 + 3); - tcg_out_mov(s, TCG_TYPE_I32, MIPS_BE ? hi : lo, TCG_TMP3); + tcg_out_mov(s, TCG_TYPE_I32, HOST_BIG_ENDIAN ? hi : lo, TCG_TM= P3); } break; =20 @@ -1802,16 +1796,16 @@ static void tcg_out_qemu_st_direct(TCGContext *s, T= CGReg lo, TCGReg hi, tcg_out_bswap64(s, TCG_TMP3, lo); tcg_out_opc_imm(s, OPC_SD, TCG_TMP3, base, 0); } else if (use_mips32r2_instructions) { - tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP0, 0, MIPS_BE ? lo : hi); - tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP1, 0, MIPS_BE ? hi : lo); + tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP0, 0, HOST_BIG_ENDIAN ? lo= : hi); + tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP1, 0, HOST_BIG_ENDIAN ? hi= : lo); tcg_out_opc_sa(s, OPC_ROTR, TCG_TMP0, TCG_TMP0, 16); tcg_out_opc_sa(s, OPC_ROTR, TCG_TMP1, TCG_TMP1, 16); tcg_out_opc_imm(s, OPC_SW, TCG_TMP0, base, 0); tcg_out_opc_imm(s, OPC_SW, TCG_TMP1, base, 4); } else { - tcg_out_bswap32(s, TCG_TMP3, MIPS_BE ? lo : hi, 0); + tcg_out_bswap32(s, TCG_TMP3, HOST_BIG_ENDIAN ? lo : hi, 0); tcg_out_opc_imm(s, OPC_SW, TCG_TMP3, base, 0); - tcg_out_bswap32(s, TCG_TMP3, MIPS_BE ? hi : lo, 0); + tcg_out_bswap32(s, TCG_TMP3, HOST_BIG_ENDIAN ? hi : lo, 0); tcg_out_opc_imm(s, OPC_SW, TCG_TMP3, base, 4); } break; @@ -1819,8 +1813,8 @@ static void tcg_out_qemu_st_direct(TCGContext *s, TCG= Reg lo, TCGReg hi, if (TCG_TARGET_REG_BITS =3D=3D 64) { tcg_out_opc_imm(s, OPC_SD, lo, base, 0); } else { - tcg_out_opc_imm(s, OPC_SW, MIPS_BE ? hi : lo, base, 0); - tcg_out_opc_imm(s, OPC_SW, MIPS_BE ? lo : hi, base, 4); + tcg_out_opc_imm(s, OPC_SW, HOST_BIG_ENDIAN ? hi : lo, base, 0); + tcg_out_opc_imm(s, OPC_SW, HOST_BIG_ENDIAN ? lo : hi, base, 4); } break; =20 @@ -1832,10 +1826,10 @@ static void tcg_out_qemu_st_direct(TCGContext *s, T= CGReg lo, TCGReg hi, static void tcg_out_qemu_st_unalign(TCGContext *s, TCGReg lo, TCGReg hi, TCGReg base, MemOp opc) { - const MIPSInsn sw1 =3D MIPS_BE ? OPC_SWL : OPC_SWR; - const MIPSInsn sw2 =3D MIPS_BE ? OPC_SWR : OPC_SWL; - const MIPSInsn sd1 =3D MIPS_BE ? OPC_SDL : OPC_SDR; - const MIPSInsn sd2 =3D MIPS_BE ? OPC_SDR : OPC_SDL; + const MIPSInsn sw1 =3D HOST_BIG_ENDIAN ? OPC_SWL : OPC_SWR; + const MIPSInsn sw2 =3D HOST_BIG_ENDIAN ? OPC_SWR : OPC_SWL; + const MIPSInsn sd1 =3D HOST_BIG_ENDIAN ? OPC_SDL : OPC_SDR; + const MIPSInsn sd2 =3D HOST_BIG_ENDIAN ? OPC_SDR : OPC_SDL; =20 /* Don't clutter the code below with checks to avoid bswapping ZERO. = */ if ((lo | hi) =3D=3D 0) { @@ -1869,17 +1863,17 @@ static void tcg_out_qemu_st_unalign(TCGContext *s, = TCGReg lo, TCGReg hi, tcg_out_bswap64(s, TCG_TMP3, lo); lo =3D TCG_TMP3; } else if (use_mips32r2_instructions) { - tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP0, 0, MIPS_BE ? hi : lo); - tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP1, 0, MIPS_BE ? lo : hi); + tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP0, 0, HOST_BIG_ENDIAN ? hi= : lo); + tcg_out_opc_reg(s, OPC_WSBH, TCG_TMP1, 0, HOST_BIG_ENDIAN ? lo= : hi); tcg_out_opc_sa(s, OPC_ROTR, TCG_TMP0, TCG_TMP0, 16); tcg_out_opc_sa(s, OPC_ROTR, TCG_TMP1, TCG_TMP1, 16); - hi =3D MIPS_BE ? TCG_TMP0 : TCG_TMP1; - lo =3D MIPS_BE ? TCG_TMP1 : TCG_TMP0; + hi =3D HOST_BIG_ENDIAN ? TCG_TMP0 : TCG_TMP1; + lo =3D HOST_BIG_ENDIAN ? TCG_TMP1 : TCG_TMP0; } else { - tcg_out_bswap32(s, TCG_TMP3, MIPS_BE ? lo : hi, 0); + tcg_out_bswap32(s, TCG_TMP3, HOST_BIG_ENDIAN ? lo : hi, 0); tcg_out_opc_imm(s, sw1, TCG_TMP3, base, 0 + 0); tcg_out_opc_imm(s, sw2, TCG_TMP3, base, 0 + 3); - tcg_out_bswap32(s, TCG_TMP3, MIPS_BE ? hi : lo, 0); + tcg_out_bswap32(s, TCG_TMP3, HOST_BIG_ENDIAN ? hi : lo, 0); tcg_out_opc_imm(s, sw1, TCG_TMP3, base, 4 + 0); tcg_out_opc_imm(s, sw2, TCG_TMP3, base, 4 + 3); break; @@ -1890,10 +1884,10 @@ static void tcg_out_qemu_st_unalign(TCGContext *s, = TCGReg lo, TCGReg hi, tcg_out_opc_imm(s, sd1, lo, base, 0); tcg_out_opc_imm(s, sd2, lo, base, 7); } else { - tcg_out_opc_imm(s, sw1, MIPS_BE ? hi : lo, base, 0 + 0); - tcg_out_opc_imm(s, sw2, MIPS_BE ? hi : lo, base, 0 + 3); - tcg_out_opc_imm(s, sw1, MIPS_BE ? lo : hi, base, 4 + 0); - tcg_out_opc_imm(s, sw2, MIPS_BE ? lo : hi, base, 4 + 3); + tcg_out_opc_imm(s, sw1, HOST_BIG_ENDIAN ? hi : lo, base, 0 + 0= ); + tcg_out_opc_imm(s, sw2, HOST_BIG_ENDIAN ? hi : lo, base, 0 + 3= ); + tcg_out_opc_imm(s, sw1, HOST_BIG_ENDIAN ? lo : hi, base, 4 + 0= ); + tcg_out_opc_imm(s, sw2, HOST_BIG_ENDIAN ? lo : hi, base, 4 + 3= ); } break; =20 --=20 2.34.1