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