From patchwork Tue Sep 21 02:25:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514385 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2639732jao; Mon, 20 Sep 2021 19:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0OiMxhlT8R1T8gN9yTVLW9FR/hztNZLak+xwatQH+4zlLVvnxzBmOHbuo7ecLqBpmxxk+ X-Received: by 2002:a25:868f:: with SMTP id z15mr35426195ybk.338.1632191354773; Mon, 20 Sep 2021 19:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632191354; cv=none; d=google.com; s=arc-20160816; b=h+5j+Z0gBCvTGncqdKM3dDP59kwrKtyR359PZvTyALhh1ThOybndhDQYO9bPk3KWzO DjAhVY0E/j8VdvuBy8gqZavGsx2pW5dC434SCDRs83a56+LpfIdlFgbX9+9kKU0lfjNd aPhOKpuFuWYS/dGudUlliIkBe05XW2CbVIx2FE/cN4NTPmd123dteZ4btojI6aqprsuj BX0uz1dd5dJTNfgPd32gYLkdzjxe85W5McmSrlFhTHe7EPgbgki4k7HpXWA8UEmhoRzR ZnB40KELFEolYfv1lk45Ptu0TWERFDCnPEdKa5K++fVrFaS4OjZeb6GF02xmj2mgNGhZ vuWA== 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=M5odl7lhVWYI7jQ2rZz9eXg1u6cFbGrkar9AkgXAJoU=; b=F5PcNu5qxHCaGclH0dWVh0H6ie9tz5/zzC4XNRjw0PKLf8bqP4DdJTFth7v69w+7rO hROLgXJ3U03qnAiG+Q0A5XPWuSdHUkoKvbxi/Tz/BNmsiy2R0AHwcMvkkgoy6/Ho1A0j bfHfOUR0B1O+auo+KM3nWR2CooroTrO11OZrSfTzRfkR6pks6auMOmh8Ony/UnoI4uFq 3wNOY0as0s4loPJH8ux3PRGv+FwodAf5iA3glxttqjE+kJoYAgzHSFlUUBfsq665KM0F YEFf/t15Q0zKXiFdljySEvMfOx7stLYfpMNw6saUKK2Oib/L97coqvonN19zLsGfWFsa PS+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w8O98B47; 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 s145si17775148ybc.531.2021.09.20.19.29.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Sep 2021 19:29:14 -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=w8O98B47; 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]:39498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSVX0-0002e5-82 for patch@linaro.org; Mon, 20 Sep 2021 22:29:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSVTa-0005X2-7I for qemu-devel@nongnu.org; Mon, 20 Sep 2021 22:25:42 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:42905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSVTY-0006Fq-Dj for qemu-devel@nongnu.org; Mon, 20 Sep 2021 22:25:41 -0400 Received: by mail-pj1-x1030.google.com with SMTP id p12-20020a17090adf8c00b0019c959bc795so1422505pjv.1 for ; Mon, 20 Sep 2021 19:25:40 -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=M5odl7lhVWYI7jQ2rZz9eXg1u6cFbGrkar9AkgXAJoU=; b=w8O98B47eQENsPbH5ljBc2gmCujldqAOdOuocESNcQXqOXu3Pu65laxfHkfTgkglGs pcqLuRmzHNxq8Y/Gp3STekFod37bSPTivEc5KXphCFZbuEAGr/+G896pDoEKpr6nW7wK oAiJw9gYtIR9TUo4+zGR+GUUZL/qeHKNx6v8OsiaVkDmfaR39z8fKqs9u+4q9k9dFVEh AYgWI6MbVh4pRDPUx2L94kTbfabc2OR7Y9cBk07DftjD+yD043GB5JRpIXVBoit0brUG 7WPOmVv8cMfjOFSvP/w1EFs/yTRGhc2R6baDnunxbqGNorFX99pZEX67aR8uVQdaDZx+ Qh0g== 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=M5odl7lhVWYI7jQ2rZz9eXg1u6cFbGrkar9AkgXAJoU=; b=tAiTuzg12MsgQ84tqtZciHsuv/idKg0ICBFz8xBIMklz6MttpB4Qx16OfYJWpYV96X kOHJbzAXnEuhMD5BrRrK9Z+Uz4nd56c9G7OHGWJW6HEOJVnYi5kMvADZBzk/a6zxu3Gv LmeVIbJA+SUcUaozFguyya8y4UlunJrZnBjOMSt7gdim4KcSNiIokBH9kmpWXbVDGE/T kOuRMk7OhhmGxc4+3lY7KhpmjQjVdStOrnp12IYMYrKkWef0Nx35m3nWk0LmWy3/k0kK I5/1ybRIYFzbK+z180I81m6vtKCS3MQXc8ROTsqZLJCyKtiYL7fyUNBB3DuTGEJQSRWE Ptig== X-Gm-Message-State: AOAM532BvErUJ2lSiNQ0nJYJPYCFLZ71YMveO+tx0DjoXeddS/TIEcjU BG3lxnkEepof7IyQ8n2uHGq4LrubUXPxAQ== X-Received: by 2002:a17:90a:311:: with SMTP id 17mr2431398pje.121.1632191139162; Mon, 20 Sep 2021 19:25:39 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id n9sm15297621pff.37.2021.09.20.19.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 19:25:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/10] tcg/mips: Allow JAL to be out of range in tcg_out_bswap_subr Date: Mon, 20 Sep 2021 19:25:28 -0700 Message-Id: <20210921022534.365291-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210921022534.365291-1-richard.henderson@linaro.org> References: <20210921022534.365291-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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. Reviewed-by: Philippe Mathieu-Daudé 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)