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;