From patchwork Fri Jul 9 04:25:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 471788 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp953779jao; Thu, 8 Jul 2021 21:47:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKUywUUgP4rIk1YZY20ytSKmdL//VYMkrJM27bQvMGQeLAuHDyx5Rc+s3a3TPwSnnU4mY7 X-Received: by 2002:a67:1906:: with SMTP id 6mr32428315vsz.6.1625806061662; Thu, 08 Jul 2021 21:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625806061; cv=none; d=google.com; s=arc-20160816; b=cIosOMLMjoZ0eNVUrFkVSf3zolgNjivjTfV6jsWPanhYLnZuUeOirAArKof6CItcZZ bq9jpwEq1pjOgkJtRlp7uZpJOAi5gSayVRmsB0CNLokwYcQACZz4sfCTPhqoVGV17VxY HZ94hVen4b1681KSsdsNIIVNjKlzO5UYd7RdnAIn3zQoSFwq9QFJv44DxtzGSTsyg1ES L5G6rmPD8QzlR8EIS4tLz4MV3KhKUAbYYZpANBDJwGvdSbpAeQv9MXiZPqNAWT3g4aXL nkCiTqlBO6rl5OL7l/nrjwExDfV0T5AMH655/0en84TpFi+to/htvZx/r1N8N9xNk827 kd5Q== 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=xyZhbP2MZlS3npwt40wzKePMMUn3bMJXYN7FzSUZsjk=; b=uaMmBgy4En059TfnLRdQFI2fHEBJIqq3Z6F7Y6nxtcwsHQioxcC4XntlQNWMnkQtI1 Wp3Pn8wOpullrPf68G6Ucy3RrHSVy88oVHixTjeyaIEgmcdKgldGETOx9I3kp8Ki1S18 DihUz96uvpU+28gP5wMsSIbRLK2LHrtHwp3E5/qhft7P020VIwG+7JejBl+7BH5/Ii+h ioMW1gYdEK7cAOdlE2oKBX51dthMDfRl717CqvxCV4q04GOL6vyfPiRvD/M+FTtxRq/m fswHEzMCm5Gw0hr2bM0eGr09RuvrjcY7k4GTOOr/1MNJN2DjkoKP8dyIUQ2PRuFhTdoP Tt5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cZteOHr+; 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=fail (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 p18si4836135vsf.19.2021.07.08.21.47.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 21:47:41 -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=fail header.i=@linaro.org header.s=google header.b=cZteOHr+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1iQP-0006YV-3J for patch@linaro.org; Fri, 09 Jul 2021 00:47:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1i5q-0006Da-HS for qemu-devel@nongnu.org; Fri, 09 Jul 2021 00:26:27 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:44823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1i5d-0001UF-R6 for qemu-devel@nongnu.org; Fri, 09 Jul 2021 00:26:26 -0400 Received: by mail-pg1-x52a.google.com with SMTP id u14so8667184pga.11 for ; Thu, 08 Jul 2021 21:26:13 -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=xyZhbP2MZlS3npwt40wzKePMMUn3bMJXYN7FzSUZsjk=; b=cZteOHr+bvPu/BxKx1Yk14ZXKUUEiXfbuvgagIwzZ9hqoav5CX5zg7dThcmBGo36tf V20b0E/3qVpsIb0PrhtAxJnzcrYm24F7bDiwPfIYkoh7rODqcfwp4Bs+ONUVAt3uw00W JB4msXKUVQbaFtbBArQq4j4NjoZOTjemXN9CccCD+qz72qbuzonqiiyFXSGaGeYXteig 8EQOtQeyN/xtYCApsHPxngKXIGfSr/vCEkPgca+hxtB9qV0s7bnIgAcT8leosXEf9GFX THVMrpVT94ECvUpucLU0Y6dvoO1OW2BmkQzbpNBwjBr07ye1cmKDXK6rcpjT+RTpPbij oHfA== 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=xyZhbP2MZlS3npwt40wzKePMMUn3bMJXYN7FzSUZsjk=; b=Qmuu752zNnnR/FDjIhMEWrUz3h+ULf5wfi6LuI+4FnkeOxhvyf3Qj2i3qbwSZEbiBL KRLkP0eC8EjVZ5XnhpLF66kDBrlO4exiK4bxnEyEm2PMjWEryWW9ePjcRtsniqwclpqZ KJkqmmWbSG5CYA+m+ORcfEO53Z/8xwhChwGRs8CWTl+TaYRl2M1ew1vFalsCzZUjbST0 bGHmCS9GMZqQiw4JrcR04EbeZpn+7SNEuwNYgytOY+SfeV+AepRPOw8elgt+BNVVBt3J G+jjw1DTDRz4ZjEHa5O52RJjbPbqMiwXYOANK4CidMfr+PjXdR2/k4LFSYxhN2v8aYFs H6yA== X-Gm-Message-State: AOAM531HpuOuudBU8BzyGw3dsmtmG6b6RzU7dC3Xe1Rz2BOKHQ5meHRo vrMICieueZyPJxU+PKViQU2O9Q/QYW+VFg== X-Received: by 2002:a63:6586:: with SMTP id z128mr8861382pgb.446.1625804772713; Thu, 08 Jul 2021 21:26:12 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id y16sm4406727pfe.70.2021.07.08.21.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 21:26:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/17] target/riscv: Use gpr_{src, dst} and tcg_constant_tl in gen_grevi Date: Thu, 8 Jul 2021 21:25:56 -0700 Message-Id: <20210709042608.883256-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210709042608.883256-1-richard.henderson@linaro.org> References: <20210709042608.883256-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=unavailable 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: alistair.francis@wdc.com, qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/riscv/translate.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) -- 2.25.1 Reviewed-by: Alistair Francis diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 7dedfd548b..6ad40e43b0 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -620,23 +620,16 @@ static void gen_sro(TCGv ret, TCGv arg1, TCGv arg2) static bool gen_grevi(DisasContext *ctx, arg_grevi *a) { - TCGv source1 = tcg_temp_new(); - TCGv source2; - - gen_get_gpr(source1, a->rs1); + TCGv dest = gpr_dst(ctx, a->rd); + TCGv src1 = gpr_src(ctx, a->rs1); if (a->shamt == (TARGET_LONG_BITS - 8)) { /* rev8, byte swaps */ - tcg_gen_bswap_tl(source1, source1); + tcg_gen_bswap_tl(dest, src1); } else { - source2 = tcg_temp_new(); - tcg_gen_movi_tl(source2, a->shamt); - gen_helper_grev(source1, source1, source2); - tcg_temp_free(source2); + TCGv src2 = tcg_constant_tl(a->shamt); + gen_helper_grev(dest, src1, src2); } - - gen_set_gpr(a->rd, source1); - tcg_temp_free(source1); return true; }