From patchwork Thu Jul 8 21:37:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 471343 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp675939jao; Thu, 8 Jul 2021 14:43:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxJBP6G6SuAfHwbCuA14dFiXZra2/L1HufgQJFCfyOtFEc+uXRb0ybpu/FcKvbqYQ0BP3C X-Received: by 2002:a02:c986:: with SMTP id b6mr6353859jap.37.1625780612972; Thu, 08 Jul 2021 14:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625780612; cv=none; d=google.com; s=arc-20160816; b=P+fli8BDg+wYpYqwxIalo+vZBhVDPKIjwNhTcPUH0m06igdX4lagB/oUOsbdMlIQCh LdB2xJe31qoKtgJ7Psurd+z+YRv/IEGtcKKVzbc3AUAqcFUdenQrv3sA16eaAs6c/u2W 9j8aaOyNCj/WBT7drfjU8NqxHTUcbyTLpYe2gS2WFK0UhC3Vk0iuFUW6lBHukVC8HIu2 cUebzP/ft3zfowwwTHZCyuTfWLAIs/ZMWn3SEkhQGhbE+J0oMvu8uvo16LHQg6DW977N KTzCNheOTTzo9HJSzMkPtok3Dxc0H8CxewMGlwE2fYubjKiWEMQ7vGPnU44YW78ldIO+ oVaA== 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=YI+k1eDoSKwErLE0nkT4pwOAj5SV9AI2zjTOQ0y/Zv8=; b=jGybcKOUNeJUkhdRowCDwV00zY/y+k/rQ0L7W9Kj8fUfPMvEfbKAbwoESqRgAfizZF M2G9V64iZH9o1upbJDlDhUogScSBR+QyXhlgzeKQ1Zn+mNMOh+RJDzA8Mntku8bM7jqE 8nCirmnfhzPHCVW8bibXPhcQ67GIEaHtrDztVacOLKP6itCz4DFBgK8EhCI6A6YBRJ66 zgIgDsTud+83VldcIM7JrLUVQdIQnFFyFqHd/4MOCcZvb+A1ZdS5arz7I82Zsr+TpZRU rnLqhIrSjkPWl7407gXp7M+G7D4Hl7Ksnr6x6LNw6aQVURlTNC+0AFM88hvY7zwYxUMQ Un6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lmzBocxv; 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 g5si3268002ilb.152.2021.07.08.14.43.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 14:43:32 -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=lmzBocxv; 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]:53970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1bnw-0005qY-EG for patch@linaro.org; Thu, 08 Jul 2021 17:43:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1big-0008Qt-Ly for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:06 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:46751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1biY-0008LN-4r for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:06 -0400 Received: by mail-pg1-x52a.google.com with SMTP id w15so7732123pgk.13 for ; Thu, 08 Jul 2021 14:37:57 -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=YI+k1eDoSKwErLE0nkT4pwOAj5SV9AI2zjTOQ0y/Zv8=; b=lmzBocxvevDSY0OTN0mZZ5wg5Un1YYty6ezpRhfp6Cen7PSVuOCQGoOgEJStMxUjPJ 6rxw3iQh/ohEzsMpaW/yeskDPbbkCYZd/T5P2q/+fTj6ceVkM7fypZLr0FbI4y9u3cyP kngRJM44khlf9ulyQgKNK8MgE9nlhxqw9fmO3Bwzwtx2mmjBomW/rZHnrU7ubGBj902g /YOCYCoP8561+Bvoj9VLqtWjl7OPZBVJBGPzxJ3DbrYilRhKJwRNVjn5XMLkoiRUMRqD X4RRjFEU3SYUPgF53gOWcE37yBc2JYmeWL99D8/kfeRjAuWzUTHz89JhYYr7yNUkhoPP rw5w== 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:mime-version:content-transfer-encoding; bh=YI+k1eDoSKwErLE0nkT4pwOAj5SV9AI2zjTOQ0y/Zv8=; b=l7nEeemo0MHv0b+u83evOmqtlvzInXEMZbZ0nR754iwqSBqn648XjsSZIEsYQ3uLRb 7bHuerqMJrWcVMuVc4EtMDGWd+tGJJvD3d6nuS+sLaJuH61I9nFWldQMdDlFSk7hqokt x3cS0cR/+qXPS7YMcWJuG7ne3LVnWmV6VsNeIzYWDCozSaGFh3CNRtkrDkFX21V6GOIp 2iEtCAhFSz/Y6+tQIXzLodwAlxmMtn03EPm/pB9s0dCz+xjlYerZ/bcM3aJUuRHDG+kA CldA20x5v7i8xh896TeNEA1O6SfJinmrJxL1MCV0mYsSpJ0ihCR4zszUtov9WLMTpLZl WGpw== X-Gm-Message-State: AOAM531ZeCE4Lxq3voj3ADzCYjAM0lXAYVrMrSbu10p3pnMOiAhLHsr6 WCqIE2X7LBpGsdJdTpzdaDfSO/D6Iz18Lw== X-Received: by 2002:aa7:848a:0:b029:305:a6bf:f8ea with SMTP id u10-20020aa7848a0000b0290305a6bff8eamr33867433pfn.20.1625780276618; Thu, 08 Jul 2021 14:37:56 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id g27sm4322800pgl.19.2021.07.08.14.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 14:37:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/4] target/openrisc: Use tcg_constant_* Date: Thu, 8 Jul 2021 14:37:51 -0700 Message-Id: <20210708213754.830485-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210708213754.830485-1-richard.henderson@linaro.org> References: <20210708213754.830485-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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: shorne@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Replace uses of tcg_const_* with the allocate and free close together. Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 42 ++++++++----------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stafford Horne diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index a9c81f8bd5..1e437d2f9d 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -130,9 +130,7 @@ void openrisc_translate_init(void) static void gen_exception(DisasContext *dc, unsigned int excp) { - TCGv_i32 tmp = tcg_const_i32(excp); - gen_helper_exception(cpu_env, tmp); - tcg_temp_free_i32(tmp); + gen_helper_exception(cpu_env, tcg_constant_i32(excp)); } static void gen_illegal_exception(DisasContext *dc) @@ -539,13 +537,11 @@ static bool trans_l_extbz(DisasContext *dc, arg_da *a) static bool trans_l_cmov(DisasContext *dc, arg_dab *a) { - TCGv zero; + TCGv zero = tcg_constant_tl(0); check_r0_write(dc, a->d); - zero = tcg_const_tl(0); tcg_gen_movcond_tl(TCG_COND_NE, cpu_R(dc, a->d), cpu_sr_f, zero, cpu_R(dc, a->a), cpu_R(dc, a->b)); - tcg_temp_free(zero); return true; } @@ -633,15 +629,11 @@ static bool trans_l_jal(DisasContext *dc, arg_l_jal *a) static void do_bf(DisasContext *dc, arg_l_bf *a, TCGCond cond) { target_ulong tmp_pc = dc->base.pc_next + a->n * 4; - TCGv t_next = tcg_const_tl(dc->base.pc_next + 8); - TCGv t_true = tcg_const_tl(tmp_pc); - TCGv t_zero = tcg_const_tl(0); + TCGv t_next = tcg_constant_tl(dc->base.pc_next + 8); + TCGv t_true = tcg_constant_tl(tmp_pc); + TCGv t_zero = tcg_constant_tl(0); tcg_gen_movcond_tl(cond, jmp_pc, cpu_sr_f, t_zero, t_true, t_next); - - tcg_temp_free(t_next); - tcg_temp_free(t_true); - tcg_temp_free(t_zero); dc->delayed_branch = 2; } @@ -814,44 +806,28 @@ static bool trans_l_adrp(DisasContext *dc, arg_l_adrp *a) static bool trans_l_addi(DisasContext *dc, arg_rri *a) { - TCGv t0; - check_r0_write(dc, a->d); - t0 = tcg_const_tl(a->i); - gen_add(dc, cpu_R(dc, a->d), cpu_R(dc, a->a), t0); - tcg_temp_free(t0); + gen_add(dc, cpu_R(dc, a->d), cpu_R(dc, a->a), tcg_constant_tl(a->i)); return true; } static bool trans_l_addic(DisasContext *dc, arg_rri *a) { - TCGv t0; - check_r0_write(dc, a->d); - t0 = tcg_const_tl(a->i); - gen_addc(dc, cpu_R(dc, a->d), cpu_R(dc, a->a), t0); - tcg_temp_free(t0); + gen_addc(dc, cpu_R(dc, a->d), cpu_R(dc, a->a), tcg_constant_tl(a->i)); return true; } static bool trans_l_muli(DisasContext *dc, arg_rri *a) { - TCGv t0; - check_r0_write(dc, a->d); - t0 = tcg_const_tl(a->i); - gen_mul(dc, cpu_R(dc, a->d), cpu_R(dc, a->a), t0); - tcg_temp_free(t0); + gen_mul(dc, cpu_R(dc, a->d), cpu_R(dc, a->a), tcg_constant_tl(a->i)); return true; } static bool trans_l_maci(DisasContext *dc, arg_l_maci *a) { - TCGv t0; - - t0 = tcg_const_tl(a->i); - gen_mac(dc, cpu_R(dc, a->a), t0); - tcg_temp_free(t0); + gen_mac(dc, cpu_R(dc, a->a), tcg_constant_tl(a->i)); return true; } From patchwork Thu Jul 8 21:37:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 471339 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp672890jao; Thu, 8 Jul 2021 14:38:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnFbFof/EhvfSrVDivftLztUiWympYQfBvdjqbqwR20aWK4V7HhsNj8rZZ1wBvLSQ8LgAJ X-Received: by 2002:ac8:5794:: with SMTP id v20mr8242496qta.17.1625780319949; Thu, 08 Jul 2021 14:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625780319; cv=none; d=google.com; s=arc-20160816; b=c/W/fq4CK8AbRqx0cVsBBPZp0N9SLs2jgKKiv2NLTGUgLZL8ehxyPRvC/K2SmlWLH8 j6CuEW8Pk04kbJL6OlikaOYFyrmf61s7GK9W2KOq8hYA14Ovw2gCYzD3cr9KXXHQMma3 jWGwAfLKJbzjdsat9u9pcIPktiPoNaz8q7h3rFIvdYZQ0YLGFR4sMduSNYfnJ9uBfIrm 73MDnz+pnzl36UUWMkkYf/6Qtoh31sGc/t16OWOkYLr1U0INBHz4ta9oEV+LePAq6rTM ZkihCn530heLbPLD+1fZGBhSBd0u8TYUF+DBu2QGnMk13smcAjd+dQq3yYeVQURQwZM4 Wa1A== 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=asfzam4uxshAkMTtphuDnwfvWVKH3o+9edCCgJ8GjhQ=; b=myj/W2ZQ6QFOeyzlI+T7Sx0c/zPT/CdkgCzXfa/svxkTjWLbp5sVOPYMDsOr5Rx+BW JflBs6VjkuPqbduQ11frJDDDPiYBgWWfdHJ3WW6fOjXrBOofuhUe0VqQdZFIEnzzmgUI PbHevyVNr+5AiJi3HAk8NlEbOuSe0tsCRYGpuVBLv34XJSAYL+a1hgRrKdn/6e2HKcvf 4QpwtfY/wQe+oVTdXCzb6Cy76CQC6SBDBZ5kCGWkvZDbMoyzIMcJ7TMnjfi7j8pxIY2L Ooxo0Zshiq9MdzL3Bac6sMH1q6b5fqBgInGxkff3vhSNAaKUufXn0z0pnYyZTXubooFf tbsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mhOiG8Xs; 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 f11si2873802qtv.339.2021.07.08.14.38.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 14:38:39 -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=mhOiG8Xs; 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]:45286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1bjD-0008Qy-9K for patch@linaro.org; Thu, 08 Jul 2021 17:38:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1bia-0008PY-SB for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:01 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:41524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1biY-0008LQ-NR for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:00 -0400 Received: by mail-pl1-x632.google.com with SMTP id z2so998335plg.8 for ; Thu, 08 Jul 2021 14:37:58 -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=asfzam4uxshAkMTtphuDnwfvWVKH3o+9edCCgJ8GjhQ=; b=mhOiG8XsljiOmtR8hr7vS8Mio9HzTexa/asLGDfTkCTr0VlzwYb6LwoaP9BIdBDdIA c9gk3aNSUdG4Tw2urYklIg2tspXW/1pwPRQojB3tbPTgX1/MDkb6/U8FOTVnG0mXDO0q wnhTHL7x1gEQHk7vTNRbtoYeg1hh/njae1zEjDpVZGh67Tz/m4FnEu4d8rMmOxP0qq+K lmzRmD+XEr9/OX52OQJEZqQIVJ4ZyEp15zddIxf6u8DeCF1E1ZwnsSlxgYI8bzjPrVkz Yrt9lPAMxnworgEXEdscRPXGqjYAxpM7Jqi6ZZ7nqk21fR5gaqwSC3P/9WiMXp00aVDW xjVQ== 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:mime-version:content-transfer-encoding; bh=asfzam4uxshAkMTtphuDnwfvWVKH3o+9edCCgJ8GjhQ=; b=oYYyLabzUOw3eAcCTI6bjNXivALuvlf/LoTW55zeEQ4ad2WS7dsHbGggihKRY24b2u GpXgWEtkqiebIHACZye9wlqZwXWRFKB6Q2z5FrU3E6UccKHn5RA9vQ80fWwd4hpKLzVO DeTLtMLPLPBKyKeZ325Cbvioye3hyGiYsbK/J5P1dyxnUfiSBWqENXfRDK0gx/R9Xpsl QZpnwwzy8yPSJmRX0UsEISQ+lcAXJuO5ixwOoNuFLNnUEI48lMBRUFUoQWnJVZyj6b4Q Qu1APka2kNblv3z03c7FjkAVNjTcua78thjh5xonRJvnohxVJ5scbir84jL5DjXxE6rC 44gA== X-Gm-Message-State: AOAM530I4azGNjqweAg7YSY2d/mLC1kAd4qQ+KHjNz9QwcPot8gtRTUT MvpUKnpWu42ZG4Auy6BgV6nIC/J3lHnnHw== X-Received: by 2002:a17:90a:ec08:: with SMTP id l8mr9771317pjy.68.1625780277218; Thu, 08 Jul 2021 14:37:57 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id g27sm4322800pgl.19.2021.07.08.14.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 14:37:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/4] target/openrisc: Use tcg_constant_tl for dc->R0 Date: Thu, 8 Jul 2021 14:37:52 -0700 Message-Id: <20210708213754.830485-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210708213754.830485-1-richard.henderson@linaro.org> References: <20210708213754.830485-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: shorne@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The temp allocated for tcg_const_tl is auto-freed at branches, but pure constants are not. So we can remove the extra hoop jumping in trans_l_swa. Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.25.1 Reviewed-by: Stafford Horne diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 1e437d2f9d..96df513fd3 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -733,12 +733,6 @@ static bool trans_l_swa(DisasContext *dc, arg_store *a) ea = tcg_temp_new(); tcg_gen_addi_tl(ea, cpu_R(dc, a->a), a->i); - /* For TB_FLAGS_R0_0, the branch below invalidates the temporary assigned - to cpu_regs[0]. Since l.swa is quite often immediately followed by a - branch, don't bother reallocating; finish the TB using the "real" R0. - This also takes care of RB input across the branch. */ - dc->R0 = cpu_regs[0]; - lab_fail = gen_new_label(); lab_done = gen_new_label(); tcg_gen_brcond_tl(TCG_COND_NE, ea, cpu_lock_addr, lab_fail); @@ -746,7 +740,7 @@ static bool trans_l_swa(DisasContext *dc, arg_store *a) val = tcg_temp_new(); tcg_gen_atomic_cmpxchg_tl(val, cpu_lock_addr, cpu_lock_value, - cpu_regs[a->b], dc->mem_idx, MO_TEUL); + cpu_R(dc, a->b), dc->mem_idx, MO_TEUL); tcg_gen_setcond_tl(TCG_COND_EQ, cpu_sr_f, val, cpu_lock_value); tcg_temp_free(val); @@ -1602,7 +1596,7 @@ static void openrisc_tr_tb_start(DisasContextBase *db, CPUState *cs) /* Allow the TCG optimizer to see that R0 == 0, when it's true, which is the common case. */ if (dc->tb_flags & TB_FLAGS_R0_0) { - dc->R0 = tcg_const_tl(0); + dc->R0 = tcg_constant_tl(0); } else { dc->R0 = cpu_regs[0]; } From patchwork Thu Jul 8 21:37:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 471341 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp673275jao; Thu, 8 Jul 2021 14:39:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz65CkL4Bv6YDspMuWdUC8m9OP0PvaJWaKXWx7eLw+Gjsf4cwse0GsQERkAdTZPZVlrDL+E X-Received: by 2002:a05:6214:250f:: with SMTP id gf15mr32095408qvb.17.1625780355999; Thu, 08 Jul 2021 14:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625780355; cv=none; d=google.com; s=arc-20160816; b=xt+HD47+M7VQP6TOmzoAq82HiQKCGgofyIRC/VFmp1eIfl+AW3kAtQRPRBn+xeA/iJ /egMdThPaMQDnnlhtONC05k/h7knu8ffrjYJRGPOutuwNVpIZ1OCZeatJS08RyOH1Et0 pyiF0HzAVvSaSlAH4M2uf8Z9WpSmNboBeR1h/0S9ZWfRYs8QibP0exlTGu6OVI5K0W+o uI7jVSogLADm/vd2y3a+Yfrsab8vtIoH/vNAoawNI1ros1odHWVMdSNHm7m+uKSLajCN EfZiP9xLybzPGixOpG91ii+RWWS6dY2rrrTa5bu3BLq5J+C8gRLaZDG55dUBA3+mRLjq NA1Q== 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=Kl6JnE7xohFEPb4Uv6igXK9acm2oRLRWePiQGSpIWy4=; b=yzKkBqwIP5OKVKZ2NEuWEiVxFFUkykcb3ML5CCZ0vCFb5hCnJZ96BEtSHe3OF1LwxV YI5Ij5B6zD3no5t7LXCFi/bG8uu7RJrAmLSUt0xfg5cD/LOyFP8913o0swoc3eQpjU8S eiGTREpetW6Cv7STrnhElgp1UtxdZdu0+egQbzPlLvrLmtTDtlxnOUgr4jIMJ/4z2QHK tI53l53F3dQzbKS2vggq378yV+8Ky6evnw2eoLrSbu2oOi8Rd0SuTzzwLYW1z9/8pJHX DVELCf+wIJiVJe1Yiwxld7KVFR3PriXT39T983h5p5TiAM20LfzcjIiL+sW0OQ74y9CU tPaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tyIOlqKF; 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 t11si2532784qkg.335.2021.07.08.14.39.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 14:39:15 -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=tyIOlqKF; 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]:45276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1bjn-0008Qf-Eh for patch@linaro.org; Thu, 08 Jul 2021 17:39:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1bib-0008PZ-C5 for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:01 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:45627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1biY-0008LW-Tq for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:01 -0400 Received: by mail-pf1-x434.google.com with SMTP id q10so6753456pfj.12 for ; Thu, 08 Jul 2021 14:37:58 -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=Kl6JnE7xohFEPb4Uv6igXK9acm2oRLRWePiQGSpIWy4=; b=tyIOlqKFHNiQ3qDfZ+BfKFbFyuhmaA2T+sVffHQvfZoEv7iVXeFKd5uYuzXQnB8v6L rD7rD65ESGk0zRdZonAApD00cqPVKYeVjRYBHauqfNyi0ogrpOjgN+D6xnK9L39JlWG8 8hjoapyrEEOJzRhhpXIrOfpx4N3NaGm+c6+HYFu6j3ckUgesXpLlntW/08GSsyeFBxWw gRzcmX3HQ6BLkHRFIU8mC/rqugA/NTz5cREsLm3Vn6dN7WpJ3p8CXB+wuCkEyGEgADs7 UBdat+nVT1ovbKKhBS1RdtdqFdLR8yxGPV0ATAdl4+gBF6diTaxhLh0y/HdtdqjLsqPx nQwg== 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:mime-version:content-transfer-encoding; bh=Kl6JnE7xohFEPb4Uv6igXK9acm2oRLRWePiQGSpIWy4=; b=cUpE7PNXIyOd7u5X/jIP0I+XqIPE9CVHJTuePOWSWHY+HeGPHa9BC1ttgLGVW2IHIS BmRcZamqTmjMbX9BbzKKZgV+UGVgALird6FqnCCaE5jgHekARdS9/7+St1X3vw8ejnyT emlis860pqoXOkd0/K57Ph7meJWsQrxFKuX09QKA4gS6vcBdygLNMUE5yQEy3jxUwJlS sJfjG+UDOx0bFcXArUrhGS7Me3BffInnbP6WIH95k3KJAnPPBkErg0xBAZulQrKcphLq FI12kHeWwH+hj6h+jgG6lcMxhm2ug7DP4+89OrLHitEFHywJH4ytK9/gcPf4rvHEULXv lNJA== X-Gm-Message-State: AOAM530GZ+VdRx2K0GT4D52AIXB3XvpmSawMo6GF3ywWQC8GOjtwBabq 3fbBuuiGDvidkeandZoOM8WdYFxn1HmD4g== X-Received: by 2002:aa7:8158:0:b029:301:8d0b:3d09 with SMTP id d24-20020aa781580000b02903018d0b3d09mr32995086pfn.48.1625780277694; Thu, 08 Jul 2021 14:37:57 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id g27sm4322800pgl.19.2021.07.08.14.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 14:37:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/4] target/openrisc: Cache constant 0 in DisasContext Date: Thu, 8 Jul 2021 14:37:53 -0700 Message-Id: <20210708213754.830485-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210708213754.830485-1-richard.henderson@linaro.org> References: <20210708213754.830485-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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: shorne@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are virtually certain to have fetched constant 0 once, at the beginning of the TB, so we might as well use it elsewhere. Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stafford Horne diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 96df513fd3..3d86bdffaa 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -53,6 +53,8 @@ typedef struct DisasContext { /* The temporary corresponding to register 0 for this compilation. */ TCGv R0; + /* The constant zero. */ + TCGv zero; } DisasContext; static inline bool is_user(DisasContext *dc) @@ -537,10 +539,8 @@ static bool trans_l_extbz(DisasContext *dc, arg_da *a) static bool trans_l_cmov(DisasContext *dc, arg_dab *a) { - TCGv zero = tcg_constant_tl(0); - check_r0_write(dc, a->d); - tcg_gen_movcond_tl(TCG_COND_NE, cpu_R(dc, a->d), cpu_sr_f, zero, + tcg_gen_movcond_tl(TCG_COND_NE, cpu_R(dc, a->d), cpu_sr_f, dc->zero, cpu_R(dc, a->a), cpu_R(dc, a->b)); return true; } @@ -631,9 +631,8 @@ static void do_bf(DisasContext *dc, arg_l_bf *a, TCGCond cond) target_ulong tmp_pc = dc->base.pc_next + a->n * 4; TCGv t_next = tcg_constant_tl(dc->base.pc_next + 8); TCGv t_true = tcg_constant_tl(tmp_pc); - TCGv t_zero = tcg_constant_tl(0); - tcg_gen_movcond_tl(cond, jmp_pc, cpu_sr_f, t_zero, t_true, t_next); + tcg_gen_movcond_tl(cond, jmp_pc, cpu_sr_f, dc->zero, t_true, t_next); dc->delayed_branch = 2; } @@ -1595,8 +1594,9 @@ static void openrisc_tr_tb_start(DisasContextBase *db, CPUState *cs) /* Allow the TCG optimizer to see that R0 == 0, when it's true, which is the common case. */ + dc->zero = tcg_constant_tl(0); if (dc->tb_flags & TB_FLAGS_R0_0) { - dc->R0 = tcg_constant_tl(0); + dc->R0 = dc->zero; } else { dc->R0 = cpu_regs[0]; } From patchwork Thu Jul 8 21:37:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 471342 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp674737jao; Thu, 8 Jul 2021 14:41:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGdGEtvVBoqJF2m/8ZspvGaYvGlGGtbY0E6/1ZjExOnTz9TTMhYGFbWGH7JhPsrQIFb/nG X-Received: by 2002:a05:620a:ed6:: with SMTP id x22mr16505778qkm.70.1625780480572; Thu, 08 Jul 2021 14:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625780480; cv=none; d=google.com; s=arc-20160816; b=V4+nFB1j0fSKt24/Urxb8LJKJ7U2wm83jDVQsbTedHR3PFNvaUfgrzOYPruxp7mmh6 dcWRTyiE4Qec0TH16vOSSBSj3mwfga27Ze+lyC4gicG173Luz1vuq01PJptzSHHB36Wy QoJi7UUwky7tBThpQmNBlIt1LO9+iD3yzyNkEC35cFogwd2JuLegUwvdHezg1M6aeuO6 meH3oko522n/MAZ0a2obuSNEe95Aatk8afCt9d+LqJlvfS3pl22TA9JivBbEgBT1PgJ/ W7wpAd7Y7E5iBg8h3J0AyqAvDqKenaPKcvbDWktnPy+EcNZEp+1K9cdZQY7TWfaFQm5o h/Jw== 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=7ItSyYsGQ9A8At3Pt+haqUSVGcYkHH5NFOEM/YPqhl0=; b=rIOeiY3DAJXwN6uIvFjMjVAXSS5E2EqGgJqg/NsS8iyvpYo5n/Ye6TRsNQyZwRtBg7 Zp7K4zRLZghWbhRL+8QjraFxlxW2TcEo1ZvWr++slKBmarsKHdDbf5dE1K54PUbp5k0x Naw1DiKHmx0ApONJ2LdPlBAcrxMezYsA01WR98KQodLEJQflNr5n0HGDszAymCberB+A m9VxsLKi12RW8hQLnwud9LD1UwBJ1DeL+l9NfGxLGt4TtHcDGA8TkTc42GcL13PIrisO OQW5Ew9GKXqsoqCEFdc9d9l6IY6VFCOP0T1rvkoPPT723Zm3vEAKRhlz5ZA7ouUcfXUT v7XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ho224I1n; 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 g15si3553425qko.214.2021.07.08.14.41.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 14:41:20 -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=ho224I1n; 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]:51768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1bln-0004IF-WC for patch@linaro.org; Thu, 08 Jul 2021 17:41:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1bic-0008Q4-Bi for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:02 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:41871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1biZ-0008Lb-NS for qemu-devel@nongnu.org; Thu, 08 Jul 2021 17:38:02 -0400 Received: by mail-pj1-x1035.google.com with SMTP id oj10-20020a17090b4d8ab0290172f77377ebso4882021pjb.0 for ; Thu, 08 Jul 2021 14:37:59 -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=7ItSyYsGQ9A8At3Pt+haqUSVGcYkHH5NFOEM/YPqhl0=; b=ho224I1nZOS/iV0YylE4vpvOiCk3UgV6gZnYgP0jyY8NpPgkGfImIJ0o5dNlxt5qeb +XAoansdFcFnSzmAiYZF5WIb9Xu7S2JL+GvXdAczDILG3cJJ4ZvOYN5AwZ+0mCT0t9hQ 2b2XLS1ywtwuEGiTai2gWRit5X6w66l7qO+eAZX6SRiJdOSe8OGLG8/kCT4wmvADUx8W t/vcwiegkp/pK6vlZYe5qkbKErAOWmMeJuJGkt5HjFGevZ8h2N6Sj9snz+UODsMMOTd5 +G9ASXLgLxcylz82jsstjBrI19GSX7A19GKzXS0HXmbv/Z5lL5HRzty8CMdGeoN5Vn5K C1Jg== 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:mime-version:content-transfer-encoding; bh=7ItSyYsGQ9A8At3Pt+haqUSVGcYkHH5NFOEM/YPqhl0=; b=fiyzDaySa+b1hZDy7aQoWyJ2yjr7MZ1dmNwMRNjN7i0cgP3H737tTYht0RmaChmCA5 QR8hHLsYCsBK4pfcLX+XAfArJjv39lxgY6c+ihcexbJ7mMgF2VKsm1ulNt2N0242/dg8 Cl41syqgDlh43Y7Cflq4vrv987sc4yqm7OOKrCGke5rs38XYXsQetomuTBfM/GbMKMBe Zq4HMAI9QGnU//tgWH0Ttn8J8Scu43jR/tTu/J5xwZWSKXiPHcje6KB+5Csbvqv7I0iJ Wf9S/yyk4QGHq/kG3KSDvIoqbJ6CC5LfNej6PgwsPZ6ksIDnDO+HBUU80Cdw5bOWKvLd OJPQ== X-Gm-Message-State: AOAM533U/Kuwq+5nfuzki/ahq+uRzEjemctX5ffa5iLa5Oib7KnOss2r JjW3Z3sk48TGz+JTm25bpylPR4EqS6/7qA== X-Received: by 2002:a17:90a:420b:: with SMTP id o11mr33272029pjg.201.1625780278246; Thu, 08 Jul 2021 14:37:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id g27sm4322800pgl.19.2021.07.08.14.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 14:37:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/4] target/openrisc: Use dc->zero in gen_add, gen_addc Date: Thu, 8 Jul 2021 14:37:54 -0700 Message-Id: <20210708213754.830485-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210708213754.830485-1-richard.henderson@linaro.org> References: <20210708213754.830485-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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: shorne@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We still need the t0 temporary for computing overflow, but we do not need to initialize it to zero first. Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.25.1 Reviewed-by: Stafford Horne diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 3d86bdffaa..3425fd881e 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -200,10 +200,10 @@ static void gen_ove_cyov(DisasContext *dc) static void gen_add(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb) { - TCGv t0 = tcg_const_tl(0); + TCGv t0 = tcg_temp_new(); TCGv res = tcg_temp_new(); - tcg_gen_add2_tl(res, cpu_sr_cy, srca, t0, srcb, t0); + tcg_gen_add2_tl(res, cpu_sr_cy, srca, dc->zero, srcb, dc->zero); tcg_gen_xor_tl(cpu_sr_ov, srca, srcb); tcg_gen_xor_tl(t0, res, srcb); tcg_gen_andc_tl(cpu_sr_ov, t0, cpu_sr_ov); @@ -217,11 +217,11 @@ static void gen_add(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb) static void gen_addc(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb) { - TCGv t0 = tcg_const_tl(0); + TCGv t0 = tcg_temp_new(); TCGv res = tcg_temp_new(); - tcg_gen_add2_tl(res, cpu_sr_cy, srca, t0, cpu_sr_cy, t0); - tcg_gen_add2_tl(res, cpu_sr_cy, res, cpu_sr_cy, srcb, t0); + tcg_gen_add2_tl(res, cpu_sr_cy, srca, dc->zero, cpu_sr_cy, dc->zero); + tcg_gen_add2_tl(res, cpu_sr_cy, res, cpu_sr_cy, srcb, dc->zero); tcg_gen_xor_tl(cpu_sr_ov, srca, srcb); tcg_gen_xor_tl(t0, res, srcb); tcg_gen_andc_tl(cpu_sr_ov, t0, cpu_sr_ov);