From patchwork Tue Oct 24 16:58:54 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: 737564 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2141163wrl; Tue, 24 Oct 2023 10:02:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJZtMK8RoOdLyqeV4YvUQlDUR0n6EQa6nlHAk5aolCGzwTgD9Ft23Uy8eQgm0oUNoYQAND X-Received: by 2002:ac8:59d1:0:b0:417:a645:982f with SMTP id f17-20020ac859d1000000b00417a645982fmr16743273qtf.29.1698166977672; Tue, 24 Oct 2023 10:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166977; cv=none; d=google.com; s=arc-20160816; b=Yo5Zw/Ubk0+H2y/S4hBrpLmmmnM/z3JenRnZaRaQo714fXugdCvIaXXRw0KSpy8vhg WKUE/krPpVQv4Mm/0FdprTVOsUBxUsv/fNFmdu0zD+mTbb+cVSFZl7N7iT38H+xFkoo7 YlGb6sZZCKaezdQXEPKGn+wi355c+OJuCQF1Dx8TreMObuZmd70W2CttpIvj34BtyH4A 7mdmgotL2TblvDEcXRIBLwjSBBhkfLNbtinMBk7hHg4fwNgkO5m09ZIx5pNRDDbEAmKf x5OFVM9fYewNslUj/IayPqCTajl9N02xkEq3DEP55bRunjKl082cqDiBjRFyW66CTL/k hveQ== 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=qdvuDWpSySdhsrITUvPFHqkuopKlbbVaHkugvXE520g=; fh=pt/4hWY+SEJLKB6dqguRl+Z9aOCOV5H8gJBPGt8QAaY=; b=CI66Q5kqw/dJBnNAGTeLAkzJX3WHg8vru/GHu1EMtt0/fNw+KzYjT4l243l9oAicRv UGXABfymCrdNzLIGDpXJxTC9IfwGOP2fVdJSL5FbS/A2YFhL2QqNQ8OUaa4MITp91xFi GFjKPsKpNWcMPXXHmt7x7Eoc54uFY7O0jQ5kazJoCyrpGBN/Tj3dum34c5OOqwRtCbu1 g22CbEfF9rpafFygD98ElY7JQeyf0TChr20km7y+orwmlZI6AwmIQ7XuE38sY8pYPYm0 3ZCh678LxHGC4ffb0OxDXv4PoW21TWAgU6hQ3kovA/lWFXj0WEmZG83h8gwsPKY81fIZ oqsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WScBoOW1; 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 u22-20020a05622a011600b00417d9251452si7777092qtw.770.2023.10.24.10.02.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:02:57 -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=WScBoOW1; 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 1qvKkT-0008Sm-2O; Tue, 24 Oct 2023 12:59:21 -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 1qvKkR-0008RY-QF for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:19 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkM-0002g9-2y for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:19 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c504a5e1deso74787301fa.2 for ; Tue, 24 Oct 2023 09:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166752; x=1698771552; 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=qdvuDWpSySdhsrITUvPFHqkuopKlbbVaHkugvXE520g=; b=WScBoOW1t45wGOd9M5Z0ON44ekzg1lW2nLGQiER693xKNV6Df/EvTUnmB5M5TnBby7 TIRsvsnFv/gU3DE8lkM+pVXrgwnVJwNk3pqY2O6SBikVncrXGfVH24qrQyKWOe3v8sAe nfKmhX2GH3gfXpbz2Iap62D2dk7Oo6O6qNDV0025M8HbQ1R6xIEvvUfxMN+MZBRLAs3E i/cR6v+nzs+gdirJ5jE3h9b0Mo6LWmlTl3jaGzp8rUF1g/4Ov+B58jWGTBph0SsC+9Fv EFZD8J4FxYUPvyHs9gXeGcQcB4RUSaLKa/3Utg+YuVvR2l6WdVtnXm1+stj9JmvILynA q8WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166752; x=1698771552; 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=qdvuDWpSySdhsrITUvPFHqkuopKlbbVaHkugvXE520g=; b=eQJjYRnFZRWD9KAQpCL9BMFcszU/r+uzGxGfiFTbo7vCwTUDGXAQGqot9+RtWybw6S d0SfBqh1ZXxrIFHwg+hYOtHjUigvAXjhDThOVdym0P0CF1GQg8B3JXr31wzOVHBCc2IH k6qkoeEuVtUckNHDAVm4iwdfYn7bGxQw1omvmweanaicoUJNDU0wRTlUgsmaVjtQkFbk jJAraYxdkY1z5Y7UVlr6DTRKiq/Jd/+IUnEOCP7cikjoSsw8j+esXZ69kBOrj9egilk2 78Y5wTzE3OfJJjvHQj0BJCsWmd9pUjfnhyZD9yCMDXlpCu8uucllshSozov5jVEyOpR7 FDCw== X-Gm-Message-State: AOJu0Yzd1He9EDzJylE30JpTesfi3UqIYutC8HteSLESp29xx470LXZB Px2/y46PUCtFFMI40cxcFsXLQo10fPTHUB/tyrA= X-Received: by 2002:a2e:b6ca:0:b0:2bc:b9c7:7ba8 with SMTP id m10-20020a2eb6ca000000b002bcb9c77ba8mr9345284ljo.43.1698166751983; Tue, 24 Oct 2023 09:59:11 -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 qk2-20020a170906d9c200b009b97aa5a3aesm8626399ejb.34.2023.10.24.09.59.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:11 -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?= , Michael Rolnik Subject: [PATCH v2 1/9] target/avr: Use tcg_gen_extract_tl Date: Tue, 24 Oct 2023 18:58:54 +0200 Message-ID: <20231024165903.40861-2-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::22c; envelope-from=philmd@linaro.org; helo=mail-lj1-x22c.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 Tue Oct 24 16:58:55 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: 737565 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2141338wrl; Tue, 24 Oct 2023 10:03:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxJN7XSEm+Z7qO68XfhsIwWeW10qyZFqOEdC1C+15qH7Ivm9bsglbKyPkKDRrTLoY7RA5x X-Received: by 2002:ad4:5746:0:b0:66d:86a7:d611 with SMTP id q6-20020ad45746000000b0066d86a7d611mr18567600qvx.50.1698166988659; Tue, 24 Oct 2023 10:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166988; cv=none; d=google.com; s=arc-20160816; b=f22EFaP420Pu4s/fu/eHRKBiiiHWmhbRtnc0eZDUTjW68koChRb+9YCYoggP3qdVTM lAgkjI7bAJ7ijlHN9Q9PAgV1QESon7d7sOwbb2mR7NrDYd4FxqcWJswPjJLJ4Sa/Hfpt S07bBF6kX+dzDsMQrL24bCjnn7E4mwYbnzD0jW46gqcwlmXs75l4gFDxqNWP78aPG8Df 24oQtPNcpTfHsfPd/3Od79bgokr8gocEs7oEo8GFo57z59RH4ggGvtouidmnkH0Jlrtk 6zvMmDA9kyy5B47AxqAi7pTawcBXmuvYgp2DdKSk3IKkF1RctNKcjN0hLvVNcLEcXcFm oABw== 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=97B3jUFIyL98Y73J6mNGIo1KYIZg9jDlgc8fhF7w5XY=; fh=wlkrfgeBVqBfahS2cRpcQfqIkEVHT70Ff2zkfWaFsjg=; b=PcYSt11ZVP4yfLSrrgoD9BFpwn6CUP4LReA0QQeSXhDIyjGO5sJojmtJMifamRWkpI zJon7M9vhIKwiqhvace6oOTedctWnjXf49fPSfTvrlfQDQZ0hha46JV0gTCM9liE8jEp ifN5BwL3dELuO7oZwQKz+6sn34Bt1APwYIEx9hlK+iMcYXg/ZXirbQYnLcItlKmSaTDm wigtqUvkmltAJNuynX/cuvyUbQXtps34Q3/K2OVKPg0GlJqX8vpLwN96jDiSj7RbtPms 0/13FSyPgL70TMPBSanV/Xgz+tr9eU+4FdBvtZ2Obrt1NyftDcotIXpBDoqgil35lp0j O1oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KnEO4bky; 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 lb7-20020a056214318700b0065afec14ae3si7871017qvb.579.2023.10.24.10.03.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:03:08 -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=KnEO4bky; 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 1qvKkV-0008Tz-0E; Tue, 24 Oct 2023 12:59:23 -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 1qvKkT-0008Sw-0u for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:21 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkR-0002gm-E7 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:20 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9ad8a822508so707960166b.0 for ; Tue, 24 Oct 2023 09:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166757; x=1698771557; 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=97B3jUFIyL98Y73J6mNGIo1KYIZg9jDlgc8fhF7w5XY=; b=KnEO4bkydynpVIxuxAQabK1ciZqfU6drQm9IIOew8x4hZuWIM89OwV/3Rcir4+kMC2 tM+UyoSTavA5q/OiL5oKP29m8rS9XNJO/lZV57JQxwQtPQ0XoSpe3iQm0K/PDYYVVzQW J2lx89Br3N2Rkts1L3kD6+E1xRFMcAov4RWm8pngMqqdMRP4sRNf++Vx/+6x2yQjKWMq q/WlOSxmQMckkKdtIuyLp+ufYq5a11enb1ou+rJnWeULpASVWS+OgXpPG3STDnDUQIaX IQVZKPPBc3XMsjiYh7FD1JzyVVdhYeGgBzzSvM9OMbDq0O+eFqci9BG73MYnQMtFfERE Q0Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166757; x=1698771557; 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=97B3jUFIyL98Y73J6mNGIo1KYIZg9jDlgc8fhF7w5XY=; b=AOwUVOqoo3aCrNSKcY1kWINxdXehjvgnFflO+BRWhFTkzyq08b9BOc/dvCSEtut72m zPuConlNkVxxaj89KH8wzX2ZKzcKyK109wrCHgykJG8zrBd/hplNoI6/uhE4La62gikC N1QsigDJldAU95oxqaNq9UhmaZn7po1vxEpqTjJG5NOKqg47YOmC/OkuL8hNTkylM9br gjhJcpQthnU/FwQvMuSJ6PA2Joy6w2D/cF5JFhnxkAWfNR0layaw3kFZB3OxB7uVvZge LCp8ff0zmkE3IpyEEXMnRkGyUJnV0RHZpHb+zT7wG+JvC4wA3FKWoKTtdA6ltfExuLgR 7FlA== X-Gm-Message-State: AOJu0YxwVCjWjj0D7Fw1aJLx6XCyayCnWvuiL6yvQZTxEUJFj43YBMf6 ubDMntssNb5NXQkKiDshlJFGjFAivAt0YEFelpk= X-Received: by 2002:a17:907:c1f:b0:9ba:65e:752b with SMTP id ga31-20020a1709070c1f00b009ba065e752bmr9657901ejc.39.1698166757613; Tue, 24 Oct 2023 09:59:17 -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 20-20020a170906019400b00992b8d56f3asm8567029ejb.105.2023.10.24.09.59.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:17 -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?= , "Edgar E . Iglesias" , "Edgar E. Iglesias" Subject: [PATCH v2 2/9] target/cris: Use tcg_gen_extract_tl Date: Tue, 24 Oct 2023 18:58:55 +0200 Message-ID: <20231024165903.40861-3-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::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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: Edgar E. Iglesias --- 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 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], From patchwork Tue Oct 24 16:58:56 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: 737561 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2139883wrl; Tue, 24 Oct 2023 10:01:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyGveM3KyW7y9uIKT96n1rPEqDQzu/K2xOq7dbz0SMWNHGjxm+KzWcceNXvyTEbwPxF4Dp X-Received: by 2002:a67:e192:0:b0:457:c1d2:a0ab with SMTP id e18-20020a67e192000000b00457c1d2a0abmr11463974vsl.18.1698166868792; Tue, 24 Oct 2023 10:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166868; cv=none; d=google.com; s=arc-20160816; b=fzCz6ZtURyrzjgU5xmtQ7dqQ0AdWNrAYumpSN5lqoq5Bfkx9d84qykssV5BXkDYcZa FgO3lvqMOOlpkPqHTxFVD9G4S4bwb/kVJqNpX20veFAGFT8yVSKBB+Hxik67lzu2GtXW Ci0lK3I2BZVgkU5pPaNn2PZQRG3SxusNyswp8yp+SeyZlXa8dajUHXnqFLgXhUfj/CEG IN3linVARnVdg46PJFlreRcQlRaYiffeD84C/wCHQxyj++enun6LNPuqMik+U9GT7tGE nDddnl26YSvoqBqP4s+Doh5xS3llssHfZ3IFnp1RthgqL83PvNCZVLJGsQcPqNntCJ+X Gd3A== 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=iByrXA/jbstkhKAzvnIubYkosqn7r/1jZtcy6mOhkro=; fh=6GFeeyaLODha98D2oto8YgGYOuWYt2UdiJ4edotdHzs=; b=TO123K2g16qgl4Aw3E/fDxZBmpNK8TkevS8RfZp6JNa4ZPOivRVkLyjZL0VE8t06si Utd2aFsxA/+pnyulY8F0vabZ/QNPixpQUJT0zCDcK5X7/4Hy4I1uhwc89mvxAdcQeyxa TOwgNs5iO1GH6vivPf8S/YQ9AdF0+4leBhPypzG2D9GE818G77YX8fPoDzsUaaRYGwHf PPTPd6mS5KGbbn2y+Zkd5QKo9Y0GlYyNO3oMcuFOSSrbbKGFIeW1Kz/EWsA/qHaYUbbB kGgrKqMB0yLfuecwwdtdxf1g1oGH8VYuAbJ3Y9ghIrt8rmgJ/TUke394Gg9CKwhlxK3G FxYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KpQsHF6Y; 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 p1-20020a67fc41000000b00452629749a1si966454vsq.81.2023.10.24.10.01.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:01:08 -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=KpQsHF6Y; 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 1qvKkb-0000Em-1p; Tue, 24 Oct 2023 12:59:29 -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 1qvKkZ-0000D4-O5 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:27 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkY-0002jJ-31 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:27 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-53e2308198eso7353768a12.1 for ; Tue, 24 Oct 2023 09:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166763; x=1698771563; 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=iByrXA/jbstkhKAzvnIubYkosqn7r/1jZtcy6mOhkro=; b=KpQsHF6Y8nbywuccYUbXI+PxdOZziu6v4oDcovgcMnR1faLGBcqOruZ9mvxb/dxNkR z6HCUvUQIbhNDyaAKy0s0j82HVFmCY30c+s5XfC56xfQXGyJeoc8IanLrnxlImN4RggL oOxFG82vsTU7+f3kFsAZmWnQIj8F9wq7xEgjafiZabNeE7uB9pyjQvoY8f3565fkzzzs gO0ZXTS2mQpbn+uYfK/pqNsJa3tp42O/BuwFeoEcr2xeKrlw9s7thYYZSYh/ysBihOsD VidszGcMKSIfJ8IH8xwLGJKi0mEF3oICtC8eL+O4ey//Jd6c2YYA/W5+LCm2JKPQC2TZ CYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166763; x=1698771563; 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=iByrXA/jbstkhKAzvnIubYkosqn7r/1jZtcy6mOhkro=; b=hxuDnQ7TOt4RvqtaUtroSo9kzNColzmovUSF0dW0TxHmBV/21w3Wt+woj6WYcUsClq bY8caYD9c/xUfNMGam4Io8C0+AcTC7TZZdvQVMQXFcySKXF+jFScn/Paf79asTWQf6Z7 T2zfE6IYlvb15ehAOt42N/L6/wpPtAd1JIuWxwZpM8sAVmY7pnae4oLeMJ/RUcqitMNC 8AaLtnG1hojH0xkoJtdRZuSfZEmvn73Gaq08UXSXy5L31dA/rj3CtZHT3l/1DNEGcPzz cqRE+pQp3OZX3uKv+VIOil8QassqQgZdTO97Itpkxl7gY19VGhdxpBPqTAmmk0Bp63vW 2++Q== X-Gm-Message-State: AOJu0YxqOnuRmmlFDKuMeg5GAnUQNPxnuQFAXEyyfbioPqMCEP112oWm HyzYw7JSOy5zpkGqBslG6bbrx45y8Zj9myjgUUE= X-Received: by 2002:a05:6402:3549:b0:514:9ab4:3524 with SMTP id f9-20020a056402354900b005149ab43524mr12299177edd.7.1698166763229; Tue, 24 Oct 2023 09:59:23 -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 v15-20020a056402174f00b0054042ebbb86sm4089239edx.89.2023.10.24.09.59.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:22 -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?= , Paolo Bonzini , Eduardo Habkost Subject: [PATCH v2 3/9] target/i386: Use tcg_gen_extract_tl Date: Tue, 24 Oct 2023 18:58:56 +0200 Message-ID: <20231024165903.40861-4-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::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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/i386/tcg/translate.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 Tue Oct 24 16:58:57 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: 737558 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2139115wrl; Tue, 24 Oct 2023 10:00:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBMxNa5QfUGEq6nbqle1t2LpcHtvnfDo5uA1Uq/JnYMKY42XklyF7+NM0OZU2G081iwsU1 X-Received: by 2002:a05:622a:c5:b0:418:1179:9195 with SMTP id p5-20020a05622a00c500b0041811799195mr15115256qtw.66.1698166802778; Tue, 24 Oct 2023 10:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166802; cv=none; d=google.com; s=arc-20160816; b=LYrnxGgjbv5NGWnEktf/kqeoJ8UhR09v8Qsf27ZA4ZQGcbmZs/nEbSufnXPFTUMHo9 JBB+nHEPmgPp5TrqpcaQeM5x8YpvZ2DFeRWHFmI0IXSV9Xk1Xx7sMB7karewJP7Wy7dH 7NgAvr5Vmrm4uaLlt9LwJwAMUHKFJqFbzL/oCwS6M/fbQdxNbkjyfEcT353/MbXAiOR+ zCGqwmbK5tFLBVRopXD/YynyBRW6OuFm1xuH1cMbzNWLsaWPakIz6EZCQVYW/mcbAhbE reE3OHWhm9V1FUbE8Qk/wB47c8ePsyZ5lRDZhnLPsjPvhRMV4Xo37kZ6MgmUTH88nEYi r6og== 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=Jl2Z3AQr2WkKHVAsoHGy9DTdbizbD7vdc1kSkoPPUTk=; fh=JbM4y0V1Nvfm0kOwRZLKSBeRZdCtz9kA6cVfvZXd2gI=; b=l5Dp4dFDDFcDhOnWuOftcO9CryndE2Bny54HtQNyCVfwOw1G4iPWJQUO7ZFAPM50bP XV6R7bZviRk0180WQkYXJV4qpZr7UGwq9KgMY8ynKfnwA6T1sY8EFvzLWnXoKk+BdQ3N WU1sGFO22OZVRvZMjvUkQDgBHGbID9YoKkKP/gKyNhgSNUgvK346932bTn8W5xg+EKr1 0mfIpRu7TvnewhqifC3G+ppPAWXbD3x2W5xuZ9p5LhQZhdA17Fr14zQyJTpihjZ05G7G tFjMJypsvhO2LHpz71bAc4gFcGhzdo7q3OkEN94wecQFCFmze2vc+VZPpYSYJwVxuFvk akqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pzANdjR6; 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 w16-20020a05622a135000b004178eb52789si7042746qtk.316.2023.10.24.10.00.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:00:02 -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=pzANdjR6; 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 1qvKkf-0000Qr-Od; Tue, 24 Oct 2023 12:59: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 1qvKke-0000Oo-CM for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:32 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkc-0002nA-OU for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:32 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9c2a0725825so700328466b.2 for ; Tue, 24 Oct 2023 09:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166769; x=1698771569; 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=Jl2Z3AQr2WkKHVAsoHGy9DTdbizbD7vdc1kSkoPPUTk=; b=pzANdjR6RnrL5EpZ78eDEcqfSPO9lt6imjSB8QAXJyYyn1Gz4Ixl5uCSws6VlCJdpc 5aDKlaHylHqtRWaYMfJiTOhFKtYmRofv210wt2+bS4zINtR08mEA7z+aV358E4lsvDmr r/Xe4OktsAIVt+lBvyJcdjoUy096Ty26sKUj8B/64S2pnzjXSSO/9ieI/yD5wYbanS0M 8R4P7AVVEXCYIwJxenF0JmNAF+OrFMgpsq7Ofpq9UtNl0cglknURfxuPB4//jIDKYsnH PFW7xk5P3u1C0lgQJJYapS9f1xplpCkyNasT1R1zql12AMffmLeHPDN9205f2JeqRWuX 0+Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166769; x=1698771569; 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=Jl2Z3AQr2WkKHVAsoHGy9DTdbizbD7vdc1kSkoPPUTk=; b=lXmHF6jDEs2zyDe2P83r8E2niqiztYOXCAeWzdMWguUYWwjpT9LEyoFrLoP5FTkvEz pCKqhI/GsXg+GDSRwYtzsiW0B+G9KT64WTwJerm9JvdX68LDkcrqnOoNGPKds/lbIVYY G2l2bstNTx5C9lt0KJJDzAKlcBRoOAb3Gopic0BWeXNcaGPIR+mNFBeKB9fnBuohUz5H IqUfLEJcdRfxS/dAN2/aX8W7HUndXZsjS16A+WfKx8/Yhse/5bb8qk4U6GZ4/Ff1gS8h 9p/55hxOVGfEKkQ8TnOhpW81rRIVWIFXVdnn1KQzjNVVvVqD0y+EdHeK0dlS7b6kLlb5 fcGA== X-Gm-Message-State: AOJu0YwZCbKYx2kANA1naVpKlPIFZnccCCh+5tPmcv3y4E4cIxJwQION Vlp7TQ9vyjetdHLa3lzlhPzWu3iAfLMcZWXf+D8= X-Received: by 2002:a17:907:3206:b0:9be:4af4:f5f4 with SMTP id xg6-20020a170907320600b009be4af4f5f4mr10128752ejb.32.1698166768882; Tue, 24 Oct 2023 09:59:28 -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 17-20020a170906019100b009ad8d444be4sm8463539ejb.43.2023.10.24.09.59.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:28 -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?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH v2 4/9] target/mips: Use tcg_gen_extract_i32 Date: Tue, 24 Oct 2023 18:58:57 +0200 Message-ID: <20231024165903.40861-5-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::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.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/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 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); } } } From patchwork Tue Oct 24 16:58:59 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: 737562 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2140176wrl; Tue, 24 Oct 2023 10:01:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLwTsx4wPTKMmwIlKS/7f5/jiEA/dixnCcp60r/JhlI8y3MCyL+aI1ErR0vQvVkFjAh3EX X-Received: by 2002:a05:622a:1490:b0:41e:1f5d:7009 with SMTP id t16-20020a05622a149000b0041e1f5d7009mr7162535qtx.25.1698166900083; Tue, 24 Oct 2023 10:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166900; cv=none; d=google.com; s=arc-20160816; b=Kw8LMy+JRk9pWs2lK5o/UmnF5hlywdliRj2MpJp6+fcNYgG3OP9ilCZxkAnx2TxpnO vyxDZD9rUvH8G8M+i4TkT/q0gboQlpM1Us01oPKhf1gxdzdwQdVEwd3RQcWoLMVgD6nC xtTMkQ7UE27nLowRD4OXx3fbYYJBJkVp4Ts4fZ+d+4727YeJHNx2GDOHoYrE9S2NfuZJ 0+KtDga4Xxa+HZhAQ45ZvsurzjtkAhq17ai4HMlJrKdSkgQqBoJ4txvv1d5qjGtdxRw4 gV8HFWPA1ndH/8IOX5sgZsfEAQkNp7mAPuy2k1+bEnzjxNUl02nh5jTTbcvMioGxoSlj k9TA== 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=tnvgobrgvZ8fCptCv+JHpeuubvqilC8RCHSCmo0hdqY=; fh=lMFlj1BLUq9uCbF2Jd22FwW7rRILQVuwhV4rwBHfLn8=; b=ZM6o8aFJ9ORxhDX5+JAUXSyEZNxiEtKe8H+UPzTArztP6aNVij5NDO0EWJitgSFjcI UqOtutYJTDMJpcZfhrQ/CXLELe7J6SYbEhqN2y6DZc6Int7+ASWpflcqSJxK/tkpwS8t ZIMcgzoVdMQTZI72GBUQ5H9Iv038TogOOOZw+Ne1Mav5YT1geUFNxbLjEIhAj3jlFsDX ZnfdFVLAuroN8W/uGrWfNeQxfFEv/X6bdmfE8s2Ja9jEW6MxFKmCmtzRt1VP6zskCrft reAu5aro/pOpHH2C4oEujkRVERdxUgkGRy3MvdX5KjpYrfiO7zzByHkh2fI99vuAdTmM q3Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrnu70PU; 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 f4-20020a05622a1a0400b004199bf94c56si7795302qtb.411.2023.10.24.10.01.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:01:40 -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=qrnu70PU; 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 1qvKky-0000d4-Ky; Tue, 24 Oct 2023 12:59:53 -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 1qvKks-0000bx-8N for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:46 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkp-0002re-37 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:44 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5384975e34cso7438940a12.0 for ; Tue, 24 Oct 2023 09:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166780; x=1698771580; 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=tnvgobrgvZ8fCptCv+JHpeuubvqilC8RCHSCmo0hdqY=; b=qrnu70PUE2+0AsIvz0zHDNlGRayobEuI6stphYkhhCcmvQJspRQKMBvOjTpxgMhQuH vog31loLmA6oGyoWnXDE/nRxqeYBTs64LysqrVqnYTXGYO8sYfWRhN/Yr655SUwP/S4o hSmI/4nSi3XWJvII8T2IhXJTG8R8vfS+pW6Lpq5hbz9moH8pBiigVRSUNjStMm+2J34g 2wnuqWLt1DPEF93krXcdMcDoSwcx/fZ/t41U8eAPBxWDqPyco6kFWVIElnhV7LVbbZhh oXDXNnwPXlNpoLGz2d4SvRmya1vc9y/AlMmut9BHexejluIbmVcXJVyes7SYA0S6q3IA M9tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166780; x=1698771580; 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=tnvgobrgvZ8fCptCv+JHpeuubvqilC8RCHSCmo0hdqY=; b=XDsvoT8u+9kmaWVnjsmZUWkpSYfcoAjCIM1O3T/afxbyhHBpXL9B2OuK4DG2MNXu4B ujZUrV1IQWfCCiC7Y+4ZffhNMLFS+XtBKM9MxH3BBBpuff4jzBMvSBya3tx0UFGe67Yk 8q/HG7Y7H35iyfZ3GNYwSjNu5CF8UicLRV8TBGjuVxrvDpnUE2I3mvcq8MkV995hw8dI 7HIlzdqtCFfO3daefeLtkLUbNg0bfAHvPfA831wDKavZS84gzmtznjMT/H085kGYXzyN Wmqu7ng5HVrdv8WGx0OD0z4yDuyY+gquKEK4KLvYaa1nvp7ZBV+kDUxCxQse1bYLSTf7 j4oQ== X-Gm-Message-State: AOJu0Yxg/NwpY7Ef3RN5wlGLQM503d1IqEeMc/WAxFRMP2wSSIb1Dsm/ 9Uk19kNoUr7U6HINjNY136nsbQigQ3qOxcMIMGA= X-Received: by 2002:a05:6402:3589:b0:53f:1ce2:a3ac with SMTP id y9-20020a056402358900b0053f1ce2a3acmr9985936edc.41.1698166780278; Tue, 24 Oct 2023 09:59:40 -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 n28-20020a5099dc000000b0053e37d13f4fsm8317919edb.52.2023.10.24.09.59.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:39 -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?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH v2 6/9] target/sparc: Use tcg_gen_extract_tl Date: Tue, 24 Oct 2023 18:58:59 +0200 Message-ID: <20231024165903.40861-7-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::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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/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 Tue Oct 24 16:59:00 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: 737560 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2139119wrl; Tue, 24 Oct 2023 10:00:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZ7UF0pxKg6BwKQ1aa/gP5MhXm0ew/tSk2sekVMqsqwG/TAuvrvc2+IGPe5Dl1m4UaB2hz X-Received: by 2002:a0c:eec7:0:b0:65a:f7b2:2057 with SMTP id h7-20020a0ceec7000000b0065af7b22057mr22706582qvs.24.1698166803029; Tue, 24 Oct 2023 10:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166803; cv=none; d=google.com; s=arc-20160816; b=eDjwesFGxSuZ1Q7v/tnKuqxdi3hgUDkgym97pTEn5dVRFYOcrlyhCXiLVKWdEAJnci MnZcz2L52cojSdpg0ZCDhBM4GznHAsy0qsZGexef8H/bYrjvX6wzFrz4OSoqxNUTqUes XiF+n2AwrshwC46F3CFzBxALnGS9hO3zLHee1lqws+yZuxpKbAvFRdsqlN4XaHHV+Xwk i1aYY/5ocLnqKYe3eLs2v5mmWix7mmVtOj8Ns+xo5Vc1vJGSUeLxAQmnYsjS5ji06G3l ZTGShvPYXDI9AeFTXzNKz27Ga8m6UdD3cIwQ2RAyOP2ce7EnWo/jtNV9rsWmCPC+uU6q 0KeA== 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=SJKbQ/KzB5PU6j23DLpfBbyLDRsAcidVy6b/XXutwa4=; fh=o84/vN2c4Vc2Aw+xkAce86tpD8jegFvPOIlB7+8VBlA=; b=HpsGkXtnG8SqGiWavGMuiA3iCe5yXBK5S5cp+i1OVBFhErUCDZOxhNSMa8P3EyUl7v uleF1d97cMnDV1ppxxPbcX+EXsiGaRnfEh4JX+Sc4CRGy6+a6g9xsiuTq24G+1lwXtC1 xHH5GHnXYCWGNwoakWZ5tOm2J6WYPdraxluudaHGBIVpkfLWr51Dg0DdLOxbYKAyPj2u hScUEL0+vTEBKfmTtL+S0y09rfTnr2SBXHjetmcoD9eB/zay4AIsGo0xueIKdQ4NbVSh OQ5KQ1DA2O11iL4eBeGhZXKc8le59qi6RvHgOPPKI9OYyXjLk2dqmI8QGmln1eGwAHoV VIrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BME1diKC; 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 h14-20020a05620a21ce00b007683e40b4a1si7184302qka.517.2023.10.24.10.00.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:00:03 -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=BME1diKC; 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 1qvKl1-0000dQ-Dq; Tue, 24 Oct 2023 12:59:55 -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 1qvKky-0000cb-9q for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:52 -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 1qvKkt-0002sb-By for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:48 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9c773ac9b15so610945366b.2 for ; Tue, 24 Oct 2023 09:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166785; x=1698771585; 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=SJKbQ/KzB5PU6j23DLpfBbyLDRsAcidVy6b/XXutwa4=; b=BME1diKCgyCx7ql7Tq+fXLdJ/5dZvsiMrn5cRVKXZlR0zfzU9h6RNyR80RFGmXtNNA Y/PDba6gYIRrAx9dg1yoa/qCNNXdYwj41ZO6PSTQWLBPNqRsUfjH7+kOcuhaK4QJYbRP F0ruzltH1uVnXf/h5B02xm5zzPSwsbtdeFBY9y4q373IHcm77YFAl1oDINfgqtJOObaK 2+j8ZqOdYO/NBGX2d0XCzcF+vSlQjgA3dyOTckOoxuMKWLXLXEff8hc9V/ocErA9T5Z/ l0ePpKqAtAEEckixyo50pwDQEv6i/VSRjzM4X3rZtSxcP6r4sWQdc1wGMg+/oaBFiOtP MnSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166785; x=1698771585; 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=SJKbQ/KzB5PU6j23DLpfBbyLDRsAcidVy6b/XXutwa4=; b=WrPY/zS4gAVl29+jcO425B2qFvesziL+xjmcpjG4icz7kR4YicuZ/lBCAqGVUNwKnr qBpZvTd/qRMVQflxZZuUcYQaWk4m+h65S4EOwzHPo8Wul7zgWoSIWkuLCDYxJrm+9brW REiHaAYMof63kRa8/rMTetdPK0ZnsHiLpIUyi5nJmli1ur0/9GoqIipJEFXxuZ/JwDuX YRMSK1ZkWGZ29jv5rIzubInO/TMLEQCmWdV5gMhe8E4HcXxZk6hotU7qJcnuTena3/Zp ZPIv1EFdNLZ/tAysuIEIDlvqmmePKmNlTj3YqTi0QByS3GBWWg0726gZYJ/omYXspQBP UpAQ== X-Gm-Message-State: AOJu0YwTdRvp1EDZ8wmyIw4mbCgwLa8MKB328cCJqA7/lm+F98Dt/WJN xfTj259xovEIDPEeyVfxkjUxs8zVXlfGjRuyDWc= X-Received: by 2002:a17:907:25c3:b0:9bf:39f3:f11a with SMTP id ae3-20020a17090725c300b009bf39f3f11amr9750219ejc.74.1698166785749; Tue, 24 Oct 2023 09:59:45 -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 v26-20020a17090610da00b00993a37aebc5sm8477875ejv.50.2023.10.24.09.59.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:45 -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?= , Max Filippov Subject: [PATCH v2 7/9] target/xtensa: Use tcg_gen_extract_i32 Date: Tue, 24 Oct 2023 18:59:00 +0200 Message-ID: <20231024165903.40861-8-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: 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 Tue Oct 24 16:59:01 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: 737567 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2141575wrl; Tue, 24 Oct 2023 10:03:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfzL78tRD8Cybp5TA4jXiDvO+ESl9mgI/RClk2DdXv9HIcKFFxemGxaKtkUP/IhcLpCFUr X-Received: by 2002:a67:ae09:0:b0:44e:99a2:a42 with SMTP id x9-20020a67ae09000000b0044e99a20a42mr8330774vse.11.1698167012561; Tue, 24 Oct 2023 10:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698167012; cv=none; d=google.com; s=arc-20160816; b=w95kOK3tpROWYa/fHFG/w4tiJRCMAEOm+u88hpYIs3I4UG/NCE0sxoKDnjbVVCu6qk 5sBY0tU2kqPvLlyCjRvVaxVmIBse1FEeA4t1evFYPo8kznH4uSiTFrOZjXYSr1CAcEor U7ww57G4U2mxBk2eAGk+wWiRd5OaxYgnshKXNFP/Not3otA5i6FKu9bnyOLq+bImurxy LGtQm969mZVpbT9fsXHXT+gB44jQuBVI0H61eSP5zqCLuXWHJxFPvZcxJA7CC2OSmv6G xCSsb87OgDyx3KEQqI1lI/1zSaRV7iQIsCdKyh0VUcNxVvyIwVPdsRUgxyL86DTcTMTT G1cA== 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=ncCgWtfinnqqDtx4stcx4MicUxQ5sAnO3Rr4b4ddO70=; fh=JbM4y0V1Nvfm0kOwRZLKSBeRZdCtz9kA6cVfvZXd2gI=; b=JDsaTKJ4l8VpvmztB2OHQS8jSbjAXCYNC0Dz0RbZk7hzRL3eV/ZfxKsmc1o7bjELkq fkX5T7FVnMVDweKFBvXJxNyjGHZppVL3S5Zc9paGvoQ99lSDOnBO48/YVnwzdQZ+iv1/ cofBFEPA8hPeoj7q6Oqm/h2ORwpx78SPYm96jHNgcdwacRd46rGgbnT+DjNhLefKQ2QS ANkb8Fzb8p/778cW1aiuS6rCT2l6A1PccuYGJWy079xhFltdJ30VQr2qMK83Jogejd/h 9MNy72c+MsVdwfnFyZWmeaOn1wqmXNjXY+bKePZTBZq8N4XSAPn8fJbqn6m68SoQiaN5 mTJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ONyfJiFd; 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 m14-20020a67fe4e000000b004546cc8fbcesi943103vsr.329.2023.10.24.10.03.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:03:32 -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=ONyfJiFd; 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 1qvKl7-0000jO-Cr; Tue, 24 Oct 2023 13:00:02 -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 1qvKl2-0000dl-1S for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:56 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKkz-0002tK-G3 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:59:55 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5384975e34cso7439328a12.0 for ; Tue, 24 Oct 2023 09:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166791; x=1698771591; 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=ncCgWtfinnqqDtx4stcx4MicUxQ5sAnO3Rr4b4ddO70=; b=ONyfJiFdZGFla/QFuvXCprU2Wr1mgLE/v6YKlF7V40h5kctIkE5uGyJSiIjXm0AT0c QLq5gmu2T1UHLhkTRz9+Ai+7PEGunWh37rmPMCkFPhNnmfE81XUNK7T7A1ITXt9zDsL4 QwICFcJQ1+AvR4wPmkkc+dHR5kVT7+qv51JzRJ4zQUsxKy3dgSFuh5R1ZN6edXZfLFqW DzY/jMyetEIKCuq2oiiCO3LfkXLf2a0e/8T2mcsE9xPHdA1uP1rCz+IObLew/Sc20ice JaMjYpbMGEU2pZTAJjGJDdjrfV4cp1PcCLmOsYtYR6DhS0DApEGOxSJueX3iGK3uXme2 ZnWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166791; x=1698771591; 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=ncCgWtfinnqqDtx4stcx4MicUxQ5sAnO3Rr4b4ddO70=; b=C2Ir96IZu1dS1DhL2VOSb29TBXxc7T63rjIqq/NYtE44BnTbEnX0d/ZSFNch0Mg3CA GDDJj92zxGyClePUNhF9eqwrwYUk6wlf+IfCqm0X6CgpbLD38+nfBK8JtTZD4wUZDdDU KtJtMgI8xJ14d3etDIP0kHozY7tDxpvc+AHntGEpYx5H0KA2QmCxd5d87h5meH4YVK2D /xVxQGDZFcA/M/n4hvAEWOnWFiiJTzu8ewPyNNr3b46+s7HTg/bU02mAlwSrR3pUWL8J zp8T4Ie2hBbOGUfvS8GMuZebY5QNnbqD33CH5GKF0j7zU6pAHtF14Bk4jARoEssc515q A9Ng== X-Gm-Message-State: AOJu0YwhOpDdhF6SRXJ1uVnVKqEBT3NmbkJ5pwjCKuwe+rFfTvOOv8tf aiJyrlQURH57TZ5SPNB9zR9bUFNzomAGrFALhkc= X-Received: by 2002:a17:907:1c93:b0:9bf:70ea:6926 with SMTP id nb19-20020a1709071c9300b009bf70ea6926mr10660594ejc.2.1698166791500; Tue, 24 Oct 2023 09:59:51 -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 gx13-20020a1709068a4d00b009ae6a6451fdsm8503502ejc.35.2023.10.24.09.59.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:51 -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?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH v2 8/9] target/mips: Use tcg_gen_ext16s_tl Date: Tue, 24 Oct 2023 18:59:01 +0200 Message-ID: <20231024165903.40861-9-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::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.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 Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 54 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c index c517258ac5..096a01e044 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -1014,10 +1014,10 @@ static void gen_mxu_d16mul(DisasContext *ctx, bool fractional, */ gen_load_mxu_gpr(t1, XRb); - tcg_gen_sextract_tl(t0, t1, 0, 16); + tcg_gen_ext16s_tl(t0, t1); tcg_gen_sextract_tl(t1, t1, 16, 16); gen_load_mxu_gpr(t3, XRc); - tcg_gen_sextract_tl(t2, t3, 0, 16); + tcg_gen_ext16s_tl(t2, t3); tcg_gen_sextract_tl(t3, t3, 16, 16); switch (optn2) { @@ -1113,11 +1113,11 @@ static void gen_mxu_d16mac(DisasContext *ctx, bool fractional, aptn2 = extract32(ctx->opcode, 24, 2); gen_load_mxu_gpr(t1, XRb); - tcg_gen_sextract_tl(t0, t1, 0, 16); + tcg_gen_ext16s_tl(t0, t1); tcg_gen_sextract_tl(t1, t1, 16, 16); gen_load_mxu_gpr(t3, XRc); - tcg_gen_sextract_tl(t2, t3, 0, 16); + tcg_gen_ext16s_tl(t2, t3); tcg_gen_sextract_tl(t3, t3, 16, 16); switch (optn2) { @@ -1234,11 +1234,11 @@ static void gen_mxu_d16madl(DisasContext *ctx) aptn2 = extract32(ctx->opcode, 24, 2); gen_load_mxu_gpr(t1, XRb); - tcg_gen_sextract_tl(t0, t1, 0, 16); + tcg_gen_ext16s_tl(t0, t1); tcg_gen_sextract_tl(t1, t1, 16, 16); gen_load_mxu_gpr(t3, XRc); - tcg_gen_sextract_tl(t2, t3, 0, 16); + tcg_gen_ext16s_tl(t2, t3); tcg_gen_sextract_tl(t3, t3, 16, 16); switch (optn2) { @@ -1323,15 +1323,15 @@ static void gen_mxu_s16mad(DisasContext *ctx) tcg_gen_sextract_tl(t1, t1, 16, 16); break; case MXU_OPTN2_LW: /* XRB.L*XRC.L */ - tcg_gen_sextract_tl(t0, t0, 0, 16); - tcg_gen_sextract_tl(t1, t1, 0, 16); + tcg_gen_ext16s_tl(t0, t0); + tcg_gen_ext16s_tl(t1, t1); break; case MXU_OPTN2_HW: /* XRB.H*XRC.L */ tcg_gen_sextract_tl(t0, t0, 16, 16); - tcg_gen_sextract_tl(t1, t1, 0, 16); + tcg_gen_ext16s_tl(t1, t1); break; case MXU_OPTN2_XW: /* XRB.L*XRC.H */ - tcg_gen_sextract_tl(t0, t0, 0, 16); + tcg_gen_ext16s_tl(t0, t0); tcg_gen_sextract_tl(t1, t1, 16, 16); break; } @@ -1998,9 +1998,9 @@ static void gen_mxu_q16sxx(DisasContext *ctx, bool right, bool arithmetic) if (arithmetic) { tcg_gen_sextract_tl(t1, t0, 16, 16); - tcg_gen_sextract_tl(t0, t0, 0, 16); + tcg_gen_ext16s_tl(t0, t0); tcg_gen_sextract_tl(t3, t2, 16, 16); - tcg_gen_sextract_tl(t2, t2, 0, 16); + tcg_gen_ext16s_tl(t2, t2); } else { tcg_gen_extract_tl(t1, t0, 16, 16); tcg_gen_extract_tl(t0, t0, 0, 16); @@ -2066,9 +2066,9 @@ static void gen_mxu_q16sxxv(DisasContext *ctx, bool right, bool arithmetic) if (arithmetic) { tcg_gen_sextract_tl(t1, t0, 16, 16); - tcg_gen_sextract_tl(t0, t0, 0, 16); + tcg_gen_ext16s_tl(t0, t0); tcg_gen_sextract_tl(t3, t2, 16, 16); - tcg_gen_sextract_tl(t2, t2, 0, 16); + tcg_gen_ext16s_tl(t2, t2); } else { tcg_gen_extract_tl(t1, t0, 16, 16); tcg_gen_extract_tl(t0, t0, 0, 16); @@ -2492,8 +2492,8 @@ static void gen_mxu_D16SLT(DisasContext *ctx) tcg_gen_sextract_tl(t1, t4, 16, 16); tcg_gen_setcond_tl(TCG_COND_LT, t0, t0, t1); tcg_gen_shli_tl(t2, t0, 16); - tcg_gen_sextract_tl(t0, t3, 0, 16); - tcg_gen_sextract_tl(t1, t4, 0, 16); + tcg_gen_ext16s_tl(t0, t3); + tcg_gen_ext16s_tl(t1, t4); tcg_gen_setcond_tl(TCG_COND_LT, t0, t0, t1); tcg_gen_or_tl(mxu_gpr[XRa - 1], t2, t0); } @@ -2547,8 +2547,8 @@ static void gen_mxu_d16avg(DisasContext *ctx, bool round45) } tcg_gen_shli_tl(t2, t0, 15); tcg_gen_andi_tl(t2, t2, 0xffff0000); - tcg_gen_sextract_tl(t0, t3, 0, 16); - tcg_gen_sextract_tl(t1, t4, 0, 16); + tcg_gen_ext16s_tl(t0, t3); + tcg_gen_ext16s_tl(t1, t4); tcg_gen_add_tl(t0, t0, t1); if (round45) { tcg_gen_addi_tl(t0, t0, 1); @@ -2844,9 +2844,9 @@ static void gen_mxu_D16CPS(DisasContext *ctx) gen_set_label(l_done_hi); tcg_gen_shli_i32(t1, t1, 16); - tcg_gen_sextract_tl(t0, mxu_gpr[XRc - 1], 0, 16); + tcg_gen_ext16s_tl(t0, mxu_gpr[XRc - 1]); tcg_gen_brcondi_tl(TCG_COND_GE, t0, 0, l_not_less_lo); - tcg_gen_sextract_tl(t0, mxu_gpr[XRb - 1], 0, 16); + tcg_gen_ext16s_tl(t0, mxu_gpr[XRb - 1]); tcg_gen_subfi_tl(t0, 0, t0); tcg_gen_br(l_done_lo); @@ -3388,7 +3388,7 @@ static void gen_mxu_d16asum(DisasContext *ctx) gen_load_mxu_gpr(t3, XRc); if (XRa != 0) { - tcg_gen_sextract_tl(t0, t2, 0, 16); + tcg_gen_ext16s_tl(t0, t2); tcg_gen_sextract_tl(t1, t2, 16, 16); tcg_gen_add_tl(t0, t0, t1); if (aptn2 & 2) { @@ -3399,7 +3399,7 @@ static void gen_mxu_d16asum(DisasContext *ctx) } if (XRd != 0) { - tcg_gen_sextract_tl(t0, t3, 0, 16); + tcg_gen_ext16s_tl(t0, t3); tcg_gen_sextract_tl(t1, t3, 16, 16); tcg_gen_add_tl(t0, t0, t1); if (aptn2 & 1) { @@ -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_ext16s_tl(t1, mxu_gpr[XRb - 1]); 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_ext16s_tl(t1, mxu_gpr[XRc - 1]); 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); @@ -3942,7 +3940,7 @@ static void gen_mxu_q16scop(DisasContext *ctx) tcg_gen_movi_tl(t3, 0x00010000); gen_set_label(l_b_lo); - tcg_gen_sextract_tl(t2, t0, 0, 16); + tcg_gen_ext16s_tl(t2, t0); tcg_gen_brcondi_tl(TCG_COND_EQ, t2, 0, l_c_hi); tcg_gen_brcondi_tl(TCG_COND_LT, t2, 0, l_b_lo_lt); tcg_gen_ori_tl(t3, t3, 0x00000001); @@ -3964,7 +3962,7 @@ static void gen_mxu_q16scop(DisasContext *ctx) tcg_gen_movi_tl(t4, 0x00010000); gen_set_label(l_c_lo); - tcg_gen_sextract_tl(t2, t1, 0, 16); + tcg_gen_ext16s_tl(t2, t1); tcg_gen_brcondi_tl(TCG_COND_EQ, t2, 0, l_done); tcg_gen_brcondi_tl(TCG_COND_LT, t2, 0, l_c_lo_lt); tcg_gen_ori_tl(t4, t4, 0x00000001); From patchwork Tue Oct 24 16:59:02 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: 737563 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2141161wrl; Tue, 24 Oct 2023 10:02:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJbVviCRCmXRPzfRgEUMCZuENodiSQ7AZxbRff2Tc6W+oISbYolsuhUcJhca1JAX0o1uRI X-Received: by 2002:a05:6870:5d86:b0:1e9:c224:bb91 with SMTP id fu6-20020a0568705d8600b001e9c224bb91mr17414765oab.38.1698166977641; Tue, 24 Oct 2023 10:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698166977; cv=none; d=google.com; s=arc-20160816; b=Gka1mX56Le9ZruVRow2yrAFyhuA9ytxXcCiAG6PZKri9UN1fOLZlC20ymWdmG0ocvg rnM0ANcrOzFJnPR7FBRPnqw8eXVsQcQS29eXMR0Ohx9JRRTbi3362AL9nVjblTna3Lnh OgAGeSW2/asTVEUrgjJULxwsqwfcW/2l7SjBdwgmNGma9ramdj4CKGk2iyeHwTrcYU1i 78GhtFJ7zxb63nhRmXndfXAsip+BYIQ9ZDDdFlszoUGbyOmhbDzJsYEt59O1ySsv2MyG p6QJFgIectaW2mMMpOkGmDpC3XR8dovAgoEksfKKQlxyv3Oixu55g8rakgIv/N0j1EN/ ts7Q== 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=k/VaFybadz8sHRxLunLaPSmKQ0yZTOJvG0Do3RUVPUA=; fh=JbM4y0V1Nvfm0kOwRZLKSBeRZdCtz9kA6cVfvZXd2gI=; b=ECvJXS/4CTcNRCqruEzjxvIvc9xzS4qVkUdKlGOzNpi5jicyQpqsZBFauDxkYJbjmu uHIGpoCKLKldzuRZ5It3uhXPDnaAeBNs+egzXRKLdZBy7cxO1FSqAsNBoFbb7eA8SYjQ Dahyz+sAErzL8DO8Y3latFtZ7A4yqyBD2cxe9f68TaCQ6RwB5MH05HucmG74Jj/y+fWs cYwIpmENU1qQ8rPUECDH+jmzYfaLPcPqXSp70pgml8n2hNgDJaQsLfnafK//JAj05/Wj U86/YSPJMvJe0NOsNp2Jc8z3b3s8lRycNsw4bRo961BvudZ1TfEef05rHq/zp5mCttef yb+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yPOYM0QT; 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 x15-20020ab0640f000000b0079b2be7768bsi1109375uao.3.2023.10.24.10.02.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 10:02:57 -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=yPOYM0QT; 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 1qvKlH-00017I-CV; Tue, 24 Oct 2023 13:00:11 -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 1qvKl9-0000x7-G8 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 13:00:03 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKl5-0002u7-F0 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 13:00:03 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9c3aec5f326so1211218266b.1 for ; Tue, 24 Oct 2023 09:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698166797; x=1698771597; 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=k/VaFybadz8sHRxLunLaPSmKQ0yZTOJvG0Do3RUVPUA=; b=yPOYM0QT0hgnpWwJ/q0KJa3FPW6ElQmDwxNPXZIRUhiT/JlmzLPgO30MfwAxTKeVog 4u8T8c8TDwehvhRxLS1t9nb1m3b/pHIVIEZzhbxfxQEU4XGiykWF6BATVHJwq4PTqdHL 1kBQ2s9yjwo1NL45QeA672noa7U2FAJ9Kvxol8VIpLrBuioBslWHTGREIsKU6/p6D1Oc awWAV4UzW4wiZ3FWEz0/LdiQ/TegX31FYb9Ed23h/fSywWE/2THsVELGN29zsDS0RP78 wRhMPoVbVkgJIUqSWcANxr0F9e1jAq1jEH9iTL5t8JUvXFqhOuOqaAYnOFnGelHRkeFw Wfwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698166797; x=1698771597; 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=k/VaFybadz8sHRxLunLaPSmKQ0yZTOJvG0Do3RUVPUA=; b=fIR2K3t954BvpC3kVtIiTZwsW/2POM+DeG/9OP4vG53i+m+41PzBQvEQ2kGrD+XnOd bpG4/jKDJFGQtypzsTvHtN5W6pnWyY0o/86rcRur6oYAiCzWm7VtSwRApq0GsxVg+dO5 DieTURlMpQXrOLfMsvfj1Hoxp1vQzBFEP2xdzCfqKSXcF0v+FxT9TE8oJRrkiW2Xfbzi pzKuWtlXAgrNGGd7/g3xPwV2mznKA0/GdsqgZ3T9OqnwTQJb+md6QHNKqgUVdvc8XI4O gT0tsCJjFIvmcbdHviLKLpZV5z7uvgaZoSWcMcF4Qz+5RfztpvIAIE03OqcRXJix1zTV HnSA== X-Gm-Message-State: AOJu0YyVUtR6tPuHhh0LTXZc5PRJDPYULSdbnX5Pn6f60FbSken4yNNd zloXHvbdyaipGqcXP3kwQSFggVUiz3UCxzktlJY= X-Received: by 2002:a17:907:86a6:b0:9b7:4ec2:444e with SMTP id qa38-20020a17090786a600b009b74ec2444emr13098317ejc.8.1698166797513; Tue, 24 Oct 2023 09:59:57 -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 g27-20020a170906395b00b00988dbbd1f7esm8423762eje.213.2023.10.24.09.59.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:59:56 -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?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH v2 9/9] target/mips: Use tcg_gen_ext*u_tl Date: Tue, 24 Oct 2023 18:59:02 +0200 Message-ID: <20231024165903.40861-10-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::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c index 096a01e044..451fbd7664 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -823,7 +823,7 @@ static void gen_mxu_s8std(DisasContext *ctx, bool postmodify) switch (optn3) { /* XRa[7:0] => tmp8 */ case MXU_OPTN3_PTN0: - tcg_gen_extract_tl(t1, t1, 0, 8); + tcg_gen_ext8u_tl(t1, t1); break; /* XRa[15:8] => tmp8 */ case MXU_OPTN3_PTN1: @@ -931,7 +931,7 @@ static void gen_mxu_s16std(DisasContext *ctx, bool postmodify) switch (optn2) { /* XRa[15:0] => tmp16 */ case MXU_OPTN2_PTN0: - tcg_gen_extract_tl(t1, t1, 0, 16); + tcg_gen_ext16u_tl(t1, t1); break; /* XRa[31:16] => tmp16 */ case MXU_OPTN2_PTN1: @@ -1259,8 +1259,8 @@ static void gen_mxu_d16madl(DisasContext *ctx) tcg_gen_mul_tl(t2, t1, t2); break; } - tcg_gen_extract_tl(t2, t2, 0, 16); - tcg_gen_extract_tl(t3, t3, 0, 16); + tcg_gen_ext16u_tl(t2, t2); + tcg_gen_ext16u_tl(t3, t3); gen_load_mxu_gpr(t1, XRa); tcg_gen_extract_tl(t0, t1, 0, 16); @@ -1961,7 +1961,7 @@ static void gen_mxu_d32sarl(DisasContext *ctx, bool sarw) gen_load_mxu_gpr(t1, XRc); tcg_gen_sar_tl(t0, t0, t2); tcg_gen_sar_tl(t1, t1, t2); - tcg_gen_extract_tl(t2, t1, 0, 16); + tcg_gen_ext16u_tl(t2, t1); tcg_gen_deposit_tl(t2, t2, t0, 16, 16); gen_store_mxu_gpr(t2, XRa); } @@ -2667,9 +2667,9 @@ static void gen_mxu_q8movzn(DisasContext *ctx, TCGCond cond) tcg_gen_deposit_tl(t2, t2, t3, 8, 8); gen_set_label(l_quarterrest); - tcg_gen_extract_tl(t3, t1, 0, 8); + tcg_gen_ext8u_tl(t3, t1); tcg_gen_brcondi_tl(cond, t3, 0, l_done); - tcg_gen_extract_tl(t3, t0, 0, 8); + tcg_gen_ext8u_tl(t3, t0); tcg_gen_deposit_tl(t2, t2, t3, 0, 8); gen_set_label(l_done); @@ -2714,9 +2714,9 @@ static void gen_mxu_d16movzn(DisasContext *ctx, TCGCond cond) tcg_gen_deposit_tl(t2, t2, t3, 16, 16); gen_set_label(l_halfdone); - tcg_gen_extract_tl(t3, t1, 0, 16); + tcg_gen_ext16u_tl(t3, t1); tcg_gen_brcondi_tl(cond, t3, 0, l_done); - tcg_gen_extract_tl(t3, t0, 0, 16); + tcg_gen_ext16u_tl(t3, t0); tcg_gen_deposit_tl(t2, t2, t3, 0, 16); gen_set_label(l_done); @@ -2851,7 +2851,7 @@ static void gen_mxu_D16CPS(DisasContext *ctx) tcg_gen_br(l_done_lo); gen_set_label(l_not_less_lo); - tcg_gen_extract_tl(t0, mxu_gpr[XRb - 1], 0, 16); + tcg_gen_ext16u_tl(t0, mxu_gpr[XRb - 1]); gen_set_label(l_done_lo); tcg_gen_deposit_tl(mxu_gpr[XRa - 1], t1, t0, 0, 16); @@ -3033,7 +3033,7 @@ static void gen_mxu_q8adde(DisasContext *ctx, bool accumulate) tcg_gen_add_tl(t2, t2, t3); } tcg_gen_shli_tl(t2, t2, 16); - tcg_gen_extract_tl(t0, t0, 0, 16); + tcg_gen_ext16u_tl(t0, t0); tcg_gen_or_tl(t4, t2, t0); } if (XRd != 0) { @@ -3056,7 +3056,7 @@ static void gen_mxu_q8adde(DisasContext *ctx, bool accumulate) tcg_gen_add_tl(t2, t2, t3); } tcg_gen_shli_tl(t2, t2, 16); - tcg_gen_extract_tl(t0, t0, 0, 16); + tcg_gen_ext16u_tl(t0, t0); tcg_gen_or_tl(t5, t2, t0); } @@ -3156,11 +3156,11 @@ static void gen_mxu_q16add(DisasContext *ctx) TCGv t5 = tcg_temp_new(); gen_load_mxu_gpr(t1, XRb); - tcg_gen_extract_tl(t0, t1, 0, 16); + tcg_gen_ext16u_tl(t0, t1); tcg_gen_extract_tl(t1, t1, 16, 16); gen_load_mxu_gpr(t3, XRc); - tcg_gen_extract_tl(t2, t3, 0, 16); + tcg_gen_ext16u_tl(t2, t3); tcg_gen_extract_tl(t3, t3, 16, 16); switch (optn2) { @@ -3210,9 +3210,9 @@ static void gen_mxu_q16add(DisasContext *ctx) } tcg_gen_shli_tl(t0, t0, 16); - tcg_gen_extract_tl(t1, t1, 0, 16); + tcg_gen_ext16u_tl(t1, t1); tcg_gen_shli_tl(t4, t4, 16); - tcg_gen_extract_tl(t5, t5, 0, 16); + tcg_gen_ext16u_tl(t5, t5); tcg_gen_or_tl(mxu_gpr[XRa - 1], t4, t5); tcg_gen_or_tl(mxu_gpr[XRd - 1], t0, t1); @@ -3242,11 +3242,11 @@ static void gen_mxu_q16acc(DisasContext *ctx) TCGv s0 = tcg_temp_new(); gen_load_mxu_gpr(t1, XRb); - tcg_gen_extract_tl(t0, t1, 0, 16); + tcg_gen_ext16u_tl(t0, t1); tcg_gen_extract_tl(t1, t1, 16, 16); gen_load_mxu_gpr(t3, XRc); - tcg_gen_extract_tl(t2, t3, 0, 16); + tcg_gen_ext16u_tl(t2, t3); tcg_gen_extract_tl(t3, t3, 16, 16); switch (aptn2) { @@ -3278,7 +3278,7 @@ static void gen_mxu_q16acc(DisasContext *ctx) if (XRa != 0) { tcg_gen_add_tl(t0, mxu_gpr[XRa - 1], s0); - tcg_gen_extract_tl(t0, t0, 0, 16); + tcg_gen_ext16u_tl(t0, t0); tcg_gen_extract_tl(t1, mxu_gpr[XRa - 1], 16, 16); tcg_gen_add_tl(t1, t1, s1); tcg_gen_shli_tl(t1, t1, 16); @@ -3287,7 +3287,7 @@ static void gen_mxu_q16acc(DisasContext *ctx) if (XRd != 0) { tcg_gen_add_tl(t0, mxu_gpr[XRd - 1], s2); - tcg_gen_extract_tl(t0, t0, 0, 16); + tcg_gen_ext16u_tl(t0, t0); tcg_gen_extract_tl(t1, mxu_gpr[XRd - 1], 16, 16); tcg_gen_add_tl(t1, t1, s3); tcg_gen_shli_tl(t1, t1, 16); @@ -3335,7 +3335,7 @@ static void gen_mxu_q16accm(DisasContext *ctx) tcg_gen_add_tl(a0, a0, t0); tcg_gen_add_tl(a1, a1, t1); } - tcg_gen_extract_tl(a0, a0, 0, 16); + tcg_gen_ext16u_tl(a0, a0); tcg_gen_shli_tl(a1, a1, 16); tcg_gen_or_tl(mxu_gpr[XRa - 1], a1, a0); } @@ -3358,7 +3358,7 @@ static void gen_mxu_q16accm(DisasContext *ctx) tcg_gen_add_tl(a0, a0, t0); tcg_gen_add_tl(a1, a1, t1); } - tcg_gen_extract_tl(a0, a0, 0, 16); + tcg_gen_ext16u_tl(a0, a0); tcg_gen_shli_tl(a1, a1, 16); tcg_gen_or_tl(mxu_gpr[XRd - 1], a1, a0); }