From patchwork Wed Aug 18 20:19:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 498986 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1010274jab; Wed, 18 Aug 2021 13:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznFWmPG5n7DOkvkLywhZSUtEkd/Gzdespu98hm+j0YE1UGPObqX9yclIa/DiC/3thcqPad X-Received: by 2002:a05:6638:38a:: with SMTP id y10mr9748467jap.110.1629318406583; Wed, 18 Aug 2021 13:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629318406; cv=none; d=google.com; s=arc-20160816; b=lXof8/oUAwdVZ6vWRHlLbDC5RgfBtRZXg0nqwNotjpR2WguSFzuviS3bva+/NqfxFA r0JWEgPaT1CEkKlHBRD1ka1cfZMvG+5tOOxPqtThga3LYO0wzJ3A5JxiH+x81XcZyxHf DrGdbGrzUk4vS2ro5atwb1FushR+uZS4jFHymMc2B0t1FWGnX6hA8zTdH2+mRdjKZ6Vs Rpv1BtA5WT7hAo8aR38ccSHPnBycXoQOsExnT4M7Xa7+bo/ZZ4OQt6u+iTMaSUdN7Nho 3CF3OC+TsDebteHkY1xVeqsONuNOqmu3qh6dTBX162dVTV9iiCGbeqRDmH57Y/HoO9gx LGrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ZAJvKrninoDXi86yNb6pa5/NGflGIWCBcmCsKqBF7oE=; b=QyO2PqLpmLXlZxu+ZD0pki0upHSE95ZbPFd0H8bm9ZmjvdEf3XyohNjF3UyBlCBIKe 8eczF9H5l0pTP06KAtrRWPbjM2GU6mPAbetOfGC1uBLIQcG/klb690G+Lj1VUY7GuyiD Ebz7Dtjf81m2nyqw7wa/pyLV35Vw8S9Q3eW+bvSRsTndUCjoNxH+FUgtO2EPczLqBQv7 hUf6wzDaMVJw2WBWbL/KLvLr3IdRNfhcp/fp2qIMxsMrrYx+2QvhlAveuLIHBuy3x/Vx 7gyqLFPp1lVLRSTEdfxaP+PzMHj9LLS4D0YaiCvzU18PUPYMp+CQ0zpxVey8qt/Qn6G2 mqMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xym+ooOP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p8si1030495ilh.18.2021.08.18.13.26.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Aug 2021 13:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xym+ooOP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGS97-0002to-Ut for patch@linaro.org; Wed, 18 Aug 2021 16:26:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGS2M-00083y-0u for qemu-devel@nongnu.org; Wed, 18 Aug 2021 16:19:46 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:36544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGS2I-0006BK-Hl for qemu-devel@nongnu.org; Wed, 18 Aug 2021 16:19:45 -0400 Received: by mail-pf1-x430.google.com with SMTP id m26so3335588pff.3 for ; Wed, 18 Aug 2021 13:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ZAJvKrninoDXi86yNb6pa5/NGflGIWCBcmCsKqBF7oE=; b=Xym+ooOPjszCLlRySpY5JoUHTx/B5Kuugcev6d//nnw6wsowaOzDz1wk9LMdotHdAE v0yEqziGlidu8gVQH8bLl5SoqLjgV1H0fDMKRPGy7sXWsHCQ6QP0eBq+9BrWh64QVTdk tSMld+MZLrAxTxForOe5gbk6tj+shbrABqt9FzK3mxOuPEJC4FqVrtP5USV9pYtT0MRe Ur9ejROnRIsqPk89WlG6oNRQqtEQk9HJ3ieQJCuHJQgA0Nw9NJmpgJlP3QlBFx6Tu2ni l1+8PWDw/cCVUXxUaOqgryBj2VffFSI03Q8i0/yvQj4snVMbfdr3Nhsa+xsZrVzLOeNP YkKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZAJvKrninoDXi86yNb6pa5/NGflGIWCBcmCsKqBF7oE=; b=XVCvh9q/ktyh1yGJjUQjNXRxNPer7kz6Un/4WXmJxZu/BipWqLH+qYepdVa5nLq639 ZPffWAVvWQW1C8fHC+MMAMKaHYGzJymOyCGDl1pEiB3+n6WWu22/uo295ybqCCprBfmY s4DZ2fjosH5AX9jsg8reSqF528nFG/txxWd7SGQahFGyhRszPos53L3yGnvgxJNVlrHr o1UTNl+60wVRbAgcIqIlY80JzSIeRLDXuHche3Rwi8cwxppKn8/Lnp6kYmUPTSeLRO7z xUbY+silL8FQA0DkljIvkJQZ0IPvqxGUnT41L4xnbZb7ZrGsb83D3Z72AgCck4IwMcKT uRVw== X-Gm-Message-State: AOAM533ascIFHkJi4qSOgXZ2DiQUCM8QbCnZ7TwtDRIw0h0LIRf0+kX1 1Kg4jF1FdzJlYPsPBx+e0HM4SAYhp2yPNQ== X-Received: by 2002:a63:88c7:: with SMTP id l190mr10485873pgd.438.1629317981121; Wed, 18 Aug 2021 13:19:41 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id x13sm619621pjh.30.2021.08.18.13.19.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 13:19:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 07/16] tcg/mips: Allow JAL to be out of range in tcg_out_bswap_subr Date: Wed, 18 Aug 2021 10:19:22 -1000 Message-Id: <20210818201931.393394-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818201931.393394-1-richard.henderson@linaro.org> References: <20210818201931.393394-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Weaning off of unique alignment requirements, so allow JAL to not reach the target. TCG_TMP1 is always available for use as a scratch because it is clobbered by the subroutine being called. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 4019c22f3c..c65c4ee1f8 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -585,8 +585,10 @@ static void tcg_out_bswap16(TCGContext *s, TCGReg ret, TCGReg arg, int flags) static void tcg_out_bswap_subr(TCGContext *s, const tcg_insn_unit *sub) { - bool ok = tcg_out_opc_jmp(s, OPC_JAL, sub); - tcg_debug_assert(ok); + if (!tcg_out_opc_jmp(s, OPC_JAL, sub)) { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP1, (uintptr_t)sub); + tcg_out_opc_reg(s, OPC_JALR, TCG_REG_RA, TCG_TMP1, 0); + } } static void tcg_out_bswap32(TCGContext *s, TCGReg ret, TCGReg arg, int flags)