From patchwork Mon Oct 23 16:09:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 737248 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1610489wrl; Mon, 23 Oct 2023 09:10:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqKHIYDSC+Qii3g3rOwFpDNuCbnebodd5tdJDd2jvtmq6lbOg56iGmLlrVzGki0zddySCb X-Received: by 2002:a05:620a:16b2:b0:76c:b53b:8702 with SMTP id s18-20020a05620a16b200b0076cb53b8702mr10263152qkj.26.1698077428683; Mon, 23 Oct 2023 09:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077428; cv=none; d=google.com; s=arc-20160816; b=GXaNO7eQbc26vPOxB3g28V5C4viHcFuDh1f10RWJtjsEa1f1vlsb2vseyUCiotZIRi 3nnJfy2m6F/Mif7lo9trT1DF7h95DWV9T5xgxTz2Aihh37hLG4qiHbYvfhACMFcFb9YD vP4R+K0p83Kf7IA7DUKXEDKQY/+C4/9ReDSBYiBtfomk83NUfu4ebYpXuQVmfJqG9FEd QNck9flGu/bMHUVY6MRmIMqaicynPD04cO+NYCtwt6XOw0/HLUTBBIC5SUkKHK54sJjT cJg+RuFimqTJQv0B28ctKMM8vr9cmMQFQsy6NtQQzAbZ4PBZBKs1DhssNbNuUx3bDRnF Sb0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=8a0cqsCGdNa/FVNQ7i0Dpa2jV5zig3Jd7dUxY5CgLJ0=; fh=uqdCd7Ktv1N43/CmHR6SlSTvkDXnOwQLQkOPKQ2deEk=; b=PdNSAiXbX7WKpUhLfcXNbn29j0e5SP6eBi7jo5OLsozDQhAvjZPI9C911v4CmmN7si yPmzZBDCAuSMRGmny98F9JCmB8ic5KhxBiiODLE0xgIB5l7LgKhDUe18h3HkNkbvodaI 9MqvI+RHIngjRwh9x6othh3uhKhAFfnZU+eJpJZzUPBnnIvpPd3LpT3JP1XoqIzJd8zy FZ+RTtlRDjn4M/PF/2w5UM6YPBz9ubEO22PRkxLqS+35eeWkK6fv1TjkbJhb0WRA1tC6 lEVsHJe/eF5z/61Elqxi9bJ6x/fchitdwh/fPi0c7DX7jqhV6j+5UYAh+poLVxNycANS NPSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=esmlNCo7; 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 bm27-20020a05620a199b00b0076d7b5dd4bfsi5952445qkb.302.2023.10.23.09.10.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:10:28 -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=esmlNCo7; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quxV9-0000jR-MJ; Mon, 23 Oct 2023 12:09:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quxV7-0000eH-LS for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:09:57 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxV5-0001Mg-JV for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:09:57 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c509f2c46cso50021621fa.1 for ; Mon, 23 Oct 2023 09:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077393; x=1698682193; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8a0cqsCGdNa/FVNQ7i0Dpa2jV5zig3Jd7dUxY5CgLJ0=; b=esmlNCo74KiK6pc0pPmajfHttryXqH8NHoYVmPkD5NzTftfPWgNqympn1XH3ZbE1/K rtF2pl/vWMMQhSVLeYPeBN+Fu1+Gw84onZGJ2u67XJNMuuNTiIYjT8h6QLbAunt2D6QH 2JrIUnNv3kew29mkVkIqldQPXqRV4TiDDSKfqyYKHX7cMSk+fp8z5xQ2kkn9CCLU3CWe lxKo58NODfAlo8wG48GUOd9H3xEIJNBPb1wvQVU0pJwV9HYhupwgJ7ijRO7dnPsmhb/K zkIcUWjuTc4qNvaNyfMxiCYOyOK98wtRcAfo3tQhrtBZa4MeU+mGx0c0ozHXPh0rCJ2p zr9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077393; x=1698682193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8a0cqsCGdNa/FVNQ7i0Dpa2jV5zig3Jd7dUxY5CgLJ0=; b=EncpHdR0PKUkjRqyZNAcocWsBvKUdqQCmV0jjgzyLXokJ2saKLpduBLgJgJFAn9fbB VYh3QjS2kILbqA0dJeeYrk3a2XVly0SByfcIT9s03EsCMuNKS3LemjGZR96o98g262/7 MKvodQnNJGKSB3jXzn+bBLQffel0cstbKflz73vhX9uw9s3ko/a64279ZSMCe5hGHsWt lnQBJ/YUw/00vw0a60ZRS5CHbYr2hNpizXtD7kFcgUrshZBsDLmUT5a1nmGh8AI3p0Jc 4N3WTBe/4EryUXT8AZ8Qo/Ct2O/kLkpC01Ty5DS73OITLeRvQiha6OZ3rixrxw3TTEKW PiSQ== X-Gm-Message-State: AOJu0Yxd2NiPnQM0lUfK792sPTrIo91jByU0KIIWiruHrC/l0mWnwooZ 3+r3rTSBNRXBx6oUIrXQfSpGr0q89Oinu0Uy0Ss= X-Received: by 2002:a2e:88cc:0:b0:2bf:fab9:db28 with SMTP id a12-20020a2e88cc000000b002bffab9db28mr6446746ljk.6.1698077393355; Mon, 23 Oct 2023 09:09:53 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-216-159.dsl.sta.abo.bbox.fr. [176.170.216.159]) by smtp.gmail.com with ESMTPSA id r9-20020a05600c35c900b0040839fcb217sm9936034wmq.8.2023.10.23.09.09.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:09:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Rolnik Subject: [PATCH 1/9] target/avr: Use tcg_gen_extract_tl Date: Mon, 23 Oct 2023 18:09:36 +0200 Message-ID: <20231023160944.10692-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023160944.10692-1-philmd@linaro.org> References: <20231023160944.10692-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Inspired-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Michael Rolnik --- target/avr/translate.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index cdffa04519..52fa7cebf6 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -223,8 +223,7 @@ static void gen_add_CHf(TCGv R, TCGv Rd, TCGv Rr) tcg_gen_or_tl(t1, t1, t3); tcg_gen_shri_tl(cpu_Cf, t1, 7); /* Cf = t1(7) */ - tcg_gen_shri_tl(cpu_Hf, t1, 3); /* Hf = t1(3) */ - tcg_gen_andi_tl(cpu_Hf, cpu_Hf, 1); + tcg_gen_extract_tl(cpu_Hf, t1, 3, 1); /* Hf = t1(3) */ } static void gen_add_Vf(TCGv R, TCGv Rd, TCGv Rr) @@ -254,8 +253,7 @@ static void gen_sub_CHf(TCGv R, TCGv Rd, TCGv Rr) tcg_gen_or_tl(t2, t2, t3); /* t2 = ~Rd & Rr | ~Rd & R | R & Rr */ tcg_gen_shri_tl(cpu_Cf, t2, 7); /* Cf = t2(7) */ - tcg_gen_shri_tl(cpu_Hf, t2, 3); /* Hf = t2(3) */ - tcg_gen_andi_tl(cpu_Hf, cpu_Hf, 1); + tcg_gen_extract_tl(cpu_Hf, t2, 3, 1); /* Hf = t2(3) */ } static void gen_sub_Vf(TCGv R, TCGv Rd, TCGv Rr) @@ -810,8 +808,7 @@ static bool trans_FMUL(DisasContext *ctx, arg_FMUL *a) /* update output registers */ tcg_gen_shli_tl(R, R, 1); tcg_gen_andi_tl(R0, R, 0xff); - tcg_gen_shri_tl(R1, R, 8); - tcg_gen_andi_tl(R1, R1, 0xff); + tcg_gen_extract_tl(R1, R, 8, 8); return true; } @@ -845,8 +842,7 @@ static bool trans_FMULS(DisasContext *ctx, arg_FMULS *a) /* update output registers */ tcg_gen_shli_tl(R, R, 1); tcg_gen_andi_tl(R0, R, 0xff); - tcg_gen_shri_tl(R1, R, 8); - tcg_gen_andi_tl(R1, R1, 0xff); + tcg_gen_extract_tl(R1, R, 8, 8); return true; } @@ -878,8 +874,7 @@ static bool trans_FMULSU(DisasContext *ctx, arg_FMULSU *a) /* update output registers */ tcg_gen_shli_tl(R, R, 1); tcg_gen_andi_tl(R0, R, 0xff); - tcg_gen_shri_tl(R1, R, 8); - tcg_gen_andi_tl(R1, R1, 0xff); + tcg_gen_extract_tl(R1, R, 8, 8); return true; } @@ -2020,8 +2015,7 @@ static bool trans_LPMX(DisasContext *ctx, arg_LPMX *a) tcg_gen_qemu_ld_tl(Rd, addr, MMU_CODE_IDX, MO_UB); tcg_gen_addi_tl(addr, addr, 1); /* addr = addr + 1 */ tcg_gen_andi_tl(L, addr, 0xff); - tcg_gen_shri_tl(addr, addr, 8); - tcg_gen_andi_tl(H, addr, 0xff); + tcg_gen_extract_tl(H, addr, 8, 8); return true; }