From patchwork Fri Oct 27 16:58:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117375 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp989844qgn; Fri, 27 Oct 2017 09:59:34 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rxr6XWUeqD3fbvtMsPboSKjkVTkiKa6JqgaIc7yAgAlh6Rfk+2GfeJTZUhpuc9YVuy5iy0 X-Received: by 10.37.130.10 with SMTP id q10mr770083ybk.53.1509123574641; Fri, 27 Oct 2017 09:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509123574; cv=none; d=google.com; s=arc-20160816; b=aXj9+NZGvGz2pHSmCgqhXSckbL2ddFonXOZT5xPLt4msnRFTOgzsfgJ9TQjpiAFr5u oBOkV8Y03Z26rqPq3JF/mWVYjNY7rHMYmZg5Nt0bXvYhiNZGjYKXCQTWn63CDha5DHMa lFQx8vRtRhJlKXMUjDJl/RwPKc+oMeiUXJIUXkstrk3K7PLkmRs71G0bUKucThXAR+n9 tMk5KgqslE5qLf9kohjLeWKQ8m5Fn8zAs3h6nw+8aCEOJfCs/ASz6japn1a7+eNFz5h6 hNvlenxR/L4hjp1tvxXICpnkH8XOi7JjRDGienQMdB+5hpo9nYUiCt1cHFeInH5eG1F0 t9rw== 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:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=HgQha+/GYr/f3hAw8yVD3Vd8qJUJjgCb4ON+gN2+k5Q=; b=pOq26uu37jaCubWGP5SibmsFIHm8j61lLuRMW/sfQjFSmuikE84oTeqmo4AHVuX/Fq hB1cBY4tNVmlsl7jkCU/tIEFRlCixSrJAcSZSwL4CmF/3GZb7kzY3rF8y3MwqWadtzqM okeCQ5hGOmQUwB/Nanb20QxSNOrBAOb5L8yzChiEUnTs3dt2oIgNZQSn5Qo9ttezTm7l mug/LZUw/J52E4qYuWOGEhv895ypon8f7NPNKZsuCWw8vNArZDHexocEOSA5mfbpAdtn OeQujJu/l5i5EFlXk8RScakeuAAHTIVKdA4KnNMJV5fZiH1C0ajWMeG7JsHfyoSoBw7W tToA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ijubiLC7; 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 n82si1287779ywc.54.2017.10.27.09.59.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 27 Oct 2017 09:59:34 -0700 (PDT) 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=ijubiLC7; 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]:58315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e87yo-00089l-5X for patch@linaro.org; Fri, 27 Oct 2017 12:59:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e87xn-0007ly-A3 for qemu-devel@nongnu.org; Fri, 27 Oct 2017 12:58:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e87xj-0001hY-5w for qemu-devel@nongnu.org; Fri, 27 Oct 2017 12:58:31 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:53722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e87xi-0001W5-Td for qemu-devel@nongnu.org; Fri, 27 Oct 2017 12:58:27 -0400 Received: by mail-wm0-x244.google.com with SMTP id r196so5028858wmf.2 for ; Fri, 27 Oct 2017 09:58:26 -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; bh=HgQha+/GYr/f3hAw8yVD3Vd8qJUJjgCb4ON+gN2+k5Q=; b=ijubiLC7d75eF6Bgn0MuGI9F//Uy32Ps3gNqBidno27EtSYdwLJ9csMAcSnrhTkwNk 84jaUPqQEwtXUUOs5Jd5MhzCndoEXPMgOW1HMsDnzaRSMvFJDMLgyvjkbqZMET9IuaRs pBUR7gFm028KlGky2qR9U43eK2L9W1kgidSt4= 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; bh=HgQha+/GYr/f3hAw8yVD3Vd8qJUJjgCb4ON+gN2+k5Q=; b=eRe1wGXQNoAXP9qX2aMkcxvTQeVKEA5d2ZLYqqDuyeV883fvPr+y/JnDYCcTPbU0cV VRoeHLlSafWdIvkDC9kg5bu3wgLUQim/80jOVDwh70/SAaUqlHZqenuLZB9sVnOCHDrY 4QeLsg/WI7J2uLxnmlVDKeXA+qXnbdtX1hKc/pIkJmvUz7IiFq3FjD762KZcIp9fOtcp W8B57PY522/aoUzFta4m2QZiJXDvwfakklrYokCqDXXeZSNC0QFX88sRM5nEZrS2xdRE VPnxu4SoLTN4KQNX/fbEEzARwSJDW1RvCUw6qsIBlOxczVZLeRCGbjvqBmHh9njdRIjG E8fw== X-Gm-Message-State: AMCzsaXA1wtOOKQB4J1IVQ26U9xs2M0eWPct6x53g7PY3jxxXFXlUnGF WP9tb+StOItjiCrwGBujs5kDhyAI/7o= X-Received: by 10.28.214.134 with SMTP id n128mr1042042wmg.59.1509123505098; Fri, 27 Oct 2017 09:58:25 -0700 (PDT) Received: from cloudburst.twiddle.net ([88.208.109.142]) by smtp.gmail.com with ESMTPSA id v35sm5588510wrc.13.2017.10.27.09.58.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Oct 2017 09:58:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 27 Oct 2017 18:58:14 +0200 Message-Id: <20171027165814.29122-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v2] target/ppc: Use tcg_gen_lookup_and_goto_ptr 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: Richard Henderson , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson --- Rebased and updated for changes to tcg_gen_lookup_and_goto_ptr. --- target/ppc/translate.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) -- 2.13.6 Reviewed-by: Daniel Henrique Barboza diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 998fbed848..4075fc8589 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -3419,7 +3419,7 @@ static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) } /*** Branch ***/ -static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) +static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { if (NARROW_MODE(ctx)) { dest = (uint32_t) dest; @@ -3441,7 +3441,7 @@ static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) gen_debug_exception(ctx); } } - tcg_gen_exit_tb(0); + tcg_gen_lookup_and_goto_ptr(); } } @@ -3479,7 +3479,7 @@ static void gen_b(DisasContext *ctx) #define BCOND_CTR 2 #define BCOND_TAR 3 -static inline void gen_bcond(DisasContext *ctx, int type) +static void gen_bcond(DisasContext *ctx, int type) { uint32_t bo = BO(ctx->opcode); TCGLabel *l1; @@ -3543,26 +3543,19 @@ static inline void gen_bcond(DisasContext *ctx, int type) } else { gen_goto_tb(ctx, 0, li); } - if ((bo & 0x14) != 0x14) { - gen_set_label(l1); - gen_goto_tb(ctx, 1, ctx->nip); - } } else { if (NARROW_MODE(ctx)) { tcg_gen_andi_tl(cpu_nip, target, (uint32_t)~3); } else { tcg_gen_andi_tl(cpu_nip, target, ~3); } - tcg_gen_exit_tb(0); - if ((bo & 0x14) != 0x14) { - gen_set_label(l1); - gen_update_nip(ctx, ctx->nip); - tcg_gen_exit_tb(0); - } - } - if (type == BCOND_LR || type == BCOND_CTR || type == BCOND_TAR) { + tcg_gen_lookup_and_goto_ptr(); tcg_temp_free(target); } + if ((bo & 0x14) != 0x14) { + gen_set_label(l1); + gen_goto_tb(ctx, 1, ctx->nip); + } } static void gen_bc(DisasContext *ctx)