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);