From patchwork Tue Oct 24 16:58:58 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: 737566 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2141540wrl; Tue, 24 Oct 2023 10:03:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEfWXCj77urNCYiy4Kg9uCY98alkMsQJB2cqclK9AM0rjnWo+odo72D5E8EKH/xsvkCCcBF X-Received: by 2002:a05:6102:2cb:b0:452:6478:3e24 with SMTP id h11-20020a05610202cb00b0045264783e24mr7735092vsh.12.1698167010092; Tue, 24 Oct 2023 10:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698167010; cv=none; d=google.com; s=arc-20160816; b=rw47PcpxeSKFCd54X45BU2+kY5iaXN8Hsf6BGT8mJtjSi2+SLXOxRV3SbYXFxkFe/N L4pDIF9Mf27/5GfYrsSp+a+C3ABDHFgL4G8IWJzuVEAkoR+h90HUjpjuxpxgLz+hLza7 x6PS+raGolI3wzRUSLCwpyqioMOZd2EKgh96lWF8uQUPQyNqGd4RUgQHt6Qa0cwHW4v4 SyvxeZWgEDiQFYUE0QLJviNlDOF/Wa9diTtE/HCOr993eAfVQtuuwjxPtEwN2jOX4aMb pvOC58TMs/dKlMLQTs6bBckFIWKkg/XftPZKClnWO9Tj50euKTk9WPtaaC3AMCZAe9x5 A5vw== 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=R/LpTsjaMG5I45mnJYlkVBvGwoC5bfHGgJpyoEShYgg=; fh=zeOCtihZxqdgHPphj/vEOuEuDhrWw3CPRgUpzpCxm8Q=; b=Nhgzg2AaFDk6HOwSxTrE4WBRHJGoZy2E7x0ZEp/hy3DcxuCkl6IGIDDUBasmXiV+Eo YBqUZgThvBJHWJoFjnZFuRfOI+k7cMJA1HfzyH0yc+xqoI3g5DTmNQuNF0qz6Qot+pWb Zq+FPOvWPUSLwdACY1IWKImnFs+FrwySkUzg5ZUrjXLZfGkPiM8ydceMag236FtaRR/H LqvQdipAaFa+3G+SToVX05W/472RF6pt66VekYlWOfg4zUIz47bg0z9Ovf/LXTMcsTkb EmolPfvQ2kKbC+NyDq+kKaIOM0jeLayGlust/Q4tXMiS+WnyoVpDnzt95fWdeC1wJI5k Pk7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OiJQ/nm1"; 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 c2-20020a67c402000000b004529d5cdd0esi1017574vsk.550.2023.10.24.10.03.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:03:30 -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="OiJQ/nm1"; 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 1qvKkm-0000Zp-3e; Tue, 24 Oct 2023 12:59: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 1qvKkk-0000Yx-JA for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:38 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkj-0002q2-1l for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:38 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-98377c5d53eso676048266b.0 for ; Tue, 24 Oct 2023 09:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166775; x=1698771575; 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=R/LpTsjaMG5I45mnJYlkVBvGwoC5bfHGgJpyoEShYgg=; b=OiJQ/nm1LrlDX5vGH80epI34WlTlgn8nFSvcV8DqYURO48oWHdUBFYBYdSP/9gpsqg inS14PSQzDBmY5d0DegbDZ0V4iu0561GSZbw4N1FIVq1ecuIZn4ApVErKbpv66MhQHp4 ffI1DgXO0nOV2/nvOKVJxoV1kNszIXLJXJs5U8ptaUenSyZOtsPjHmEphqplDC6krIIk 3gFtSCA3l8DzViZGIlKZZ1VG9cOTPX4I6CNF5Hskpi64nnLdQ94+webY3hQz6rVpMb3p 7PH1cky+937aBM4J1HN6f2tC9pfjUVixxa0bPPdyke+pAlB/kFEKeUdrLbymrDPuo/rV pnSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166775; x=1698771575; 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=R/LpTsjaMG5I45mnJYlkVBvGwoC5bfHGgJpyoEShYgg=; b=uGCCTsUqIFzXbbm4WwICWQ8srqXt2QVawbBsoddZk0hZwx7xMnLZTdOh/SkfXsvUqu haB5APt9o9WX1arpjQgxEMgNg4UhO9BvLaEQmBkKQSH6q7HdBUEGcxZfj0OnNzLEnbd5 l6wl3LNg75NjL9cZCFn1ZkgO2xv9JKCkHvksqdFg3bdSvfP50S+vNVGmjuQrvGzZU+eD TzECIMn/dqhBsu1F2USnR1h0fXz3UbAyNZ9qm6/7zWGFuUwyV6Rid2Y4pD8jKjPVGSOO wxVEqrvgVbOStH+KKtj3JRkXVPxhgH45MDB8idaIe/rdKfzlxeFmpkWEeVG3JRpr6k6P ra0A== X-Gm-Message-State: AOJu0Yyog8qX31v6XVYSz7HSX9vUGwx9Cq2qVdAK8syb1G7S5ubTE4H9 khdA/kImGnh3hjbXomflchUT2hmeZR2iwHymTN8= X-Received: by 2002:a17:907:8691:b0:9be:4bb0:650 with SMTP id qa17-20020a170907869100b009be4bb00650mr8566644ejc.73.1698166774719; Tue, 24 Oct 2023 09:59:34 -0700 (PDT) Received: from m1x-phil.lan (sem44-h01-176-172-55-165.dsl.sta.abo.bbox.fr. [176.172.55.165]) by smtp.gmail.com with ESMTPSA id n17-20020a170906089100b009c3f8f46c22sm8546630eje.77.2023.10.24.09.59.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org Subject: [PATCH v2 5/9] target/ppc: Use tcg_gen_extract_i32 Date: Tue, 24 Oct 2023 18:58:58 +0200 Message-ID: <20231024165903.40861-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024165903.40861-1-philmd@linaro.org> References: <20231024165903.40861-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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: Nicholas Piggin --- 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..c696fedbcc 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); } } }