From nobody Tue Feb 10 07:57:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542985798093839.1885001992446; Fri, 23 Nov 2018 07:09:58 -0800 (PST) Received: from localhost ([::1]:52884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQD5b-0006N4-UL for importer@patchew.org; Fri, 23 Nov 2018 10:09:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQCj1-0000EB-M9 for qemu-devel@nongnu.org; Fri, 23 Nov 2018 09:46:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQCiw-0003Xg-5p for qemu-devel@nongnu.org; Fri, 23 Nov 2018 09:46:30 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:46584) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQCiu-0003Rv-MR for qemu-devel@nongnu.org; Fri, 23 Nov 2018 09:46:25 -0500 Received: by mail-wr1-x443.google.com with SMTP id l9so12570617wrt.13 for ; Fri, 23 Nov 2018 06:46:22 -0800 (PST) Received: from cloudburst.twiddle.net ([195.77.246.50]) by smtp.gmail.com with ESMTPSA id p74sm10339630wmd.29.2018.11.23.06.46.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Nov 2018 06:46:20 -0800 (PST) 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; bh=hZUCxApR4j0ObPvqrCHsopCtmT5xOXmakkLY1hrC/Hk=; b=jMvyyhaphe8ow49+KZIp3sK5IJCWA7NwPJeCGmw94pNxqomexsLUNXwVspLXqGGM9M /6flI1CK3//66zUG7y40aAM07gK2+9mn4OXroLCPDHJNVw6Uzr1HMrcNe4dHJ8A83RDh KfaKJu+Mb2ym8+Xc+e+4bSQbJXD3FlyIyCvQE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hZUCxApR4j0ObPvqrCHsopCtmT5xOXmakkLY1hrC/Hk=; b=Za25MyzFh2RUHO8tq39zDG6lXspgRznfiNdaxoRC+WmGDZiabVbpO76G3YmkDVef8/ uEwwKEvdaYZGgI9/vzhqwd3emQSjFyTPweAQdMkVtA4hj9AccbREaQV7MUdQdbPEVVpv 8btV425JzCJC9IopwEvOCkaVLm+z1BRaiCQCk+1wIb7BOFAkmo0btrkPhRDeYvA8w5lK ltSNYs8DWHgQEfMMC0cOin5xGRGMKugOnSwifvliYI+D2DGS2kBuHFU/TyhOVdPuknw2 /tuEjnnFnc38ch7/Evld9weLZyX4eGzM2bp7O2n6ISrGsM9YnItT6CfHPfFTKxLVvmF5 sFjA== X-Gm-Message-State: AA+aEWaP1/MArgswnrUnCE6DlVuZrrE9Z9NrOCfyV1/iwJxQnhVUZlar 5fGCOstMBfRvqloMMxlYsPrhgLW39pNQ2g== X-Google-Smtp-Source: AFSGD/UPhYW311dm3Vdtv+JEYjsJdJ6SFrt/X7BDLj8LR4pvPYtC81ggxGEN9TDnIsbCstj011h55g== X-Received: by 2002:adf:f984:: with SMTP id f4mr14472801wrr.234.1542984381291; Fri, 23 Nov 2018 06:46:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 15:45:42 +0100 Message-Id: <20181123144558.5048-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181123144558.5048-1-richard.henderson@linaro.org> References: <20181123144558.5048-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH for-4.0 v2 21/37] tcg/ppc: Split out tcg_out_call_int X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair.Francis@wdc.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Pass in a LK parameter, allowing us to create tail calls. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index 6e656cd41e..6377e3a829 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -1408,7 +1408,7 @@ void tb_target_set_jmp_target(uintptr_t tc_ptr, uintp= tr_t jmp_addr, } } =20 -static void tcg_out_call(TCGContext *s, tcg_insn_unit *target) +static void tcg_out_call_int(TCGContext *s, tcg_insn_unit *target, int lk) { #ifdef _CALL_AIX /* Look through the descriptor. If the branch is in range, and we @@ -1419,7 +1419,7 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit= *target) =20 if (in_range_b(diff) && toc =3D=3D (uint32_t)toc) { tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_TMP1, toc); - tcg_out_b(s, LK, tgt); + tcg_out_b(s, lk, tgt); } else { /* Fold the low bits of the constant into the addresses below. */ intptr_t arg =3D (intptr_t)target; @@ -1434,7 +1434,7 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit= *target) tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_R0, TCG_REG_TMP1, ofs); tcg_out32(s, MTSPR | RA(TCG_REG_R0) | CTR); tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_R2, TCG_REG_TMP1, ofs + SZP); - tcg_out32(s, BCCTR | BO_ALWAYS | LK); + tcg_out32(s, BCCTR | BO_ALWAYS | lk); } #elif defined(_CALL_ELF) && _CALL_ELF =3D=3D 2 intptr_t diff; @@ -1448,16 +1448,21 @@ static void tcg_out_call(TCGContext *s, tcg_insn_un= it *target) =20 diff =3D tcg_pcrel_diff(s, target); if (in_range_b(diff)) { - tcg_out_b(s, LK, target); + tcg_out_b(s, lk, target); } else { tcg_out32(s, MTSPR | RS(TCG_REG_R12) | CTR); - tcg_out32(s, BCCTR | BO_ALWAYS | LK); + tcg_out32(s, BCCTR | BO_ALWAYS | lk); } #else - tcg_out_b(s, LK, target); + tcg_out_b(s, lk, target); #endif } =20 +static void tcg_out_call(TCGContext *s, tcg_insn_unit *target) +{ + tcg_out_call_int(s, target, LK); +} + static const uint32_t qemu_ldx_opc[16] =3D { [MO_UB] =3D LBZX, [MO_UW] =3D LHZX, --=20 2.17.2