From patchwork Fri Nov 23 14:45:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 151902 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2235407ljp; Fri, 23 Nov 2018 07:08:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VKeuVbGKylkXJjQx9zmw5cGWixIAgNRfwD5mfa8tcvZem4drmPhcB1/o+pQ0QwyYHBmOhr X-Received: by 2002:a0c:e789:: with SMTP id x9mr15138230qvn.245.1542985717522; Fri, 23 Nov 2018 07:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542985717; cv=none; d=google.com; s=arc-20160816; b=UCOZPdO+Jd6humF2liXvPW37+IpEN1pQaGXsKZpScVJJ6yd6hV9UMR1c8rmZ5iSWj9 bMP8CFuxR8V5nk4kPeDQ4Gohb6szZt6MIFfD5U4iu80WPKlM3+uX1GqyH9X8gRxxFo/d LTlAFgPkQU7gRXG9teFV1zW2iWUvsgaKvn3JZ0RQ9FY5WSkWhQDjMh1neVZt6GaRswbT K9Pu58Y7z95tbzj5fSMNn75Zzlvmgxj+3wrXiLaodV+995Q/GGyeZepfrvTw2Q6/KiPW LjtY8UaWt3kEGXSvQIryytytuu9MsgbZjaHNhpa5zb9+kduvE5Me5cX5BB8Pp4Lnc0qH /wxw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=hZUCxApR4j0ObPvqrCHsopCtmT5xOXmakkLY1hrC/Hk=; b=qkqIqKy7gVD7ejf29RIo9NHOrZS+6zGixD27Dc0kxvOjzkEKM51Nc/SurXLPaoCbDm ukLOvOF1UdnzWOHSeZPcPsUzAv1ph5xfap5aNUCiE81NBkvWhAN0n9Jx67gip1Ue7feN 2oK9YnTWetVWYyfEkbuE9y06LxwhkOx6RrBvxTSmiye4xByA6HpZpO85npX8MBn2ypm6 XxGzA0ef1Sjn/BuPUZ8MmGGEIDJlH/qAksCyBWWvs3wTmNojT6jLeFSyZipYo+pztUzg 05w8xTyMD7ditmhIPoq7wFFN4x7Qs3bYEjntinMbNH8FfrD4Pchw1i8NaEDScfpg8UN3 l1cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jMvyyhap; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r15si3293381qtj.56.2018.11.23.07.08.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 23 Nov 2018 07:08:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jMvyyhap; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQD4O-0005Ui-GS for patch@linaro.org; Fri, 23 Nov 2018 10:08:36 -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) 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-Received: by 2002:adf:f984:: with SMTP id f4mr14472801wrr.234.1542984381291; Fri, 23 Nov 2018 06:46:21 -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) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.2 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, uintptr_t jmp_addr, } } -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) if (in_range_b(diff) && toc == (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 = (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 == 2 intptr_t diff; @@ -1448,16 +1448,21 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit *target) diff = 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 } +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] = { [MO_UB] = LBZX, [MO_UW] = LHZX,