From patchwork Thu Sep 16 15:30:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 512967 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1343206jao; Thu, 16 Sep 2021 08:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbktx180mJvVrEJCF3G+gOfdb1tUr+PuyBHBMHBdbMLFvEoNJcqpBmGQArLGHSsCGsJHXa X-Received: by 2002:a37:6147:: with SMTP id v68mr3117075qkb.154.1631807789828; Thu, 16 Sep 2021 08:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631807789; cv=none; d=google.com; s=arc-20160816; b=qlzZmpKSI3sCZt+wG/zDCoR2XhBAMVtOF/0vXcDshoi37gohFq31/fqw0sf4nmXVnb kDESR6qMQg+8RhAEH/JQYwa0MdGZF+YWFGW2tBicbaf49o3p5deN8heGtwutdk9PAUyi uDO8tLf6B31WQoikuTjhBXOSXpvBCP5pYxnW+0TFUJ+6tvSX3G0mp9dUozX87mcg1JpB rhEL+1Z3tlVMfvi4jfCbYVt198+S+u7fOMVdo4nTreIlejZ2trwl9In124UXrp7CcK0L iqCrYQ8BVfwYGmPruU8g9gRe/Wg2MRA8xCChdV7F84e16cTIjGGwCNqYL6g6cRqaiWIN FX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=boBYT/QiHeueJZHokksNQvqeAcOMVEQaXWz4csao3Kg=; b=gYT9JDKzYhQ3tYKkGLaHp+/Y7NaLZFAqIo8u9cSBhhL3ZOqNdYnlfjsfycgyEh3Mzz bk9QRf1tjmiqXmQrakKplsdfAuv/2+z9HQsPbHQq6/xePq2mr9jVbQ/La7imx1/mizzO hJQNCaerob6Fi/rmZbHLQSMpkChoEKccuYMeKzlMv5fBHua0J2kz2E0Yb6QJbuuxi2x8 GqmBqmeoevU0FW02A76Zmj3qf/+y6yyDMY6IkjWKKZpAKPvuC7jtzjNi00+ZCWczaCLW Qab1+a2RHFVnXsbsKam+mtWH5LZ8rlNM29I/wQLeMo1skD22S2Sa5+WDBFh3QNX+5L5C 7ixg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TZpfsdUU; 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 s5si2162137qkp.36.2021.09.16.08.56.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Sep 2021 08:56:29 -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=TZpfsdUU; 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]:42630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQtkT-0004FH-AI for patch@linaro.org; Thu, 16 Sep 2021 11:56:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQtLn-0001lW-Ia for qemu-devel@nongnu.org; Thu, 16 Sep 2021 11:30:59 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:42619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQtLf-0002eM-10 for qemu-devel@nongnu.org; Thu, 16 Sep 2021 11:30:59 -0400 Received: by mail-pf1-x430.google.com with SMTP id q23so4149690pfs.9 for ; Thu, 16 Sep 2021 08:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=boBYT/QiHeueJZHokksNQvqeAcOMVEQaXWz4csao3Kg=; b=TZpfsdUUSIg1OPfVjhAs+xnvlBPhlHTRlz0aqyDT+4B2+bpIcVg09ZIkUdOC9MWLdR LelQdWAK1nojTOzs7Z2FrQzo/cYJWXSF+YQgBvrdjuGzdb2CNN9T7D4oiMly0myFtBK+ ytGSerNPIOEW34H4cRNSMLCkIdhS2VKt3ijNqvkLWTD+3DuYvUWUlHSHW7GCqLynbTlv eQ/jb3FCsflgGP4r8IVuYmgnqTiftv+BFBQK4+n+46Gq8l5DqBvLZ+mkrVYV9EQyUrsO C8RSiAJPE1TtVFvlvTOw3nsbXquOuU9gi8rcUueTxtvsmxlPMhQN7moyDdYk/NG4mwl9 AubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=boBYT/QiHeueJZHokksNQvqeAcOMVEQaXWz4csao3Kg=; b=GZMX12+dVrTxZHc0sVhsqKYBeymPyZ1hL9tJbt1xm2RZ5mt+ID+kDNnTScpG7S9Wnz XzoLknexO3De/171i9xub2/RVpV35bML2WSE4WzwopVhDRJOCounX18NpLxcVv53OnsH 1eEEEKm3anZtKHSikOWeyhKNmelPK0+XJVrJJLUoGjhpJDg1wv6ERmYfhW16PaDvtbFW A8fTF+KOKehVCwYE63E8KsenK/RUiYTHKlYgm+EEa3RhONezVdtJreFJp7oTfxNGvYIu 7fUGlNv3YbL/d6XRHICMX/GgPk2la54+8T9hxgBtPwlIb8gDgBjofuFypdAg26g7sPnN XhIg== X-Gm-Message-State: AOAM530qKY3gTVO14n50Q55VbcJ4xIsDCVvkEPhFNxZFBHVQ6e6I+/7K U7ow7bQTYQMILymM1ZTAtZc80uj6BUVrrg== X-Received: by 2002:a63:c10b:: with SMTP id w11mr5553924pgf.228.1631806249237; Thu, 16 Sep 2021 08:30:49 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id b7sm3779447pgs.64.2021.09.16.08.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 08:30:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 33/35] tcg/mips: Allow JAL to be out of range in tcg_out_bswap_subr Date: Thu, 16 Sep 2021 08:30:23 -0700 Message-Id: <20210916153025.1944763-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210916153025.1944763-1-richard.henderson@linaro.org> References: <20210916153025.1944763-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: , Cc: peter.maydell@linaro.org 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 diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 320795a637..3a40af8799 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -573,8 +573,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)