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; } From patchwork Mon Oct 23 16:09:37 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: 737256 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1611238wrl; Mon, 23 Oct 2023 09:11:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGctRoKDKlk6CnLYEF0avwqR+wm2KIs+Sc8iye+ZjprvOoKIsJ1pc2N7bFozERDPjXw7pik X-Received: by 2002:a05:622a:130a:b0:417:b72a:7339 with SMTP id v10-20020a05622a130a00b00417b72a7339mr11799058qtk.33.1698077519510; Mon, 23 Oct 2023 09:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077519; cv=none; d=google.com; s=arc-20160816; b=ACQicKlsdbb8tAJjf+vHGbWqJaSsIc/fkjP7QoBztY9r5mpWiFPgEhZg2MU82KkA74 P4Q+c7I+L7RwrnbYycaqgLf75cJnRAbNEFSYRGfHQ4btWNmRlVMFncP3N6eirVgg78D/ 4TPOc3Pf8/I8pNXGLU8nFqzRmqXq9Yx18crFl+mt9S3pjqppo0OGMf2j4Rlx+Vn/ShV4 5c2EN8QRWeKEfb4o4tfph3PrJxrjF1iLfwv/5EzcAYBLIp5IPAcYsJsO82Csa+uFYp/M TEgViwCVOZQVHDhzF1eaXUFUwJi7X1dBWkqzxjgo4UWmo7gT7qZsZj1OR3EdtqqiURQA FV8g== 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=cGdMBoRQL+JhEHsdcrKM5twfzIuQtQkjsvy/D+szlAY=; fh=i7i5bSRYmkFTLFZshv8I1U4ONE1eHJkZdtnKlsW+DA4=; b=zVBen8NYMl1wlTAIvpRVyYKpbDXLFKX9GQ8fGFWT67yqPcPBNI/FFZgEIvMIOTcKIt yvWC5f9Tv6yOhmpZkfdHm7RWxP6+nCvbfhdQS+G+u03R5Byb4uPymWkm0LrUOM1rDj9M Zup6t+UPhel7r3vdUc13duR0t9f2Cp+VQ7/QgFD7q6HCRCDCEU4lPyhMG8LJR0dtkPD+ 4LLNJltcmqk/4fDkHP79yXIKt8YuY7jNL2CZBgw4QB6xWDQni+pKAdpEQJcW9bBNq3Ph 9ngE3xTsY30tKh0K3+DzhFBwnoWIH544T8iPwPDOjbztXxh/RVXtv6JaQicUB5Pxvv7/ XnMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=io+jAE0L; 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 o9-20020a05622a138900b00419767946aasi5797956qtk.113.2023.10.23.09.11.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:11:59 -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=io+jAE0L; 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 1quxVN-00011T-Q1; Mon, 23 Oct 2023 12:10:14 -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 1quxVE-0000tE-Cn for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:05 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVB-0001P9-SM for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:03 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4084de32db5so30010825e9.0 for ; Mon, 23 Oct 2023 09:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077399; x=1698682199; 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=cGdMBoRQL+JhEHsdcrKM5twfzIuQtQkjsvy/D+szlAY=; b=io+jAE0LqfVov+WFFIE6WQLSCa9u4YSJ/IkgNhGFg/B5gtt7wAWemIPvLKT4L/ZhcC TZtXrINht9NqgV6lcUHjPu2s7wO7voqSTfpBr8rXknXLMeISg9/tMfhfc2A3emnHucf4 I9nSiqIIgj0bt17ui+RBXKgTFGovpKKZfd1eCuYG7nLF0tH60wpHJRs0iztpUm6m/H2T GUiQ1rm2M6RfW8TwUuISoh91e6szQOTc0rqBFA6+pYfHG56F5tbquPt9gAjwboa7UHmD 8EmbBMwV01XKED+DuGs4gRQUVLDoRzoHkXMK92/0jcEObsIR7EA/QeJofTAtru9FvWTu lXgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077399; x=1698682199; 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=cGdMBoRQL+JhEHsdcrKM5twfzIuQtQkjsvy/D+szlAY=; b=E25cqtPnM4BfCuqYXCgFB8lbVIFobfQXg/Y3B2YzKTU3m05KBL/2AaNYATWFktvaHw GDqXcfLjN9OhVcwfT09wS/JIn0WVgKEMVZgTo1q8QqtWw0I1DREwgf/Y9iX4fQKJNeQq 2HRV1+GIJ+sy0aE2ExXrUYqlbbf1cEazd0DtmpvVVqEW+XRT3I1gmUu8TLOgGLw5qGnq /x1Kfugx1juTyT2zFMefw2ipPUhHrANyOf3kLhOp/vWWtUXeLMVazrHQIgQWX0Vl/mh3 +MqElrUHmo1SeRZVVvTOGJW+o4CWWrVkkYCt536tOKwd9qVVlF3ymwNmNbgMayrP6okV ealg== X-Gm-Message-State: AOJu0Yw6sAR45M/eLhm3Auh/GtIkXwiRRAxR/TcdBrA7kU1cQj1yFqJg g5Y1SPvN3OvGzILrzPN9j6vv0oyQF5sI43G1l/A= X-Received: by 2002:a05:600c:1c81:b0:405:458d:d54 with SMTP id k1-20020a05600c1c8100b00405458d0d54mr7748258wms.33.1698077399469; Mon, 23 Oct 2023 09:09:59 -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 o22-20020a5d58d6000000b003143867d2ebsm8077853wrf.63.2023.10.23.09.09.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:09:58 -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?= , "Edgar E. Iglesias" , Paolo Bonzini , Eduardo Habkost Subject: [PATCH 2/9] target/cris: Use tcg_gen_extract_tl Date: Mon, 23 Oct 2023 18:09:37 +0200 Message-ID: <20231023160944.10692-3-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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.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: Edgar E. Iglesias --- target/cris/translate.c | 3 +-- target/i386/tcg/translate.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index b3974ba0bb..65b07e1d80 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -871,8 +871,7 @@ static void gen_tst_cc (DisasContext *dc, TCGv cc, int cond) bits = 15; } - tcg_gen_shri_tl(cc, cc_result, bits); - tcg_gen_andi_tl(cc, cc, 1); + tcg_gen_extract_tl(cc, cc_result, bits, 1); } else { cris_evaluate_flags(dc); tcg_gen_andi_tl(cc, cpu_PR[PR_CCS], diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 587d88692a..25289eeec9 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1159,8 +1159,7 @@ static void gen_setcc1(DisasContext *s, int b, TCGv reg) if (cc.cond == TCG_COND_NE && !cc.use_reg2 && cc.imm == 0 && cc.mask != 0 && (cc.mask & (cc.mask - 1)) == 0) { - tcg_gen_shri_tl(reg, cc.reg, ctztl(cc.mask)); - tcg_gen_andi_tl(reg, reg, 1); + tcg_gen_extract_tl(reg, cc.reg, ctztl(cc.mask), 1); return; } if (cc.mask != -1) { @@ -1783,8 +1782,7 @@ static void gen_rot_rm_T1(DisasContext *s, MemOp ot, int op1, int is_right) currently dead. */ if (is_right) { tcg_gen_shri_tl(cpu_cc_src2, s->T0, mask - 1); - tcg_gen_shri_tl(cpu_cc_dst, s->T0, mask); - tcg_gen_andi_tl(cpu_cc_dst, cpu_cc_dst, 1); + tcg_gen_extract_tl(cpu_cc_dst, s->T0, mask, 1); } else { tcg_gen_shri_tl(cpu_cc_src2, s->T0, mask); tcg_gen_andi_tl(cpu_cc_dst, s->T0, 1); @@ -1873,8 +1871,7 @@ static void gen_rot_rm_im(DisasContext *s, MemOp ot, int op1, int op2, currently dead. */ if (is_right) { tcg_gen_shri_tl(cpu_cc_src2, s->T0, mask - 1); - tcg_gen_shri_tl(cpu_cc_dst, s->T0, mask); - tcg_gen_andi_tl(cpu_cc_dst, cpu_cc_dst, 1); + tcg_gen_extract_tl(cpu_cc_dst, s->T0, mask, 1); } else { tcg_gen_shri_tl(cpu_cc_src2, s->T0, mask); tcg_gen_andi_tl(cpu_cc_dst, s->T0, 1); From patchwork Mon Oct 23 16:09:38 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: 737252 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1610840wrl; Mon, 23 Oct 2023 09:11:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5fXNExsAQxp3zJsxEkRd1TBN1i7ssoBJhYyV8Pb2HDzyD1E2kIlnqVUyYXiHmCIjBCzRd X-Received: by 2002:a67:e1c6:0:b0:457:ce49:3bb9 with SMTP id p6-20020a67e1c6000000b00457ce493bb9mr7574946vsl.3.1698077469653; Mon, 23 Oct 2023 09:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077469; cv=none; d=google.com; s=arc-20160816; b=qgwEg6Q1GGvcNr9WJiihpUY6ZPf0S2gpheoXYA/iVKRzb1/8QuhEB1Wxu5K0bV30QJ e0qTQnV3RAEm9wVgl1y/Ewc5ZUhUbo1ICNTIKm2DD16En+HR201TmM7s8bvRp2OJhjpE yZfxAGgR3xoAEPKOBVQMRb5qbMCvKaNOzjPr10Zw2I+M0ICW8stw3pooHp9Pjo5sID8h RGYpGgT3YfP49RsAypDEavQbIjH+n8EqcGgoiZgy1zu1umoNqRbcuZUhZYc8kwEuUeCm /n+lvHWA2Lf2OFPdfheEFLFqXFlSEo6NogMdatU+U4qFZWU5oUxjw4YlvC4FWxY4P1af Ak5g== 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=oLtOMzuv0VPHT9a9CaWKn6byerFC4jGbzx/kTIVLUc4=; fh=gFnAV9pP5i83r7+1WKjVRXy5Pp6xcAGV1enn2AIoQa0=; b=mkRe1ZS6R/fa2J2br0JvHsIRb6PUZy99tP8kq1eG91yEBd19vparOsZbQ38du5Nd// yP8z+k6fTkr5XbJ3KaK4QbIMd7HKhYTNG2AYY2gFg2kFB3DhcMZaEMBV2RRtBeWlQDAC OSEbFp3epRlidU3h7l7FUY12OE5HcSdHR6YZCwomYIeui73L5/unYxUYYvOQJIwi2kGF KH41fJPOa0PkiQZccWRTs3ObNxoRWP4ul9sgORG+PlZu80ULuu/0TjVERxXtM9EzCB1I K/FcH9+PedD0muX++v4fhMqOVYAPGYlGrQHi7yjwxeiRat2V+7eJvTXIb3QlPVnIQucF l9Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lngf9Pmf; 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 p21-20020ab02a55000000b007a8911a5869si797256uar.89.2023.10.23.09.11.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:11:09 -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=lngf9Pmf; 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 1quxVQ-000164-52; Mon, 23 Oct 2023 12:10:16 -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 1quxVK-0000zp-Oa for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:11 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVH-0001dy-Ts for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:10 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4083f613275so28729795e9.2 for ; Mon, 23 Oct 2023 09:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077405; x=1698682205; 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=oLtOMzuv0VPHT9a9CaWKn6byerFC4jGbzx/kTIVLUc4=; b=lngf9Pmfuuj1TvMW0n1He+xaLJAT6ND1xi8ubpoCT0jVecp9EKyBV/eqiyW3eE7qn4 q0HaRLGUHyqurMeRNhoQZM73/RFjOmCTHsiewn4sasnq709HTl4k1JeMJl8oDpDRewmU hjSAhw5B+uV7Q/DqsQ4Yu++/5wJ9/lI05ydreY30h0UCy4/2oiAV4LZlrbByQX3A4BbL l2rsgL1e8bZ16jCWrhso3gmlftrMIZQdpJu6iJkua636FV2AkDw6ua5KkOU535zDocon 9Ww4e8cKGPRANz8pUciAxSYqmVIb6nNUxBnRhUyjrKvul80GeZ+LOmkNMgWXMLUW7ahT Ev+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077405; x=1698682205; 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=oLtOMzuv0VPHT9a9CaWKn6byerFC4jGbzx/kTIVLUc4=; b=RH+Eavog9lJEmyvvhXxpGWL+zfd3gFf8K6NVwVlC8nnJs/Dbl0HYjzwcetjuYCN0He B/+kKElKl5pLwm6Tckz1k8uXX8kuKEkBp0AMDsQKdUZ1pfPw94ohKgX/w4sUp+2xKp5s ejsyXOz5pRvX24syQFVOqBLhSWfAc1IYpkqgfSpBp7jDXL0CR3u3hLNKM5NURZhQ/tIj 6895dIC8RTYo8ZDtWivNghJ2EQVFWWWF2LYyCFOemwbLJJv2XhO0Tw0GcYsar+rrNnV4 lC9uj3lx5WMlVaBOpA7+Vbwfqbe7+aIjjkN7/D8kVGON7DneUa8raEUiboaqreGo5lk5 N22A== X-Gm-Message-State: AOJu0YxKHI6Fdm7phtvH8qtVmmrbgLyslHqDox63CLVBt0W7lfh+fWF9 v75KBT4XxN1wFTjbu1PUM24n7bzi8oxEIBL38f4= X-Received: by 2002:a5d:5c0d:0:b0:32d:ad8b:29fd with SMTP id cc13-20020a5d5c0d000000b0032dad8b29fdmr9502431wrb.11.1698077405487; Mon, 23 Oct 2023 09:10:05 -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 e16-20020adfe390000000b0032dab20e773sm8060112wrm.69.2023.10.23.09.10.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:05 -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?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH 3/9] target/mips: Use tcg_gen_extract_i32 Date: Mon, 23 Oct 2023 18:09:38 +0200 Message-ID: <20231023160944.10692-4-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::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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.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 --- target/mips/tcg/translate.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 13e43fa3b6..2586d9c85a 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1269,8 +1269,7 @@ static inline void gen_load_srsgpr(int from, int to) TCGv_ptr addr = tcg_temp_new_ptr(); tcg_gen_ld_i32(t2, tcg_env, offsetof(CPUMIPSState, CP0_SRSCtl)); - tcg_gen_shri_i32(t2, t2, CP0SRSCtl_PSS); - tcg_gen_andi_i32(t2, t2, 0xf); + tcg_gen_extract_i32(t2, t2, CP0SRSCtl_PSS, 4); tcg_gen_muli_i32(t2, t2, sizeof(target_ulong) * 32); tcg_gen_ext_i32_ptr(addr, t2); tcg_gen_add_ptr(addr, tcg_env, addr); @@ -1289,8 +1288,7 @@ static inline void gen_store_srsgpr(int from, int to) gen_load_gpr(t0, from); tcg_gen_ld_i32(t2, tcg_env, offsetof(CPUMIPSState, CP0_SRSCtl)); - tcg_gen_shri_i32(t2, t2, CP0SRSCtl_PSS); - tcg_gen_andi_i32(t2, t2, 0xf); + tcg_gen_extract_i32(t2, t2, CP0SRSCtl_PSS, 4); tcg_gen_muli_i32(t2, t2, sizeof(target_ulong) * 32); tcg_gen_ext_i32_ptr(addr, t2); tcg_gen_add_ptr(addr, tcg_env, addr); @@ -8981,13 +8979,11 @@ static void gen_compute_branch1(DisasContext *ctx, uint32_t op, tcg_gen_extu_i32_tl(bcond, t0); goto likely; case OPC_BC1T: - tcg_gen_shri_i32(t0, fpu_fcr31, get_fp_bit(cc)); - tcg_gen_andi_i32(t0, t0, 1); + tcg_gen_extract_i32(t0, fpu_fcr31, get_fp_bit(cc), 1); tcg_gen_extu_i32_tl(bcond, t0); goto not_likely; case OPC_BC1TL: - tcg_gen_shri_i32(t0, fpu_fcr31, get_fp_bit(cc)); - tcg_gen_andi_i32(t0, t0, 1); + tcg_gen_extract_i32(t0, fpu_fcr31, get_fp_bit(cc), 1); tcg_gen_extu_i32_tl(bcond, t0); likely: ctx->hflags |= MIPS_HFLAG_BL; From patchwork Mon Oct 23 16:09:39 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: 737254 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1610980wrl; Mon, 23 Oct 2023 09:11:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7uQannZMTtKPsZTtMb/qwoM42DaCrkLPdnT6L9Ifq8vcFMnLPwFMquhV+s6Snhj+b8dUN X-Received: by 2002:a05:620a:3f0a:b0:774:f7b:f0a with SMTP id tx10-20020a05620a3f0a00b007740f7b0f0amr8711947qkn.76.1698077486540; Mon, 23 Oct 2023 09:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077486; cv=none; d=google.com; s=arc-20160816; b=Yd2SjXqDrfteBmGGQ+g2RTAU8GxuoEkF0b0fBXuV4VZADM4Fq8TwlDhOweC7RcqJLJ IlKVfXdwnUeMD2fXCpP0VCGEPlBRf+Bwgg+U91H//G1Gv9WEKPVgr3hdFvm6w8M/mhiJ ll/YXULKlB57NwalDuIlXi9ou6iwREYb4/7q/KeJG4asHMk0m8dTXFiddQGRLMR19kel TSHEqSjMCywVFkaICouw9RyQYakHk3YdUm2FesSkz7hh8UR9VpjvfoVa3uQ8Y9VLgtpC iAJJ5/tDwV0r2vVNJFZBa9nkFJmP2tgVl0cHfwhvCzhqr1M50foPma+dXqjTKxGilHq+ 08iw== 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=2HdF9ypEYHp2YFU11iLO4WAj8FlGyWoVdlHbB5VsvS0=; fh=3AhLBgip2CWvqllKMHi2jwz7FSLJQCJrsVJb7G0MhAM=; b=Z3y2jAianfVG8biKIak5KoGiQSJxXglmIp/UkIsbY7EOEMLjhuqDaZHQr4lt6b2+R4 JkKtPDlsSYjxq1xXuFmMX8V2tRwKyXBm0KEtvTCqfmn1tR9R0C6VCxNRdPFfQq0j5Sue RYZoAF3sEfaldaa96pV5tKh9AZqPF0BEtBoD4wt7GnKM7ZO/ds7f7st3DTWP06jR7pF/ XOzfvRgK3XfL+iXAPOvsiXjeDBIrj8jEjgTPWfmzPUTSQJKybeP1lEHQthlehix1y8K6 gU+4hmDRsaoWhIir2gijA7vw4OE1SnnNNaXD1llZX/xopnmOg4dPs6sOc0mwlgBk8XRT SVwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=llbzwJRh; 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 s25-20020ae9f719000000b007770d8ed700si5515458qkg.460.2023.10.23.09.11.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:11:26 -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=llbzwJRh; 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 1quxVU-0001VC-N4; Mon, 23 Oct 2023 12:10:20 -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 1quxVP-00013s-2l for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:15 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVN-0001g2-Hj for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:14 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40839807e82so20266405e9.0 for ; Mon, 23 Oct 2023 09:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077412; x=1698682212; 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=2HdF9ypEYHp2YFU11iLO4WAj8FlGyWoVdlHbB5VsvS0=; b=llbzwJRhN0rWNp42KhzFR5sZcqcGxGCqtwmQRQ695q+QSfVHHsIs8efQHojJgnTo/Q UuocJSJ8Cun2Kaj5p6MzC/4ce5HaMufzY7c08Mnr62H7Gr6RAhGaULgYYxCcop+/LkKC SzuatCPXtEAjCqgUg29p0+f/imXWml6/LsbA2KpjET8rRL1Bg9vKpL80NRCpByGExW2P tTLlPhr+taHTqC8smOnO0Z28JnKfvM/euxGO3CLdbHs3I1WLqzxeSBzkZDH1NOHRXsZc JuG4INlAi+HIHPCWM0zWJSuMpD6XzBpiaoYq+mv4MmGF1+J4qyyr6T5T8rUlVDSadOIc +9Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077412; x=1698682212; 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=2HdF9ypEYHp2YFU11iLO4WAj8FlGyWoVdlHbB5VsvS0=; b=C9onkH3Y729UVgJL/3kKYy000IoOxRCTv9X9ZU7DxntDQ+sWLWM/NzHdV/dBAtIT49 /3IqTAlsLVoYWp7QSRNSjLkEUx2jC3beVk+H78O0RAA0GXYLhARPWvFttoIa6OaZRCPI BAU44n9WlObV4bbMlT9FKLsJ/Z254LwaBn8EOZargyzz184lBhWTvXbefKc01tHUnskL fbQvUCsUNq6E7mImbiDukTVR2FaVfyAJOEIpUR2VoBs+C6aGoHSY22nZH8jOG9jeWFXf XoWpz3cZG3rWEPdxMUhTZDxBYtRB8GoQf1ppzMUZ+R9mWi7fDYaAA5ioVPMgIej5DKXU YSyA== X-Gm-Message-State: AOJu0Yyu/+uaRctY4sVilaKBcW+Y2SDbv8/a7cNSGc3sKziX01AMpY0+ xcsYRdzx5crbOgH6Z6WarAiNEF7o8B6YZ9ejb/I= X-Received: by 2002:a05:600c:450d:b0:405:409e:1fcb with SMTP id t13-20020a05600c450d00b00405409e1fcbmr9962058wmo.5.1698077411797; Mon, 23 Oct 2023 09:10:11 -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 h2-20020a5d5042000000b0032d886039easm8064986wrt.14.2023.10.23.09.10.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:11 -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?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= Subject: [PATCH 4/9] target/ppc: Use tcg_gen_extract_i32 Date: Mon, 23 Oct 2023 18:09:39 +0200 Message-ID: <20231023160944.10692-5-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 --- target/ppc/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 329da4d518..c6e1f7c2ca 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -4802,16 +4802,14 @@ static void gen_mtcrf(DisasContext *ctx) TCGv_i32 temp = tcg_temp_new_i32(); crn = ctz32(crm); tcg_gen_trunc_tl_i32(temp, cpu_gpr[rS(ctx->opcode)]); - tcg_gen_shri_i32(temp, temp, crn * 4); - tcg_gen_andi_i32(cpu_crf[7 - crn], temp, 0xf); + tcg_gen_extract_i32(cpu_crf[7 - crn], temp, crn * 4, 4); } } else { TCGv_i32 temp = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(temp, cpu_gpr[rS(ctx->opcode)]); for (crn = 0 ; crn < 8 ; crn++) { if (crm & (1 << crn)) { - tcg_gen_shri_i32(cpu_crf[7 - crn], temp, crn * 4); - tcg_gen_andi_i32(cpu_crf[7 - crn], cpu_crf[7 - crn], 0xf); + tcg_gen_extract_i32(cpu_crf[7 - crn], temp, crn * 4, 4); } } } From patchwork Mon Oct 23 16:09:40 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: 737253 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1610981wrl; Mon, 23 Oct 2023 09:11:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFp/Hr9eNCwNn37fASZSHZw2icZ5s6MeHcDMsGT3Oj4EguMVC9mqRkeJ7Qva+HdwS8SG58o X-Received: by 2002:a05:6808:1a88:b0:3ad:fe8d:dfae with SMTP id bm8-20020a0568081a8800b003adfe8ddfaemr6866490oib.57.1698077486559; Mon, 23 Oct 2023 09:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077486; cv=none; d=google.com; s=arc-20160816; b=OV1JydC0Gz5CcyT8Oz74YemcUnyy/UNZBXbcyJmcdi+Eez8BG+XUeyjhzr3KJ0vo7o /0ceZQHye7LzUiYvsD2M7OtZYwvuvlno8wBBFNMc4MEESyq1t+2NiJXcVBfhT+L2mtNF PkGpVv60E+S3ZpePlTSOXsMbNFQCyuzbwMwyij8mBph3u3bdrTO0VJbuWkym+Vi+TA07 IQZa8FHXZBPwOg+kkcq7hb1gs2HG0sPtHY9LQlIYD0TQMoohtIBfdq8DXbqCeA3/NZD+ NQqdPgKcBaPFjmx4wi1wtf66La/TqdNnZSN1SLo+yrHNIfT86oweBm39gMAAbtm+qcTf Kc6Q== 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=4jeYU2eBThHCBIgCveuE9hS0ohpcPJOThHJUYhTifyQ=; fh=Cvht7PUShZEX/siyFI77eHC9GqIpxNDPxoPNDtPysxQ=; b=rmADc77J/776ZFEAPe+jyw6Ip0ciRuAiYDHYQBLe1vCyx93P8Set03WFvIqpVTsXq4 0NIus9/uGzcvAqpdUkFqV2zVSXS9ClKg+WZYJW1dmJGuzg3rYbOzxLGAADjqvsxS0jN1 9Cc/wHFzNKBCP1wmcg5tYbw9EH2LLWa5V/oAXQ9WKZGkY0exhlTjGTU3obNuodqPQwcU Vv+msOVf1fkJr88qFehIA5eEXka3pfrOnPQaCn+dKPedIyA3FgWFJQcb7lSOM5Bxh3lX 8+HDAzZbLFpVfcBjtQVHbF0Innkj6R8SBCyRxVX44Ur8f/5M7syvFoUiBueurQ5oDPLA kRxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uQCCgTyP; 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 dn5-20020a056214094500b0065825c392ffsi5695193qvb.398.2023.10.23.09.11.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:11:26 -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=uQCCgTyP; 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 1quxVW-0001eT-OX; Mon, 23 Oct 2023 12:10:22 -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 1quxVV-0001YE-HB for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:21 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVT-0001jv-RA for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:21 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2c5056059e0so52852331fa.3 for ; Mon, 23 Oct 2023 09:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077417; x=1698682217; 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=4jeYU2eBThHCBIgCveuE9hS0ohpcPJOThHJUYhTifyQ=; b=uQCCgTyPu082B/ZR6WJiUayNIuOSkqAGp1TpfMcI4yzoyXldu+yPt0zWj9+6qymAPV cyUfP2iJDe/+CDHfC4OrKHaQPHy/PWkE+5eKo53+gjuCirWpjh9UyabnrLyWzC4a8Icc EOJKapnfbgiSxgyZfkInpBbQrl9YpuQqE35C+TT5OYyiTgSZkH/wkpwy8w3GkcngAmqH 6d+9chaaXnwO1bJdjneTGVe+45bunSvW/BQwTgVF/tKSL+kdMfQcvyxS+znFFoacN664 +Ez27pIkZLCADi3FZYhUgRIIwEAYB9C3z+9Xqix0GZoRrVTBUuGfuWy/ivxpvWzsZD5H FysQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077417; x=1698682217; 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=4jeYU2eBThHCBIgCveuE9hS0ohpcPJOThHJUYhTifyQ=; b=PKLDhxHp4Dfm5bNBtUJ/UTOwWDiRlgMJPBy1K1+KKPg/Hc+kXqa0Taf+4oBmtoiBKB QpH5udKR+zVRIFjq21b5ktexLOS95D6uwwGOoqSud0BPuH70WC9mTOilZzpEdMfXHe+G Euf7V58/t0l8m4/7wXiTGOOSsfWUjwV0EF7Z5schb+YMDfCZ7hK5lwUoVIT8r9+73a2h zOP/gBirxAlGnrZ3yKooD2RDY7sScPbiOtKxryrGU5bR5rot9TsrpJ9gRLSW7CIXinrN icE+3PlAcvwd5SDYDVcLAPL4XbBXTkL2491YKCGTEY7/ZtCGU7I8Skr9jNro4P2d2kZK zENQ== X-Gm-Message-State: AOJu0YyMeGMNdL0/HfVGG0byEbVFPwtkYkcxuEMs8E/gEJM3pHqAB35e bHeU05YhGoURp4IO2iLvwIlaoB6jdEv4Kb0K6SQ= X-Received: by 2002:a2e:9396:0:b0:2bc:d634:2210 with SMTP id g22-20020a2e9396000000b002bcd6342210mr6100008ljh.16.1698077417688; Mon, 23 Oct 2023 09:10:17 -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 x10-20020a05600c21ca00b003feea62440bsm9586039wmj.43.2023.10.23.09.10.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:17 -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?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 5/9] target/sparc: Use tcg_gen_extract_tl Date: Mon, 23 Oct 2023 18:09:40 +0200 Message-ID: <20231023160944.10692-6-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::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.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.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 --- target/sparc/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index f92ff80ac8..16d9151b90 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -740,14 +740,12 @@ static void gen_op_eval_bvc(TCGv dst, TCGv_i32 src) static void gen_mov_reg_FCC0(TCGv reg, TCGv src, unsigned int fcc_offset) { - tcg_gen_shri_tl(reg, src, FSR_FCC0_SHIFT + fcc_offset); - tcg_gen_andi_tl(reg, reg, 0x1); + tcg_gen_extract_tl(reg, src, FSR_FCC0_SHIFT + fcc_offset, 1); } static void gen_mov_reg_FCC1(TCGv reg, TCGv src, unsigned int fcc_offset) { - tcg_gen_shri_tl(reg, src, FSR_FCC1_SHIFT + fcc_offset); - tcg_gen_andi_tl(reg, reg, 0x1); + tcg_gen_extract_tl(reg, src, FSR_FCC1_SHIFT + fcc_offset, 1); } // !0: FCC0 | FCC1 From patchwork Mon Oct 23 16:09:41 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: 737250 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1610600wrl; Mon, 23 Oct 2023 09:10:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkgyAqSalNbwBCyDmnJgZ6LFxZCGaAZI3bEpSzbK9sitdwd8eIlKRWT+pBk4VVlI+Lm8nG X-Received: by 2002:a05:620a:2412:b0:779:cf30:600b with SMTP id d18-20020a05620a241200b00779cf30600bmr6278042qkn.4.1698077442299; Mon, 23 Oct 2023 09:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077442; cv=none; d=google.com; s=arc-20160816; b=zaELg2BrA43rpvGFoKU1hN8Vw6m7XVkU4XwqKQ61CrvFhFWMGZpiMGYQxz4pVx4YFR 9+Tx73g15tqlhFOnEsgQzaE8hklmoePzTu3rj6hMeuAhzBfebq5yex64WeAXUfz+Rdui PMdf0/jYhvtuqWE3aImySrrke60BAhmdkjp3FTu63MeyQy8HtRIcaoxG1uRp/frunszD t7miPJ5OXp3Y6dcYSkB9HbOLYQE05Q47wMan07PmBq8CKj9LAoSKYkCNMwiQYBPACCXz toRhN7Mooqkd/D0TSOSUnAu808NYuQTaTklUBu1muwyAMV6sCMgqvYKXNUDYI3ttKLQA JG6A== 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=hay4vfiV3EkB4X3edFjXsW35St08FgrroC8EsCiYjMU=; fh=jeUsxrN2AFdWyzxn9BzOHZSCEYJQi89Ipt60MqdoTsk=; b=pQXl0wsO+SUXK1Fbg7l3bU4LLd9Q0KItSYvTwk5bnBCMuTVIsxgf8MEwtgHHlsc2VQ dnap4WU4re6nMZDtqxKnqjcXN+uPciZ1djzkOPfdlJsQDoiur/a4VSNfB+XB5E/xs0sj 6NmY48FKVVe9w0s1vX5EmDfc7mBoKIejO+33BkCctG1PFsjl0XgGKVCuBFB3XswvNQjo 3OcGew/tNd4KlC+JTobHgppWi2Ij7SlqrXP4tsqkt/Fupz5Dj1zNW2czYXgK/vxEldE/ r7lJa24fRL1eIqYU4jYTob7zw7oB8i5TlSAb2JIlGeogYwuQwYStyyHkUWDuRtXbYSON /qSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z8JGKPjh; 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 o28-20020a05620a131c00b007709df4a576si5382761qkj.711.2023.10.23.09.10.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:10:42 -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=z8JGKPjh; 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 1quxVg-00020v-PV; Mon, 23 Oct 2023 12:10:33 -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 1quxVc-0001vf-Re for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:29 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVb-0001nY-9Z for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:28 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-408425c7c10so29171955e9.0 for ; Mon, 23 Oct 2023 09:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077423; x=1698682223; 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=hay4vfiV3EkB4X3edFjXsW35St08FgrroC8EsCiYjMU=; b=z8JGKPjhwDwf7gQOYAytON0SwbIJK9CFfP5KJWP7hsod8OcBJimgpuBTeOiCpxRPms l4qTOXMcK4fj/dPXsfGeATnlPtDr4drwBpjWEiKofeoY4WD8BSSb8/WdKmKgnakIxJd+ oijY83LvdaieHr3mZsnIeaH5D6kbJVofNHAXDp+5gzypFj9GN6A7aN8qs9Uq7YFNrTM8 61p7hOIphWkQfWQ1vZ5ECfdOYjIYB+SvbyLxG1zRM/YfNlRfH0QSt9il5hfk94p8E/Nh F9WgxZuIstWTfUQqk8qQi987TOjQKiRDObjf7E/s9TF1Sl2yKB+V/X4lNQLmfw/WXW8k M0YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077423; x=1698682223; 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=hay4vfiV3EkB4X3edFjXsW35St08FgrroC8EsCiYjMU=; b=uy8UTSe2A2uRDylH+iK0T3cutBDAbEK/ghav9P1jx2FU4m1ph4qQkxqUS89CDwSpaa 4k5A7DcD5n0pBheoKQ54YC9WQsVXUA+4/LoHW4D6pSJMKx6KJX5iSw39+NZeAANKpUHp b4FudCy8Rrn9N6xY7O9bdqgIeKx+FKrws1CxkjLzlyZ+KDlafJoMEpmXy55GOLgt6Bic 3yR5aYyK10G+C6YPPLY7pmMc2B+aFZnxTCX88mjgI8Nz8/5a3wS121AZQXEjGBV+trIR xMT26Vps88DdF0z7y+DRCawbJ1FjiB+h3QNHyFItTd0LRo54MCpqU5b5Utcubr6Laijl frgw== X-Gm-Message-State: AOJu0Yz1P6R+poxFjJJkD5RzyYCLwCLtY2N4AbfqchKDs3Q3Sv89ZdKq HsODKyeRjJqMkLWZLZ5LpSp9/TQTyR2MzdeQO6g= X-Received: by 2002:a05:600c:3483:b0:405:a30:151e with SMTP id a3-20020a05600c348300b004050a30151emr8250917wmq.12.1698077423459; Mon, 23 Oct 2023 09:10:23 -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 o3-20020a5d6843000000b003143c9beeaesm8065718wrw.44.2023.10.23.09.10.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:23 -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?= , Max Filippov Subject: [PATCH 6/9] target/xtensa: Use tcg_gen_extract_i32 Date: Mon, 23 Oct 2023 18:09:41 +0200 Message-ID: <20231023160944.10692-7-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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.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: Max Filippov --- target/xtensa/translate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index de89940599..cbc564c020 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1595,11 +1595,7 @@ static void translate_entry(DisasContext *dc, const OpcodeArg arg[], static void translate_extui(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - int maskimm = (1 << arg[3].imm) - 1; - - TCGv_i32 tmp = tcg_temp_new_i32(); - tcg_gen_shri_i32(tmp, arg[1].in, arg[2].imm); - tcg_gen_andi_i32(arg[0].out, tmp, maskimm); + tcg_gen_extract_i32(arg[0].out, arg[1].in, arg[2].imm, arg[3].imm); } static void translate_getex(DisasContext *dc, const OpcodeArg arg[], From patchwork Mon Oct 23 16:09:42 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: 737255 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1611040wrl; Mon, 23 Oct 2023 09:11:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgBRCcndXA3PWGLTqLqlxnzJ2U1BSi0lXSVVWN7ACRJ1K0wyzCFWXOLDZqfvmVeDe4r7R+ X-Received: by 2002:a05:6214:1764:b0:66d:9900:cfa3 with SMTP id et4-20020a056214176400b0066d9900cfa3mr10360067qvb.28.1698077495487; Mon, 23 Oct 2023 09:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077495; cv=none; d=google.com; s=arc-20160816; b=SQBk5S4L2UkxwuPPbRCbTXK9uHwHI7tN+8s6PIblhGKbmTe+oXi+G/ptHsD57rYIGx YSUvF8PfW7xjxqvokM8GJv57YVo8dl8E8ArFcSVvWbxQDoZiwJSsF9nr+9bp5jv1T4cv +2UiMiQ2FYe8OKTrKVupaojTHgqM1bvrOLR7eC3KSCiQuHSeC6kUMeMH9kFnoddwGQwv mtzawT6AF44F88LPnZlgYLC4fpRr3uUEkWrUipGI6BkNKRV/8cWDqAjIYx1zUqZS/ebb Vtof6R+y+HA6etdE2Q7r6BwZ4qvDzkQzmBxc66FKegFg/aK5S39CZO/AS1MASOtW+ri/ vgyQ== 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=a2aDD8+H4pT9uJ8J9/1URUzXa0n+4QaQuTomlnp3aRg=; fh=gFnAV9pP5i83r7+1WKjVRXy5Pp6xcAGV1enn2AIoQa0=; b=umKbF/5ffFukq3vvU+DvXs0OMfXTrYNy9CBwGX4h8c7iERhkL8vxmQM5mYt86d3v9S Llm+t45OhdOktlFHKVVQ694YyWJ5RD7FXJoijanjok/TYqGfCdyJlN2WWsTJxF1P7Izq 11enh3Bj5Le5j6wjnTfkBsNAaOtkCb7nCxxs//eqW4WJn6Hoe+s6rRahSSnjSQsWqw1P 0LZfEFA7hdulTH4dVWfQHk7qtqsobabbFQNQr8/1wR1S5iq2Iy/gi6a2NjctPPVODvjc OKujITdUUm1iIsXCTNQ4plgKIOaTZQnhdzARNNcdBjCBMmCP14/P+2eRQOR39z+HJKJS bsTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bHr8z2B/"; 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 nf2-20020a0562143b8200b0066d23395d24si5860957qvb.360.2023.10.23.09.11.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:11:35 -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="bHr8z2B/"; 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 1quxVo-0002Hi-4X; Mon, 23 Oct 2023 12:10:40 -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 1quxVg-00021V-Q9 for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:33 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVf-0001q9-8H for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:32 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40806e40fccso25619095e9.2 for ; Mon, 23 Oct 2023 09:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077429; x=1698682229; 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=a2aDD8+H4pT9uJ8J9/1URUzXa0n+4QaQuTomlnp3aRg=; b=bHr8z2B/HuIiNG4o6s2w86Ib2aACq8iXQJTZe63HTZYW6mBR9KH2JxRalvNE3+je0B ygUKAJlN9QfmL5eqP/q7/1xm++9by6QoPg4CfYwcOwEX74u8eyX3WeCLCina9z0OYhZt U2VrkdVU9zhoHNmVylk0dH6u87kCRgfAeTFVOgEUcVVYYfm6IzViff19NBSWetuJvmI0 i7ZtaJ0j6WGaYbk80+t9r96oMqg5aYTM5j4nkkE9pRkAf2HpEgbxuXRd82PtCP9NQaF6 ZUmP/XEMhDKHKqlLSRu8KmAmOJjroEcmGOG4OcuwnQzO/ScZYAsyVvH7+XLBTDa2hSDc aFOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077429; x=1698682229; 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=a2aDD8+H4pT9uJ8J9/1URUzXa0n+4QaQuTomlnp3aRg=; b=nWCnkXw5/8zJOesa8afn0kxWrub0UI+twlqz+JFayluKNs+9gU1LVB1hYkzlzEPYAR R5OUYSE6WShF+c8LvuvuPbPDaIVgvhriYVbNesFFOuELuetBagE6IEER3tu/ip+jovBT 5sTDQ4Y7yaAfdUbo59UQc2SrlOJ3dio4KqijXbHy1j0LvUJN/EKanwc39m3Gf1hb59kb syP4Nb9wTC2ckZq/w2Ciqxf6HbqPQTTwKyDUjATkakxtaLefrHqJR2Qv4zq3lcPI7bAV Wf794VIKjF6DvAivztiKyM8zRtbu9blszSDNK+lXNVqEywdPKvn07lz+8FRn+bQxxYJD h1PA== X-Gm-Message-State: AOJu0YyDpshUHrD/tjOjillcz9PuNSYRS/BdMQkJmhbLy1FGWdeOW/TK cmn2rThzYkLLt3+SJMZiZgpt65X7ytLsJAdmcRI= X-Received: by 2002:a05:600c:4f12:b0:401:bdd7:49ae with SMTP id l18-20020a05600c4f1200b00401bdd749aemr8370112wmq.18.1698077429362; Mon, 23 Oct 2023 09:10:29 -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 c16-20020a05600c0ad000b003fee567235bsm14511150wmr.1.2023.10.23.09.10.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:29 -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?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH 7/9] target/mips: Use tcg_gen_sextract_tl Date: Mon, 23 Oct 2023 18:09:42 +0200 Message-ID: <20231023160944.10692-8-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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.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é --- target/mips/tcg/mxu_translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c index c517258ac5..6eb73256b2 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -3840,8 +3840,7 @@ static void gen_mxu_Q16SAT(DisasContext *ctx) tcg_gen_movi_tl(t0, 255); gen_set_label(l_lo); - tcg_gen_shli_tl(t1, mxu_gpr[XRb - 1], 16); - tcg_gen_sari_tl(t1, t1, 16); + tcg_gen_sextract_tl(t1, mxu_gpr[XRb - 1], 0, 16); tcg_gen_brcondi_tl(TCG_COND_LT, t1, 0, l_less_lo); tcg_gen_brcondi_tl(TCG_COND_GT, t1, 255, l_greater_lo); tcg_gen_br(l_done); @@ -3876,8 +3875,7 @@ static void gen_mxu_Q16SAT(DisasContext *ctx) tcg_gen_movi_tl(t0, 255); gen_set_label(l_lo); - tcg_gen_shli_tl(t1, mxu_gpr[XRc - 1], 16); - tcg_gen_sari_tl(t1, t1, 16); + tcg_gen_sextract_tl(t1, mxu_gpr[XRc - 1], 0, 16); tcg_gen_brcondi_tl(TCG_COND_LT, t1, 0, l_less_lo); tcg_gen_brcondi_tl(TCG_COND_GT, t1, 255, l_greater_lo); tcg_gen_br(l_done); From patchwork Mon Oct 23 16:09:43 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: 737251 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1610801wrl; Mon, 23 Oct 2023 09:11:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6pfqk8EcM6Npy/XQEW0NELUKRcKvRboQhFZLjzqBWGFrXCluz12DyhZg6XxEXXLUL7CgR X-Received: by 2002:a05:622a:19a3:b0:418:f63f:7fd with SMTP id u35-20020a05622a19a300b00418f63f07fdmr11351617qtc.6.1698077464633; Mon, 23 Oct 2023 09:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077464; cv=none; d=google.com; s=arc-20160816; b=IiSXZ50tk6u9ZNOpQEmrIqY2AHCOumN6DlZBp7abUHe4HXh8hXSrK0egAV3jViDcm0 nBwrLuXryYTpL/SGeKeziNVFRAxcwCGI83AFvHP1Y4+0Ga0X8xj5GEyNfFAMJsG+ZI8k FihiJTZ6TLtxGtoxz2pajrURa60RIqvAA+9UeqrRmwvykuWms7mQhDj5NfwH7dngPhZW /KmPYU7o2Nar70zhgFB4i9eI9YL4/63KMo1T04e/7IhoETiPw4A2Lzo8y0PEAPeWPVAt C65suLWrxCSBTjdtMCiGpy4ACli06fEMVcd5DQ5NhQ/Up5qBNC+ufaz7MHh9E/wQAk+I WKkw== 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=5hoUi02NxWDs20ifpWCQFnAQBxqhpEhCw6XqoL6TeI0=; fh=cx5u7DKGOSTAVM/PLQsESwV3vheqaKcswhPCHwmEH8k=; b=ehlUvlKvXkevGpnzy8QFwN9aZ8Otqs8ca1zmtA/e8YlzlAIXo2QlSVwPRYvYgrxG/L aKbfXJw6/zG1IMpsiN/ZnADJX1KF7A6MN2ZqZ4t5gG6OGpzzJe8L+LOOm9V1zfdBUwqq EOxKK0cmmTKvmODXR9/cNjIP2Qou7YL4HVAHJbInbBc+5jyDIDBNhaWsBAUP0eO9tWF+ GA9UN7kutJmVhc6eJuJsjo1WjBJUy+p8ou+R0GWiI/QYvTHkoi2PtWr/7rl1agVyW7lm VbS2XMcuu53EhEqQtJd6jJoc7T9V/ivRFXqVGCThFMZ0p9CjBi8w1u9yRlnb5fumqMXm E65Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H2IjsxDF; 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 t12-20020a05622a148c00b00417f199f9e5si5938841qtx.738.2023.10.23.09.11.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:11:04 -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=H2IjsxDF; 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 1quxVq-0002Qi-Rt; Mon, 23 Oct 2023 12:10:42 -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 1quxVn-0002Hq-CV for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:40 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVk-0001qo-RA for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:39 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4084095722aso28443385e9.1 for ; Mon, 23 Oct 2023 09:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077435; x=1698682235; 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=5hoUi02NxWDs20ifpWCQFnAQBxqhpEhCw6XqoL6TeI0=; b=H2IjsxDFZbt3VkZxUwFMpgUbFescPikobcRuf8JlJl72FyUnxSIXa8ZLQlH0Zi6Lct YbrjSUxBL30VipBNauKSHHEnxnDRlazpfcWOSC0s9dIjdeZmbVeg6t8GLGqJ/Q3Z2qsb q5gyD+gLX4Fct79aiR8HXTZMAboe32HC5yZuO92FJ/k+TS4IauO6gsa+zCXm2HDl4GQF IWW0W7qqr1S96RxrHjSECXgoQOb0i3BURG0/BXMjZ8uJLn0WYg1cA7Lv9LaHIFQ29/e0 GClBE09b1cXSRMhPggcxwpDY1/k7007cJ4RQXSPOhErFo90sFbPFe+t8zTsNNm0kjHsD GDeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077435; x=1698682235; 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=5hoUi02NxWDs20ifpWCQFnAQBxqhpEhCw6XqoL6TeI0=; b=dQh5z7ifdxsapbS7bw/n8np8zBoyESf+LFDSoU6xqvcO1m3kCW6zB2piiaBARLpXm1 Q8b26AHhpBV6cRpxOGrC4jbJy4sWNh5oCFmLU+TttCW/Lv6662SXccM2hi0usDtOpXI2 CuQ4f0JQsKErKSgluHvjvLhflqmnYcmJC5r8bcKXSFA3oiiTqFBGF6rgccWoiqhxqxTW VaKp/DAjSw2taRdSCdP4YeZUzh2Swohnz6GWrKW6RW4JS05C8k/iyCVs8u+a3sgYmUSL P6lHpoBIklxEQUFB1W3AWeRRx7wTChsKH0mHET8QeHpbT2JGcB6IjBbyAeSPRpgDFC7c jinA== X-Gm-Message-State: AOJu0YzAx/+4hoT2fTma1Pafqusilntv4FRJVUmxeap0gzIlZ6LWd/jX iOAe5zMnRa7yFXXNtUUHQeDoN5RDg6wJ8peoD8w= X-Received: by 2002:a05:600c:310d:b0:405:359e:ee43 with SMTP id g13-20020a05600c310d00b00405359eee43mr7808740wmo.1.1698077435158; Mon, 23 Oct 2023 09:10:35 -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 bh9-20020a05600c3d0900b003feae747ff2sm14712349wmb.35.2023.10.23.09.10.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:34 -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?= , "Edgar E. Iglesias" Subject: [RFC PATCH 8/9] target/cris: Use tcg_gen_sextract_tl Date: Mon, 23 Oct 2023 18:09:43 +0200 Message-ID: <20231023160944.10692-9-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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.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é --- RFC: please double-check bits --- target/cris/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 65b07e1d80..3a161f8f73 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -336,8 +336,7 @@ static void t_gen_cris_mstep(TCGv d, TCGv a, TCGv b, TCGv ccs) */ t = tcg_temp_new(); tcg_gen_shli_tl(d, a, 1); - tcg_gen_shli_tl(t, ccs, 31 - 3); - tcg_gen_sari_tl(t, t, 31); + tcg_gen_sextract_tl(t, ccs, 3, 1); tcg_gen_and_tl(t, t, b); tcg_gen_add_tl(d, d, t); } From patchwork Mon Oct 23 16:09:44 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: 737257 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1611482wrl; Mon, 23 Oct 2023 09:12:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTZDpX1US/r74Tuv3wnaI7f69jdcgm4XNVD+ZfmkxUzSbJvViUwamkiOh5C1EADZlIFpXJ X-Received: by 2002:a05:620a:430c:b0:778:a4a5:8bc5 with SMTP id u12-20020a05620a430c00b00778a4a58bc5mr9995568qko.6.1698077546542; Mon, 23 Oct 2023 09:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077546; cv=none; d=google.com; s=arc-20160816; b=mulfw8HYu6CoCHRyHTDRvs4XkcMFzg2frgDMOtVncJvPPomFs7bOnjJhM9vYZEww/R 8RGUHa3nTX2FkIadtg5IFqVf3WKyXpEV9hYPuYoLSNd9ft0pi1Fe0G1211jHqz3HNZFT G6drWQ1zlsuQMmuvhjhEv7kCKA5PjygDAthFjUTj3NqkUBTwL28tdC2zPLLYZR3qplTJ //T1yroRCJfD4Xs9eARZYXVKFibPPU1A8pUlSJtGDgM3FpzKobFi/ioYBNZE7BqufFe6 k3RCRJ626162a/CUMxu950EnbjvojTo1XA9QpUBgiNVQdh7TkP1VOlnxj0y+vLSIY3YO mxsg== 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=fSz8G6MPNajxBQHe67TPEcfd1QqFtTe7tRA8HW/GPrw=; fh=3AhLBgip2CWvqllKMHi2jwz7FSLJQCJrsVJb7G0MhAM=; b=jDa5+k/kN1YU416ESq7nZOud4MyaiEtaHjk7Uf5YNd03fOFIYsTegAS9KXVjFcUVfo 7l2TqT+93s6P8+kMKyiuhk/kgYAd7DUXFmUKdari/CPyxfpPdZwga9u6CXEbZvD7DZXB /s+hJsMYMV6IhooLDplRZwms9zDlFxbmEi8tmlaZ8ToZcxJXaskutMfZAjej8sz0qp5o +7U1M9vXTJJ0c4ZEq06O8XUPq0DdhRs127ePOBeaIRHNHV6CQAeBt0ZEkceNEwiJqXv0 /YUkopRqAMq7gByT5rv6Rt/lgDNCwmHTlAAND4Tk0iLb8Gm2Gldwd+ekM0Uz4wWKn1Z/ KgyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BcYG/pAP"; 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 z4-20020ae9c104000000b007758e274072si5493943qki.42.2023.10.23.09.12.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 09:12:26 -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="BcYG/pAP"; 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 1quxVu-0002xK-F6; Mon, 23 Oct 2023 12:10:46 -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 1quxVt-0002kq-7B for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:45 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxVq-0001ra-Ln for qemu-devel@nongnu.org; Mon, 23 Oct 2023 12:10:44 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32da7ac5c4fso2421789f8f.1 for ; Mon, 23 Oct 2023 09:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698077441; x=1698682241; 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=fSz8G6MPNajxBQHe67TPEcfd1QqFtTe7tRA8HW/GPrw=; b=BcYG/pAPZxwLx4GZeXNd2jFwTTm5XSBCNiOYPouoaMsHnoh10X8DlzRJj5qVmEz9zm afh16a1+ttj0WYifRGn/0c6ysBseNYKrEZBCL4U3Vm5AQhmRHxRvBG+lTB9HY7pKecg9 wVJw/o7ntKsC4fJlfc08rCZmnQx8o7kDidu7IklUM+LecknR2URYVsNC3vitVE5gMA7Q LPBrHCT+hXKXSbRcbZJWbMbE03U26bzIptkgkCfHyRQO/TTocB3qoO4gW9g4nlWOSbAh GN8aWC1h84ooeG9sFk9a3Mt+r8NCWohrD1nrvU5DN828N8NkvB38vIbJcQu4otrmAPgY YZ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077441; x=1698682241; 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=fSz8G6MPNajxBQHe67TPEcfd1QqFtTe7tRA8HW/GPrw=; b=wIewh0RANcqyJIXGJu3s7S2UPAI8UbwrR3BsEPLNpQMmD6p8o+QvHO5QItqdLgScOa fmlxxSuuc3YWSw44BOSwVXSIpt2AJ5gX20iYP+TJs4v0T7quyoOdGPDx0McyW6hmh8ku rz0uAASpn6xN+9bVey9shCsEogeH+aJY99XPty2AOQ+PBD98085MEGR2Z7HHGAPt9BNP dfToBoJt6za/646MXhHk0juKMAe4omnm9sCLhX40T2XoJ6gIYnRfLEUBUdKwTdRHp24p mR/2iR12RtBBKQxWso21gCkP8p16yf3bB05bT3mAotPiICu0dnuu/JtXBfDF6k3nOfMX YG1A== X-Gm-Message-State: AOJu0Yz4Mx6mczWqMjAUUs57bIznLVHKG/weGN1qnp0moq51b7/EUPIt RRzMxYQaDGiZ2KYsq2JFJsXIEHRfriGjXL/i+6M= X-Received: by 2002:a5d:68c1:0:b0:32d:bf26:e7a8 with SMTP id p1-20020a5d68c1000000b0032dbf26e7a8mr6690479wrw.36.1698077441118; Mon, 23 Oct 2023 09:10:41 -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 dj18-20020a0560000b1200b0032d96dd703bsm8108495wrb.70.2023.10.23.09.10.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Oct 2023 09:10:40 -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?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= Subject: [RFC PATCH 9/9] target/ppc: Use tcg_gen_sextract_tl Date: Mon, 23 Oct 2023 18:09:44 +0200 Message-ID: <20231023160944.10692-10-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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.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: Nicholas Piggin --- RFC: Please double-check 32/64 & bits --- target/ppc/translate.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index c6e1f7c2ca..1370db9bd5 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -2892,13 +2892,7 @@ static void gen_slw(DisasContext *ctx) t0 = tcg_temp_new(); /* AND rS with a mask that is 0 when rB >= 0x20 */ -#if defined(TARGET_PPC64) - tcg_gen_shli_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x3a); - tcg_gen_sari_tl(t0, t0, 0x3f); -#else - tcg_gen_shli_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x1a); - tcg_gen_sari_tl(t0, t0, 0x1f); -#endif + tcg_gen_sextract_tl(t0, cpu_gpr[rB(ctx->opcode)], 5, 1); tcg_gen_andc_tl(t0, cpu_gpr[rS(ctx->opcode)], t0); t1 = tcg_temp_new(); tcg_gen_andi_tl(t1, cpu_gpr[rB(ctx->opcode)], 0x1f); @@ -2956,13 +2950,7 @@ static void gen_srw(DisasContext *ctx) t0 = tcg_temp_new(); /* AND rS with a mask that is 0 when rB >= 0x20 */ -#if defined(TARGET_PPC64) - tcg_gen_shli_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x3a); - tcg_gen_sari_tl(t0, t0, 0x3f); -#else - tcg_gen_shli_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x1a); - tcg_gen_sari_tl(t0, t0, 0x1f); -#endif + tcg_gen_sextract_tl(t0, cpu_gpr[rB(ctx->opcode)], 5, 1); tcg_gen_andc_tl(t0, cpu_gpr[rS(ctx->opcode)], t0); tcg_gen_ext32u_tl(t0, t0); t1 = tcg_temp_new(); @@ -2981,8 +2969,7 @@ static void gen_sld(DisasContext *ctx) t0 = tcg_temp_new(); /* AND rS with a mask that is 0 when rB >= 0x40 */ - tcg_gen_shli_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x39); - tcg_gen_sari_tl(t0, t0, 0x3f); + tcg_gen_sextract_tl(t0, cpu_gpr[rB(ctx->opcode)], 6, 1); tcg_gen_andc_tl(t0, cpu_gpr[rS(ctx->opcode)], t0); t1 = tcg_temp_new(); tcg_gen_andi_tl(t1, cpu_gpr[rB(ctx->opcode)], 0x3f); @@ -3071,8 +3058,7 @@ static void gen_srd(DisasContext *ctx) t0 = tcg_temp_new(); /* AND rS with a mask that is 0 when rB >= 0x40 */ - tcg_gen_shli_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x39); - tcg_gen_sari_tl(t0, t0, 0x3f); + tcg_gen_sextract_tl(t0, cpu_gpr[rB(ctx->opcode)], 6, 1); tcg_gen_andc_tl(t0, cpu_gpr[rS(ctx->opcode)], t0); t1 = tcg_temp_new(); tcg_gen_andi_tl(t1, cpu_gpr[rB(ctx->opcode)], 0x3f);